mirror of https://github.com/databricks/cli.git
12368e3382
## Changes ***Note: this PR relies on sync.include functionality from here: https://github.com/databricks/cli/pull/671*** Added transformation mutator for Python wheel task for them to work on DBR <13.1 Using wheels upload to Workspace file system as cluster libraries is not supported in DBR < 13.1 In order to make Python wheel work correctly on DBR < 13.1 we do the following: 1. Build and upload python wheel as usual 2. Transform python wheel task into special notebook task which does the following a. Installs all necessary wheels with %pip magic b. Executes defined entry point with all provided parameters 3. Upload this notebook file to workspace file system 4. Deploy transformed job task This is also beneficial for executing on existing clusters because this notebook always reinstall wheels so if there are any changes to the wheel package, they are correctly picked up ## Tests bundle.yml ```yaml bundle: name: wheel-task workspace: host: **** resources: jobs: test_job: name: "[${bundle.environment}] My Wheel Job" tasks: - task_key: TestTask existing_cluster_id: "***" python_wheel_task: package_name: "my_test_code" entry_point: "run" parameters: ["first argument","first value","second argument","second value"] libraries: - whl: ./dist/*.whl ``` Output ``` andrew.nester@HFW9Y94129 wheel % databricks bundle run test_job Run URL: *** 2023-08-03 15:58:04 "[default] My Wheel Job" TERMINATED SUCCESS Output: ======= Task TestTask: Hello from my func Got arguments v1: ['python', 'first argument', 'first value', 'second argument', 'second value'] ``` |
||
---|---|---|
.. | ||
default_target.go | ||
default_target_test.go | ||
default_workspace_paths.go | ||
default_workspace_paths_test.go | ||
default_workspace_root.go | ||
default_workspace_root_test.go | ||
expand_workspace_root.go | ||
expand_workspace_root_test.go | ||
load_git_details.go | ||
mutator.go | ||
override_compute.go | ||
override_compute_test.go | ||
populate_current_user.go | ||
populate_current_user_test.go | ||
process_include.go | ||
process_include_test.go | ||
process_root_includes.go | ||
process_root_includes_test.go | ||
process_target_mode.go | ||
process_target_mode_test.go | ||
run_as.go | ||
select_default_target.go | ||
select_default_target_test.go | ||
select_target.go | ||
select_target_test.go | ||
set_variables.go | ||
set_variables_test.go | ||
trampoline.go | ||
trampoline_test.go | ||
translate_paths.go | ||
translate_paths_test.go | ||
validate_git_details.go | ||
validate_git_details_test.go |