<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Install bundle built artifact as notebook-scoped library in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/install-bundle-built-artifact-as-notebook-scoped-library/m-p/113751#M9313</link>
    <description>&lt;P&gt;We are having a hard time finding an intuitive way of using the artifacts we build and deploy with&amp;nbsp;&lt;STRONG&gt;databricks bundle deploy&lt;/STRONG&gt; notebook-scoped.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Desired result:&lt;BR /&gt;&lt;/STRONG&gt;Having internal artifacts be available notebook-scoped for jobs by config&lt;BR /&gt;or&lt;BR /&gt;Having an easier way of %pip installing internal artifacts&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Our setup:&lt;/STRONG&gt;&lt;BR /&gt;Monorepo of multiple bundles and&amp;nbsp;a package of module of shared functionality&lt;BR /&gt;&lt;BR /&gt;This snippet in all bundles:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;artifacts:
  common-lib:
    type: "whl"
    path: "../common-lib"&lt;/LI-CODE&gt;&lt;P&gt;This ensures that the common-lib is built and included in &lt;STRONG&gt;artifacts/.internal/&lt;/STRONG&gt; for each bundle deployment&lt;BR /&gt;Then we specify this for every task that needs it:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;libraries:
  - whl: ${workspace.artifact_path}/.internal/common-0.1-py3-none-any.whl&lt;/LI-CODE&gt;&lt;P&gt;This works, but we found out that this installs the library at the cluster level.&lt;BR /&gt;This makes many entries in the libraries tabs for the clusters pointing to internal artifacts to the bundles.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Working "solution":&lt;BR /&gt;&lt;/STRONG&gt;We have gotten it to work by doing this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# For each job.yml under resources
parameters:
  - name: common-lib-path
    default: ${workspace.artifact_path}/.internal/common-0.1-py3-none-any.whl&lt;/LI-CODE&gt;&lt;LI-CODE lang="python"&gt;# On top of notebooks that needs the common lib

# Cell 1
lib_path = dbutils.widgets.get("common-lib-path")

# Cell 2
%pip install $lib_path&lt;/LI-CODE&gt;&lt;P&gt;It works, but it is not a proper solution.&lt;BR /&gt;&lt;BR /&gt;Is there a good way of achieving this we have not found?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Mar 2025 19:31:02 GMT</pubDate>
    <dc:creator>keb</dc:creator>
    <dc:date>2025-03-26T19:31:02Z</dc:date>
    <item>
      <title>Install bundle built artifact as notebook-scoped library</title>
      <link>https://community.databricks.com/t5/get-started-discussions/install-bundle-built-artifact-as-notebook-scoped-library/m-p/113751#M9313</link>
      <description>&lt;P&gt;We are having a hard time finding an intuitive way of using the artifacts we build and deploy with&amp;nbsp;&lt;STRONG&gt;databricks bundle deploy&lt;/STRONG&gt; notebook-scoped.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Desired result:&lt;BR /&gt;&lt;/STRONG&gt;Having internal artifacts be available notebook-scoped for jobs by config&lt;BR /&gt;or&lt;BR /&gt;Having an easier way of %pip installing internal artifacts&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Our setup:&lt;/STRONG&gt;&lt;BR /&gt;Monorepo of multiple bundles and&amp;nbsp;a package of module of shared functionality&lt;BR /&gt;&lt;BR /&gt;This snippet in all bundles:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;artifacts:
  common-lib:
    type: "whl"
    path: "../common-lib"&lt;/LI-CODE&gt;&lt;P&gt;This ensures that the common-lib is built and included in &lt;STRONG&gt;artifacts/.internal/&lt;/STRONG&gt; for each bundle deployment&lt;BR /&gt;Then we specify this for every task that needs it:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;libraries:
  - whl: ${workspace.artifact_path}/.internal/common-0.1-py3-none-any.whl&lt;/LI-CODE&gt;&lt;P&gt;This works, but we found out that this installs the library at the cluster level.&lt;BR /&gt;This makes many entries in the libraries tabs for the clusters pointing to internal artifacts to the bundles.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Working "solution":&lt;BR /&gt;&lt;/STRONG&gt;We have gotten it to work by doing this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# For each job.yml under resources
parameters:
  - name: common-lib-path
    default: ${workspace.artifact_path}/.internal/common-0.1-py3-none-any.whl&lt;/LI-CODE&gt;&lt;LI-CODE lang="python"&gt;# On top of notebooks that needs the common lib

# Cell 1
lib_path = dbutils.widgets.get("common-lib-path")

# Cell 2
%pip install $lib_path&lt;/LI-CODE&gt;&lt;P&gt;It works, but it is not a proper solution.&lt;BR /&gt;&lt;BR /&gt;Is there a good way of achieving this we have not found?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Mar 2025 19:31:02 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/install-bundle-built-artifact-as-notebook-scoped-library/m-p/113751#M9313</guid>
      <dc:creator>keb</dc:creator>
      <dc:date>2025-03-26T19:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: Install bundle built artifact as notebook-scoped library</title>
      <link>https://community.databricks.com/t5/get-started-discussions/install-bundle-built-artifact-as-notebook-scoped-library/m-p/114791#M9314</link>
      <description>&lt;P&gt;We were not able to find a clean solution for this, so what we ended up doing is referencing the common lib like this in every notebook it is needed.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;%pip install ../../../artifacts/.internal/common-0.1-py3-none-any.whl&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Apr 2025 07:49:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/install-bundle-built-artifact-as-notebook-scoped-library/m-p/114791#M9314</guid>
      <dc:creator>keb</dc:creator>
      <dc:date>2025-04-08T07:49:51Z</dc:date>
    </item>
  </channel>
</rss>

