-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from datarevenue-berlin/MLOPS-291-fix-dask-jup…
…yter Daskhub deployment, deprecating Jupyter + Dask
- Loading branch information
Showing
14 changed files
with
251 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM jupyter/scipy-notebook:hub-1.4.2 | ||
RUN set -ex \ | ||
&& pip install \ | ||
'prefect==0.14.12' \ | ||
'mlflow==1.14.1' \ | ||
'seldon-core==1.6.0' \ | ||
'dask==2021.7.0' \ | ||
'dask-kubernetes==2021.3.1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
resource "helm_release" "dask-jupyterhub" { | ||
name = "daskhub" | ||
namespace = var.namespace | ||
|
||
repository = "https://helm.dask.org" | ||
chart = "daskhub" | ||
version = "2021.7.2" | ||
|
||
// It takes some time to pull all the necessary images. | ||
timeout = 15 * 60 | ||
|
||
values = [templatefile("${path.module}/values.yaml", { | ||
jupyterhub_secret = var.jupyterhub_secret | ||
daskgateway_secret = var.daskgateway_secret | ||
singleuser_profile_list = var.singleuser_profile_list | ||
singleuser_image_pull_secrets = var.singleuser_image_pull_secrets | ||
singleuser_image_pull_policy = var.singleuser_image_pull_policy | ||
singleuser_memory_guarantee = var.singleuser_memory_guarantee | ||
singleuser_storage_capacity = var.singleuser_storage_capacity | ||
singleuser_storage_mount_path = var.singleuser_storage_mount_path | ||
hub_allow_named_servers = var.hub_allow_named_servers | ||
})] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
jupyterhub: | ||
proxy: | ||
service: | ||
type: "ClusterIP" | ||
hub: | ||
allowNamedServers: ${ hub_allow_named_servers } | ||
singleuser: | ||
serviceAccountName: "daskhub-sa" | ||
profileList: | ||
%{for profile in singleuser_profile_list ~} | ||
- display_name: ${ profile.display_name } | ||
description: "${ profile.description }" | ||
default: ${ profile.default } | ||
kubespawner_override: | ||
image: ${ profile.kubespawner_override.image } | ||
%{ endfor ~} | ||
memory: | ||
guarantee: ${ singleuser_memory_guarantee } | ||
storage: | ||
capacity: ${ singleuser_storage_capacity } | ||
homeMountPath: ${ singleuser_storage_mount_path } | ||
extraEnv: | ||
TZ: "Europe/Berlin" | ||
|
||
dask-gateway: | ||
enabled: false | ||
gateway: | ||
auth: | ||
type: null | ||
|
||
dask-kubernetes: | ||
enabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
variable "namespace" { | ||
description = "Namespace name to deploy the application" | ||
default = "default" | ||
} | ||
|
||
variable "jupyterhub_secret" { | ||
type = string | ||
default = "4301bf5a2aa1fbade157046863ac64ec46df03e3da39ec3bf345a2f8caa81e02" | ||
} | ||
|
||
variable "daskgateway_secret" { | ||
type = string | ||
default = "ca7de235a4ae54103d49f5004a11690004c66fe14810f35dc476103573e56ff1" | ||
} | ||
|
||
variable "singleuser_image_pull_secrets" { | ||
type = list( | ||
object({ | ||
name = string | ||
}) | ||
) | ||
default = [] | ||
} | ||
|
||
variable "singleuser_image_pull_policy" { | ||
default = "Always" | ||
} | ||
|
||
variable "singleuser_default_url" { | ||
description = "" | ||
default = "/lab" | ||
} | ||
|
||
variable "singleuser_profile_list" { | ||
description = "List of images which the user can select to spawn a server" | ||
type = list( | ||
object({ | ||
display_name = string | ||
description = string | ||
default = bool | ||
kubespawner_override = object({ | ||
image = string | ||
}) | ||
})) | ||
|
||
default = [{ | ||
display_name = "OpenMLOps client environment" | ||
description = "Notebook with OpenMLOps required client libraries installed. <br> Image: drtools/openmlops-notebook:v1.4" | ||
default = true | ||
kubespawner_override = { | ||
image = "drtools/openmlops-notebook:v1.4" | ||
} | ||
}] | ||
} | ||
|
||
variable "singleuser_memory_guarantee" { | ||
default = "1G" | ||
} | ||
|
||
variable "singleuser_storage_capacity" { | ||
default = "1G" | ||
} | ||
|
||
variable "singleuser_storage_mount_path" { | ||
default = "/home/jovyan/persistent" | ||
} | ||
|
||
variable "hub_allow_named_servers" { | ||
description = "Configures if a user can spawn multiple servers" | ||
default = false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
kind: Pod | ||
spec: | ||
restartPolicy: Never | ||
containers: | ||
- image: daskdev/dask:2021.3.1 | ||
imagePullPolicy: IfNotPresent | ||
args: [dask-worker, --nthreads, '2', --no-dashboard, --memory-limit, 6GB, --death-timeout, '60'] | ||
name: dask | ||
env: | ||
- name: EXTRA_PIP_PACKAGES | ||
value: git+https://github.com/dask/distributed | ||
resources: | ||
limits: | ||
cpu: "0.5" | ||
memory: 1G | ||
requests: | ||
cpu: "0.5" | ||
memory: 1G |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.