-
Notifications
You must be signed in to change notification settings - Fork 187
terraform_dabs_map: make DABsPathToTerraform a true inverse of TerraformPathToDABs #5621
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7beac34
terraform_dabs_map: fix DABsPathToTerraform to skip wrapper for root-…
denik 014705f
terraform_dabs_map: remove noRoundtrip escape hatch from translate_te…
denik db9fb9c
terraform_dabs_map: add fixed-point check to TestTerraformPathToDABs
denik 8e69f83
terraform_dabs_map: note why DABsPathToTerraform lacks the fixed-poin…
denik da32f7f
terraform_dabs_map: regenerate with postgres_roles
denik d5daae7
terraform_dabs_map: switch wrapper logic to positive field set
denik d3cde77
terraform_dabs_map: fix gofmt alignment in generate_test.go
denik f2e6aee
terraform_dabs_map: regenerate after rebase for postgres_databases
denik 5f01604
terraform_dabs_map: map model_id to registered_model_id
denik fe7744a
acceptance: use print_requests.py instead of inline jq in model_id_ref
denik 5b1f10c
changelog: registered_model_id resolves under direct engine
denik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
acceptance/bundle/resource_deps/model_id_ref/databricks.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| bundle: | ||
| name: test-bundle | ||
|
|
||
| # A model's numeric ID is named registered_model_id in Terraform state and model_id in | ||
| # direct state. terraform_dabs_map bridges the two names, so a reference to | ||
| # registered_model_id resolves on both engines. | ||
| resources: | ||
| models: | ||
| my_model: | ||
| name: my-model | ||
| description: my model | ||
|
|
||
| jobs: | ||
| consumer: | ||
| name: consumer | ||
| description: model id is ${resources.models.my_model.registered_model_id} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
|
|
||
| === the consumer job implicitly depends on the model | ||
| >>> [CLI] bundle plan | ||
| create jobs.consumer | ||
| create models.my_model | ||
|
|
||
| Plan: 2 to add, 0 to change, 0 to delete, 0 unchanged | ||
|
|
||
| === after deploy, registered_model_id is resolved to the model's numeric id | ||
| >>> [CLI] bundle deploy | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... | ||
| Deploying resources... | ||
| Updating deployment state... | ||
| Deployment complete! | ||
|
|
||
| >>> print_requests.py //mlflow/registered-models/create //jobs/create --sort | ||
| { | ||
| "method": "POST", | ||
| "path": "/api/2.0/mlflow/registered-models/create", | ||
| "body": { | ||
| "description": "my model", | ||
| "name": "my-model" | ||
| } | ||
| } | ||
| { | ||
| "method": "POST", | ||
| "path": "/api/2.2/jobs/create", | ||
| "body": { | ||
| "deployment": { | ||
| "kind": "BUNDLE", | ||
| "metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/metadata.json" | ||
| }, | ||
| "description": "model id is [MY_MODEL_ID]", | ||
| "edit_mode": "UI_LOCKED", | ||
| "format": "MULTI_TASK", | ||
| "max_concurrent_runs": 1, | ||
| "name": "consumer", | ||
| "queue": { | ||
| "enabled": true | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| title "the consumer job implicitly depends on the model" | ||
| trace $CLI bundle plan | ||
|
|
||
| title "after deploy, registered_model_id is resolved to the model's numeric id" | ||
| trace $CLI bundle deploy | ||
|
|
||
| # Bind the model's exact numeric id to [MY_MODEL_ID] so the resolved reference is matched | ||
| # precisely rather than by the broad [NUMID] pattern. The id comes from the API (independent | ||
| # of the deploy engine), so terraform and direct must both resolve to this exact value. | ||
| model_id=$($CLI model-registry get-model my-model | jq -r '.registered_model_databricks.id') | ||
| add_repl.py "$model_id" MY_MODEL_ID | ||
|
|
||
| trace print_requests.py //mlflow/registered-models/create //jobs/create --sort |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is registered_model_id? I don't see it here in our public documentation:
https://docs.databricks.com/api/workspace/registeredmodels/create
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the field that DABs on terraform supports. So we translate it for compat between terraform & direct engine.