-
Notifications
You must be signed in to change notification settings - Fork 147
Added support for lifecycle.started option #4672
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
Open
andrewnester
wants to merge
10
commits into
main
Choose a base branch
from
feat/lifecycle-started
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4131876
Added support for lifecycle.started option
andrewnester dec451b
Merge branch 'main' into feat/lifecycle-started
andrewnester 006910a
fixed sche,a
andrewnester da107eb
some refactoring and fixed test output
andrewnester 0fa3370
Merge branch 'main' into feat/lifecycle-started
andrewnester a79625c
fixed python codegene
andrewnester 176e874
updated tests
andrewnester 8580843
fixed lifecycle check
andrewnester 77e2ba6
introduce lifecyclewithstarted
andrewnester e47fa4e
fix test output
andrewnester 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| bundle: | ||
| name: test_lifecycle_started | ||
|
|
||
| resources: | ||
| jobs: | ||
| my_job: | ||
| name: my_job | ||
| lifecycle: | ||
| started: true |
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,7 @@ | ||
| Warning: unknown field: started | ||
| at resources.jobs.my_job.lifecycle | ||
| in databricks.yml:9:9 | ||
|
|
||
| create jobs.my_job | ||
|
|
||
| Plan: 1 to add, 0 to change, 0 to delete, 0 unchanged |
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 @@ | ||
| errcode $CLI bundle plan |
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,7 @@ | ||
| Local = true | ||
| Cloud = false | ||
|
|
||
| Ignore = [".databricks"] | ||
|
|
||
| [EnvMatrix] | ||
| DATABRICKS_BUNDLE_ENGINE = ["direct"] | ||
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
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 @@ | ||
| print("Hello world!") |
11 changes: 11 additions & 0 deletions
11
acceptance/bundle/resources/apps/lifecycle-started/databricks.yml.tmpl
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,11 @@ | ||
| bundle: | ||
| name: lifecycle-started-$UNIQUE_NAME | ||
|
|
||
| resources: | ||
| apps: | ||
| myapp: | ||
| name: $UNIQUE_NAME | ||
| description: my_app_description | ||
| source_code_path: ./app | ||
| lifecycle: | ||
| started: true |
75 changes: 75 additions & 0 deletions
75
acceptance/bundle/resources/apps/lifecycle-started/out.deploy.direct.txt
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,75 @@ | ||
|
|
||
| >>> errcode [CLI] bundle deploy | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/lifecycle-started-[UNIQUE_NAME]/default/files... | ||
| Deploying resources... | ||
| Updating deployment state... | ||
| Deployment complete! | ||
|
|
||
| >>> jq select(.method == "POST" and .path == "/api/2.0/apps") out.requests.txt | ||
| { | ||
| "method": "POST", | ||
| "path": "/api/2.0/apps", | ||
| "body": { | ||
| "description": "my_app_description", | ||
| "name": "[UNIQUE_NAME]" | ||
| } | ||
| } | ||
|
|
||
| >>> errcode [CLI] apps get [UNIQUE_NAME] | ||
| "ACTIVE" | ||
|
|
||
| >>> errcode [CLI] bundle deploy | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/lifecycle-started-[UNIQUE_NAME]/default/files... | ||
| Deploying resources... | ||
| ✓ Deployment succeeded. | ||
| Updating deployment state... | ||
| Deployment complete! | ||
|
|
||
| >>> jq select(.method == "POST" and (.path | endswith("/deployments"))) out.requests.txt | ||
| { | ||
| "method": "POST", | ||
| "path": "/api/2.0/apps/[UNIQUE_NAME]/deployments", | ||
| "body": { | ||
| "mode": "SNAPSHOT", | ||
| "source_code_path": "/Workspace/Users/[USERNAME]/.bundle/lifecycle-started-[UNIQUE_NAME]/default/files/app" | ||
| } | ||
| } | ||
|
|
||
| >>> errcode [CLI] apps stop [UNIQUE_NAME] | ||
| "STOPPED" | ||
|
|
||
| >>> errcode [CLI] bundle deploy | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/lifecycle-started-[UNIQUE_NAME]/default/files... | ||
| Deploying resources... | ||
| Updating deployment state... | ||
| Deployment complete! | ||
|
|
||
| >>> jq select(.method == "POST" and (.path | endswith("/deployments"))) out.requests.txt | ||
|
|
||
| >>> errcode [CLI] apps get [UNIQUE_NAME] | ||
| "STOPPED" | ||
|
|
||
| >>> errcode [CLI] bundle deploy | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/lifecycle-started-[UNIQUE_NAME]/default/files... | ||
| Deploying resources... | ||
| ✓ Deployment succeeded. | ||
| Updating deployment state... | ||
| Deployment complete! | ||
|
|
||
| >>> jq select(.method == "POST" and (.path | (endswith("/start") or endswith("/deployments")))) out.requests.txt | ||
| { | ||
| "method": "POST", | ||
| "path": "/api/2.0/apps/[UNIQUE_NAME]/start", | ||
| "body": {} | ||
| } | ||
| { | ||
| "method": "POST", | ||
| "path": "/api/2.0/apps/[UNIQUE_NAME]/deployments", | ||
| "body": { | ||
| "mode": "SNAPSHOT", | ||
| "source_code_path": "/Workspace/Users/[USERNAME]/.bundle/lifecycle-started-[UNIQUE_NAME]/default/files/app" | ||
| } | ||
| } | ||
|
|
||
| >>> errcode [CLI] apps get [UNIQUE_NAME] | ||
| "ACTIVE" |
51 changes: 51 additions & 0 deletions
51
acceptance/bundle/resources/apps/lifecycle-started/out.deploy.terraform.txt
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,51 @@ | ||
|
|
||
| >>> errcode [CLI] bundle deploy | ||
| Error: lifecycle.started is only supported in direct deployment mode | ||
| in databricks.yml:11:18 | ||
|
|
||
|
|
||
| Exit code: 1 | ||
|
|
||
| >>> jq select(.method == "POST" and .path == "/api/2.0/apps") out.requests.txt | ||
|
|
||
| >>> errcode [CLI] apps get [UNIQUE_NAME] | ||
| Error: Resource apps.App not found: [UNIQUE_NAME] | ||
|
|
||
| Exit code: 1 | ||
|
|
||
| >>> errcode [CLI] bundle deploy | ||
| Error: lifecycle.started is only supported in direct deployment mode | ||
| in databricks.yml:11:18 | ||
|
|
||
|
|
||
| Exit code: 1 | ||
|
|
||
| >>> jq select(.method == "POST" and (.path | endswith("/deployments"))) out.requests.txt | ||
|
|
||
| >>> errcode [CLI] apps stop [UNIQUE_NAME] | ||
| Error: Not Found | ||
|
|
||
| Exit code: 1 | ||
|
|
||
| >>> errcode [CLI] bundle deploy | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/lifecycle-started-[UNIQUE_NAME]/default/files... | ||
| Deploying resources... | ||
| Updating deployment state... | ||
| Deployment complete! | ||
|
|
||
| >>> jq select(.method == "POST" and (.path | endswith("/deployments"))) out.requests.txt | ||
|
|
||
| >>> errcode [CLI] apps get [UNIQUE_NAME] | ||
| "ACTIVE" | ||
|
|
||
| >>> errcode [CLI] bundle deploy | ||
| Error: lifecycle.started is only supported in direct deployment mode | ||
| in databricks.yml:11:18 | ||
|
|
||
|
|
||
| Exit code: 1 | ||
|
|
||
| >>> jq select(.method == "POST" and (.path | (endswith("/start") or endswith("/deployments")))) out.requests.txt | ||
|
|
||
| >>> errcode [CLI] apps get [UNIQUE_NAME] | ||
| "ACTIVE" |
9 changes: 9 additions & 0 deletions
9
acceptance/bundle/resources/apps/lifecycle-started/out.destroy.direct.txt
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,9 @@ | ||
|
|
||
| >>> [CLI] bundle destroy --auto-approve | ||
| The following resources will be deleted: | ||
| delete resources.apps.myapp | ||
|
|
||
| All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/lifecycle-started-[UNIQUE_NAME]/default | ||
|
|
||
| Deleting files... | ||
| Destroy complete! |
9 changes: 9 additions & 0 deletions
9
acceptance/bundle/resources/apps/lifecycle-started/out.destroy.terraform.txt
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,9 @@ | ||
|
|
||
| >>> [CLI] bundle destroy --auto-approve | ||
| The following resources will be deleted: | ||
| delete resources.apps.myapp | ||
|
|
||
| All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/lifecycle-started-[UNIQUE_NAME]/default | ||
|
|
||
| Deleting files... | ||
| Destroy complete! |
5 changes: 5 additions & 0 deletions
5
acceptance/bundle/resources/apps/lifecycle-started/out.test.toml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
acceptance/bundle/resources/apps/lifecycle-started/output.txt
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,10 @@ | ||
|
|
||
| >>> update_file.py databricks.yml my_app_description MY_APP_DESCRIPTION | ||
|
|
||
| >>> update_file.py databricks.yml started: true started: false | ||
|
|
||
| >>> update_file.py databricks.yml MY_APP_DESCRIPTION MY_APP_DESCRIPTION_2 | ||
|
|
||
| >>> update_file.py databricks.yml started: false started: true | ||
|
|
||
| >>> update_file.py databricks.yml MY_APP_DESCRIPTION_2 MY_APP_DESCRIPTION_3 |
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,32 @@ | ||
| envsubst < databricks.yml.tmpl > databricks.yml | ||
|
|
||
| cleanup() { | ||
| trace $CLI bundle destroy --auto-approve &> out.destroy.$DATABRICKS_BUNDLE_ENGINE.txt | ||
| rm -f out.requests.txt | ||
| } | ||
| trap cleanup EXIT | ||
|
|
||
| { trace errcode $CLI bundle deploy; } &> out.deploy.$DATABRICKS_BUNDLE_ENGINE.txt | ||
| { trace jq 'select(.method == "POST" and .path == "/api/2.0/apps")' out.requests.txt; } >> out.deploy.$DATABRICKS_BUNDLE_ENGINE.txt 2>&1 | ||
| rm -f out.requests.txt | ||
| { trace errcode $CLI apps get $UNIQUE_NAME | jq '.compute_status.state'; } >> out.deploy.$DATABRICKS_BUNDLE_ENGINE.txt 2>&1 || true | ||
|
|
||
| trace update_file.py databricks.yml my_app_description MY_APP_DESCRIPTION | ||
| { trace errcode $CLI bundle deploy; } >> out.deploy.$DATABRICKS_BUNDLE_ENGINE.txt 2>&1 | ||
| { trace jq 'select(.method == "POST" and (.path | endswith("/deployments")))' out.requests.txt; } >> out.deploy.$DATABRICKS_BUNDLE_ENGINE.txt 2>&1 | ||
| rm -f out.requests.txt | ||
| { trace errcode $CLI apps stop $UNIQUE_NAME | jq '.compute_status.state'; } >> out.deploy.$DATABRICKS_BUNDLE_ENGINE.txt 2>&1 || true | ||
|
|
||
| trace update_file.py databricks.yml "started: true" "started: false" | ||
| trace update_file.py databricks.yml MY_APP_DESCRIPTION MY_APP_DESCRIPTION_2 | ||
| { trace errcode $CLI bundle deploy; } >> out.deploy.$DATABRICKS_BUNDLE_ENGINE.txt 2>&1 | ||
| { trace jq 'select(.method == "POST" and (.path | endswith("/deployments")))' out.requests.txt; } >> out.deploy.$DATABRICKS_BUNDLE_ENGINE.txt 2>&1 | ||
| rm -f out.requests.txt | ||
| { trace errcode $CLI apps get $UNIQUE_NAME | jq '.compute_status.state'; } >> out.deploy.$DATABRICKS_BUNDLE_ENGINE.txt 2>&1 || true | ||
|
|
||
| trace update_file.py databricks.yml "started: false" "started: true" | ||
| trace update_file.py databricks.yml MY_APP_DESCRIPTION_2 MY_APP_DESCRIPTION_3 | ||
| { trace errcode $CLI bundle deploy; } >> out.deploy.$DATABRICKS_BUNDLE_ENGINE.txt 2>&1 | ||
| { trace jq 'select(.method == "POST" and (.path | (endswith("/start") or endswith("/deployments"))))' out.requests.txt; } >> out.deploy.$DATABRICKS_BUNDLE_ENGINE.txt 2>&1 | ||
| rm -f out.requests.txt | ||
| { trace errcode $CLI apps get $UNIQUE_NAME | jq '.compute_status.state'; } >> out.deploy.$DATABRICKS_BUNDLE_ENGINE.txt 2>&1 || 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,8 @@ | ||
| Local = true | ||
| Cloud = true | ||
| RecordRequests = true | ||
|
|
||
| Ignore = [".databricks", "databricks.yml"] | ||
|
|
||
| [EnvMatrix] | ||
| DATABRICKS_BUNDLE_ENGINE = ["direct", "terraform"] |
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.
Uh oh!
There was an error while loading. Please reload this page.