Command line tool to retreive access token for mlflow instance
Project description
mlflow-token
Obtain an access token for an MLFlow instance deployed behind OAuth2-proxy and keycloak.
This script will use your current setting of MLFLOW_TRACKING_URI
to look for
the keycloak redirect from it's OAuth2-proxy. From there it will start an
OAuth device flow to allow you to obtain a valid access token. You can use this
to update your MLFLOW_TRACKING_TOKEN
by executing the command as
% export $(mlflow-token)
and following the prompt.
Usage In Jupyter Notebook
If you want to authenticate to an MLFlow instance from within a Jupyter notebook you can add the following lines to a cell:
import mlflow_token
mlflow_token.setup_mlflow_environment("https://mlflow-demo.software-dev.ncsa.illinois.edu/")
This will update the notebook's os.environ
so you can immediately use the
mlflow SDK. The token will eventually expire, so you may need to occasionally
re-run the cell.
The cell will print the url for the user to visit and wait for the device flow to complete.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mlflow_token-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 537fadfd04476d541bb4b9672f7ee4971c5260d2b261be1dfe93290dd7450c65 |
|
MD5 | db00fc56d68f43a3b3022b48b274afb3 |
|
BLAKE2b-256 | 971331217736b07dcabf7f2098623eff5f5048588d4c5a63d5736b36923dc53e |