databricks / cli

Databricks CLI
Other
132 stars 50 forks source link

Offline install for Databricks labs project #1646

Open JCZuurmond opened 2 months ago

JCZuurmond commented 2 months ago

Description

Support an offline install for a Databricks labs project: databricks labs install <project name>. Instead of downloading the project from Github, the install is performed on the locally available project in ~/.databricks/labs/<project name>.

This capability allows distributing a Databricks labs project via a different route besides downloading it from Github using this cli, which is helpful for user performing installations in environments with network restrictions (Github being blocked).

This user flow would roughly look like:

  1. Install a Databricks labs project in a location WITH Github access: databricks labs install <project name>
  2. Archive the Databricks labs project: zip -r <project name>.zip ~/.databricks/labs/<project name>/
  3. Move archive and cli executable to the machine WITHOUT Github access: usb, floppy disk, who knows
  4. Unzip archive into ~/.databricks/labs and put cli executable on $PATH
  5. Offline install Databricks labs project: databricks labs install <project name>

Note: the Python environment might need manual fixing on the machine WITHOUT Github access ~/.databricks/labs/<project name>/state/venv/bin. Recommendation is to use the same Python version on both machines.

Implementation

Options:

  1. Try to download the Databricks labs project from Github, report if it fails to download the latest project, continue with the installation process as normal, fail if the project does not exist locally
  2. Add --offline flag, that skips downloading the Github project and installs the project from the local files.