-
Notifications
You must be signed in to change notification settings - Fork 69
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
Added databricks bundle generate job
command
#1043
Conversation
databricks bundle generate job
command
cmd/bundle/generate/job.go
Outdated
} | ||
|
||
for _, task := range job.Settings.Tasks { | ||
err := downloadNotebookAndReplaceTaskPath(ctx, &task, w, outputDir) |
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.
We should also do this for SparkPythonTask
. Are we also planning to do this for wheel and jar tasks?
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.
@shreyas-goenka eventually yes, for now it's only scoped to notebook tasks
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.
Note that we can't really fully support wheel and jar tasks without user intervention, since we'd want the Python/Scala sources, not the wheel or jar file. The job doesn't know about those sources.
libs/config/value.go
Outdated
// See convert.convertMap for details | ||
sort.SliceStable(keys, func(i, j int) bool { | ||
return m[keys[i]].Location().Line < m[keys[j]].Location().Line | ||
}) |
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.
Smart :)
e7b5ec9
to
882c8bc
Compare
ee458ca
to
316eda4
Compare
f13e585
to
2777a29
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1043 +/- ##
==========================================
+ Coverage 49.24% 49.50% +0.26%
==========================================
Files 273 281 +8
Lines 10570 10711 +141
==========================================
+ Hits 5205 5303 +98
- Misses 4810 4844 +34
- Partials 555 564 +9 ☔ View full report in Codecov by Sentry. |
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.
Given we have the YAML loader in a separate package, I think the YAML saver should also be outside of the main dyn
package. The attributes we need to turn a dyn.Value
tree into a YAML document are all public/exported anyway.
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.
Two minor remaining issues. Unblocking merge.
CLI: * Fix windows style file paths in fs cp command ([#1118](#1118)). * Do not require positional arguments if they should be provided in JSON ([#1125](#1125)). * Always require path parameters as positional arguments ([#1129](#1129)). Bundles: * Add debug log line for when bundle init is run from non-TTY interface ([#1117](#1117)). * Added `databricks bundle generate job` command ([#1043](#1043)). * Support passing job parameters to bundle run ([#1115](#1115)). Dependency updates: * Bump golang.org/x/oauth2 from 0.15.0 to 0.16.0 ([#1124](#1124)).
CLI: * Fix windows style file paths in fs cp command ([#1118](#1118)). * Do not require positional arguments if they should be provided in JSON ([#1125](#1125)). * Always require path parameters as positional arguments ([#1129](#1129)). Bundles: * Add debug log line for when bundle init is run from non-TTY interface ([#1117](#1117)). * Added `databricks bundle generate job` command ([#1043](#1043)). * Support passing job parameters to bundle run ([#1115](#1115)). Dependency updates: * Bump golang.org/x/oauth2 from 0.15.0 to 0.16.0 ([#1124](#1124)).
Changes
Now it's possible to generate bundle configuration for existing job.
For now it only supports jobs with notebook tasks.
It will download notebooks referenced in the job tasks and generate bundle YAML config for this job which can be included in larger bundle.
Tests
Running command manually
Example of generated config
Tests
Manual (on our last 100 jobs) + added end-to-end test