-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a warning when
config
section is used in apps (#2416)
## Changes Added a warning when `config` section is used in apps ## Why To avoid the confusion between using apps in DABs and outside of DABs, we want to provide only one way of configuring apps runtime configuration - by using `app.yml` file in the root of the app. ## Tests Added acceptance tests
- Loading branch information
1 parent
8b7e0ba
commit 010f88f
Showing
16 changed files
with
121 additions
and
54 deletions.
There are no files selected for viewing
Empty file.
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,3 @@ | ||
command: | ||
- python | ||
- app.py |
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,8 @@ | ||
bundle: | ||
name: apps_yaml | ||
|
||
resources: | ||
apps: | ||
myapp: | ||
name: myapp | ||
source_code_path: ./app |
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,5 @@ | ||
{ | ||
"method": "POST", | ||
"path": "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/apps_yaml/default/files/app/app.yml", | ||
"raw_body": "command:\n - python\n - app.py\n" | ||
} |
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 @@ | ||
|
||
>>> [CLI] bundle validate | ||
Name: apps_yaml | ||
Target: default | ||
Workspace: | ||
User: [USERNAME] | ||
Path: /Workspace/Users/[USERNAME]/.bundle/apps_yaml/default | ||
|
||
Validation OK! | ||
|
||
>>> [CLI] bundle deploy | ||
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/apps_yaml/default/files... | ||
Deploying resources... | ||
Updating deployment state... | ||
Deployment complete! |
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,4 @@ | ||
trace $CLI bundle validate | ||
trace $CLI bundle deploy | ||
jq 'select(.path == "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/apps_yaml/default/files/app/app.yml")' out.requests.txt | sed 's/\\r//g' > out.app.yml.txt | ||
rm out.requests.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 @@ | ||
print("Hello world!") |
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,12 @@ | ||
bundle: | ||
name: apps_config_section | ||
|
||
resources: | ||
apps: | ||
myapp: | ||
name: myapp | ||
source_code_path: ./app | ||
config: | ||
command: | ||
- python | ||
- app.py |
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,5 @@ | ||
{ | ||
"method": "POST", | ||
"path": "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/apps_config_section/default/files/app/app.yml", | ||
"raw_body": "command:\n - python\n - app.py\n" | ||
} |
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,23 @@ | ||
|
||
>>> [CLI] bundle validate | ||
Warning: App config section detected | ||
|
||
remove 'config' from app resource 'myapp' section and use app.yml file in the root of this app instead | ||
|
||
Name: apps_config_section | ||
Target: default | ||
Workspace: | ||
User: [USERNAME] | ||
Path: /Workspace/Users/[USERNAME]/.bundle/apps_config_section/default | ||
|
||
Found 1 warning | ||
|
||
>>> [CLI] bundle deploy | ||
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/apps_config_section/default/files... | ||
Deploying resources... | ||
Updating deployment state... | ||
Deployment complete! | ||
Warning: App config section detected | ||
|
||
remove 'config' from app resource 'myapp' section and use app.yml file in the root of this app instead | ||
|
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,4 @@ | ||
trace $CLI bundle validate | ||
trace $CLI bundle deploy | ||
jq 'select(.path == "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/apps_config_section/default/files/app/app.yml")' out.requests.txt > out.app.yml.txt | ||
rm out.requests.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,26 @@ | ||
Cloud = false | ||
RecordRequests = true | ||
|
||
Ignore = [ | ||
'.databricks', | ||
] | ||
|
||
[[Server]] | ||
Pattern = "POST /api/2.0/apps" | ||
|
||
[[Server]] | ||
Pattern = "GET /api/2.0/apps/myapp" | ||
Response.Body = ''' | ||
{ | ||
"name": "myapp", | ||
"description": "", | ||
"compute_status": { | ||
"state": "ACTIVE", | ||
"message": "App compute is active." | ||
}, | ||
"app_status": { | ||
"state": "RUNNING", | ||
"message": "Application is running." | ||
} | ||
} | ||
''' |
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
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,7 +1,11 @@ | ||
Warning: App config section detected | ||
|
||
remove 'config' from app resource 'test_app' section and use app.yml file in the root of this app instead | ||
|
||
Name: basic | ||
Target: default | ||
Workspace: | ||
User: [USERNAME] | ||
Path: /Workspace/Users/[USERNAME]/.bundle/$UNIQUE_PRJ | ||
|
||
Validation OK! | ||
Found 1 warning |