Repository navigation
[SSH] Check port_fwd_serverless_enabled before starting serverless compute #7063
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
acceptance/ssh/connect-serverless-port-forwarding-disabled/out.test.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| Cloud = false | ||
| GOOS.darwin = false | ||
| GOOS.linux = true | ||
| GOOS.windows = false | ||
| EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] |
10 changes: 10 additions & 0 deletions
10
acceptance/ssh/connect-serverless-port-forwarding-disabled/output.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
|
|
||
| >>> [CLI] workspace-settings-v2 patch-public-workspace-setting port_fwd_serverless_enabled --json {"name": "port_fwd_serverless_enabled", "boolean_val": {"value": false}} | ||
|
|
||
| === CLI ssh connect | ||
|
|
||
| >>> musterr [CLI] ssh connect --name port-forwarding-disabled -- echo 'Connection successful' | ||
| Connecting to port-forwarding-disabled... | ||
| Error: port forwarding to serverless compute is disabled for this workspace (setting port_fwd_serverless_enabled), and the SSH tunnel needs it. Ask a workspace or account admin to enable it, or connect to a dedicated cluster with --cluster | ||
|
|
||
| >>> print_requests.py //api |
13 changes: 13 additions & 0 deletions
13
acceptance/ssh/connect-serverless-port-forwarding-disabled/script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # An administrator disabled port forwarding to serverless compute. The CLI reads the setting | ||
| # before anything else, so it refuses the connection without creating a secret scope, uploading | ||
| # binaries or starting compute that nobody could reach. | ||
| # The body repeats the name: with only {"value": false} in it, the API sees an empty message. | ||
| trace $CLI workspace-settings-v2 patch-public-workspace-setting port_fwd_serverless_enabled --json '{"name": "port_fwd_serverless_enabled", "boolean_val": {"value": false}}' >/dev/null | ||
| # Drop the setup request so the check below only sees what ssh connect sent. | ||
| print_requests.py //api/2.1/settings >/dev/null | ||
|
|
||
| title "CLI ssh connect\n" | ||
| trace musterr $CLI ssh connect --name port-forwarding-disabled -- "echo 'Connection successful'" | ||
|
|
||
| # Expect no requests other than reads: the connection stops at the settings check. | ||
| trace print_requests.py //api |
11 changes: 11 additions & 0 deletions
11
acceptance/ssh/connect-serverless-port-forwarding-disabled/test.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| Cloud = false | ||
|
|
||
| # Record requests so we can assert that nothing is created before the CLI gives up. | ||
| RecordRequests = true | ||
|
|
||
| # The rest of acceptance/ssh only runs on Linux; nothing here needs another OS. | ||
| GOOS.linux = true | ||
| GOOS.darwin = false | ||
| GOOS.windows = false | ||
|
|
||
| EnvMatrix.DATABRICKS_BUNDLE_ENGINE = ["direct"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
[nice to have]This early return does not setoutcome.errorCategory, sologSshTunnelEventrecordsUNKNOWN. The comment inRunsays each failing step sets a category, andUNKNOWNis meant to signal CLI bugs. Add a category such asPORT_FORWARDING_DISABLED, which needs the matching proto change, and use it for the #7057 403 path too. If you add it in a follow-up PR, please say so here.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.
Doing this in the follow-up #7064. It adds
PORT_FORWARDING_DISABLEDfor this early return andDRIVER_PROXY_FORBIDDENfor the #7057 403 path. Both still need the matching universe enum change.