-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support serverless in default-python
It's not interesting since it just dumps what is in the repo. This is especially annoying with bundle/templates tests with a lot of files.
- Loading branch information
Showing
16 changed files
with
263 additions
and
19 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
acceptance/bundle/templates/default-python-classic/input.json
This file contains 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,6 @@ | ||
{ | ||
"project_name": "my_default_python", | ||
"include_notebook": "yes", | ||
"include_dlt": "yes", | ||
"include_python": "yes" | ||
} |
27 changes: 27 additions & 0 deletions
27
acceptance/bundle/templates/default-python-classic/out.compare-vs-serverless.diff
This file contains 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,27 @@ | ||
--- [TESTROOT]/bundle/templates/default-python-classic/../default-python/output/my_default_python/resources/my_default_python.job.yml | ||
+++ output/my_default_python/resources/my_default_python.job.yml | ||
@@ -17,4 +17,5 @@ | ||
tasks: | ||
- task_key: notebook_task | ||
+ job_cluster_key: job_cluster | ||
notebook_task: | ||
notebook_path: ../src/notebook.ipynb | ||
@@ -29,5 +30,5 @@ | ||
depends_on: | ||
- task_key: refresh_pipeline | ||
- environment_key: default | ||
+ job_cluster_key: job_cluster | ||
python_wheel_task: | ||
package_name: my_default_python | ||
@@ -39,3 +40,10 @@ | ||
- whl: ../dist/*.whl | ||
|
||
- | ||
+ job_clusters: | ||
+ - job_cluster_key: job_cluster | ||
+ new_cluster: | ||
+ spark_version: 15.4.x-scala2.12 | ||
+ node_type_id: i3.xlarge | ||
+ autoscale: | ||
+ min_workers: 1 | ||
+ max_workers: 4 |
30 changes: 30 additions & 0 deletions
30
acceptance/bundle/templates/default-python-classic/output.txt
This file contains 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,30 @@ | ||
|
||
>>> [CLI] bundle init default-python --config-file ./input.json --output-dir output | ||
|
||
Welcome to the default Python template for Databricks Asset Bundles! | ||
Workspace to use (auto-detected, edit in 'my_default_python/databricks.yml'): [DATABRICKS_URL] | ||
|
||
✨ Your new project has been created in the 'my_default_python' directory! | ||
|
||
Please refer to the README.md file for "getting started" instructions. | ||
See also the documentation at https://docs.databricks.com/dev-tools/bundles/index.html. | ||
|
||
>>> [CLI] bundle validate -t dev | ||
Name: my_default_python | ||
Target: dev | ||
Workspace: | ||
Host: [DATABRICKS_URL] | ||
User: [USERNAME] | ||
Path: /Workspace/Users/[USERNAME]/.bundle/my_default_python/dev | ||
|
||
Validation OK! | ||
|
||
>>> [CLI] bundle validate -t prod | ||
Name: my_default_python | ||
Target: prod | ||
Workspace: | ||
Host: [DATABRICKS_URL] | ||
User: [USERNAME] | ||
Path: /Workspace/Users/[USERNAME]/.bundle/my_default_python/prod | ||
|
||
Validation OK! |
This file contains 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,15 @@ | ||
trace $CLI bundle init default-python --config-file ./input.json --output-dir output | ||
|
||
cd output/my_default_python | ||
trace $CLI bundle validate -t dev | ||
trace $CLI bundle validate -t prod | ||
|
||
# Do not affect this repository's git behaviour #2318 | ||
mv .gitignore out.gitignore | ||
|
||
cd ../../ | ||
|
||
# Calculate the difference from the standard (serverless) template | ||
diff.py $TESTDIR/../default-python/output output/ > out.compare-vs-serverless.diff | ||
|
||
rm -fr output |
This file contains 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 @@ | ||
# At the moment, there are many differences across different envs w.r.t to catalog use, node type and so on. | ||
LocalOnly = true | ||
SaveRepls = true | ||
|
||
[[Server]] | ||
Pattern = "GET /api/2.0/settings-api/workspace/{workspaceId}/serverless_job_nb" | ||
Response.Body = '{}' |
6 changes: 6 additions & 0 deletions
6
acceptance/bundle/templates/default-python-errorserverless/input.json
This file contains 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,6 @@ | ||
{ | ||
"project_name": "my_default_python", | ||
"include_notebook": "yes", | ||
"include_dlt": "yes", | ||
"include_python": "yes" | ||
} |
27 changes: 27 additions & 0 deletions
27
acceptance/bundle/templates/default-python-errorserverless/out.compare-vs-serverless.diff
This file contains 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,27 @@ | ||
--- [TESTROOT]/bundle/templates/default-python-errorserverless/../default-python/output/my_default_python/resources/my_default_python.job.yml | ||
+++ output/my_default_python/resources/my_default_python.job.yml | ||
@@ -17,4 +17,5 @@ | ||
tasks: | ||
- task_key: notebook_task | ||
+ job_cluster_key: job_cluster | ||
notebook_task: | ||
notebook_path: ../src/notebook.ipynb | ||
@@ -29,5 +30,5 @@ | ||
depends_on: | ||
- task_key: refresh_pipeline | ||
- environment_key: default | ||
+ job_cluster_key: job_cluster | ||
python_wheel_task: | ||
package_name: my_default_python | ||
@@ -39,3 +40,10 @@ | ||
- whl: ../dist/*.whl | ||
|
||
- | ||
+ job_clusters: | ||
+ - job_cluster_key: job_cluster | ||
+ new_cluster: | ||
+ spark_version: 15.4.x-scala2.12 | ||
+ node_type_id: i3.xlarge | ||
+ autoscale: | ||
+ min_workers: 1 | ||
+ max_workers: 4 |
31 changes: 31 additions & 0 deletions
31
acceptance/bundle/templates/default-python-errorserverless/output.txt
This file contains 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,31 @@ | ||
|
||
>>> [CLI] bundle init default-python --config-file ./input.json --output-dir output | ||
|
||
Welcome to the default Python template for Databricks Asset Bundles! | ||
Warn: Failed to detect if serverless is supported: /api/2.0/settings-api/workspace/900800700600/serverless_job_nb failed: Internal Server Error | ||
Workspace to use (auto-detected, edit in 'my_default_python/databricks.yml'): [DATABRICKS_URL] | ||
|
||
✨ Your new project has been created in the 'my_default_python' directory! | ||
|
||
Please refer to the README.md file for "getting started" instructions. | ||
See also the documentation at https://docs.databricks.com/dev-tools/bundles/index.html. | ||
|
||
>>> [CLI] bundle validate -t dev | ||
Name: my_default_python | ||
Target: dev | ||
Workspace: | ||
Host: [DATABRICKS_URL] | ||
User: [USERNAME] | ||
Path: /Workspace/Users/[USERNAME]/.bundle/my_default_python/dev | ||
|
||
Validation OK! | ||
|
||
>>> [CLI] bundle validate -t prod | ||
Name: my_default_python | ||
Target: prod | ||
Workspace: | ||
Host: [DATABRICKS_URL] | ||
User: [USERNAME] | ||
Path: /Workspace/Users/[USERNAME]/.bundle/my_default_python/prod | ||
|
||
Validation OK! |
15 changes: 15 additions & 0 deletions
15
acceptance/bundle/templates/default-python-errorserverless/script
This file contains 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,15 @@ | ||
trace $CLI bundle init default-python --config-file ./input.json --output-dir output | ||
|
||
cd output/my_default_python | ||
trace $CLI bundle validate -t dev | ||
trace $CLI bundle validate -t prod | ||
|
||
# Do not affect this repository's git behaviour #2318 | ||
mv .gitignore out.gitignore | ||
|
||
cd ../../ | ||
|
||
# Calculate the difference from the standard (serverless) template | ||
diff.py $TESTDIR/../default-python/output output/ > out.compare-vs-serverless.diff | ||
|
||
rm -fr output |
7 changes: 7 additions & 0 deletions
7
acceptance/bundle/templates/default-python-errorserverless/test.toml
This file contains 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 @@ | ||
# At the moment, there are many differences across different envs w.r.t to catalog use, node type and so on. | ||
LocalOnly = true | ||
SaveRepls = true | ||
|
||
[[Server]] | ||
Pattern = "GET /api/2.0/settings-api/workspace/{workspaceId}/serverless_job_nb" | ||
Response.StatusCode = 500 |
This file contains 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 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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
# At the moment, there are many differences across different envs w.r.t to catalog use, node type and so on. | ||
LocalOnly = true | ||
|
||
[[Server]] | ||
Pattern = "GET /api/2.0/settings-api/workspace/{workspaceId}/serverless_job_nb" | ||
Response.Body = '''{"setting": {"value": {"preview_enablement_val": {"enabled": true}}}}''' |
This file contains 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 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 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
Oops, something went wrong.