Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 215
When globbing for wheels, only consider most recent version; do not clean up dist/build/__pycache__#2982
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
Uh oh!
There was an error while loading. Please reload this page.
When globbing for wheels, only consider most recent version; do not clean up dist/build/__pycache__ #2982
Changes from all commits
87cae7fd6b012a138190a6f48b6be35e713e7f1f4121370e4980a0662e4445e8b24696a7f36bf2cc0910fd214ff670bd5db7518f6c0d9c664f4690700b560aFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| build/ | ||
| *.egg-info | ||
| .databricks |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| resources: | ||
| jobs: | ||
| test_job: | ||
| name: "[${bundle.target}] My Wheel Job" | ||
| tasks: | ||
| - task_key: TestTask | ||
| existing_cluster_id: "0717-aaaaa-bbbbbb" | ||
| python_wheel_task: | ||
| package_name: "my_test_code" | ||
| entry_point: "run" | ||
| libraries: | ||
| - whl: ./dist/*.whl |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| __version__ = "0.1.0" | ||
| __author__ = "Databricks" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| """ | ||
| The entry point of the Python Wheel | ||
| """ | ||
| import sys | ||
| def main(): | ||
| # This method will print the provided arguments | ||
| print("Hello from my func") | ||
| print("Got arguments:") | ||
| print(sys.argv) | ||
| if __name__ == "__main__": | ||
| main() |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,138 @@ | ||
| >>> [CLI] bundle deploy | ||
| Building python_artifact... | ||
| Uploading dist/my_test_code-0.1.0-py3-none-any.whl... | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... | ||
| Deploying resources... | ||
| Updating deployment state... | ||
| Deployment complete! | ||
| >>> find.py --expect 1 whl | ||
| dist/my_test_code-0.1.0-py3-none-any.whl | ||
| === Expecting 1 wheel in libraries section in /jobs/create | ||
| >>> jq -s .[] | select(.path=="/api/2.2/jobs/create") | .body.tasks out.requests.txt | ||
| [ | ||
| { | ||
| "existing_cluster_id": "0717-aaaaa-bbbbbb", | ||
| "libraries": [ | ||
| { | ||
| "whl": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.1.0-py3-none-any.whl" | ||
| } | ||
| ], | ||
| "python_wheel_task": { | ||
| "entry_point": "run", | ||
| "package_name": "my_test_code" | ||
| }, | ||
| "task_key": "TestTask" | ||
| } | ||
| ] | ||
| === Expecting 1 wheel to be uploaded | ||
| >>> jq .path out.requests.txt | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.1.0-py3-none-any.whl" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/.gitignore" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/databricks.yml" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/dist/my_test_code-0.1.0-py3-none-any.whl" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/my_test_code/__init__.py" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/my_test_code/__main__.py" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/out.requests.txt" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/output.txt" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/repls.json" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/script" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/setup.py" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/deploy.lock" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/deployment.json" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/metadata.json" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/terraform.tfstate" | ||
| >>> update_file.py my_test_code/__init__.py 0.1.0 0.2.0 | ||
| >>> [CLI] bundle deploy | ||
| Building python_artifact... | ||
| Uploading dist/my_test_code-0.2.0-py3-none-any.whl... | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... | ||
| Deploying resources... | ||
| Updating deployment state... | ||
| Deployment complete! | ||
| >>> find.py --expect 2 whl | ||
| dist/my_test_code-0.1.0-py3-none-any.whl | ||
| dist/my_test_code-0.2.0-py3-none-any.whl | ||
| === Expecting 1 wheel in libraries section in /jobs/reset | ||
| >>> jq -s .[] | select(.path=="/api/2.2/jobs/reset") | .body.new_settings.tasks out.requests.txt | ||
| [ | ||
| { | ||
| "existing_cluster_id": "0717-aaaaa-bbbbbb", | ||
| "libraries": [ | ||
| { | ||
| "whl": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.2.0-py3-none-any.whl" | ||
| } | ||
| ], | ||
| "python_wheel_task": { | ||
| "entry_point": "run", | ||
| "package_name": "my_test_code" | ||
| }, | ||
| "task_key": "TestTask" | ||
| } | ||
| ] | ||
| === Expecting 1 wheel to be uploaded | ||
| >>> jq .path out.requests.txt | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.2.0-py3-none-any.whl" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/dist/my_test_code-0.2.0-py3-none-any.whl" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/my_test_code/__init__.py" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/out.requests.txt" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/output.txt" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/deploy.lock" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/deployment.json" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/metadata.json" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/terraform.tfstate" | ||
| === Restore config to target old wheel | ||
| >>> update_file.py databricks.yml ./dist/*.whl ./dist/my*0.1.0*.whl | ||
| >>> [CLI] bundle deploy | ||
| Building python_artifact... | ||
| Uploading dist/my_test_code-0.1.0-py3-none-any.whl... | ||
| Uploading dist/my_test_code-0.2.0-py3-none-any.whl... | ||
| Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... | ||
| Deploying resources... | ||
| Updating deployment state... | ||
| Deployment complete! | ||
| >>> find.py --expect 2 whl | ||
| dist/my_test_code-0.1.0-py3-none-any.whl | ||
| dist/my_test_code-0.2.0-py3-none-any.whl | ||
| === Expecting 1 wheel in libraries section in /jobs/reset | ||
| >>> jq -s .[] | select(.path=="/api/2.2/jobs/reset") | .body.new_settings.tasks out.requests.txt | ||
| [ | ||
| { | ||
| "existing_cluster_id": "0717-aaaaa-bbbbbb", | ||
| "libraries": [ | ||
| { | ||
| "whl": "/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.1.0-py3-none-any.whl" | ||
| } | ||
| ], | ||
| "python_wheel_task": { | ||
| "entry_point": "run", | ||
| "package_name": "my_test_code" | ||
| }, | ||
| "task_key": "TestTask" | ||
| } | ||
| ] | ||
| === Expecting 1 wheel to be uploaded | ||
| >>> jq .path out.requests.txt | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.1.0-py3-none-any.whl" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/artifacts/.internal/my_test_code-0.2.0-py3-none-any.whl" | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does it upload both? ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/databricks.yml" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/dist/my_test_code-0.2.0-py3-none-any.whl" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/out.requests.txt" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files/output.txt" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/deploy.lock" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/deployment.json" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/metadata.json" | ||
| "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.bundle/test-bundle/default/state/terraform.tfstate" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| trace $CLI bundle deploy | ||
| trace find.py --expect 1 whl | ||
| title "Expecting 1 wheel in libraries section in /jobs/create" | ||
| trace jq -s '.[] | select(.path=="/api/2.2/jobs/create") | .body.tasks' out.requests.txt | ||
| title "Expecting 1 wheel to be uploaded" | ||
| trace jq .path out.requests.txt | grep import | sort | ||
| rm out.requests.txt | ||
| trace update_file.py my_test_code/__init__.py 0.1.0 0.2.0 | ||
| trace $CLI bundle deploy | ||
| trace find.py --expect 2 whl # there are now 2 wheels on disk | ||
| title "Expecting 1 wheel in libraries section in /jobs/reset" | ||
| trace jq -s '.[] | select(.path=="/api/2.2/jobs/reset") | .body.new_settings.tasks' out.requests.txt | ||
| title "Expecting 1 wheel to be uploaded" | ||
| trace jq .path out.requests.txt | grep import | sort | ||
| rm out.requests.txt | ||
| title 'Restore config to target old wheel' | ||
| trace update_file.py databricks.yml './dist/*.whl' './dist/my*0.1.0*.whl' | ||
| trace $CLI bundle deploy | ||
| trace find.py --expect 2 whl | ||
| title "Expecting 1 wheel in libraries section in /jobs/reset" | ||
| trace jq -s '.[] | select(.path=="/api/2.2/jobs/reset") | .body.new_settings.tasks' out.requests.txt | ||
| title "Expecting 1 wheel to be uploaded" | ||
| trace jq .path out.requests.txt | grep import | sort | ||
| rm out.requests.txt |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| from setuptools import setup, find_packages | ||
| import my_test_code | ||
| setup( | ||
| name="my_test_code", | ||
| version=my_test_code.__version__, | ||
| author=my_test_code.__author__, | ||
| url="https://databricks.com", | ||
| author_email="john.doe@databricks.com", | ||
| description="my test wheel", | ||
| packages=find_packages(include=["my_test_code"]), | ||
| entry_points={"group_1": "run=my_test_code.__main__:main"}, | ||
| install_requires=["setuptools"], | ||
| ) |
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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 are both uploaded if the glob only matches the
0.1.0one?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.
The glob in libraries matches 0.1.0 but the glob in artifacts section matches 0.2.0.
Those filters operate independently from different mutators so each makes their own decision.
Perhaps it's a sign that glob expansion should be done from a single place with a global tracker of wheel versions.
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.
Is the glob in artifacts implicit or a default? If so, that seems surprising.
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.
Not sure what you mean? implicit == default, no?
Somewhat. It would also be surprising if default
*.whlbehaved differently from explicit*.whl