Skip to content

Commit 7f824ac

Browse files
committed
Merge branch 'release/0.1.9'
2 parents 45f004a + 381d085 commit 7f824ac

File tree

5 files changed

+15
-3
lines changed

5 files changed

+15
-3
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mltooling/ssh-proxy:0.1.8
1+
FROM mltooling/ssh-proxy:0.1.10
22

33
WORKDIR /
44

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ We override [DockerSpawner](https://github.com/ml-tooling/ml-hub/blob/master/res
166166

167167
- Create / delete services for a workspace, so that the hub can access them via Kubernetes DNS.
168168

169+
All resources created by our custom spawners are labeled (Docker / Kubernetes labels) with the labels `mlhub.origin` set to the Hub name `$ENV_HUB_NAME`, `mlhub.user` set to the JupyterHub user the resources belongs to, and `mlhub.server_name` to the named server name. For example, if the hub name is "mlhub" and a user named "foo" has a named server "bar", the labels would be `mlhub.origin=mlhub`, `mlhub.user=foo`, `mlhub.server_name=bar`.
170+
169171
## Support
170172

171173
The ML Hub project is maintained by [@raethlein](https://twitter.com/raethlein) and [@LukasMasuch](https://twitter.com/LukasMasuch). Please understand that we won't be able
@@ -226,6 +228,10 @@ The service has two endpoints which can be reached under the Hub service url `/s
226228

227229
- `GET /services/cleanup-service/expired`: When starting a named workspace, an expiration date can be assigned to it. This endpoint will delete all containers that are expired. The respective named server is deleted from the JupyterHub database and also the Docker/Kubernetes resource is deleted.
228230

231+
## Customization
232+
233+
- Logo: if you want to have your own logo in the corner, place it at `/usr/local/share/jupyterhub/static/images/jupyter.png` inside the hub container.
234+
229235
## Contribution
230236

231237
- Pull requests are encouraged and always welcome. Read [`CONTRIBUTING.md`](https://github.com/ml-tooling/ml-hub/tree/master/CONTRIBUTING.md) and check out [help-wanted](https://github.com/ml-tooling/ml-hub/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+label%3A"help+wanted"+sort%3Areactions-%2B1-desc+) issues.

resources/docker-entrypoint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ fi
2525
$_RESOURCES_PATH/scripts/setup_certs.sh
2626

2727
function start_ssh {
28+
"""See the documentation of the ssh-proxy image
29+
- the image this hub image is based on - for more information"""
30+
2831
echo "Start SSH Daemon service"
32+
export SSH_TARGET_LABELS="mlhub.origin=$HUB_NAME"
2933
# Run ssh-bastion image entrypoint
3034
nohup python $_RESOURCES_PATH/start_ssh.py &
3135
}

resources/jupyterhub_config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ def combine_config_dicts(*configs) -> dict:
9595

9696
# Connect containers to this Docker network
9797
c.Spawner.use_internal_ip = True
98-
c.Spawner.extra_host_config = { 'shm_size': '256m' }
9998

10099
c.Spawner.prefix = 'ws'
101100
c.Spawner.name_template = c.Spawner.prefix + '-{username}-' + ENV_HUB_NAME + '{servername}' # override in your config when you want to have a different name schema. Also consider changing c.Authenticator.username_pattern and check the environment variables to permit ssh connection
@@ -161,6 +160,9 @@ def combine_config_dicts(*configs) -> dict:
161160

162161

163162
elif ENV_EXECUTION_MODE == utils.EXECUTION_MODE_LOCAL:
163+
# shm_size can only be set for Docker, not Kubernetes (see https://stackoverflow.com/questions/43373463/how-to-increase-shm-size-of-a-kubernetes-container-shm-size-equivalent-of-doc)
164+
c.Spawner.extra_host_config = { 'shm_size': '256m' }
165+
164166
client_kwargs = {**get_or_init(c.DockerSpawner.client_kwargs, dict), **get_or_init(c.MLHubDockerSpawner.client_kwargs, dict)}
165167
tls_config = {**get_or_init(c.DockerSpawner.tls_config, dict), **get_or_init(c.MLHubDockerSpawner.tls_config, dict)}
166168

resources/mlhubspawner/mlhubspawner/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
LABEL_NVIDIA_VISIBLE_DEVICES = 'nvidia_visible_devices'
1616
LABEL_EXPIRATION_TIMESTAMP = 'expiration_timestamp_seconds'
1717

18+
LABEL_MLHUB_ORIGIN = "mlhub.origin"
1819
LABEL_MLHUB_USER = "mlhub.user"
1920
LABEL_MLHUB_SERVER_NAME = "mlhub.server_name"
2021

@@ -23,7 +24,6 @@
2324
EXECUTION_MODE_KUBERNETES = "k8s"
2425
ENV_NAME_CLEANUP_INTERVAL_SECONDS = "CLEANUP_INTERVAL_SECONDS"
2526

26-
LABEL_MLHUB_ORIGIN = "mlhub.origin"
2727
ENV_HUB_NAME = os.getenv("HUB_NAME", "mlhub")
2828

2929
def get_lifetime_timestamp(labels: dict) -> float:

0 commit comments

Comments
 (0)