Skip to content

Commit d4d96c3

Browse files
cleanup
1 parent ce2e2c7 commit d4d96c3

File tree

5 files changed

+67
-47
lines changed

5 files changed

+67
-47
lines changed

acceptance/bundle/deploy/models/basic/output.txt

Lines changed: 44 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11

2-
=== deply a model
2+
>>> export MODEL_NAME=original-name-[UNIQUE_NAME]
3+
4+
>>> export MODEL_DESCRIPTION=original-description-[UNIQUE_NAME]
5+
6+
=== create a model
37
>>> [CLI] bundle plan
48
create models.my_model
59

@@ -11,11 +15,10 @@ Deploying resources...
1115
Updating deployment state...
1216
Deployment complete!
1317

14-
=== GET Model
15-
>>> [CLI] model-registry get-model my-model-[UNIQUE_NAME]
18+
>>> [CLI] model-registry get-model original-name-[UNIQUE_NAME]
1619
{
17-
"name": "my-model-[UNIQUE_NAME]",
18-
"description": "original description",
20+
"name": "original-name-[UNIQUE_NAME]",
21+
"description": "original-description-[UNIQUE_NAME]",
1922
"tags": [
2023
{
2124
"key": "key1",
@@ -24,7 +27,9 @@ Deployment complete!
2427
]
2528
}
2629

27-
=== add a new tag, this should be a no-op
30+
>>> export MODEL_DESCRIPTION=new-description-[UNIQUE_NAME]
31+
32+
=== update the description, this should update the description remotely as well
2833
>>> [CLI] bundle plan
2934
update models.my_model
3035

@@ -36,11 +41,36 @@ Deploying resources...
3641
Updating deployment state...
3742
Deployment complete!
3843

39-
=== GET Model
40-
>>> [CLI] model-registry get-model my-model-[UNIQUE_NAME]
44+
>>> [CLI] model-registry get-model original-name-[UNIQUE_NAME]
45+
{
46+
"name": "original-name-[UNIQUE_NAME]",
47+
"description": "new-description-[UNIQUE_NAME]",
48+
"tags": [
49+
{
50+
"key": "key1",
51+
"value": "value1"
52+
}
53+
]
54+
}
55+
56+
>>> export MODEL_NAME=new-name-[UNIQUE_NAME]
57+
58+
=== update the name, this should recreate the model with the new name
59+
>>> [CLI] bundle plan
60+
recreate models.my_model
61+
62+
Plan: 1 to add, 0 to change, 1 to delete, 0 unchanged
63+
64+
>>> [CLI] bundle deploy
65+
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/deploy-models-basic-[UNIQUE_NAME]/default/files...
66+
Deploying resources...
67+
Updating deployment state...
68+
Deployment complete!
69+
70+
>>> [CLI] model-registry get-model new-name-[UNIQUE_NAME]
4171
{
42-
"name": "my-model-[UNIQUE_NAME]",
43-
"description": "original description",
72+
"name": "new-name-[UNIQUE_NAME]",
73+
"description": "new-description-[UNIQUE_NAME]",
4474
"tags": [
4575
{
4676
"key": "key1",
@@ -49,7 +79,7 @@ Deployment complete!
4979
]
5080
}
5181

52-
=== update the description, this should update the description
82+
=== add a new tag, this should be a no-op
5383
>>> [CLI] bundle plan
5484
update models.my_model
5585

@@ -61,11 +91,10 @@ Deploying resources...
6191
Updating deployment state...
6292
Deployment complete!
6393

64-
=== GET Model
65-
>>> [CLI] model-registry get-model my-model-[UNIQUE_NAME]
94+
>>> [CLI] model-registry get-model new-name-[UNIQUE_NAME]
6695
{
67-
"name": "my-model-[UNIQUE_NAME]",
68-
"description": "new description",
96+
"name": "new-name-[UNIQUE_NAME]",
97+
"description": "new-description-[UNIQUE_NAME]",
6998
"tags": [
7099
{
71100
"key": "key1",
Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,32 @@
1-
title "deply a model"
2-
envsubst < templates/original.tmpl > databricks.yml
3-
4-
trace $CLI bundle plan
5-
61
cleanup() {
72
trace $CLI bundle destroy --auto-approve
83
}
94
trap cleanup EXIT
105

6+
trace export MODEL_NAME=original-name-$UNIQUE_NAME
7+
trace export MODEL_DESCRIPTION=original-description-$UNIQUE_NAME
8+
envsubst < templates/one_tag.tmpl > databricks.yml
9+
title "create a model"
10+
trace $CLI bundle plan
1111
trace $CLI bundle deploy
12+
trace $CLI model-registry get-model $MODEL_NAME | jq '.registered_model_databricks | {name, description, tags}'
1213

13-
title "GET Model"
14-
trace $CLI model-registry get-model my-model-$UNIQUE_NAME | jq '.registered_model_databricks | {name, description, tags}'
15-
16-
title "add a new tag, this should be a no-op"
17-
envsubst < templates/additional_tag.tmpl > databricks.yml
14+
trace export MODEL_DESCRIPTION=new-description-$UNIQUE_NAME
15+
envsubst < templates/one_tag.tmpl > databricks.yml
16+
title "update the description, this should update the description remotely as well"
1817
trace $CLI bundle plan
1918
trace $CLI bundle deploy
19+
trace $CLI model-registry get-model $MODEL_NAME | jq '.registered_model_databricks | {name, description, tags}'
2020

21-
title "GET Model"
22-
trace $CLI model-registry get-model my-model-$UNIQUE_NAME | jq '.registered_model_databricks | {name, description, tags}'
23-
24-
title "update the description, this should update the description"
25-
envsubst < templates/new_description.tmpl > databricks.yml
21+
trace export MODEL_NAME=new-name-$UNIQUE_NAME
22+
envsubst < templates/one_tag.tmpl > databricks.yml
23+
title "update the name, this should recreate the model with the new name"
2624
trace $CLI bundle plan
2725
trace $CLI bundle deploy
26+
trace $CLI model-registry get-model $MODEL_NAME | jq '.registered_model_databricks | {name, description, tags}'
2827

29-
title "GET Model"
30-
trace $CLI model-registry get-model my-model-$UNIQUE_NAME | jq '.registered_model_databricks | {name, description, tags}'
28+
title "add a new tag, this should be a no-op"
29+
envsubst < templates/two_tag.tmpl > databricks.yml
30+
trace $CLI bundle plan
31+
trace $CLI bundle deploy
32+
trace $CLI model-registry get-model $MODEL_NAME | jq '.registered_model_databricks | {name, description, tags}'

acceptance/bundle/deploy/models/basic/templates/new_description.tmpl renamed to acceptance/bundle/deploy/models/basic/templates/one_tag.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ bundle:
44
resources:
55
models:
66
my_model:
7-
name: my-model-$UNIQUE_NAME
8-
description: "new description"
7+
name: $MODEL_NAME
8+
description: $MODEL_DESCRIPTION
99
tags:
1010
- key: "key1"
1111
value: "value1"

acceptance/bundle/deploy/models/basic/templates/original.tmpl

Lines changed: 0 additions & 11 deletions
This file was deleted.

acceptance/bundle/deploy/models/basic/templates/additional_tag.tmpl renamed to acceptance/bundle/deploy/models/basic/templates/two_tag.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ bundle:
44
resources:
55
models:
66
my_model:
7-
name: my-model-$UNIQUE_NAME
8-
description: "original description"
7+
name: $MODEL_NAME
8+
description: $MODEL_DESCRIPTION
99
tags:
1010
- key: "key1"
1111
value: "value1"

0 commit comments

Comments
 (0)