Skip to content
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

Runtime authentication uses host = None in job clusters #202

Closed
mgyucht opened this issue Jun 27, 2023 · 0 comments · Fixed by #209
Closed

Runtime authentication uses host = None in job clusters #202

mgyucht opened this issue Jun 27, 2023 · 0 comments · Fixed by #209

Comments

@mgyucht
Copy link
Contributor

mgyucht commented Jun 27, 2023

Seems like in an interactive cluster it will set the host correctly and get a bearer token all transparently as expected. For some reason the host is not set when running the same notebook in a job cluster, causing all attempts to use the WorkspaceClient with the host set to https://none/. Same user for both the interactive and job clusters and both running 12.2LTS.

I've also tried directly setting host=https:... in the WorkspaceClient() initialisation but the runtime auth seems to ignore that.

Job Cluster Bad
Interactive_Cluster_Good
Job_Cluster_Explicit_Hostname_Bad

@nfx nfx closed this as completed in #209 Jun 29, 2023
nfx pushed a commit that referenced this issue Jun 29, 2023
## Changes
Change runtime authentication to use ctx.workspaceUrl instead of
ctx.browserHostName. The latter is only defined in interactive
environments, whereas the former is always defined, in both jobs and
interactive environments.

Fixes #202.

## Tests
Tested by running a notebook interactively and in a job. 
Job:
![Screenshot 2023-06-29 at 15 03
43](https://github.com/databricks/databricks-sdk-py/assets/1850319/e65bfb5f-d91a-4eac-bd3c-fc21e0d11767)
Interactive:
![Screenshot 2023-06-29 at 15 06
14](https://github.com/databricks/databricks-sdk-py/assets/1850319/e0907638-07a4-4555-b8e9-f265ceb0f081)



- [ ] `make test` run locally
- [ ] `make fmt` applied
- [ ] relevant integration tests applied
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant