Uh oh!
There was an error while loading. Please reload this page.
Added transformation mutator for Python wheel task for them to work on DBR <13.1 - #635
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| remotePath := path.Join(b.Config.Workspace.FilesPath, filepath.ToSlash(internalDirRel), notebookName) | ||
| task.NotebookTask = &jobs.NotebookTask{ | ||
| NotebookPath: remotePath, |
There was a problem hiding this comment.
Can you comment on how we expect the wheel args, or task params, to be passed in the template?
There was a problem hiding this comment.
As a reference example, in Python trampoline we do it with sys.argv as you can see here
https://github.com/databricks/cli/pull/635/files#diff-8ddf2564fcd580399d61df5283d0c0c7b614c476e0803f63f9f785b62dc69a04R23
I'd expect it should work similarly for task params
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
CLI: * Fixed --environment flag ([#705](#705)). Bundles: * Support cluster overrides with cluster_key and compute_key ([#696](#696)). * Allow referencing local Python wheels without artifacts section defined ([#703](#703)). * Correctly identify local paths in libraries section ([#702](#702)). * Fixed path joining in FindFilesWithSuffixInPath ([#704](#704)). * Added transformation mutator for Python wheel task for them to work on DBR <13.1 ([#635](#635)). Internal: * Add a foundation for built-in templates ([#685](#685)).
## Changes Fixes issue introduced in #635. ## Tests Added new unit test to confirm correct behavior. Manually deployed sample bundle.
Bundles: * Support cluster overrides with cluster_key and compute_key ([#696](#696)). * Allow referencing local Python wheels without artifacts section defined ([#703](#703)). * Fixed --environment flag ([#705](#705)). * Correctly identify local paths in libraries section ([#702](#702)). * Fixed path joining in FindFilesWithSuffixInPath ([#704](#704)). * Added transformation mutator for Python wheel task for them to work on DBR <13.1 ([#635](#635)). Internal: * Add a foundation for built-in templates ([#685](#685)). * Test transform when no Python wheel tasks defined ([#714](#714)). * Pin Terraform binary version to 1.5.5 ([#715](#715)). * Cleanup after "Add a foundation for built-in templates" ([#707](#707)). * Filter down to Python wheel tasks only for trampoline ([#712](#712)). * Update Terraform provider schema structs from 1.23.0 ([#713](#713)).
Bundles: * Support cluster overrides with cluster_key and compute_key ([#696](#696)). * Allow referencing local Python wheels without artifacts section defined ([#703](#703)). * Fixed --environment flag ([#705](#705)). * Correctly identify local paths in libraries section ([#702](#702)). * Fixed path joining in FindFilesWithSuffixInPath ([#704](#704)). * Added transformation mutator for Python wheel task for them to work on DBR <13.1 ([#635](#635)). Internal: * Add a foundation for built-in templates ([#685](#685)). * Test transform when no Python wheel tasks defined ([#714](#714)). * Pin Terraform binary version to 1.5.5 ([#715](#715)). * Cleanup after "Add a foundation for built-in templates" ([#707](#707)). * Filter down to Python wheel tasks only for trampoline ([#712](#712)). * Update Terraform provider schema structs from 1.23.0 ([#713](#713)).
…on DBR <13.1 (#635) ## Changes ***Note: this PR relies on sync.include functionality from here: #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'] ```
## Changes Fixes issue introduced in #635. ## Tests Added new unit test to confirm correct behavior. Manually deployed sample bundle.
Bundles: * Support cluster overrides with cluster_key and compute_key ([#696](#696)). * Allow referencing local Python wheels without artifacts section defined ([#703](#703)). * Fixed --environment flag ([#705](#705)). * Correctly identify local paths in libraries section ([#702](#702)). * Fixed path joining in FindFilesWithSuffixInPath ([#704](#704)). * Added transformation mutator for Python wheel task for them to work on DBR <13.1 ([#635](#635)). Internal: * Add a foundation for built-in templates ([#685](#685)). * Test transform when no Python wheel tasks defined ([#714](#714)). * Pin Terraform binary version to 1.5.5 ([#715](#715)). * Cleanup after "Add a foundation for built-in templates" ([#707](#707)). * Filter down to Python wheel tasks only for trampoline ([#712](#712)). * Update Terraform provider schema structs from 1.23.0 ([#713](#713)).
…on DBR <13.1 (databricks#635) ## Changes ***Note: this PR relies on sync.include functionality from here: databricks#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'] ``` Signed-off-by: Arpit Jasapara <arpit.jasapara@databricks.com>
## Changes Fixes issue introduced in databricks#635. ## Tests Added new unit test to confirm correct behavior. Manually deployed sample bundle. Signed-off-by: Arpit Jasapara <arpit.jasapara@databricks.com>
Bundles: * Support cluster overrides with cluster_key and compute_key ([databricks#696](databricks#696)). * Allow referencing local Python wheels without artifacts section defined ([databricks#703](databricks#703)). * Fixed --environment flag ([databricks#705](databricks#705)). * Correctly identify local paths in libraries section ([databricks#702](databricks#702)). * Fixed path joining in FindFilesWithSuffixInPath ([databricks#704](databricks#704)). * Added transformation mutator for Python wheel task for them to work on DBR <13.1 ([databricks#635](databricks#635)). Internal: * Add a foundation for built-in templates ([databricks#685](databricks#685)). * Test transform when no Python wheel tasks defined ([databricks#714](databricks#714)). * Pin Terraform binary version to 1.5.5 ([databricks#715](databricks#715)). * Cleanup after "Add a foundation for built-in templates" ([databricks#707](databricks#707)). * Filter down to Python wheel tasks only for trampoline ([databricks#712](databricks#712)). * Update Terraform provider schema structs from 1.23.0 ([databricks#713](databricks#713)). Signed-off-by: Arpit Jasapara <arpit.jasapara@databricks.com>
stawo
commented
Sep 19, 2023
@andrewnester , @pietern , I believe this PR introduced some breaking behavior. See #783 |
## Summary The `wrapper` and `wrapper_custom_params` tests pin Spark to `12.2.x-scala2.12` to exercise the trampoline workaround for DBR <13.1 ([PR #635](#635)). The AWS test workspaces have disabled legacy access, so 12.2.x is rejected at job submission time: ``` INVALID_PARAMETER_VALUE: Spark version 12.2.x-scala2.12 isn't supported because legacy access is disabled in your workspace. Please use Databricks Runtime 13.3 LTS or above when any legacy features are disabled. ``` Bumping the runtime would defeat the purpose of the test (the trampoline only triggers for DBR <13.1). Restrict the test matrix to Azure where 12.2.x is still bookable. GCP was already excluded for an unrelated DBR release issue. The trampoline itself is covered by unit tests in `bundle/trampoline/` and acceptance tests under `acceptance/bundle/trampoline/`. ## Test plan - [ ] Confirm next nightly: wrapper and wrapper_custom_params no longer in the failures list on aws-prod-is or aws-prod-ucws-is. - [ ] They continue to pass on Azure (azure-prod-is, azure-prod-ucws-is) where they had been passing before. This pull request was AI-assisted by Isaac.
…on DBR <13.1 (#635) ## Changes ***Note: this PR relies on sync.include functionality from here: #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'] ```
## Changes Fixes issue introduced in #635. ## Tests Added new unit test to confirm correct behavior. Manually deployed sample bundle.
Bundles: * Support cluster overrides with cluster_key and compute_key ([#696](#696)). * Allow referencing local Python wheels without artifacts section defined ([#703](#703)). * Fixed --environment flag ([#705](#705)). * Correctly identify local paths in libraries section ([#702](#702)). * Fixed path joining in FindFilesWithSuffixInPath ([#704](#704)). * Added transformation mutator for Python wheel task for them to work on DBR <13.1 ([#635](#635)). Internal: * Add a foundation for built-in templates ([#685](#685)). * Test transform when no Python wheel tasks defined ([#714](#714)). * Pin Terraform binary version to 1.5.5 ([#715](#715)). * Cleanup after "Add a foundation for built-in templates" ([#707](#707)). * Filter down to Python wheel tasks only for trampoline ([#712](#712)). * Update Terraform provider schema structs from 1.23.0 ([#713](#713)).
## Summary The `wrapper` and `wrapper_custom_params` tests pin Spark to `12.2.x-scala2.12` to exercise the trampoline workaround for DBR <13.1 ([PR #635](#635)). The AWS test workspaces have disabled legacy access, so 12.2.x is rejected at job submission time: ``` INVALID_PARAMETER_VALUE: Spark version 12.2.x-scala2.12 isn't supported because legacy access is disabled in your workspace. Please use Databricks Runtime 13.3 LTS or above when any legacy features are disabled. ``` Bumping the runtime would defeat the purpose of the test (the trampoline only triggers for DBR <13.1). Restrict the test matrix to Azure where 12.2.x is still bookable. GCP was already excluded for an unrelated DBR release issue. The trampoline itself is covered by unit tests in `bundle/trampoline/` and acceptance tests under `acceptance/bundle/trampoline/`. ## Test plan - [ ] Confirm next nightly: wrapper and wrapper_custom_params no longer in the failures list on aws-prod-is or aws-prod-ucws-is. - [ ] They continue to pass on Azure (azure-prod-is, azure-prod-ucws-is) where they had been passing before. This pull request was AI-assisted by Isaac.
…abricks#5152) ## Summary The `wrapper` and `wrapper_custom_params` tests pin Spark to `12.2.x-scala2.12` to exercise the trampoline workaround for DBR <13.1 ([PR databricks#635](databricks#635)). The AWS test workspaces have disabled legacy access, so 12.2.x is rejected at job submission time: ``` INVALID_PARAMETER_VALUE: Spark version 12.2.x-scala2.12 isn't supported because legacy access is disabled in your workspace. Please use Databricks Runtime 13.3 LTS or above when any legacy features are disabled. ``` Bumping the runtime would defeat the purpose of the test (the trampoline only triggers for DBR <13.1). Restrict the test matrix to Azure where 12.2.x is still bookable. GCP was already excluded for an unrelated DBR release issue. The trampoline itself is covered by unit tests in `bundle/trampoline/` and acceptance tests under `acceptance/bundle/trampoline/`. ## Test plan - [ ] Confirm next nightly: wrapper and wrapper_custom_params no longer in the failures list on aws-prod-is or aws-prod-ucws-is. - [ ] They continue to pass on Azure (azure-prod-is, azure-prod-ucws-is) where they had been passing before. This pull request was AI-assisted by Isaac.
Changes
Note: this PR relies on sync.include functionality from here: #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:
a. Installs all necessary wheels with %pip magic
b. Executes defined entry point with all provided parameters
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
Output