From 8a4213f28ad1e35d771e5de5a7b8d221f958f384 Mon Sep 17 00:00:00 2001 From: ClimaBot Date: Fri, 4 Sep 2020 15:34:33 -0400 Subject: [PATCH 1/5] adding volumes and volume mounts to jupyter and worker configs --- dask/templates/dask-jupyter-deployment.yaml | 6 ++++++ dask/templates/dask-worker-deployment.yaml | 9 +++++++++ dask/values.yaml | 15 +++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/dask/templates/dask-jupyter-deployment.yaml b/dask/templates/dask-jupyter-deployment.yaml index a439381..cd2890e 100644 --- a/dask/templates/dask-jupyter-deployment.yaml +++ b/dask/templates/dask-jupyter-deployment.yaml @@ -47,6 +47,9 @@ spec: volumeMounts: - name: config-volume mountPath: /usr/local/etc/jupyter + {{- if .Values.worker.mounts.volumeMounts }} + {{- toYaml .Values.worker.mounts.volumeMounts | nindent 12 }} + {{- end }} env: - name: DASK_SCHEDULER_ADDRESS value: {{ template "dask.fullname" . }}-scheduler:{{ .Values.scheduler.servicePort }} @@ -54,6 +57,9 @@ spec: {{- toYaml .Values.jupyter.env | nindent 12 }} {{- end }} volumes: + {{- if .Values.jupyter.mounts.volumes }} + {{- toYaml .Values.worker.mounts.volumes | nindent 8}} + {{- end }} - name: config-volume configMap: name: {{ template "dask.fullname" . }}-jupyter-config diff --git a/dask/templates/dask-worker-deployment.yaml b/dask/templates/dask-worker-deployment.yaml index 4647a73..6140351 100644 --- a/dask/templates/dask-worker-deployment.yaml +++ b/dask/templates/dask-worker-deployment.yaml @@ -26,6 +26,10 @@ spec: spec: imagePullSecrets: {{- toYaml .Values.worker.image.pullSecrets | nindent 8 }} + {{- if .Values.worker.mounts.volumes }} + volumes: + {{- toYaml .Values.worker.mounts.volumes | nindent 8}} + {{- end }} containers: - name: {{ template "dask.fullname" . }}-worker image: "{{ .Values.worker.image.repository }}:{{ .Values.worker.image.tag }}" @@ -50,6 +54,11 @@ spec: {{- toYaml .Values.worker.resources | nindent 12 }} env: {{- toYaml .Values.worker.env | nindent 12 }} + + {{- if .Values.worker.mounts.volumeMounts }} + volumeMounts: + {{- toYaml .Values.worker.mounts.volumeMounts | nindent 12 }} + {{- end }} {{- with .Values.worker.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/dask/values.yaml b/dask/values.yaml index c434984..c45e0ce 100644 --- a/dask/values.yaml +++ b/dask/values.yaml @@ -69,6 +69,13 @@ worker: # cpu: 1 # memory: 3G # nvidia.com/gpu: 1 + mounts: {} + # volumes: + # - name: data + # emptyDir: {} + # volumeMounts: + # - name: data + # mountPath: /data tolerations: [] # Tolerations. affinity: {} # Container affinity. nodeSelector: {} # Node Selector. @@ -89,6 +96,7 @@ jupyter: pullPolicy: IfNotPresent # Container image pull policy. pullSecrets: # Container image [pull secrets](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/). # - name: regcred + # replicas: 1 # Number of notebook servers. serviceType: "ClusterIP" # Scheduler service type. Set to `LoadBalancer` to expose outside of your cluster. # serviceType: "NodePort" @@ -117,6 +125,13 @@ jupyter: # requests: # cpu: 2 # memory: 6G + mounts: {} + # volumes: + # - name: data + # emptyDir: {} + # volumeMounts: + # - name: data + # mountPath: /data tolerations: [] # Tolerations. affinity: {} # Container affinity. nodeSelector: {} # Node Selector. From df0485e9a530ac5010ca7f620389f7a0fcecf3ef Mon Sep 17 00:00:00 2001 From: ClimaBot Date: Fri, 4 Sep 2020 15:42:20 -0400 Subject: [PATCH 2/5] autogenerating readme per docs --- README.md | 282 ++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 266 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index a44f94e..0b0b723 100644 --- a/README.md +++ b/README.md @@ -1,38 +1,288 @@ + +Dask +=========== + [![Travis Build Status](https://travis-ci.com/dask/helm-chart.svg?branch=master)](https://travis-ci.com/dask/helm-chart) -[![Dask Chart version](https://img.shields.io/badge/dynamic/yaml?url=https://helm.dask.org/index.yaml&label=chart&query=$.entries.dask[:1].version&color=277A9F)](https://helm.dask.org/) -[![DaskHub Chart version](https://img.shields.io/badge/dynamic/yaml?url=https://helm.dask.org/index.yaml&label=chart&query=$.entries.daskhub[:1].version&color=277A9F)](https://helm.dask.org/) +[![Chart version](https://img.shields.io/badge/dynamic/yaml?url=https://helm.dask.org/index.yaml&label=chart&query=$.entries.dask[:1].version&color=277A9F)](https://helm.dask.org/) [![Dask version](https://img.shields.io/badge/dynamic/yaml?url=https://helm.dask.org/index.yaml&label=Dask&query=$.entries.dask[:1].appVersion&color=D67548)](https://helm.dask.org/) +- +- +## Chart Details -Dask Helm Charts -================ +This chart will deploy the following: -This repository contains Dask's two helm charts. +- 1 x Dask scheduler with port 8786 (scheduler) and 80 (Web UI) exposed on an external LoadBalancer (default) +- 3 x Dask workers that connect to the scheduler +- 1 x Jupyter notebook (optional) with port 80 exposed on an external LoadBalancer (default) +- All using Kubernetes Deployments -- [dask](./dask/README.md): Install Dask on Kubernetes for a single user with Jupyter and dask-kubernetes. -- [daskhub](./daskhub/README.md): Install Dask on Kubernetes for multiple users with JupyterHub and Dask Gateway. +> **Tip**: See the [Kubernetes Service Type Docs](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) +> for the differences between ClusterIP, NodePort, and LoadBalancer. -## Single-user Quickstart +## Installing the Chart -Users deploying Dask for a single user should use the `dask/dask` helm chart. +First we need to add the Dask helm repo to our local helm config. -``` +```bash helm repo add dask https://helm.dask.org/ helm repo update +``` + +To install the chart with the release name `my-release`: + +```bash helm install --name my-release dask/dask ``` -See [dask](./dask/README.md) for more. +Depending on how your cluster was setup, you may also need to specify +a namespace with the following flag: `--namespace my-namespace`. -## Multi-user Quickstart +### Upgrading an existing installation that used stable/dask -Users deploying Dask for multiple users should use the `dask/daskhub` helm chart. +This chart is fully compatible with the previous chart, it is just a change of location. +If you have an existing deployment of Dask which used the now-deprecated `stable/dask` chart +you can upgrade it by changing the repo name in your upgrade command. -``` +```bash +# Add the Dask repo if you haven't already helm repo add dask https://helm.dask.org/ helm repo update -helm install --name my-release dask/daskhub + +# Upgrade your deployment that was previous created with stable/dask +helm upgrade my-release dask/dask +``` +## Configuration + +The following table lists the configurable parameters of the Dask chart and their default values. + +| Parameter | Description | Default | +| ------------------------ | ----------------------- | -------------- | +| `scheduler.name` | Dask scheduler name. | `"scheduler"` | +| `scheduler.image.repository` | Container image repository. | `"daskdev/dask"` | +| `scheduler.image.tag` | Container image tag. | `"2.24.0"` | +| `scheduler.image.pullPolicy` | Container image pull policy. | `"IfNotPresent"` | +| `scheduler.image.pullSecrets` | Container image [pull secrets](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/). | `null` | +| `scheduler.replicas` | Number of schedulers (should always be 1). | `1` | +| `scheduler.serviceType` | Scheduler service type. set to `loadbalancer` to expose outside of your cluster. | `"ClusterIP"` | +| `scheduler.servicePort` | Scheduler service internal port. | `8786` | +| `scheduler.resources` | Scheduler pod resources. see `values.yaml` for example values. | `{}` | +| `scheduler.tolerations` | Tolerations. | `[]` | +| `scheduler.affinity` | Container affinity. | `{}` | +| `scheduler.nodeSelector` | Node selector. | `{}` | +| `webUI.name` | Dask webui name. | `"webui"` | +| `webUI.servicePort` | Webui service internal port. | `80` | +| `webUI.ingress.enabled` | Enable ingress. | `false` | +| `webUI.ingress.tls` | Ingress should use tls. | `false` | +| `webUI.ingress.hostname` | Ingress hostname. | `"dask-ui.example.com"` | +| `webUI.ingress.annotations` | Ingress annotations. see `values.yaml` for example values. | `null` | +| `worker.name` | Dask worker name. | `"worker"` | +| `worker.image.repository` | Container image repository. | `"daskdev/dask"` | +| `worker.image.tag` | Container image tag. | `"2.24.0"` | +| `worker.image.pullPolicy` | Container image pull policy. | `"IfNotPresent"` | +| `worker.image.dask_worker` | Dask worker command. e.g `dask-cuda-worker` for gpu worker. | `"dask-worker"` | +| `worker.image.pullSecrets` | Container image [pull secrets](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/). | `null` | +| `worker.replicas` | Number of workers. | `3` | +| `worker.default_resources.cpu` | Default cpu (deprecated use `resources`). | `1` | +| `worker.default_resources.memory` | Default memory (deprecated use `resources`). | `"4GiB"` | +| `worker.env` | Environment variables. see `values.yaml` for example values. | `null` | +| `worker.resources` | Worker pod resources. see `values.yaml` for example values. | `{}` | +| `worker.mounts` | | `{}` | +| `worker.tolerations` | Tolerations. | `[]` | +| `worker.affinity` | Container affinity. | `{}` | +| `worker.nodeSelector` | Node selector. | `{}` | +| `worker.securityContext` | Security contect. | `{}` | +| `jupyter.name` | Jupyter name. | `"jupyter"` | +| `jupyter.enabled` | Enable/disable the bundled jupyter notebook. | `true` | +| `jupyter.rbac` | Create rbac service account and role to allow jupyter pod to scale worker pods and access logs. | `true` | +| `jupyter.image.repository` | Container image repository. | `"daskdev/dask-notebook"` | +| `jupyter.image.tag` | Container image tag. | `"2.24.0"` | +| `jupyter.image.pullPolicy` | Container image pull policy. | `"IfNotPresent"` | +| `jupyter.image.pullSecrets` | Container image [pull secrets](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/). | `null` | +| `jupyter.replicas` | Number of notebook servers. | `1` | +| `jupyter.serviceType` | Scheduler service type. set to `loadbalancer` to expose outside of your cluster. | `"ClusterIP"` | +| `jupyter.servicePort` | Jupyter service internal port. | `80` | +| `jupyter.password` | Password hash. default hash corresponds to the password `dask`. | `"sha1:aae8550c0a44:9507d45e087d5ee481a5ce9f4f16f37a0867318c"` | +| `jupyter.env` | Environment variables. see `values.yaml` for example values. | `null` | +| `jupyter.command` | Container command. | `null` | +| `jupyter.args` | Container arguments. | `null` | +| `jupyter.extraConfig` | | `"# Extra Jupyter config goes here\n# E.g\n# c.NotebookApp.port = 8888"` | +| `jupyter.resources` | Jupyter pod resources. see `values.yaml` for example values. | `{}` | +| `jupyter.mounts` | | `{}` | +| `jupyter.tolerations` | Tolerations. | `[]` | +| `jupyter.affinity` | Container affinity. | `{}` | +| `jupyter.nodeSelector` | Node selector. | `{}` | +| `jupyter.securityContext` | Security contect. | `{}` | +| `jupyter.serviceAccountName` | Service account for use with rbac | `"dask-jupyter"` | +| `jupyter.ingress.enabled` | Enable ingress. | `false` | +| `jupyter.ingress.tls` | Ingress should use tls. | `false` | +| `jupyter.ingress.hostname` | Ingress hostname. | `"dask-jupyter.example.com"` | +| `jupyter.ingress.annotations` | Ingress annotations. see `values.yaml` for example values. | `null` | + +#### Jupyter Password + +When launching the Jupyter server, you will be prompted for a password. The +default password set in [values.yaml](/dask/values.yaml) is `dask`. + +```yaml +jupyter: + ... + password: 'sha1:aae8550c0a44:9507d45e087d5ee481a5ce9f4f16f37a0867318c' # 'dask' +``` + +To change this password, run `jupyter notebook password` in the command-line, +example below: + +```bash +$ jupyter notebook password +Enter password: dask +Verify password: dask +[NotebookPasswordApp] Wrote hashed password to /home/dask/.jupyter/jupyter_notebook_config.json + +$ cat /home/dask/.jupyter/jupyter_notebook_config.json +{ + "NotebookApp": { + "password": "sha1:aae8550c0a44:9507d45e087d5ee481a5ce9f4f16f37a0867318c" + } +} ``` -See [daskhub](./daskhub/README.md) for more. +Replace the `jupyter.password` field in [values.yaml](/dask/values.yaml) with the +hash generated for your new password. + +## Custom Configuration + +If you want to change the default parameters, you can do this in two ways. + +### YAML Config Files + +You can change the default parameters in `values.yaml`, or create your own +custom YAML config file, and specify this file when installing your chart with +the `-f` flag. Example: + +```bash +helm install --name my-release -f values.yaml dask/dask +``` + +> **Tip**: You can use the default [values.yaml](/dask/values.yaml) for reference + +### Command-Line Arguments + +If you want to change parameters for a specific install without changing +`values.yaml`, you can use the `--set key=value[,key=value]` flag when running +`helm install`, and it will override any default values. Example: + +```bash +helm install --name my-release --set jupyter.enabled=false dask/dask +``` + +### Customizing Python Environment + +The default `daskdev/dask` images have a standard Miniconda installation along +with some common packages like NumPy and Pandas. You can install custom packages +with either Conda or Pip using optional environment variables. This happens +when your container starts up. + +> **Note**: The `IP:PORT` of this chart's services will not be accessible until +> extra packages finish installing. Expect to wait at least a minute for the +> Jupyter Server to be accessible if adding packages below, like `numba`. This +> time will vary depending on which extra packages you choose to install. + +Consider the following YAML config as an example: + +```yaml +jupyter: + env: + - name: EXTRA_CONDA_PACKAGES + value: numba xarray -c conda-forge + - name: EXTRA_PIP_PACKAGES + value: s3fs dask-ml --upgrade + +worker: + env: + - name: EXTRA_CONDA_PACKAGES + value: numba xarray -c conda-forge + - name: EXTRA_PIP_PACKAGES + value: s3fs dask-ml --upgrade +``` + +> **Note**: The Jupyter and Dask-worker environments should have matching +> software environments, at least where a user is likely to distribute that +> functionality. + +### RBAC + +By default the Jupyter pod will be given an RBAC role via a service account which allows you to scale +deployments and access pod logs from the Jupyter pod. + +For example to scale the workers you can run the following command from the Jupyter terminal. + +```bash +kubectl scale deployment dask-worker --replicas=10 +``` + +You can also get pod logs using kubectl. + +```bash +# List pods +kubectl get pods + +# Watch pod logs +kubectl logs -f {podname} +``` + +The RBAC role will give the Jupyter pod access to view all pods and update all deployments in the namespace you +install the Helm Chart in. If you wish to disable this you must disable the Jupyter RBAC and unset the service account. + +```yaml +jupyter: + rbac: false + serviceAccountName: null +``` + +Also see the [dask-kubernetes documentation](https://kubernetes.dask.org/en/latest/api.html#dask_kubernetes.HelmCluster) +for the `HelmCluster` cluster manager for managing workers from within your Python session. + +## Maintaining + +### Generating the README + +This repo uses [Frigate](https://frigate.readthedocs.io/en/master/index.html) to autogenerate the README. This makes it quick to keep the table +of config options up to date. + +If you wish to make a change to the README body you must edit `dask/.frigate` instead. + +To generate the readme run Frigate. + +``` +frigate gen dask > README.md +``` + +### Releasing + +Releases of the Helm chart are automatically pushed to the `gh-pages` branch by Travis CI when git tags are created. + +Before releasing you may want to ensure the chart is up to date with the latest Docker images and Dask versions: + +- Update the image tags in `dask/values.yaml` to reflect the [latest release of the Dask Docker images](https://github.com/dask/dask-docker/releases). +- Update the `appVersion` value in `dask/Chart.yaml` to also reflect this version. + +Then to perform a release you need to create and push a new tag. + +You can either use the `ci/release.sh` script. + +``` +ci/release.sh x.x.x +``` + +Or manually run the steps below. + +- Update the `version` key in `dask/Chart.yaml` with the new chart version `x.x.x`. +- For ease of releasing set the version as an environment variable `export DASK_HELM_VERSION=x.x.x`. +- Add a release commit `git commit -a -m "bump version to $DASK_HELM_VERSION"`. +- Tag the commit `git tag -a $DASK_HELM_VERSION -m "Version $DASK_HELM_VERSION"`. +- Push the tags `git push upstream master --tags`. +- Travis CI will automatically build and release to the chart repository. + + From 0ff30983bbd5cabb793d5e9c1d98e100b1c57793 Mon Sep 17 00:00:00 2001 From: ClimaBot Date: Fri, 4 Sep 2020 15:44:36 -0400 Subject: [PATCH 3/5] fix(README.md) updated wrong readme... duh --- README.md | 282 +++---------------------------------------------- dask/README.md | 2 + 2 files changed, 18 insertions(+), 266 deletions(-) diff --git a/README.md b/README.md index 0b0b723..a44f94e 100644 --- a/README.md +++ b/README.md @@ -1,288 +1,38 @@ - -Dask -=========== - [![Travis Build Status](https://travis-ci.com/dask/helm-chart.svg?branch=master)](https://travis-ci.com/dask/helm-chart) -[![Chart version](https://img.shields.io/badge/dynamic/yaml?url=https://helm.dask.org/index.yaml&label=chart&query=$.entries.dask[:1].version&color=277A9F)](https://helm.dask.org/) +[![Dask Chart version](https://img.shields.io/badge/dynamic/yaml?url=https://helm.dask.org/index.yaml&label=chart&query=$.entries.dask[:1].version&color=277A9F)](https://helm.dask.org/) +[![DaskHub Chart version](https://img.shields.io/badge/dynamic/yaml?url=https://helm.dask.org/index.yaml&label=chart&query=$.entries.daskhub[:1].version&color=277A9F)](https://helm.dask.org/) [![Dask version](https://img.shields.io/badge/dynamic/yaml?url=https://helm.dask.org/index.yaml&label=Dask&query=$.entries.dask[:1].appVersion&color=D67548)](https://helm.dask.org/) -- -- -## Chart Details -This chart will deploy the following: +Dask Helm Charts +================ -- 1 x Dask scheduler with port 8786 (scheduler) and 80 (Web UI) exposed on an external LoadBalancer (default) -- 3 x Dask workers that connect to the scheduler -- 1 x Jupyter notebook (optional) with port 80 exposed on an external LoadBalancer (default) -- All using Kubernetes Deployments +This repository contains Dask's two helm charts. -> **Tip**: See the [Kubernetes Service Type Docs](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) -> for the differences between ClusterIP, NodePort, and LoadBalancer. +- [dask](./dask/README.md): Install Dask on Kubernetes for a single user with Jupyter and dask-kubernetes. +- [daskhub](./daskhub/README.md): Install Dask on Kubernetes for multiple users with JupyterHub and Dask Gateway. -## Installing the Chart +## Single-user Quickstart -First we need to add the Dask helm repo to our local helm config. +Users deploying Dask for a single user should use the `dask/dask` helm chart. -```bash +``` helm repo add dask https://helm.dask.org/ helm repo update -``` - -To install the chart with the release name `my-release`: - -```bash helm install --name my-release dask/dask ``` -Depending on how your cluster was setup, you may also need to specify -a namespace with the following flag: `--namespace my-namespace`. +See [dask](./dask/README.md) for more. -### Upgrading an existing installation that used stable/dask +## Multi-user Quickstart -This chart is fully compatible with the previous chart, it is just a change of location. -If you have an existing deployment of Dask which used the now-deprecated `stable/dask` chart -you can upgrade it by changing the repo name in your upgrade command. +Users deploying Dask for multiple users should use the `dask/daskhub` helm chart. -```bash -# Add the Dask repo if you haven't already +``` helm repo add dask https://helm.dask.org/ helm repo update - -# Upgrade your deployment that was previous created with stable/dask -helm upgrade my-release dask/dask -``` -## Configuration - -The following table lists the configurable parameters of the Dask chart and their default values. - -| Parameter | Description | Default | -| ------------------------ | ----------------------- | -------------- | -| `scheduler.name` | Dask scheduler name. | `"scheduler"` | -| `scheduler.image.repository` | Container image repository. | `"daskdev/dask"` | -| `scheduler.image.tag` | Container image tag. | `"2.24.0"` | -| `scheduler.image.pullPolicy` | Container image pull policy. | `"IfNotPresent"` | -| `scheduler.image.pullSecrets` | Container image [pull secrets](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/). | `null` | -| `scheduler.replicas` | Number of schedulers (should always be 1). | `1` | -| `scheduler.serviceType` | Scheduler service type. set to `loadbalancer` to expose outside of your cluster. | `"ClusterIP"` | -| `scheduler.servicePort` | Scheduler service internal port. | `8786` | -| `scheduler.resources` | Scheduler pod resources. see `values.yaml` for example values. | `{}` | -| `scheduler.tolerations` | Tolerations. | `[]` | -| `scheduler.affinity` | Container affinity. | `{}` | -| `scheduler.nodeSelector` | Node selector. | `{}` | -| `webUI.name` | Dask webui name. | `"webui"` | -| `webUI.servicePort` | Webui service internal port. | `80` | -| `webUI.ingress.enabled` | Enable ingress. | `false` | -| `webUI.ingress.tls` | Ingress should use tls. | `false` | -| `webUI.ingress.hostname` | Ingress hostname. | `"dask-ui.example.com"` | -| `webUI.ingress.annotations` | Ingress annotations. see `values.yaml` for example values. | `null` | -| `worker.name` | Dask worker name. | `"worker"` | -| `worker.image.repository` | Container image repository. | `"daskdev/dask"` | -| `worker.image.tag` | Container image tag. | `"2.24.0"` | -| `worker.image.pullPolicy` | Container image pull policy. | `"IfNotPresent"` | -| `worker.image.dask_worker` | Dask worker command. e.g `dask-cuda-worker` for gpu worker. | `"dask-worker"` | -| `worker.image.pullSecrets` | Container image [pull secrets](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/). | `null` | -| `worker.replicas` | Number of workers. | `3` | -| `worker.default_resources.cpu` | Default cpu (deprecated use `resources`). | `1` | -| `worker.default_resources.memory` | Default memory (deprecated use `resources`). | `"4GiB"` | -| `worker.env` | Environment variables. see `values.yaml` for example values. | `null` | -| `worker.resources` | Worker pod resources. see `values.yaml` for example values. | `{}` | -| `worker.mounts` | | `{}` | -| `worker.tolerations` | Tolerations. | `[]` | -| `worker.affinity` | Container affinity. | `{}` | -| `worker.nodeSelector` | Node selector. | `{}` | -| `worker.securityContext` | Security contect. | `{}` | -| `jupyter.name` | Jupyter name. | `"jupyter"` | -| `jupyter.enabled` | Enable/disable the bundled jupyter notebook. | `true` | -| `jupyter.rbac` | Create rbac service account and role to allow jupyter pod to scale worker pods and access logs. | `true` | -| `jupyter.image.repository` | Container image repository. | `"daskdev/dask-notebook"` | -| `jupyter.image.tag` | Container image tag. | `"2.24.0"` | -| `jupyter.image.pullPolicy` | Container image pull policy. | `"IfNotPresent"` | -| `jupyter.image.pullSecrets` | Container image [pull secrets](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/). | `null` | -| `jupyter.replicas` | Number of notebook servers. | `1` | -| `jupyter.serviceType` | Scheduler service type. set to `loadbalancer` to expose outside of your cluster. | `"ClusterIP"` | -| `jupyter.servicePort` | Jupyter service internal port. | `80` | -| `jupyter.password` | Password hash. default hash corresponds to the password `dask`. | `"sha1:aae8550c0a44:9507d45e087d5ee481a5ce9f4f16f37a0867318c"` | -| `jupyter.env` | Environment variables. see `values.yaml` for example values. | `null` | -| `jupyter.command` | Container command. | `null` | -| `jupyter.args` | Container arguments. | `null` | -| `jupyter.extraConfig` | | `"# Extra Jupyter config goes here\n# E.g\n# c.NotebookApp.port = 8888"` | -| `jupyter.resources` | Jupyter pod resources. see `values.yaml` for example values. | `{}` | -| `jupyter.mounts` | | `{}` | -| `jupyter.tolerations` | Tolerations. | `[]` | -| `jupyter.affinity` | Container affinity. | `{}` | -| `jupyter.nodeSelector` | Node selector. | `{}` | -| `jupyter.securityContext` | Security contect. | `{}` | -| `jupyter.serviceAccountName` | Service account for use with rbac | `"dask-jupyter"` | -| `jupyter.ingress.enabled` | Enable ingress. | `false` | -| `jupyter.ingress.tls` | Ingress should use tls. | `false` | -| `jupyter.ingress.hostname` | Ingress hostname. | `"dask-jupyter.example.com"` | -| `jupyter.ingress.annotations` | Ingress annotations. see `values.yaml` for example values. | `null` | - -#### Jupyter Password - -When launching the Jupyter server, you will be prompted for a password. The -default password set in [values.yaml](/dask/values.yaml) is `dask`. - -```yaml -jupyter: - ... - password: 'sha1:aae8550c0a44:9507d45e087d5ee481a5ce9f4f16f37a0867318c' # 'dask' -``` - -To change this password, run `jupyter notebook password` in the command-line, -example below: - -```bash -$ jupyter notebook password -Enter password: dask -Verify password: dask -[NotebookPasswordApp] Wrote hashed password to /home/dask/.jupyter/jupyter_notebook_config.json - -$ cat /home/dask/.jupyter/jupyter_notebook_config.json -{ - "NotebookApp": { - "password": "sha1:aae8550c0a44:9507d45e087d5ee481a5ce9f4f16f37a0867318c" - } -} +helm install --name my-release dask/daskhub ``` -Replace the `jupyter.password` field in [values.yaml](/dask/values.yaml) with the -hash generated for your new password. - -## Custom Configuration - -If you want to change the default parameters, you can do this in two ways. - -### YAML Config Files - -You can change the default parameters in `values.yaml`, or create your own -custom YAML config file, and specify this file when installing your chart with -the `-f` flag. Example: - -```bash -helm install --name my-release -f values.yaml dask/dask -``` - -> **Tip**: You can use the default [values.yaml](/dask/values.yaml) for reference - -### Command-Line Arguments - -If you want to change parameters for a specific install without changing -`values.yaml`, you can use the `--set key=value[,key=value]` flag when running -`helm install`, and it will override any default values. Example: - -```bash -helm install --name my-release --set jupyter.enabled=false dask/dask -``` - -### Customizing Python Environment - -The default `daskdev/dask` images have a standard Miniconda installation along -with some common packages like NumPy and Pandas. You can install custom packages -with either Conda or Pip using optional environment variables. This happens -when your container starts up. - -> **Note**: The `IP:PORT` of this chart's services will not be accessible until -> extra packages finish installing. Expect to wait at least a minute for the -> Jupyter Server to be accessible if adding packages below, like `numba`. This -> time will vary depending on which extra packages you choose to install. - -Consider the following YAML config as an example: - -```yaml -jupyter: - env: - - name: EXTRA_CONDA_PACKAGES - value: numba xarray -c conda-forge - - name: EXTRA_PIP_PACKAGES - value: s3fs dask-ml --upgrade - -worker: - env: - - name: EXTRA_CONDA_PACKAGES - value: numba xarray -c conda-forge - - name: EXTRA_PIP_PACKAGES - value: s3fs dask-ml --upgrade -``` - -> **Note**: The Jupyter and Dask-worker environments should have matching -> software environments, at least where a user is likely to distribute that -> functionality. - -### RBAC - -By default the Jupyter pod will be given an RBAC role via a service account which allows you to scale -deployments and access pod logs from the Jupyter pod. - -For example to scale the workers you can run the following command from the Jupyter terminal. - -```bash -kubectl scale deployment dask-worker --replicas=10 -``` - -You can also get pod logs using kubectl. - -```bash -# List pods -kubectl get pods - -# Watch pod logs -kubectl logs -f {podname} -``` - -The RBAC role will give the Jupyter pod access to view all pods and update all deployments in the namespace you -install the Helm Chart in. If you wish to disable this you must disable the Jupyter RBAC and unset the service account. - -```yaml -jupyter: - rbac: false - serviceAccountName: null -``` - -Also see the [dask-kubernetes documentation](https://kubernetes.dask.org/en/latest/api.html#dask_kubernetes.HelmCluster) -for the `HelmCluster` cluster manager for managing workers from within your Python session. - -## Maintaining - -### Generating the README - -This repo uses [Frigate](https://frigate.readthedocs.io/en/master/index.html) to autogenerate the README. This makes it quick to keep the table -of config options up to date. - -If you wish to make a change to the README body you must edit `dask/.frigate` instead. - -To generate the readme run Frigate. - -``` -frigate gen dask > README.md -``` - -### Releasing - -Releases of the Helm chart are automatically pushed to the `gh-pages` branch by Travis CI when git tags are created. - -Before releasing you may want to ensure the chart is up to date with the latest Docker images and Dask versions: - -- Update the image tags in `dask/values.yaml` to reflect the [latest release of the Dask Docker images](https://github.com/dask/dask-docker/releases). -- Update the `appVersion` value in `dask/Chart.yaml` to also reflect this version. - -Then to perform a release you need to create and push a new tag. - -You can either use the `ci/release.sh` script. - -``` -ci/release.sh x.x.x -``` - -Or manually run the steps below. - -- Update the `version` key in `dask/Chart.yaml` with the new chart version `x.x.x`. -- For ease of releasing set the version as an environment variable `export DASK_HELM_VERSION=x.x.x`. -- Add a release commit `git commit -a -m "bump version to $DASK_HELM_VERSION"`. -- Tag the commit `git tag -a $DASK_HELM_VERSION -m "Version $DASK_HELM_VERSION"`. -- Push the tags `git push upstream master --tags`. -- Travis CI will automatically build and release to the chart repository. - - +See [daskhub](./daskhub/README.md) for more. diff --git a/dask/README.md b/dask/README.md index 017475c..0b0b723 100644 --- a/dask/README.md +++ b/dask/README.md @@ -88,6 +88,7 @@ The following table lists the configurable parameters of the Dask chart and thei | `worker.default_resources.memory` | Default memory (deprecated use `resources`). | `"4GiB"` | | `worker.env` | Environment variables. see `values.yaml` for example values. | `null` | | `worker.resources` | Worker pod resources. see `values.yaml` for example values. | `{}` | +| `worker.mounts` | | `{}` | | `worker.tolerations` | Tolerations. | `[]` | | `worker.affinity` | Container affinity. | `{}` | | `worker.nodeSelector` | Node selector. | `{}` | @@ -108,6 +109,7 @@ The following table lists the configurable parameters of the Dask chart and thei | `jupyter.args` | Container arguments. | `null` | | `jupyter.extraConfig` | | `"# Extra Jupyter config goes here\n# E.g\n# c.NotebookApp.port = 8888"` | | `jupyter.resources` | Jupyter pod resources. see `values.yaml` for example values. | `{}` | +| `jupyter.mounts` | | `{}` | | `jupyter.tolerations` | Tolerations. | `[]` | | `jupyter.affinity` | Container affinity. | `{}` | | `jupyter.nodeSelector` | Node selector. | `{}` | From fde3c279f47d5fbe0fc8289091ec1aa023fcab9a Mon Sep 17 00:00:00 2001 From: ClimaBot Date: Fri, 11 Sep 2020 17:57:59 -0400 Subject: [PATCH 4/5] adding readme --- dask/values.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dask/values.yaml b/dask/values.yaml index c45e0ce..c8d7322 100644 --- a/dask/values.yaml +++ b/dask/values.yaml @@ -69,7 +69,7 @@ worker: # cpu: 1 # memory: 3G # nvidia.com/gpu: 1 - mounts: {} + mounts: {} # Worker Pod volumes and volume mounts, mounts.volumes follows kuberentes api v1 Volumes spec. mounts.volumeMounts follows kubernetesapi v1 VolumeMount spec # volumes: # - name: data # emptyDir: {} @@ -125,7 +125,7 @@ jupyter: # requests: # cpu: 2 # memory: 6G - mounts: {} + mounts: {} # Worker Pod volumes and volume mounts, mounts.volumes follows kuberentes api v1 Volumes spec. mounts.volumeMounts follows kubernetesapi v1 VolumeMount spec # volumes: # - name: data # emptyDir: {} From 5dd48627fd63bd993f9fd6d4bea5afc6e623bacc Mon Sep 17 00:00:00 2001 From: ClimaBot Date: Fri, 11 Sep 2020 18:00:21 -0400 Subject: [PATCH 5/5] updated readme --- dask/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dask/README.md b/dask/README.md index 0b0b723..9ec4c1e 100644 --- a/dask/README.md +++ b/dask/README.md @@ -88,7 +88,7 @@ The following table lists the configurable parameters of the Dask chart and thei | `worker.default_resources.memory` | Default memory (deprecated use `resources`). | `"4GiB"` | | `worker.env` | Environment variables. see `values.yaml` for example values. | `null` | | `worker.resources` | Worker pod resources. see `values.yaml` for example values. | `{}` | -| `worker.mounts` | | `{}` | +| `worker.mounts` | Worker pod volumes and volume mounts, mounts.volumes follows kuberentes api v1 volumes spec. mounts.volumemounts follows kubernetesapi v1 volumemount spec | `{}` | | `worker.tolerations` | Tolerations. | `[]` | | `worker.affinity` | Container affinity. | `{}` | | `worker.nodeSelector` | Node selector. | `{}` | @@ -109,7 +109,7 @@ The following table lists the configurable parameters of the Dask chart and thei | `jupyter.args` | Container arguments. | `null` | | `jupyter.extraConfig` | | `"# Extra Jupyter config goes here\n# E.g\n# c.NotebookApp.port = 8888"` | | `jupyter.resources` | Jupyter pod resources. see `values.yaml` for example values. | `{}` | -| `jupyter.mounts` | | `{}` | +| `jupyter.mounts` | Worker pod volumes and volume mounts, mounts.volumes follows kuberentes api v1 volumes spec. mounts.volumemounts follows kubernetesapi v1 volumemount spec | `{}` | | `jupyter.tolerations` | Tolerations. | `[]` | | `jupyter.affinity` | Container affinity. | `{}` | | `jupyter.nodeSelector` | Node selector. | `{}` |