Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
### CLI

### Bundles
- Removed unused fields from resources.models schema: creation\_timestamp, last\_updated\_timestamp, latest\_versions and user\_id. Using them now raises a warning.

### API Changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
bundle:
name: test-bundle

resources:
models:
mymodel: {}
7 changes: 7 additions & 0 deletions acceptance/bundle/validate/models/missing_name/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Name: test-bundle
Target: default
Workspace:
User: [USERNAME]
Path: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default

Validation OK!
1 change: 1 addition & 0 deletions acceptance/bundle/validate/models/missing_name/script
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$CLI bundle validate
1 change: 1 addition & 0 deletions acceptance/bundle/validate/models/missing_name/test.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Badness = "Name is required in the schema but not by DABs"
7 changes: 7 additions & 0 deletions acceptance/bundle/validate/models/user_id/databricks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
bundle:
name: test-bundle

resources:
models:
mymodel:
user_id: 123
11 changes: 11 additions & 0 deletions acceptance/bundle/validate/models/user_id/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Warning: unknown field: user_id
at resources.models.mymodel
in databricks.yml:7:7

Name: test-bundle
Target: default
Workspace:
User: [USERNAME]
Path: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default

Found 1 warning
1 change: 1 addition & 0 deletions acceptance/bundle/validate/models/user_id/script
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$CLI bundle validate
4 changes: 2 additions & 2 deletions bundle/config/mutator/initialize_urls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ func TestInitializeURLs(t *testing.T) {
},
Models: map[string]*resources.MlflowModel{
"model1": {
ID: "a model uses its name for identifier",
Model: ml.Model{Name: "a model uses its name for identifier"},
ID: "a model uses its name for identifier",
CreateModelRequest: ml.CreateModelRequest{Name: "a model uses its name for identifier"},
},
},
ModelServingEndpoints: map[string]*resources.ModelServingEndpoint{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func mockBundle(mode config.Mode) *bundle.Bundle {
"experiment2": {Experiment: ml.Experiment{Name: "experiment2"}},
},
Models: map[string]*resources.MlflowModel{
"model1": {Model: ml.Model{Name: "model1"}},
"model1": {CreateModelRequest: ml.CreateModelRequest{Name: "model1"}},
},
ModelServingEndpoints: map[string]*resources.ModelServingEndpoint{
"servingendpoint1": {CreateServingEndpoint: serving.CreateServingEndpoint{Name: "servingendpoint1"}},
Expand Down
2 changes: 1 addition & 1 deletion bundle/config/resources/mlflow_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type MlflowModel struct {
ModifiedStatus ModifiedStatus `json:"modified_status,omitempty" bundle:"internal"`
URL string `json:"url,omitempty" bundle:"internal"`

ml.Model
ml.CreateModelRequest
}

func (s *MlflowModel) UnmarshalJSON(b []byte) error {
Expand Down
10 changes: 5 additions & 5 deletions bundle/deploy/terraform/convert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ func TestBundleToTerraformPipelinePermissions(t *testing.T) {

func TestBundleToTerraformModel(t *testing.T) {
src := resources.MlflowModel{
Model: ml.Model{
CreateModelRequest: ml.CreateModelRequest{
Name: "name",
Description: "description",
Tags: []ml.ModelTag{
Expand Down Expand Up @@ -332,7 +332,7 @@ func TestBundleToTerraformModel(t *testing.T) {

func TestBundleToTerraformModelPermissions(t *testing.T) {
src := resources.MlflowModel{
Model: ml.Model{
CreateModelRequest: ml.CreateModelRequest{
Name: "name",
},
Permissions: []resources.MlflowModelPermission{
Expand Down Expand Up @@ -766,7 +766,7 @@ func TestTerraformToBundleEmptyRemoteResources(t *testing.T) {
},
Models: map[string]*resources.MlflowModel{
"test_mlflow_model": {
Model: ml.Model{
CreateModelRequest: ml.CreateModelRequest{
Name: "test_mlflow_model",
},
},
Expand Down Expand Up @@ -910,12 +910,12 @@ func TestTerraformToBundleModifiedResources(t *testing.T) {
},
Models: map[string]*resources.MlflowModel{
"test_mlflow_model": {
Model: ml.Model{
CreateModelRequest: ml.CreateModelRequest{
Name: "test_mlflow_model",
},
},
"test_mlflow_model_new": {
Model: ml.Model{
CreateModelRequest: ml.CreateModelRequest{
Name: "test_mlflow_model_new",
},
},
Expand Down
4 changes: 2 additions & 2 deletions bundle/deploy/terraform/interpolate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func TestInterpolate(t *testing.T) {
},
Models: map[string]*resources.MlflowModel{
"my_model": {
Model: ml.Model{
CreateModelRequest: ml.CreateModelRequest{
Name: "my_model",
},
},
Expand All @@ -77,7 +77,7 @@ func TestInterpolate(t *testing.T) {
assert.Equal(t, "${databricks_app.other_app.id}", j.Tags["other_app"])

m := b.Config.Resources.Models["my_model"]
assert.Equal(t, "my_model", m.Model.Name)
assert.Equal(t, "my_model", m.CreateModelRequest.Name)
}

func TestInterpolateUnknownResourceType(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion bundle/deploy/terraform/tfdyn/convert_model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

func TestConvertModel(t *testing.T) {
src := resources.MlflowModel{
Model: ml.Model{
CreateModelRequest: ml.CreateModelRequest{
Name: "name",
Description: "description",
Tags: []ml.ModelTag{
Expand Down
59 changes: 0 additions & 59 deletions bundle/internal/schema/annotations_openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2733,65 +2733,6 @@ github.com/databricks/databricks-sdk-go/service/ml.ModelTag:
"value":
"description": |-
The tag value.
github.com/databricks/databricks-sdk-go/service/ml.ModelVersion:
"creation_timestamp":
"description": |-
Timestamp recorded when this `model_version` was created.
"current_stage":
"description": |-
Current stage for this `model_version`.
"description":
"description": |-
Description of this `model_version`.
"last_updated_timestamp":
"description": |-
Timestamp recorded when metadata for this `model_version` was last updated.
"name":
"description": |-
Unique name of the model
"run_id":
"description": |-
MLflow run ID used when creating `model_version`, if `source` was generated by an
experiment run stored in MLflow tracking server.
"run_link":
"description": |-
Run Link: Direct link to the run that generated this version
"source":
"description": |-
URI indicating the location of the source model artifacts, used when creating `model_version`
"status":
"description": |-
Current status of `model_version`
"status_message":
"description": |-
Details on current `status`, if it is pending or failed.
"tags":
"description": |-
Tags: Additional metadata key-value pairs for this `model_version`.
"user_id":
"description": |-
User that created this `model_version`.
"version":
"description": |-
Model's version number.
github.com/databricks/databricks-sdk-go/service/ml.ModelVersionStatus:
"_":
"description": |-
Current status of `model_version`
"enum":
- |-
PENDING_REGISTRATION
- |-
FAILED_REGISTRATION
- |-
READY
github.com/databricks/databricks-sdk-go/service/ml.ModelVersionTag:
"key":
"description": |-
The tag key.
"value":
"description": |-
The tag value.
github.com/databricks/databricks-sdk-go/service/pipelines.CronTrigger:
"quartz_cron_schedule": {}
"timezone_id": {}
Expand Down
6 changes: 1 addition & 5 deletions bundle/internal/schema/testdata/pass/ml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,8 @@ variables:
resources:
models:
mymodel:
creation_timestamp: 123
name: mymodel
description: "my model"
latest_versions:
- creation_timestamp: 123
tags: ${var.complexvar.key1}
status: READY
permissions:
- service_principal_name: myserviceprincipal
level: CAN_MANAGE
Expand Down
8 changes: 4 additions & 4 deletions bundle/permissions/workspace_root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ func TestApplyWorkspaceRootPermissions(t *testing.T) {
"pipeline_2": {CreatePipeline: pipelines.CreatePipeline{}},
},
Models: map[string]*resources.MlflowModel{
"model_1": {Model: ml.Model{}},
"model_2": {Model: ml.Model{}},
"model_1": {},
"model_2": {},
},
Experiments: map[string]*resources.MlflowExperiment{
"experiment_1": {Experiment: ml.Experiment{}},
Expand Down Expand Up @@ -102,8 +102,8 @@ func TestApplyWorkspaceRootPermissionsForAllPaths(t *testing.T) {
"pipeline_2": {CreatePipeline: pipelines.CreatePipeline{}},
},
Models: map[string]*resources.MlflowModel{
"model_1": {Model: ml.Model{}},
"model_2": {Model: ml.Model{}},
"model_1": {},
"model_2": {},
},
Experiments: map[string]*resources.MlflowExperiment{
"experiment_1": {Experiment: ml.Experiment{}},
Expand Down
Loading
Loading