โ09-12-2024 11:03 AM
Hello, we have a need to uninstall older versions of whl files from personal cluster via databricks CLI - could you please provide the exact command to be used here. We tried with many found on the documentations but none of them worked to do the actual uninstall. Please help here. Thanks !
โ09-16-2024 12:04 PM - edited โ09-16-2024 12:09 PM
Hi @Visakh_Vijayan ,
Sorry for late response, I didn't notice your reply. So I prepared simple example. Here I installed whl file on a cluster using below command:
databricks libraries install --json `@libraries_to_install.json
The content of libraries_to_install.json file looks following:
{
"cluster_id": "your_cluster_id",
"libraries": [
{
"whl": "/Workspace/Users/path_to_your_wheel/my_package-0.1-py2.py3-none-any.whl"
}
]
}
As a result I have installed whl library on cluster:
Now, to uninstall library I used below command:
databricks libraries uninstall --json `@libraries_to_uninstall.json
The content of libraries_to_uninstall.json is following:
{
"cluster_id": "your_cluster_id",
"libraries": [
{
"whl": "/Workspace/Users/path_to_your_wheel/my_package-0.1-py2.py3-none-any.whl"
}
]
}
After cluster restarted, wheel library uninstalled successfully .
Edit: If you use powershell terminal use backtick to escape @ character `@libraries_to_uninstall.json
โ09-12-2024 10:35 PM
This topic is a very nice Official Site
Thank you for sharing
โ09-13-2024 01:48 AM
Hi @Visakh_Vijayan ,
Did you try to use databricks libraries uninstall? It's exactly crafted for this purpose
databricks libraries uninstall --json YOUR_JSON_WITH_REQUEST_BODY
Also, when you uninstall a library from a cluster, the library is removed only when you restart the cluster. Until you restart the cluster, the status of the uninstalled library appears as Uninstall pending restart.
โ09-13-2024 09:08 AM
Thanks for the immediate response ! Yes, we tried with an inline JSON string and executed it and the command went through without any success or failure messages but didn't do anything. The whl file was still there in the cluster even after a restart so we had to mark this as failed. The older CLI had an uninstall all libraries method. Is that still supported ? If not could you please send across a command with an actual JSON string with a dummy whl file ? We will compare if there were any formatting issues on our end and was the reason the uninstall didn't happen. Btw, we are using databricks CLI 0.227.1
โ09-16-2024 12:04 PM - edited โ09-16-2024 12:09 PM
Hi @Visakh_Vijayan ,
Sorry for late response, I didn't notice your reply. So I prepared simple example. Here I installed whl file on a cluster using below command:
databricks libraries install --json `@libraries_to_install.json
The content of libraries_to_install.json file looks following:
{
"cluster_id": "your_cluster_id",
"libraries": [
{
"whl": "/Workspace/Users/path_to_your_wheel/my_package-0.1-py2.py3-none-any.whl"
}
]
}
As a result I have installed whl library on cluster:
Now, to uninstall library I used below command:
databricks libraries uninstall --json `@libraries_to_uninstall.json
The content of libraries_to_uninstall.json is following:
{
"cluster_id": "your_cluster_id",
"libraries": [
{
"whl": "/Workspace/Users/path_to_your_wheel/my_package-0.1-py2.py3-none-any.whl"
}
]
}
After cluster restarted, wheel library uninstalled successfully .
Edit: If you use powershell terminal use backtick to escape @ character `@libraries_to_uninstall.json
โ09-17-2024 08:30 AM
Thanks a bunch ! Yep, that worked like a charm - appreciate the detailing of the solution ๐
Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโt want to miss the chance to attend and share knowledge.
If there isnโt a group near you, start one and help create a community that brings people together.
Request a New Group