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 clusters in deployment bind/unbind commands #2536

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

anton-107
Copy link
Contributor

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

Changes

  1. Changed FindResourceByConfigKey to return cluster resources
  2. Added a new option for acceptance tests: RequiresCluster

Why

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

  • Bind clusters using databricks bundle deployment bind <mycluster_key> <mycluster_id>
  • Unbind experiments using databricks bundle deployment unbind <mycluster_key>

Where:

  • mycluster_key is a resource key defined in the bundle's .yml file
  • mycluster_id references an existing cluster in the Databricks workspace

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

Tests

Added a new acceptance test that tests bind and unbind methods

@anton-107 anton-107 temporarily deployed to test-trigger-is March 20, 2025 11:08 — with GitHub Actions Inactive
@anton-107 anton-107 force-pushed the anton-107/bind-cluster branch from 4c53b3b to e357296 Compare March 20, 2025 11:09
@anton-107 anton-107 temporarily deployed to test-trigger-is March 20, 2025 11:09 — with GitHub Actions Inactive
@anton-107 anton-107 marked this pull request as ready for review March 20, 2025 12:00
@anton-107 anton-107 temporarily deployed to test-trigger-is March 20, 2025 16:06 — with GitHub Actions Inactive
@@ -0,0 +1,23 @@

>>> cat databricks.yml
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I'd drop this, it's pretty much the same as committed databricks.yml.tmpl

@@ -290,6 +290,10 @@ func getSkipReason(config *internal.TestConfig, configPath string) string {
return fmt.Sprintf("Disabled via RequiresUnityCatalog setting in %s (TEST_METASTORE_ID=%s)", configPath, os.Getenv("TEST_METASTORE_ID"))
}

if isTruePtr(config.RequiresCluster) && os.Getenv("TEST_DEFAULT_CLUSTER_ID") == "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

which environments do not have TEST_DEFAULT_CLUSTER_ID?

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