Skip to content

Commit 9c0ca16

Browse files
committed
add jobs/delete_task
1 parent ee9ff1d commit 9c0ca16

File tree

9 files changed

+189
-0
lines changed

9 files changed

+189
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
bundle:
2+
name: test-bundle
3+
4+
resources:
5+
jobs:
6+
job:
7+
tasks:
8+
- task_key: TestTask1 # TO_DELETE
9+
existing_cluster_id: "0717-132531-5opeqon1" # TO_DELETE
10+
python_wheel_task: # TO_DELETE
11+
package_name: "whl" # TO_DELETE
12+
entry_point: "run" # TO_DELETE
13+
libraries: # TO_DELETE
14+
- whl: /Workspace/Users/foo@bar.com/mywheel.whl # TO_DELETE
15+
- task_key: TestTask2
16+
for_each_task:
17+
inputs: "[1]"
18+
task:
19+
task_key: TestTask2
20+
existing_cluster_id: "0717-132531-5opeqon1"
21+
python_wheel_task:
22+
package_name: "whl"
23+
entry_point: "run"
24+
libraries:
25+
- whl: /Workspace/Users/foo@bar.com/mywheel.whl
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"plan": {
3+
"resources.jobs.job": {
4+
"action": "create",
5+
"new_state": {
6+
"config": {
7+
"deployment": {
8+
"kind": "BUNDLE",
9+
"metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/metadata.json"
10+
},
11+
"edit_mode": "UI_LOCKED",
12+
"format": "MULTI_TASK",
13+
"max_concurrent_runs": 1,
14+
"name": "Untitled",
15+
"queue": {
16+
"enabled": true
17+
},
18+
"tasks": [
19+
{
20+
"existing_cluster_id": "0717-132531-5opeqon1",
21+
"libraries": [
22+
{
23+
"whl": "/Workspace/Users/foo@bar.com/mywheel.whl"
24+
}
25+
],
26+
"python_wheel_task": {
27+
"entry_point": "run",
28+
"package_name": "whl"
29+
},
30+
"task_key": "TestTask1"
31+
},
32+
{
33+
"for_each_task": {
34+
"inputs": "[1]",
35+
"task": {
36+
"existing_cluster_id": "0717-132531-5opeqon1",
37+
"libraries": [
38+
{
39+
"whl": "/Workspace/Users/foo@bar.com/mywheel.whl"
40+
}
41+
],
42+
"python_wheel_task": {
43+
"entry_point": "run",
44+
"package_name": "whl"
45+
},
46+
"task_key": "TestTask2"
47+
}
48+
},
49+
"task_key": "TestTask2"
50+
}
51+
]
52+
}
53+
}
54+
}
55+
}
56+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"plan": {
3+
"resources.jobs.job": {
4+
"action": "create"
5+
}
6+
}
7+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"plan": {
3+
"resources.jobs.job": {
4+
"action": "update",
5+
"new_state": {
6+
"config": {
7+
"deployment": {
8+
"kind": "BUNDLE",
9+
"metadata_file_path": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/metadata.json"
10+
},
11+
"edit_mode": "UI_LOCKED",
12+
"format": "MULTI_TASK",
13+
"max_concurrent_runs": 1,
14+
"name": "Untitled",
15+
"queue": {
16+
"enabled": true
17+
},
18+
"tasks": [
19+
{
20+
"for_each_task": {
21+
"inputs": "[1]",
22+
"task": {
23+
"existing_cluster_id": "0717-132531-5opeqon1",
24+
"libraries": [
25+
{
26+
"whl": "/Workspace/Users/foo@bar.com/mywheel.whl"
27+
}
28+
],
29+
"python_wheel_task": {
30+
"entry_point": "run",
31+
"package_name": "whl"
32+
},
33+
"task_key": "TestTask2"
34+
}
35+
},
36+
"task_key": "TestTask2"
37+
}
38+
]
39+
}
40+
},
41+
"changes": {
42+
"local": {
43+
"tasks": {
44+
"action": "update"
45+
}
46+
}
47+
}
48+
}
49+
}
50+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"plan": {
3+
"resources.jobs.job": {
4+
"action": "update"
5+
}
6+
}
7+
}

acceptance/bundle/resources/jobs/delete_task/out.test.toml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
>>> [CLI] bundle deploy
3+
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...
4+
Deploying resources...
5+
Updating deployment state...
6+
Deployment complete!
7+
8+
>>> cat databricks.yml
9+
bundle:
10+
name: test-bundle
11+
12+
resources:
13+
jobs:
14+
job:
15+
tasks:
16+
- task_key: TestTask2
17+
for_each_task:
18+
inputs: "[1]"
19+
task:
20+
task_key: TestTask2
21+
existing_cluster_id: "0717-132531-5opeqon1"
22+
python_wheel_task:
23+
package_name: "whl"
24+
entry_point: "run"
25+
libraries:
26+
- whl: /Workspace/Users/foo@bar.com/mywheel.whl
27+
28+
>>> [CLI] bundle deploy
29+
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files...
30+
Deploying resources...
31+
Updating deployment state...
32+
Deployment complete!
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
$CLI bundle debug plan > out.plan_create.$DATABRICKS_BUNDLE_ENGINE.json
2+
trace $CLI bundle deploy
3+
grep -v TO_DELETE databricks.yml > tmp.yml && mv tmp.yml databricks.yml
4+
trace cat databricks.yml
5+
$CLI bundle debug plan > out.plan_update.$DATABRICKS_BUNDLE_ENGINE.json
6+
trace $CLI bundle deploy
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
RecordRequests = false

0 commit comments

Comments
 (0)