<?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 Re: Can't load model from UC due to DBFS issue in Machine Learning</title>
    <link>https://community.databricks.com/t5/machine-learning/can-t-load-model-from-uc-due-to-dbfs-issue/m-p/79510#M3446</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/102731"&gt;@migq2&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Look at below snippets from documentation. It works on single user cluster, because that mode has full access to DBFS.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try to grant ANY FILE permission to make it work on shared cluster.&lt;/P&gt;&lt;DIV class=""&gt;&lt;H2&gt;How does DBFS work in single user access mode?&lt;/H2&gt;&lt;/DIV&gt;&lt;P&gt;Clusters configured with single user access mode have full access to DBFS, including all files in the DBFS root and mounted data.&lt;/P&gt;&lt;DIV class=""&gt;&lt;H2&gt;How does DBFS work in shared access mode?&lt;/H2&gt;&lt;/DIV&gt;&lt;P&gt;Shared access mode combines Unity Catalog data governance with Azure Databricks legacy table ACLs. Access to data in the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;hive_metastore&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is only available to users that have permissions explicitly granted.&lt;/P&gt;&lt;P&gt;To interact with files directly using DBFS, you must have&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;ANY FILE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;permissions granted. Because&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;ANY FILE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;allows users to bypass legacy tables ACLs in the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;hive_metastore&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and access all data managed by DBFS, Databricks recommends caution when granting this privilege.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can also try to hack this library a little bit. Take a look on stackoverflow thread. Maybe instead passing path to dbfs, you can try pass path to UC Volume. I don't know if it'll work, but it's worth a try.&lt;/P&gt;&lt;P&gt;from mlflow.utils.databricks_utils import _get_dbutils&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;def fake_tmp():&lt;/P&gt;&lt;P&gt;&amp;nbsp; return 'path_to_Volume...' # something writable&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;_get_dbutils().entry_point.getReplLocalTempDir = fake_tmp&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/77579396/databricks-11-mlflow-error-permission-denied-in-create-tmp-dir" target="_blank" rel="noopener"&gt;https://stackoverflow.com/questions/77579396/databricks-11-mlflow-error-permission-denied-in-create-tmp-dir&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 20 Jul 2024 03:14:08 GMT</pubDate>
    <dc:creator>szymon_dybczak</dc:creator>
    <dc:date>2024-07-20T03:14:08Z</dc:date>
    <item>
      <title>Can't load model from UC due to DBFS issue</title>
      <link>https://community.databricks.com/t5/machine-learning/can-t-load-model-from-uc-due-to-dbfs-issue/m-p/79490#M3445</link>
      <description>&lt;P&gt;I want to load a model I have registered in Unity Catalog using a Shared cluster, but it seems to be trying to use dbfs under the hood and it gives me an error.&lt;/P&gt;&lt;P&gt;I am using DBR 13.3 LTS and mlflow-skinny[databricks]==2.14.3&lt;/P&gt;&lt;P&gt;My code&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import mlflow

mlflow.set_registry_uri("databricks-uc")

mlflow.spark.load_model("models:/my_uc_catalog.my_schema.my_model@my_alias")&lt;/LI-CODE&gt;&lt;P&gt;Throws:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;OSError: [Errno 95] Operation not supported: '/dbfs/tmp'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;If I run it on a Single User cluster it works fine, but I want it to work on Shared clusters&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2024 18:14:38 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/can-t-load-model-from-uc-due-to-dbfs-issue/m-p/79490#M3445</guid>
      <dc:creator>migq2</dc:creator>
      <dc:date>2024-07-19T18:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Can't load model from UC due to DBFS issue</title>
      <link>https://community.databricks.com/t5/machine-learning/can-t-load-model-from-uc-due-to-dbfs-issue/m-p/79510#M3446</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/102731"&gt;@migq2&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Look at below snippets from documentation. It works on single user cluster, because that mode has full access to DBFS.&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try to grant ANY FILE permission to make it work on shared cluster.&lt;/P&gt;&lt;DIV class=""&gt;&lt;H2&gt;How does DBFS work in single user access mode?&lt;/H2&gt;&lt;/DIV&gt;&lt;P&gt;Clusters configured with single user access mode have full access to DBFS, including all files in the DBFS root and mounted data.&lt;/P&gt;&lt;DIV class=""&gt;&lt;H2&gt;How does DBFS work in shared access mode?&lt;/H2&gt;&lt;/DIV&gt;&lt;P&gt;Shared access mode combines Unity Catalog data governance with Azure Databricks legacy table ACLs. Access to data in the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;hive_metastore&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;is only available to users that have permissions explicitly granted.&lt;/P&gt;&lt;P&gt;To interact with files directly using DBFS, you must have&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;ANY FILE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;permissions granted. Because&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;ANY FILE&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;allows users to bypass legacy tables ACLs in the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;hive_metastore&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and access all data managed by DBFS, Databricks recommends caution when granting this privilege.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can also try to hack this library a little bit. Take a look on stackoverflow thread. Maybe instead passing path to dbfs, you can try pass path to UC Volume. I don't know if it'll work, but it's worth a try.&lt;/P&gt;&lt;P&gt;from mlflow.utils.databricks_utils import _get_dbutils&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;def fake_tmp():&lt;/P&gt;&lt;P&gt;&amp;nbsp; return 'path_to_Volume...' # something writable&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;_get_dbutils().entry_point.getReplLocalTempDir = fake_tmp&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/77579396/databricks-11-mlflow-error-permission-denied-in-create-tmp-dir" target="_blank" rel="noopener"&gt;https://stackoverflow.com/questions/77579396/databricks-11-mlflow-error-permission-denied-in-create-tmp-dir&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jul 2024 03:14:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/can-t-load-model-from-uc-due-to-dbfs-issue/m-p/79510#M3446</guid>
      <dc:creator>szymon_dybczak</dc:creator>
      <dc:date>2024-07-20T03:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can't load model from UC due to DBFS issue</title>
      <link>https://community.databricks.com/t5/machine-learning/can-t-load-model-from-uc-due-to-dbfs-issue/m-p/79536#M3448</link>
      <description>&lt;P&gt;Have you tried to tell MLFlow to look for models in UC?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;mlflow.set_registry_uri("databricks-uc")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit: never mind I see you have already. It shouldn't do/search for anything on DBFS anymore when setting this option so it is a bit strange. Shared cluster security model doesn't allow interaction with DBFS and even ANY FILE permissions shouldn't be needed. Wouldn't recommend it either.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jul 2024 09:19:38 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/can-t-load-model-from-uc-due-to-dbfs-issue/m-p/79536#M3448</guid>
      <dc:creator>jacovangelder</dc:creator>
      <dc:date>2024-07-20T09:19:38Z</dc:date>
    </item>
  </channel>
</rss>

