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 experiments in deployment bind/unbind commands #2434

Merged
merged 6 commits into from
Mar 17, 2025

Conversation

anton-107
Copy link
Contributor

@anton-107 anton-107 commented Mar 5, 2025

Changes

  1. Changed FindResourceByConfigKey to return experiment resources

Why

This PR adds support for experiment resources in deployment operations, enabling users to:

  • Bind experiments using databricks bundle deployment bind <myexperiment_key> <experiment_id>
  • Unbind experiments using databricks bundle deployment unbind <myexperiment_key>

Where:

  • myexperiment_key is a resource key defined in the bundle's .yml file
  • experiment_id references an existing experiment in the Databricks workspace

These capabilities allow for more flexible resource management of experiments within bundles.

Tests

Added a new acceptance test that tests bind and unbind methods together with bundle deployment and destruction.

@anton-107 anton-107 temporarily deployed to test-trigger-is March 5, 2025 14:55 — with GitHub Actions Inactive
@anton-107 anton-107 temporarily deployed to test-trigger-is March 5, 2025 15:11 — with GitHub Actions Inactive
@anton-107 anton-107 marked this pull request as ready for review March 5, 2025 15:34
)

func TestBindExperimentToExistingExperiment(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I know that existing tests for bind are integration tests but have you explored making new ones acceptance tests instead?

@anton-107 anton-107 force-pushed the anton-107/bind-experiment branch from 0566adb to 509408c Compare March 11, 2025 14:37
@anton-107 anton-107 force-pushed the anton-107/bind-experiment branch from 509408c to 333a7cf Compare March 11, 2025 14:43
@anton-107 anton-107 temporarily deployed to test-trigger-is March 11, 2025 14:43 — with GitHub Actions Inactive
@anton-107 anton-107 temporarily deployed to test-trigger-is March 11, 2025 14:54 — with GitHub Actions Inactive
@anton-107 anton-107 temporarily deployed to test-trigger-is March 11, 2025 16:04 — with GitHub Actions Inactive
@anton-107 anton-107 temporarily deployed to test-trigger-is March 11, 2025 16:26 — with GitHub Actions Inactive
Deployment complete!

=== Read the pre-defined experiment: {
"name": "/Users/[USERNAME]/test-experiment[UUID]",
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not related to this PR but this highlights that experiment API does not respect /Workspace prefix in name when they are created

BUNDLE_NAME_SUFFIX=$(uuid)
export BUNDLE_NAME_SUFFIX

# double slash at the start prevents Windows to apply replacements to the path
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this replacement setting comes from some other test? Any chance we can just disable this replacement for this test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I discovered this behavior by writing this test and seeing our Windows environments failing on it.
There is a variety of env variables that we could try to disable the replacements: https://stackoverflow.com/questions/7250130/how-to-stop-mingw-and-msys-from-mangling-path-names-given-at-the-command-line, but they are reported to causing other issues unexpectedly, so I propose to not dive into this until there are more cases that cause trouble.

@anton-107 anton-107 added this pull request to the merge queue Mar 17, 2025
Merged via the queue into main with commit e5f39b5 Mar 17, 2025
9 checks passed
@anton-107 anton-107 deleted the anton-107/bind-experiment branch March 17, 2025 15:21
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