Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 215
Fix bundle plan to not create workspace objects or upload the files#3442
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.
Changes from all commits
3a40b03b52e57f55f0f636c3eaaa22a6ea6e4e0f78616a9a66d2050574aa4343a8e0187fb9bfc7fdf47a5eeb08dcb062a6233ecd54b15de37db75a5File 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,19 @@ | ||
| bundle: | ||
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. For more comprehensive test, can we add "bundle plan" + request recording to default-python various local and integration tests and check that there are no side effects there? 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. I tried to include | ||
| name: plan-no-upload | ||
| resources: | ||
| jobs: | ||
| my_job: | ||
| name: my-job | ||
| tasks: | ||
| - task_key: task1 | ||
| spark_python_task: | ||
| python_file: "./my_script.py" | ||
| environment_key: "env" | ||
| environments: | ||
| - environment_key: "env" | ||
| spec: | ||
| client: "1" | ||
| dependencies: | ||
| - "*.whl" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| print("Hello, World!") |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Local = true | ||
| Cloud = false | ||
| [EnvMatrix] | ||
| DATABRICKS_CLI_DEPLOYMENT = ["terraform", "direct-exp"] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| >>> [CLI] bundle plan | ||
| create jobs.my_job | ||
| >>> jq -s .[] | select(.method != "GET") out.requests.txt |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| trace $CLI bundle plan | ||
| # Expect no non-GET requests | ||
| trace jq -s '.[] | select(.method != "GET")' out.requests.txt | ||
| rm out.requests.txt |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Local = true | ||
| Cloud = false | ||
| RecordRequests = true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -3,6 +3,7 @@ package libraries | ||
| import ( | ||
| "context" | ||
| "path" | ||
| "strings" | ||
| "github.com/databricks/cli/bundle" | ||
| "github.com/databricks/cli/libs/diag" | ||
| @@ -24,6 +25,7 @@ func GetFilerForLibraries(ctx context.Context, b *bundle.Bundle) (filer.Filer, s | ||
| } | ||
| uploadPath := path.Join(b.Config.Workspace.ArtifactPath, InternalDirName) | ||
| uploadPath = ensureWorkspaceOrVolumesPrefix(uploadPath) | ||
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. Could you add a comment why this is needed? Unclear why we would be missing prefix now. 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. Added, it's not that we miss it now, I just moved it from the other place to here, but I added the comment to the function | ||
| switch { | ||
| case IsVolumesPath(artifactPath): | ||
| @@ -40,11 +42,23 @@ func GetFilerForLibrariesCleanup(ctx context.Context, b *bundle.Bundle) (filer.F | ||
| return nil, "", diag.Errorf("remote artifact path not configured") | ||
| } | ||
| artifactPath = ensureWorkspaceOrVolumesPrefix(artifactPath) | ||
| switch { | ||
| case IsVolumesPath(artifactPath): | ||
| return filerForVolume(b, b.Config.Workspace.ArtifactPath) | ||
| return filerForVolume(b, artifactPath) | ||
| default: | ||
| return filerForWorkspace(b, b.Config.Workspace.ArtifactPath) | ||
| return filerForWorkspace(b, artifactPath) | ||
| } | ||
| } | ||
| // If the remote path does not start with /Workspace or /Volumes, prepend /Workspace | ||
| // Some of the bundle configuration might use workspace paths like /Users or /Shared. | ||
| // While this is still a valid workspace path, the backend converts it to /Workspace/Users or /Workspace/Shared. | ||
| func ensureWorkspaceOrVolumesPrefix(path string) string { | ||
| if !strings.HasPrefix(path, "/Workspace") && !strings.HasPrefix(path, "/Volumes") { | ||
| path = "/Workspace" + path | ||
| } | ||
| return path | ||
| } | ||
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.
The order is changed because now we set wheel wrapper earlier then we do artifacts cleanup