Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for installing the CLI on DBR #85

Merged
merged 11 commits into from
Feb 22, 2024
Merged

Add support for installing the CLI on DBR #85

merged 11 commits into from
Feb 22, 2024

Conversation

shreyas-goenka
Copy link
Contributor

@shreyas-goenka shreyas-goenka commented Feb 6, 2024

We want to install the CLI at $HOME/bin when the install.sh installation script is invoked from DBR. This allows us to provide the CLI in DBR though a proxy trampoline script that's installed in DBR at /usr/local/bin.

This PR also adds a couple of tests and assertions to make this functionality robust for use in DBR.

install.sh Show resolved Hide resolved
@shreyas-goenka shreyas-goenka changed the title Set installation target to ~/bin when install.sh is run from DBR Add support for installing the CLI on DBR Feb 22, 2024
run: ./setup-cli/install.sh
shell: bash
env:
DATABRICKS_RUNTIME_VERSION: value-does-not-matter
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this env variable always set on DBR?

Copy link
Contributor Author

@shreyas-goenka shreyas-goenka Feb 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While it's not documented to be guaranteed, it's been present on all clusters I have tried out and is very well-established as a rubric to detect that code is being run from DBR.

For example, Mlflow also uses the same check here
https://github.com/mlflow/mlflow/blob/30462203357010cba51d743a96c0cae5397e7e1b/mlflow/utils/databricks_utils.py#L180

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shreyas-goenka shreyas-goenka merged commit c55718d into main Feb 22, 2024
14 checks passed
@shreyas-goenka shreyas-goenka deleted the install-dbr branch February 22, 2024 15:28
assert/not-installed.sh Show resolved Hide resolved
.github/workflows/test.yml Show resolved Hide resolved
.github/workflows/test.yml Show resolved Hide resolved
.github/workflows/test.yml Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants