-
Notifications
You must be signed in to change notification settings - Fork 72
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
Reading variables from file #2171
Merged
Merged
Changes from 26 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
a794490
feat: Read variables from file
ilyakuz-db 3f0b5f8
test: Acceptance test for flag overrides
ilyakuz-db a75c6af
fix: Rename to --var-file
ilyakuz-db 66dae81
fix: More detailed error for json parsing
ilyakuz-db d0db1d7
fix: Cleanup
ilyakuz-db 2c9adcb
fix: More acceptance tests
ilyakuz-db 15c9c5c
fix: Flaky test
ilyakuz-db 01a6a66
fix: Remove extra tests
ilyakuz-db c5109cd
Merge branch 'main' of github.com:databricks/cli into feat/variable-f…
ilyakuz-db f52423c
fix: Update `help` snapshots
ilyakuz-db 2a1c4d1
fix: Message in test
ilyakuz-db bdb8f1e
fix: Message in acceptance tests
ilyakuz-db 19b5018
fix: Flaky test
ilyakuz-db 44aba7e
fix: Remove platform specific part from output
ilyakuz-db e4164c1
fix: Try `jq -b` to preserve window output
ilyakuz-db bfec3c4
Merge branch 'main' of github.com:databricks/cli into feat/variable-f…
ilyakuz-db 6dd8fc2
fix: Less flaky sed execution
ilyakuz-db 1656bf5
fix: Remove redundant test
ilyakuz-db 422585c
feat: Default value for variable path
ilyakuz-db 47c8fb3
chore: Regenerate other snapshots
ilyakuz-db 6f20e88
Added annotations to output
ilyakuz-db ad6343a
Cleanup in flag description
ilyakuz-db e0c81f0
Regenerate help snapshots
ilyakuz-db 38b7d27
Remove unnecessary locations
ilyakuz-db 3e1a335
Fix test with error message
ilyakuz-db 229fdb2
Use variable-overrides.json name
ilyakuz-db 6e8f5f3
Fix message in test
ilyakuz-db cf42459
Add file path to parsing error
ilyakuz-db d771ce7
Remove --var-file
ilyakuz-db f1ab4f0
Regenerate snapshots
ilyakuz-db 8e8287b
Adds test case with value from target specified
ilyakuz-db 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 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
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
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
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
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
7 changes: 7 additions & 0 deletions
7
.../var_file_overrides/.databricks/bundle/with-default-variable-file/variable-overrides.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,7 @@ | ||
{ | ||
"cluster": { | ||
"node_type_id": "Standard_DS3_v3" | ||
}, | ||
"cluster_key": "mlops_stacks-cluster-2", | ||
"cluster_workers": 9 | ||
} |
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 @@ | ||
!.databricks |
35 changes: 35 additions & 0 deletions
35
acceptance/bundle/variables/var_file_overrides/databricks.yml
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,35 @@ | ||
bundle: | ||
name: TestResolveVariablesFromFile | ||
|
||
variables: | ||
cluster: | ||
type: "complex" | ||
cluster_key: | ||
cluster_workers: | ||
|
||
resources: | ||
jobs: | ||
job1: | ||
job_clusters: | ||
- job_cluster_key: ${var.cluster_key} | ||
new_cluster: | ||
node_type_id: "${var.cluster.node_type_id}" | ||
num_workers: ${var.cluster_workers} | ||
|
||
targets: | ||
with-defaults: | ||
default: true | ||
variables: | ||
cluster_workers: | ||
default: 1 | ||
cluster: | ||
type: "complex" | ||
default: | ||
node_type_id: "default" | ||
cluster_key: | ||
default: "default" | ||
|
||
without-defaults: | ||
|
||
# see .databricks/bundle/default_target/ for variable values | ||
with-default-variable-file: | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need a target here? The default variables are read for any target, right? so it's the same as without-defaults.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made separate target to avoid affecting other tests by this default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E.g. I put
.databrick/bundle/without-defaults/variable-overrides.json
file and previous test implicitly has this additional variable sources which may lead to confusion if anything goes wrong