Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 213
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
7beac34014705fdb9fb9c8e69f83da32f7fd5daae7d3cde77f2e6aee5f01604fe7744a5b1f10cFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| 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.
Uh oh!
There was an error while loading. Please reload this page.
| 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 | ||
| } | ||
| } | ||
| } |
| 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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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.
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.