-
Notifications
You must be signed in to change notification settings - Fork 136
[Feature] Add support for Unified Host with experimental flag #4260
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
Conversation
|
Commit: be536d3
32 interesting tests: 14 flaky, 7 KNOWN, 5 SKIP, 4 RECOVERED, 2 BUG
Top 50 slowest tests (at least 2 minutes):
|
| var authArguments auth.AuthArguments | ||
| cmd.PersistentFlags().StringVar(&authArguments.Host, "host", "", "Databricks Host") | ||
| cmd.PersistentFlags().StringVar(&authArguments.AccountID, "account-id", "", "Databricks Account ID") | ||
| cmd.PersistentFlags().BoolVar(&authArguments.IsUnifiedHost, "experimental-is-unified-host", false, "Flag to indicate if the host is a unified host") |
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.
question - can we reliably determine if host is unified based on regex on host? Then we don't need to ask users that and there is no risk of mismatch.
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.
Just found this: databricks/databricks-sdk-go#1403 it looks like this flag is going to be removed?
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.
Hi @denik , we have taken the decision to keep the flag for now and not rely on regex as there are a number of use cases that will not be supported (dependent on cloud etc...) so we keep the usage of unified host as opt-in to set the right expectations.
The second PR is a PoC based on the internal pattern matching, it is not going to be merged for now. In future we would have support for cloud agnostic hosts so the flag won't be required at that time.
|
Please include relevant PRs on SDK side in the description. I found these databricks/databricks-sdk-go#1307 (depends on) databricks/databricks-sdk-go#1403 (not used yet, but should be?) |
|
Thanks for the review @denik, added the relevant PR in the description. |
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.
FYI, we have some acceptance tests for auth in acceptance/auth. Can you check if you can add another test there for new functionality? (Unfortunately, no easy way to test interactive stuff yet but at least you can test the non-interactive part).
Thanks @denik added. |
| func promptForWorkspaceID(ctx context.Context) (string, error) { | ||
| if !cmdio.IsPromptSupported(ctx) { | ||
| // Workspace ID is optional for unified hosts, so return empty string in non-interactive mode | ||
| return "", nil |
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 is it optional? If I understand correctly, we cannot make API calls without a workspace ID.
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.
And then this should return an error.
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.
This is optional because without workspace ID we configure the client for account to make account requests.
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.
Does the caller error if neither an account ID nor a workspace ID is specified?
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.
Yes
Error: fetching oauth config: fetching OAuth endpoints: failed to get OAuth endpoints: received HTML response instead of JSON
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.
That's not actionable. I was thinking of a proper error saying that you need either an account ID or a workspace ID.
|
Commit: 5c0467c
29 interesting tests: 13 flaky, 7 KNOWN, 5 SKIP, 4 RECOVERED
Top 50 slowest tests (at least 2 minutes):
|
Changes
Why
This support is required for enabling unified hosts which Databricks free edition uses.
Tests
databricks auth login --host <spog-host> --experimental-is-unified-hostprompts for account and workspace id followed by opening web browser. The IDs and flag is stores in the config. The subsequent cli operations eg: databricks clusters list --profile "above-profile" works.