-
Notifications
You must be signed in to change notification settings - Fork 31
Added basic script to make api-token for culler #97
Added basic script to make api-token for culler #97
Conversation
.jupyter/jupyterhub_config.py
Outdated
@@ -25,6 +25,9 @@ | |||
'KUBERNETES_SERVICE_PORT': os.environ['KUBERNETES_SERVICE_PORT'], | |||
'JUPYTERHUB_LOGIN_URL': None | |||
} | |||
|
|||
idle_culler_api_token = str(uuid.uuid4()) |
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 cannot be re-generated on every restart of the JH as the culler container would not get the new value and API calls woulds start failing after restart.
Ideally implement 2 functions:
get_culler_secret
set_culler_secret
Call the get_culler_secret
here and only if the secret does not exist, call set_culler_secret
And use the loaded or created secret in the services dict
Also, the name of the secret should be something like jupyterhub-idle-culler
and the key in it should be api_token
d96de4d
to
f4d53ec
Compare
f4d53ec
to
435f96d
Compare
869b829
to
90882c0
Compare
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.
/lgtm
.jupyter/jupyterhub_config.py
Outdated
def set_culler_secret(): | ||
|
||
secret_data = str(uuid.uuid4()) | ||
openshift.write_secret('jupyterhub-api-token', {'token': secret_data}) |
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.
Chanfe the name to something related to idle-culler - e.g. jupyterhub-idle-culler
90882c0
to
ecc8ad8
Compare
ecc8ad8
to
db0a847
Compare
/deploy |
Related Issues and Dependencies
…
This introduces a breaking change
This Pull Request implements
Adds the JupyterHub Idle Culler as an external service
Description
This PR adds the idle culler as an external service and also exposes its api-token into a secret the the idle culler can read from.