From cfc2b8483934c7468723724c4215d215a5ffade1 Mon Sep 17 00:00:00 2001 From: Javier Salmeron Garcia Date: Wed, 29 May 2019 16:46:43 +0200 Subject: [PATCH 1/9] [bitnami/mxnet] Release MXNet chart Signed-off-by: Javier Salmeron Garcia --- bitnami/mxnet/.helmignore | 22 ++ bitnami/mxnet/Chart.yaml | 18 ++ bitnami/mxnet/README.md | 262 ++++++++++++++++++ bitnami/mxnet/templates/NOTES.txt | 51 ++++ bitnami/mxnet/templates/_helpers.tpl | 187 +++++++++++++ bitnami/mxnet/templates/configmap.yaml | 13 + bitnami/mxnet/templates/deployment-pvc.yaml | 26 ++ bitnami/mxnet/templates/headless-svc.yaml | 17 ++ .../mxnet/templates/scheduler-deployment.yaml | 160 +++++++++++ .../mxnet/templates/scheduler-service.yaml | 22 ++ .../mxnet/templates/server-statefulset.yml | 188 +++++++++++++ .../templates/standalone-deployment.yaml | 151 ++++++++++ .../mxnet/templates/worker-statefulset.yml | 188 +++++++++++++ bitnami/mxnet/values-production.yaml | 216 +++++++++++++++ bitnami/mxnet/values.yaml | 216 +++++++++++++++ 15 files changed, 1737 insertions(+) create mode 100644 bitnami/mxnet/.helmignore create mode 100644 bitnami/mxnet/Chart.yaml create mode 100644 bitnami/mxnet/README.md create mode 100644 bitnami/mxnet/templates/NOTES.txt create mode 100644 bitnami/mxnet/templates/_helpers.tpl create mode 100644 bitnami/mxnet/templates/configmap.yaml create mode 100644 bitnami/mxnet/templates/deployment-pvc.yaml create mode 100644 bitnami/mxnet/templates/headless-svc.yaml create mode 100644 bitnami/mxnet/templates/scheduler-deployment.yaml create mode 100644 bitnami/mxnet/templates/scheduler-service.yaml create mode 100644 bitnami/mxnet/templates/server-statefulset.yml create mode 100644 bitnami/mxnet/templates/standalone-deployment.yaml create mode 100644 bitnami/mxnet/templates/worker-statefulset.yml create mode 100644 bitnami/mxnet/values-production.yaml create mode 100644 bitnami/mxnet/values.yaml diff --git a/bitnami/mxnet/.helmignore b/bitnami/mxnet/.helmignore new file mode 100644 index 0000000000..50af031725 --- /dev/null +++ b/bitnami/mxnet/.helmignore @@ -0,0 +1,22 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/bitnami/mxnet/Chart.yaml b/bitnami/mxnet/Chart.yaml new file mode 100644 index 0000000000..1f155b699c --- /dev/null +++ b/bitnami/mxnet/Chart.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +name: mxnet +version: 0.0.1 +appVersion: 1.4.1 +description: A flexible and efficient library for deep learning +keywords: +- mxnet +- python +- machine +- learning +home: https://mxnet.apache.org/ +sources: +- https://github.com/bitnami/bitnami-docker-mxnet +maintainers: +- name: Bitnami + email: containers@bitnami.com +engine: gotpl +icon: https://bitnami.com/assets/stacks/mxnet/img/mxnet-stack-110x117.png diff --git a/bitnami/mxnet/README.md b/bitnami/mxnet/README.md new file mode 100644 index 0000000000..39d57477fc --- /dev/null +++ b/bitnami/mxnet/README.md @@ -0,0 +1,262 @@ +# MXNet + +[MXNet](https://mxnet.apache.org/) is a deep learning platform that accelerates the transition from research prototyping to production deployment. It is built for full integration into Python that enables you to use it with its libraries and main packages. + +## TL;DR; + +```console +$ helm install bitnami/mxnet +``` + +## Introduction + +This chart bootstraps a [MXNet](https://github.com/bitnami/bitnami-docker-mxnet) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. + +Bitnami charts can be used with [Kubeapps](https://kubeapps.com/) for deployment and management of Helm Charts in clusters. This Helm chart has been tested on top of [Bitnami Kubernetes Production Runtime](https://kubeprod.io/) (BKPR). Deploy BKPR to get automated TLS certificates, logging and monitoring for your applications. + +## Prerequisites + +- Kubernetes 1.8+ with Beta APIs enabled +- PV provisioner support in the underlying infrastructure + +## Installing the Chart + +To install the chart with the release name `my-release`: + +```console +$ helm install --name my-release bitnami/mxnet +``` + +The command deploys MXNet on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured. + +> **Tip**: List all releases using `helm list` + +## Uninstalling the Chart + +To uninstall/delete the `my-release` deployment: + +```console +$ helm delete my-release +``` + +The command removes all the Kubernetes components associated with the chart and deletes the release. + +## Configuration + +The following table lists the configurable parameters of the MinIO chart and their default values. + +| Parameter | Description | Default | +| ------------------------------------ | -------------------------------------------------------------------------------------------- | ------------------------------------------------------- | +| `global.imageRegistry` | Global Docker image registry | `nil` | +| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | +| `image.registry` | MXNet image registry | `docker.io` | +| `image.repository` | MXNet image name | `bitnami/MXNet` | +| `image.tag` | MXNet image tag | `{VERSION}` | +| `image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | +| `image.debug` | Specify if debug logs should be enabled | `false` | +| `git.registry` | Git image registry | `docker.io` | +| `git.repository` | Git image name | `bitnami/git` | +| `git.tag` | Git image tag | `latest` | +| `git.pullPolicy` | Git image pull policy | `Always` | +| `git.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | +| service.type | Kubernetes service type | `ClusterIP` | +| `entrypoint.file` | Main entrypoint to your application. If not speficied, it will be a `sleep infinity` command | `''` | +| `entrypoint.args` | Args required by your entrypoint | `nil` | +| `entrypoint.workDir` | Working directory for launching the entrypoint | `'/app'` | +| `podManagementPolicy` | StatefulSet (worker and server nodes) pod management policy | `Parallel` | +| `mode` | Run MXNet in standalone or distributed mode (possible values: `standalone`, `distributed`) | `standalone` | +| `serverCount` | Number of server nodes that will execute your code | `1` | +| `workerCount` | Number of worker nodes that will execute your code | `1` | +| `schedulerPort` | MXNet scheduler port (only for distributed mode) | `49875` | +| `configMap` | Config map that contains the files you want to load in MXNet | `nil` | +| `cloneFilesFromGit.enabled` | Enable in order to download files from git repository | `false` | +| `cloneFilesFromGit.repository` | Repository that holds the files | `nil` | +| `cloneFilesFromGit.revision` | Revision from the repository to checkout | `master` | +| `commonExtraEnvVars` | Extra environment variables to add to server, scheduler and worker nodes | `nil` | +| `workerExtraEnvVars` | Extra environment variables to add to the worker nodes | `nil` | +| `serverExtraEnvVars` | Extra environment variables to add to the server nodes | `nil` | +| `schedulerExtraEnvVars` | Extra environment variables to add to the scheduler node | `nil` | +| `sidecars` | Attach additional containers to the pods (scheduler, worker and server nodes) | `nil` | +| `initContainers` | Attach additional init containers to the pods (scheduler, worker and server nodes) | `nil` | +| `existingSecret` | Name of a secret with sensitive data to mount in the pods | `nil` | +| `nodeSelector` | Node labels for pod assignment | `{}` | +| `tolerations` | Toleration labels for pod assignment | `[]` | +| `affinity` | Map of node/pod affinities | `{}` | +| `resources` | Pod resources | `{}` | +| `securityContext.enabled` | Enable security context | `true` | +| `securityContext.fsGroup` | Group ID for the container | `1001` | +| `securityContext.runAsUser` | User ID for the container | `1001` | +| `livenessProbe.enabled` | Enable/disable the Liveness probe | `true` | +| `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | `5` | +| `livenessProbe.periodSeconds` | How often to perform the probe | `5` | +| `livenessProbe.timeoutSeconds` | When the probe times out | `5` | +| `livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | `1` | +| `livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `5` | +| `readinessProbe.enabled` | Enable/disable the Readiness probe | `true` | +| `readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated | `5` | +| `readinessProbe.periodSeconds` | How often to perform the probe | `5` | +| `readinessProbe.timeoutSeconds` | When the probe times out | `1` | +| `readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | `1` | +| `readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `5` | +| `persistence.enabled` | Use a PVC to persist data | `false` | +| `persistence.mountPath` | Path to mount the volume at | `/bitnami/mxnet` | +| `persistence.storageClass` | Storage class of backing PVC | `nil` (uses alpha storage class annotation) | +| `persistence.accessMode` | Use volume as ReadOnly or ReadWrite | `ReadWriteOnce` | +| `persistence.size` | Size of data volume | `8Gi` | +| `persistence.annotations` | Persistent Volume annotations | `{}` | + +Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, + +```console +$ helm install --name my-release \ + --set mode=distributed \ + --set serverCount=2 \ + --set workerCount=3 \ + bitnami/mxnet +``` + +The above command create 6 pods for MXNet: one scheduler, two servers and and three workers. + +Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example, + +```console +$ helm install --name my-release -f values.yaml bitnami/mxnet +``` + +> **Tip**: You can use the default [values.yaml](values.yaml) + +## Loading your files + +The MXNet chart supports three different ways to load your files. In order of priority, they are: + + 1. Existing config map + 2. Files under the `files` directory + 3. Cloning a git repository + +This means that if you specify a config map with your files, it won't look for the `files/` directory nor the git repository. + +In order to use use an existing config map: + +```console +$ helm install --name my-release \ + --set configMap=my-config-map \ + bitnami/mxnet +``` + +To load your files from the `files/` directory you don't have to set any option. Just copy your files inside and don't specify a `ConfigMap`: + +```console +$ helm install --name my-release \ + bitnami/mxnet +``` + +Finally, if you want to clone a git repository: + +```console +$ helm install --name my-release \ + --set cloneFilesFromGit.enabled=true \ + --set cloneFilesFromGit.repository=https://github.com/my-user/my-repo \ + --set cloneFilesFromGit.revision=master \ + bitnami/mxnet +``` + +In case you want to add a file that includes sensitive information, pass a secret object using the `existingSecret` parameter. All the files in the secret will be mounted in the `/secrets` folder. + +### Distributed training example + +We will use the gluon example from the [MXNet official repository](https://github.com/apache/incubator-mxnet/tree/master/example/gluon). Launch it with the following command: + +```console +$ helm install --name my-release \ + --set mode=distributed \ + --set cloneFilesFromGit.enabled=true \ + --set cloneFilesFromGit.repository=https://github.com/apache/incubator-mxnet.git \ + --set cloneFilesFromGit.revision=master \ + --set entrypoint.file=image_classification.py \ + --set entrypoint.args="--dataset cifar10 --model vgg11 --epochs 1 --kvstore dist_sync" \ + --set entrypoint.workDir=/app/example/gluon/ \ + bitnami/mxnet +``` + +Check the logs of the worker node: + +```console +$ kubectl logs my-release-mxnet-worker-0 -f + +INFO:root:Starting new image-classification task:, Namespace(batch_norm=False, batch_size=32, builtin_profiler=0, data_dir='', dataset='cifar10', dtype='float32', epochs=1, gpus='', kvstore='dist_sync', log_interval=50, lr=0.1, lr_factor=0.1, lr_steps='30,60,90', mode=None, model='vgg11', momentum=0.9, num_workers=4, prefix='', profile=False, resume='', save_frequency=10, seed=123, start_epoch=0, use_pretrained=False, use_thumbnail=False, wd=0.0001) +INFO:root:downloaded http://data.mxnet.io/mxnet/data/cifar10.zip into data/cifar10.zip successfully +[10:05:40] src/io/iter_image_recordio_2.cc:172: ImageRecordIOParser2: data/cifar/train.rec, use 1 threads for decoding.. +[10:05:45] src/io/iter_image_recordio_2.cc:172: ImageRecordIOParser2: data/cifar/test.rec, use 1 threads for decoding.. +``` + +If you want to increase the verbosity, set the environment variable `PS_VERBOSE=1` or `PS_VERBOSE=2` using the `commonEnvVars` value. + +```console +$ helm install --name my-release \ + --set mode=distributed \ + --set cloneFilesFromGit.enabled=true \ + --set cloneFilesFromGit.repository=https://github.com/apache/incubator-mxnet.git \ + --set cloneFilesFromGit.revision=master \ + --set entrypoint.file=image_classification.py \ + --set entrypoint.args="--dataset cifar10 --model vgg11 --epochs 1 --kvstore dist_sync" \ + --set entrypoint.workDir=/app/example/gluon/ \ + --set commonExtraEnvVars[0].name=PS_VERBOSE \ + --set commonExtraEnvVars[0].value=1 \ + bitnami/mxnet +``` + +You will now see log entries in the scheduler and server nodes. + +```console +$ kubectl logs my-release-mxnet-server-0 +[14:22:53] src/van.cc:290: Bind to role=server, ip=10.32.0.12, port=57099, is_recovery=0 +[14:22:53] src/van.cc:238: S[10] is connected to others + +$ kubectl logs my-release-mxnet-scheduler-67dbd4bb7c-px2wf +[14:22:44] src/van.cc:290: Bind to role=scheduler, id=1, ip=10.32.0.11, port=9092, is_recovery=0 +[14:22:53] src/van.cc:56: assign rank=9 to node role=worker, ip=10.32.0.17, port=55423, is_recovery=0 +[14:22:53] src/van.cc:56: assign rank=11 to node role=worker, ip=10.32.0.16, port=60779, is_recovery=0 +[14:22:53] src/van.cc:56: assign rank=13 to node role=worker, ip=10.32.0.15, port=39817, is_recovery=0 +[14:22:53] src/van.cc:56: assign rank=15 to node role=worker, ip=10.32.0.14, port=48119, is_recovery=0 +[14:22:53] src/van.cc:56: assign rank=8 to node role=server, ip=10.32.0.13, port=56713, is_recovery=0 +[14:22:53] src/van.cc:56: assign rank=10 to node role=server, ip=10.32.0.12, port=57099, is_recovery=0 +[14:22:53] src/van.cc:83: the scheduler is connected to 4 workers and 2 servers +[14:22:53] src/van.cc:183: Barrier count for 7 : 1 +[14:22:53] src/van.cc:183: Barrier count for 7 : 2 +[14:22:53] src/van.cc:183: Barrier count for 7 : 3 +[14:22:53] src/van.cc:183: Barrier count for 7 : 4 +... +``` + +## Persistence + +The [Bitnami MXNet](https://github.com/bitnami/bitnami-docker-mxnet) image can persist data. If enabled, the persisted path is `/bitnami/mxnet` by default. + +The chart mounts a [Persistent Volume](http://kubernetes.io/docs/user-guide/persistent-volumes/) at this location. The volume is created using dynamic volume provisioning. + +## Sidecars and Init Containers + +If you have a need for additional containers to run within the same pod as MXNet (e.g. an additional metrics or logging exporter), you can do so via the `sidecars` config parameter. Simply define your container according to the Kubernetes container spec. + +```yaml +sidecars: +- name: your-image-name + image: your-image + imagePullPolicy: Always + ports: + - name: portname + containerPort: 1234 +``` + +Similarly, you can add extra init containers using the `initContainers` parameter. + +```yaml +initContainers: +- name: your-image-name + image: your-image + imagePullPolicy: Always + ports: + - name: portname + containerPort: 1234 +``` diff --git a/bitnami/mxnet/templates/NOTES.txt b/bitnami/mxnet/templates/NOTES.txt new file mode 100644 index 0000000000..02b92757d3 --- /dev/null +++ b/bitnami/mxnet/templates/NOTES.txt @@ -0,0 +1,51 @@ +{{- if and (contains "bitnami/" .Values.image.repository) (not (.Values.image.tag | toString | regexFind "-r\\d+$|sha256:")) }} + +WARNING: Rolling tag detected ({{ .Values.image.repository }}:{{ .Values.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment. ++info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/ + +{{- end }} +{{- if or (.Values.configMap) (.Files.Glob "files/*") (.Values.cloneFilesFromGit.enabled) }} +{{- if .Values.entrypoint.file }} +The provided file {{ .Values.entrypoint.file }} is being executed. You can see the logs of each running node with: + kubectl logs [POD_NAME] + +and the list of pods: + kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "mxnet.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" +{{- else }} +You didn't specify any entrypoint to your code. +To run it, you can either deploy again using the `mxnet.entrypoint.file` option to specify your entrypoint, or execute it manually by jumping into the pods: + +1. Get the running pods + kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "mxnet.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" + +2. Get into a pod + kubectl exec -ti [POD_NAME] bash + +3. Execute your script as you would normally do. +{{- end }} +{{- else }} +WARNING: You haven't loaded any file. You can access the Python REPL by jumping into the pods: + +1. Get the running pods + kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "mxnet.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" + +2. Run the Python REPL + kubectl exec -ti [POD_NAME] python3 + +This chart allows three different methods to load your files: + +1. Load the files from an existing ConfigMap, using the `configMap` option. +2. Putting your files in a `files` folder in the root of the Chart. +3. Cloning a Git repository with the `cloneFilesFromGit` option. + +Examples for the different methods can be found in the README. +{{- end }} + +{{- if and (contains "bitnami/" .Values.image.repository) (not (regexMatch "-r\\d+$" .Values.image.tag)) }} + +WARNING: Rolling tag detected ({{ .Values.image.repository }}:{{ .Values.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment. ++info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/ + +{{- end }} + +{{ include "mxnet.validateValues" . }} diff --git a/bitnami/mxnet/templates/_helpers.tpl b/bitnami/mxnet/templates/_helpers.tpl new file mode 100644 index 0000000000..42bcbecea3 --- /dev/null +++ b/bitnami/mxnet/templates/_helpers.tpl @@ -0,0 +1,187 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "mxnet.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "mxnet.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "mxnet.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + +{{/* +Return the proper MXNet image name +*/}} +{{- define "mxnet.image" -}} +{{- $registryName := .Values.image.registry -}} +{{- $repositoryName := .Values.image.repository -}} +{{- $tag := .Values.image.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* Validate values of MXNet - number of workers must be greater than 0 */}} +{{- define "mxnet.entrypoint" -}} +{{- if .Values.entrypoint.file }} + {{- if (.Values.entrypoint.file | regexFind "[.]py$") }} +python3 {{ .Values.entrypoint.file }} {{ if .Values.entrypoint.args }}{{ .Values.entrypoint.args }}{{ end }} + {{- else }} +bash {{ .Values.entrypoint.file }} {{ if .Values.entrypoint.args }}{{ .Values.entrypoint.args }}{{ end }} + {{- end }} + {{- else }} +sleep infinity + {{- end }} +{{- end -}} + +{{/* +Return the proper git image name +*/}} +{{- define "git.image" -}} +{{- $registryName := .Values.git.registry -}} +{{- $repositoryName := .Values.git.repository -}} +{{- $tag := .Values.git.tag | toString -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic. +Also, we can't use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} + {{- if .Values.global.imageRegistry }} + {{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}} + {{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} + {{- end -}} +{{- else -}} + {{- printf "%s/%s:%s" $registryName $repositoryName $tag -}} +{{- end -}} +{{- end -}} + +{{/* +Return the proper Docker Image Registry Secret Names +*/}} +{{- define "mxnet.imagePullSecrets" -}} +{{/* +Helm 2.11 supports the assignment of a value to a variable defined in a different scope, +but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic. +Also, we can not use a single if because lazy evaluation is not an option +*/}} +{{- if .Values.global }} +{{- if .Values.global.imagePullSecrets }} +imagePullSecrets: +{{- range .Values.global.imagePullSecrets }} + - name: {{ . }} +{{- end }} +{{- else if or .Values.image.pullSecrets .Values.git.pullSecrets }} +imagePullSecrets: +{{- range .Values.image.pullSecrets }} + - name: {{ . }} +{{- end }} +{{- range .Values.git.pullSecrets }} + - name: {{ . }} +{{- end }} +{{- end -}} +{{- else if or .Values.image.pullSecrets .Values.git.pullSecrets }} +imagePullSecrets: +{{- range .Values.image.pullSecrets }} + - name: {{ . }} +{{- end }} +{{- range .Values.git.pullSecrets }} + - name: {{ . }} +{{- end }} +{{- end -}} +{{- end -}} + +{{/* +Compile all warnings into a single message, and call fail. +*/}} +{{- define "mxnet.validateValues" -}} +{{- $messages := list -}} +{{- $messages := append $messages (include "mxnet.validateValues.mode" .) -}} +{{- $messages := append $messages (include "mxnet.validateValues.workerCount" .) -}} +{{- $messages := append $messages (include "mxnet.validateValues.serverCount" .) -}} +{{- $messages := without $messages "" -}} +{{- $message := join "\n" $messages -}} + +{{- if $message -}} +{{- printf "\nVALUES VALIDATION:\n%s" $message | fail -}} +{{- end -}} +{{- end -}} + +{{/* Validate values of MXNet - must provide a valid mode ("distributed" or "standalone") */}} +{{- define "mxnet.validateValues.mode" -}} +{{- if and (ne .Values.mode "distributed") (ne .Values.mode "standalone") -}} +mxnet: mode + Invalid mode selected. Valid values are "distributed" and + "standalone". Please set a valid mode (--set mode="xxxx") +{{- end -}} +{{- end -}} + +{{/* Validate values of MXNet - number of workers must be greater than 0 */}} +{{- define "mxnet.validateValues.workerCount" -}} +{{- $replicaCount := int .Values.workerCount }} +{{- if and (eq .Values.mode "distributed") (lt $replicaCount 1) -}} +mxnet: workerCount + Worker count must be greater than 0 in distributed mode!! + Please set a valid worker count size (--set workerCount=X) +{{- end -}} +{{- end -}} + +{{- define "mxnet.parseEnvVars" -}} +{{- range $env := . }} +{{- if $env.value }} +- name: {{ $env.name }} + value: {{ $env.value | quote }} +{{- else if $env.valueFrom }} +- name: {{ $env.name }} + valueFrom: +{{ toYaml $env.valueFrom | indent 4 }} +{{- else }} {{/* Leave this for future compatibility */}} +- +{{ toYaml $env | indent 2}} +{{- end }} +{{- end }} +{{- end }} + +{{/* Validate values of MXNet - number of workers must be greater than 0 */}} +{{- define "mxnet.validateValues.serverCount" -}} +{{- $replicaCount := int .Values.serverCount }} +{{- if and (eq .Values.mode "distributed") (lt $replicaCount 1) -}} +mxnet: serverCount + Server count must be greater than 0 in distributed mode!! + Please set a valid worker count size (--set serverCount=X) +{{- end -}} +{{- end -}} diff --git a/bitnami/mxnet/templates/configmap.yaml b/bitnami/mxnet/templates/configmap.yaml new file mode 100644 index 0000000000..738ea7c78f --- /dev/null +++ b/bitnami/mxnet/templates/configmap.yaml @@ -0,0 +1,13 @@ +{{- if .Files.Glob "files/*" }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "mxnet.fullname" . }}-files + labels: + app.kubernetes.io/name: {{ include "mxnet.name" . }} + helm.sh/chart: {{ include "mxnet.chart" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} +data: +{{ (.Files.Glob "files/*").AsConfig | indent 2 }} +{{ end }} diff --git a/bitnami/mxnet/templates/deployment-pvc.yaml b/bitnami/mxnet/templates/deployment-pvc.yaml new file mode 100644 index 0000000000..54f891b015 --- /dev/null +++ b/bitnami/mxnet/templates/deployment-pvc.yaml @@ -0,0 +1,26 @@ +{{- if and .Values.persistence.enabled }} +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{ include "mxnet.fullname" . }}{{ if eq .Values.mode "distributed" }}-scheduler{{ end }} + labels: + app.kubernetes.io/name: {{ include "mxnet.name" . }} + helm.sh/chart: {{ include "mxnet.chart" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} +spec: + accessModes: + {{- range .Values.persistence.accessModes }} + - {{ . | quote }} + {{- end }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} + {{- if .Values.persistence.storageClass }} + {{- if (eq "-" .Values.persistence.storageClass) }} + storageClassName: "" + {{- else }} + storageClassName: "{{ .Values.persistence.storageClass }}" + {{- end }} + {{- end }} +{{- end }} diff --git a/bitnami/mxnet/templates/headless-svc.yaml b/bitnami/mxnet/templates/headless-svc.yaml new file mode 100644 index 0000000000..9b6538e10d --- /dev/null +++ b/bitnami/mxnet/templates/headless-svc.yaml @@ -0,0 +1,17 @@ +{{- if eq .Values.mode "distributed" }} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "mxnet.fullname" . }}-headless + labels: + app.kubernetes.io/name: {{ include "mxnet.name" . }} + helm.sh/chart: {{ include "mxnet.chart" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} +spec: + type: ClusterIP + clusterIP: None + selector: + app.kubernetes.io/name: {{ include "mxnet.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} \ No newline at end of file diff --git a/bitnami/mxnet/templates/scheduler-deployment.yaml b/bitnami/mxnet/templates/scheduler-deployment.yaml new file mode 100644 index 0000000000..feef3f7842 --- /dev/null +++ b/bitnami/mxnet/templates/scheduler-deployment.yaml @@ -0,0 +1,160 @@ +{{- if eq .Values.mode "distributed" }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "mxnet.fullname" . }}-scheduler + labels: + app.kubernetes.io/name: {{ include "mxnet.name" . }} + helm.sh/chart: {{ include "mxnet.chart" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/component: "scheduler" +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: {{ include "mxnet.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: "scheduler" + template: + metadata: + labels: + app.kubernetes.io/name: {{ include "mxnet.name" . }} + helm.sh/chart: {{ include "mxnet.chart" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/component: "scheduler" + spec: + {{- include "mxnet.imagePullSecrets" . | nindent 6 }} + {{- if .Values.securityContext.enabled }} + securityContext: + fsGroup: {{ .Values.securityContext.fsGroup }} + runAsUser: {{ .Values.securityContext.runAsUser }} + {{- end }} + {{- if .Values.nodeSelector }} + nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }} + {{- end }} + {{- if .Values.tolerations }} + tolerations: {{ toYaml .Values.tolerations | nindent 8 }} + {{- end }} + {{- if .Values.affinity }} + affinity: {{ toYaml .Values.affinity | nindent 8 }} + {{- end }} + {{- if .Values.cloneFilesFromGit.enabled }} + initContainers: + - name: git-clone-repository + image: {{ include "git.image" . }} + imagePullPolicy: {{ .Values.git.pullPolicy | quote }} + command: + - /bin/sh + - -c + - | + git clone {{ .Values.cloneFilesFromGit.repository }} /app + cd /app + git checkout {{ .Values.cloneFilesFromGit.revision }} + volumeMounts: + - name: git-cloned-files + mountPath: /app + {{- end }} +{{- if .Values.initContainers }} +{{ toYaml .Values.initContainers | indent 6 }} +{{- end }} + containers: + - name: mxnet + workingDir: {{ .Values.entrypoint.workDir }} + image: {{ include "mxnet.image" . }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + command: + - bash + - -c + - | +{{ include "mxnet.entrypoint" . | indent 10 }} + env: + - name: DMLC_ROLE + value: "scheduler" + - name: DMLC_NUM_WORKER + value: {{ .Values.workerCount | quote }} + - name: DMLC_NUM_SERVER + value: {{ .Values.serverCount | quote }} + - name: DMLC_PS_ROOT_URI + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: DMLC_PS_ROOT_PORT + value: {{ .Values.schedulerPort | quote }} +{{- if .Values.commonExtraEnvVars }} +{{ include "mxnet.parseEnvVars" .Values.commonExtraEnvVars | indent 8 }} +{{- end }} +{{- if .Values.schedulerExtraEnvVars }} +{{ include "mxnet.parseEnvVars" .Values.schedulerExtraVars | indent 8 }} +{{- end }} + ports: + - name: mxnet + containerPort: {{ .Values.schedulerPort }} + {{- if .Values.livenessProbe.enabled }} + livenessProbe: + tcpSocket: + port: {{ .Values.schedulerPort }} + initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.livenessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} + successThreshold: {{ .Values.livenessProbe.successThreshold }} + failureThreshold: {{ .Values.livenessProbe.failureThreshold }} + {{- end }} + {{- if .Values.readinessProbe.enabled }} + readinessProbe: + tcpSocket: + port: {{ .Values.schedulerPort }} + initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.readinessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} + successThreshold: {{ .Values.readinessProbe.successThreshold }} + failureThreshold: {{ .Values.readinessProbe.failureThreshold }} + {{- end }} + resources: {{ toYaml .Values.resources | nindent 12 }} + volumeMounts: + {{- if .Values.configMap }} + - name: ext-files + mountPath: /app + {{- else if .Files.Glob "files/*" }} + - name: local-files + mountPath: /app + {{- else if .Values.cloneFilesFromGit.enabled }} + - name: git-cloned-files + mountPath: /app + {{- end }} + - name: data + mountPath: {{ .Values.persistence.mountPath }} + {{- if .Values.existingSecret }} + - name: secret-data + mountPath: /secrets + {{- end }} +{{- if .Values.sidecars }} +{{ toYaml .Values.sidecars | indent 6 }} +{{- end }} + volumes: + {{- if .Values.existingSecret }} + - name: secret-data + secret: + secretName: {{ .Values.existingSecret }} + {{- end }} + {{- if .Values.configMap }} + - name: ext-files + configMap: + name: {{ .Values.configMap }} + {{- else if .Files.Glob "files/*" }} + - name: local-files + configMap: + name: {{ include "mxnet.fullname" . }}-files + {{- else if .Values.cloneFilesFromGit.enabled }} + - name: git-cloned-files + emptyDir: {} + {{- end }} + - name: data + {{- if .Values.persistence.enabled }} + persistentVolumeClaim: + claimName: {{ include "mxnet.fullname" . }}-scheduler + {{- else }} + emptyDir: {} + {{- end }} +{{- end }} diff --git a/bitnami/mxnet/templates/scheduler-service.yaml b/bitnami/mxnet/templates/scheduler-service.yaml new file mode 100644 index 0000000000..d8c5d566c8 --- /dev/null +++ b/bitnami/mxnet/templates/scheduler-service.yaml @@ -0,0 +1,22 @@ +{{- if eq .Values.mode "distributed" }} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "mxnet.fullname" . }}-scheduler + labels: + app.kubernetes.io/name: {{ include "mxnet.name" . }} + helm.sh/chart: {{ include "mxnet.chart" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/component: "scheduler" +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.schedulerPort }} + targetPort: mxnet + name: mxnet + selector: + app.kubernetes.io/name: {{ include "mxnet.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: "scheduler" +{{- end }} diff --git a/bitnami/mxnet/templates/server-statefulset.yml b/bitnami/mxnet/templates/server-statefulset.yml new file mode 100644 index 0000000000..a6de5ec73f --- /dev/null +++ b/bitnami/mxnet/templates/server-statefulset.yml @@ -0,0 +1,188 @@ +{{- if eq .Values.mode "distributed" }} +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ include "mxnet.fullname" . }}-server + labels: + app.kubernetes.io/name: {{ include "mxnet.name" . }} + helm.sh/chart: {{ include "mxnet.chart" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/component: "server" +spec: + podManagementPolicy: {{ .Values.podManagementPolicy }} + selector: + matchLabels: + app.kubernetes.io/name: {{ include "mxnet.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: "server" + replicas: {{ .Values.serverCount }} + serviceName: {{ template "mxnet.fullname" . }}-headless + template: + metadata: + labels: + app.kubernetes.io/name: {{ include "mxnet.name" . }} + helm.sh/chart: {{ include "mxnet.chart" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: "server" + spec: + {{- include "mxnet.imagePullSecrets" . | nindent 6 }} + {{- if .Values.securityContext.enabled }} + securityContext: + fsGroup: {{ .Values.securityContext.fsGroup }} + runAsUser: {{ .Values.securityContext.runAsUser }} + {{- end }} + {{- if .Values.nodeSelector }} + nodeSelector: {{ toYaml .Values.server.nodeSelector | nindent 8 }} + {{- end }} + {{- if .Values.tolerations }} + tolerations: {{ toYaml .Values.server.tolerations | nindent 8 }} + {{- end }} + {{- if .Values.affinity }} + affinity: {{ toYaml .Values.server.affinity | nindent 8 }} + {{- end }} + {{- if .Values.cloneFilesFromGit.enabled }} + initContainers: + - name: git-clone-repository + image: {{ include "git.image" . }} + imagePullPolicy: {{ .Values.git.pullPolicy | quote }} + command: + - /bin/sh + - -c + - | + git clone {{ .Values.cloneFilesFromGit.repository }} /app + cd /app + git checkout {{ .Values.cloneFilesFromGit.revision }} + volumeMounts: + - name: git-cloned-files + mountPath: /app + {{- end }} +{{- if .Values.initContainers }} +{{ toYaml .Values.initContainers | indent 6 }} +{{- end }} + containers: + - name: mxnet + workingDir: {{ .Values.entrypoint.workDir }} + image: {{ include "mxnet.image" . }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + command: + - bash + - -c + - | + SERVER_RANK=${POD_NAME##*-} + ((SERVER_RANK++)) + export SERVER_RANK +{{ include "mxnet.entrypoint" . | indent 10 }} + env: + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: DMLC_ROLE + value: "server" + - name: DMLC_NUM_WORKER + value: {{ .Values.workerCount | quote }} + - name: DMLC_NUM_SERVER + value: {{ .Values.serverCount | quote }} + - name: DMLC_PS_ROOT_URI + value: {{ include "mxnet.fullname" . }}-scheduler + - name: DMLC_PS_ROOT_PORT + value: {{ .Values.schedulerPort | quote }} +{{- if .Values.commonExtraEnvVars }} +{{ include "mxnet.parseEnvVars" .Values.commonExtraEnvVars | indent 8 }} +{{- end }} +{{- if .Values.serverExtraEnvVars }} +{{ include "mxnet.parseEnvVars" .Values.serverExtraVars | indent 8 }} +{{- end }} + {{- if .Values.livenessProbe.enabled }} + livenessProbe: + exec: + command: + - python3 + - -c + - import os; os.environ["DMLC_PS_ROOT_URI"] = "127.0.0.1"; os.environ["DMLC_ROLE"] = "worker"; import mxnet; print(mxnet.__version__) + initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.livenessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} + successThreshold: {{ .Values.livenessProbe.successThreshold }} + failureThreshold: {{ .Values.livenessProbe.failureThreshold }} + {{- end }} + {{- if .Values.readinessProbe.enabled }} + readinessProbe: + exec: + command: + - python3 + - -c + - import os; os.environ["DMLC_PS_ROOT_URI"] = "127.0.0.1"; os.environ["DMLC_ROLE"] = "worker"; import mxnet; print(mxnet.__version__) + initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.readinessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} + successThreshold: {{ .Values.readinessProbe.successThreshold }} + failureThreshold: {{ .Values.readinessProbe.failureThreshold }} + {{- end }} + resources: {{ toYaml .Values.resources | nindent 12 }} + volumeMounts: + {{- if .Values.configMap }} + - name: ext-files + mountPath: /app + {{- else if .Files.Glob "files/*" }} + - name: local-files + mountPath: /app + {{- else if .Values.cloneFilesFromGit.enabled }} + - name: git-cloned-files + mountPath: /app + {{- end }} + - name: data + mountPath: {{ .Values.persistence.mountPath }} + {{- if .Values.existingSecret }} + - name: secret-data + mountPath: /secrets + {{- end }} +{{- if .Values.sidecars }} +{{ toYaml .Values.sidecars | indent 6 }} +{{- end }} + volumes: + {{- if .Values.existingSecret }} + - name: secret-data + secret: + secretName: {{ .Values.existingSecret }} + {{- end }} + {{- if .Values.configMap }} + - name: ext-files + configMap: + name: {{ .Values.configMap }} + {{- else if .Files.Glob "files/*" }} + - name: local-files + configMap: + name: {{ include "mxnet.fullname" . }}-files + {{- else if .Values.cloneFilesFromGit.enabled }} + - name: git-cloned-files + emptyDir: {} + {{- end }} + {{- if .Values.persistence.enabled }} + volumeClaimTemplates: + - metadata: + name: data + labels: + app.kubernetes.io/name: {{ include "mxnet.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + {{- if .Values.persistence.annotations }} + annotations: {{ toYaml .Values.persistence.annotations | nindent 8 }} + {{- end }} + spec: + accessModes: {{ toYaml .Values.persistence.accessModes | nindent 8 }} + {{- if .Values.persistence.storageClass }} + {{- if (eq "-" .Values.persistence.storageClass) }} + storageClassName: "" + {{- else }} + storageClassName: {{ .Values.persistence.storageClass | quote }} + {{- end }} + {{- end }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} + {{- else }} + - name: data + emptyDir: {} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/bitnami/mxnet/templates/standalone-deployment.yaml b/bitnami/mxnet/templates/standalone-deployment.yaml new file mode 100644 index 0000000000..ca79a3d6b8 --- /dev/null +++ b/bitnami/mxnet/templates/standalone-deployment.yaml @@ -0,0 +1,151 @@ +{{- if eq .Values.mode "standalone" }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "mxnet.fullname" . }} + labels: + app.kubernetes.io/name: {{ include "mxnet.name" . }} + helm.sh/chart: {{ include "mxnet.chart" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/component: "standalone" +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: {{ include "mxnet.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: "standalone" + template: + metadata: + labels: + app.kubernetes.io/name: {{ include "mxnet.name" . }} + helm.sh/chart: {{ include "mxnet.chart" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/component: "standalone" + spec: + {{- include "mxnet.imagePullSecrets" . | nindent 6 }} + {{- if .Values.securityContext.enabled }} + securityContext: + fsGroup: {{ .Values.securityContext.fsGroup }} + runAsUser: {{ .Values.securityContext.runAsUser }} + {{- end }} + {{- if .Values.nodeSelector }} + nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }} + {{- end }} + {{- if .Values.tolerations }} + tolerations: {{ toYaml .Values.tolerations | nindent 8 }} + {{- end }} + {{- if .Values.affinity }} + affinity: {{ toYaml .Values.affinity | nindent 8 }} + {{- end }} + {{- if .Values.cloneFilesFromGit.enabled }} + initContainers: + - name: git-clone-repository + image: {{ include "git.image" . }} + imagePullPolicy: {{ .Values.git.pullPolicy | quote }} + command: + - /bin/sh + - -c + - | + git clone {{ .Values.cloneFilesFromGit.repository }} /app + cd /app + git checkout {{ .Values.cloneFilesFromGit.revision }} + volumeMounts: + - name: git-cloned-files + mountPath: /app + {{- end }} +{{- if .Values.initContainers }} +{{ toYaml .Values.initContainers | indent 6 }} +{{- end }} + containers: + - name: mxnet + workingDir: {{ .Values.entrypoint.workDir }} + image: {{ include "mxnet.image" . }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + command: + - bash + - -c + - | +{{ include "mxnet.entrypoint" . | indent 10 }} + env: +{{- if .Values.commonExtraEnvVars }} +{{ include "mxnet.parseEnvVars" .Values.commonExtraEnvVars | indent 8 }} +{{- end }} + ports: + - name: mxnet + containerPort: {{ .Values.schedulerPort }} + {{- if .Values.livenessProbe.enabled }} + livenessProbe: + exec: + command: + - python3 + - -c + - import mxnet; print(mxnet.__version__) + initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.livenessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} + successThreshold: {{ .Values.livenessProbe.successThreshold }} + failureThreshold: {{ .Values.livenessProbe.failureThreshold }} + {{- end }} + {{- if .Values.readinessProbe.enabled }} + readinessProbe: + exec: + command: + - python3 + - -c + - import mxnet; print(mxnet.__version__) + initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.readinessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} + successThreshold: {{ .Values.readinessProbe.successThreshold }} + failureThreshold: {{ .Values.readinessProbe.failureThreshold }} + {{- end }} + resources: {{ toYaml .Values.resources | nindent 12 }} + volumeMounts: + {{- if .Values.configMap }} + - name: ext-files + mountPath: /app + {{- else if .Files.Glob "files/*" }} + - name: local-files + mountPath: /app + {{- else if .Values.cloneFilesFromGit.enabled }} + - name: git-cloned-files + mountPath: /app + {{- end }} + - name: data + mountPath: {{ .Values.persistence.mountPath }} + {{- if .Values.existingSecret }} + - name: secret-data + mountPath: /secrets + {{- end }} +{{- if .Values.sidecars }} +{{ toYaml .Values.sidecars | indent 6 }} +{{- end }} + volumes: + {{- if .Values.existingSecret }} + - name: secret-data + secret: + secretName: {{ .Values.existingSecret }} + {{- end }} + {{- if .Values.configMap }} + - name: ext-files + configMap: + name: {{ .Values.configMap }} + {{- else if .Files.Glob "files/*" }} + - name: local-files + configMap: + name: {{ include "mxnet.fullname" . }}-files + {{- else if .Values.cloneFilesFromGit.enabled }} + - name: git-cloned-files + emptyDir: {} + {{- end }} + - name: data + {{- if .Values.persistence.enabled }} + persistentVolumeClaim: + claimName: {{ include "mxnet.fullname" . }} + {{- else }} + emptyDir: {} + {{- end }} +{{- end }} diff --git a/bitnami/mxnet/templates/worker-statefulset.yml b/bitnami/mxnet/templates/worker-statefulset.yml new file mode 100644 index 0000000000..9394023700 --- /dev/null +++ b/bitnami/mxnet/templates/worker-statefulset.yml @@ -0,0 +1,188 @@ +{{- if eq .Values.mode "distributed" }} +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: {{ include "mxnet.fullname" . }}-worker + labels: + app.kubernetes.io/name: {{ include "mxnet.name" . }} + helm.sh/chart: {{ include "mxnet.chart" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/component: "worker" +spec: + podManagementPolicy: {{ .Values.podManagementPolicy }} + serviceName: {{ template "mxnet.fullname" . }}-headless + selector: + matchLabels: + app.kubernetes.io/name: {{ include "mxnet.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: "worker" + replicas: {{ .Values.workerCount }} + template: + metadata: + labels: + app.kubernetes.io/name: {{ include "mxnet.name" . }} + helm.sh/chart: {{ include "mxnet.chart" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: "worker" + spec: + {{- include "mxnet.imagePullSecrets" . | nindent 6 }} + {{- if .Values.securityContext.enabled }} + securityContext: + fsGroup: {{ .Values.securityContext.fsGroup }} + runAsUser: {{ .Values.securityContext.runAsUser }} + {{- end }} + {{- if .Values.nodeSelector }} + nodeSelector: {{ toYaml .Values.server.nodeSelector | nindent 8 }} + {{- end }} + {{- if .Values.tolerations }} + tolerations: {{ toYaml .Values.server.tolerations | nindent 8 }} + {{- end }} + {{- if .Values.affinity }} + affinity: {{ toYaml .Values.server.affinity | nindent 8 }} + {{- end }} + {{- if .Values.cloneFilesFromGit.enabled }} + initContainers: + - name: git-clone-repository + image: {{ include "git.image" . }} + imagePullPolicy: {{ .Values.git.pullPolicy | quote }} + command: + - /bin/sh + - -c + - | + git clone {{ .Values.cloneFilesFromGit.repository }} /app + cd /app + git checkout {{ .Values.cloneFilesFromGit.revision }} + volumeMounts: + - name: git-cloned-files + mountPath: /app + {{- end }} +{{- if .Values.initContainers }} +{{ toYaml .Values.initContainers | indent 6 }} +{{- end }} + containers: + - name: mxnet + workingDir: {{ .Values.entrypoint.workDir }} + image: {{ include "mxnet.image" . }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + command: + - bash + - -c + - | + WORKER_RANK=${POD_NAME##*-} + ((WORKER_RANK++)) + export WORKER_RANK +{{ include "mxnet.entrypoint" . | indent 10 }} + env: + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: DMLC_ROLE + value: "worker" + - name: DMLC_NUM_WORKER + value: {{ .Values.workerCount | quote }} + - name: DMLC_NUM_SERVER + value: {{ .Values.serverCount | quote }} + - name: DMLC_PS_ROOT_URI + value: {{ include "mxnet.fullname" . }}-scheduler + - name: DMLC_PS_ROOT_PORT + value: {{ .Values.schedulerPort | quote }} +{{- if .Values.commonExtraEnvVars }} +{{ include "mxnet.parseEnvVars" .Values.commonExtraEnvVars | indent 8 }} +{{- end }} +{{- if .Values.workerExtraEnvVars }} +{{ include "mxnet.parseEnvVars" .Values.workerExtraVars | indent 8 }} +{{- end }} + {{- if .Values.livenessProbe.enabled }} + livenessProbe: + exec: + command: + - python3 + - -c + - import mxnet; print(mxnet.__version__) + initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.livenessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} + successThreshold: {{ .Values.livenessProbe.successThreshold }} + failureThreshold: {{ .Values.livenessProbe.failureThreshold }} + {{- end }} + {{- if .Values.readinessProbe.enabled }} + readinessProbe: + exec: + command: + - python3 + - -c + - import mxnet; print(mxnet.__version__) + initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.readinessProbe.periodSeconds }} + timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} + successThreshold: {{ .Values.readinessProbe.successThreshold }} + failureThreshold: {{ .Values.readinessProbe.failureThreshold }} + {{- end }} + resources: {{ toYaml .Values.resources | nindent 12 }} + volumeMounts: + {{- if .Values.configMap }} + - name: ext-files + mountPath: /app + {{- else if .Files.Glob "files/*" }} + - name: local-files + mountPath: /app + {{- else if .Values.cloneFilesFromGit.enabled }} + - name: git-cloned-files + mountPath: /app + {{- end }} + - name: data + mountPath: {{ .Values.persistence.mountPath }} + {{- if .Values.existingSecret }} + - name: secret-data + mountPath: /secrets + {{- end }} +{{- if .Values.sidecars }} +{{ toYaml .Values.sidecars | indent 6 }} +{{- end }} + volumes: + {{- if .Values.existingSecret }} + - name: secret-data + secret: + secretName: {{ .Values.existingSecret }} + {{- end }} + {{- if .Values.configMap }} + - name: ext-files + configMap: + name: {{ .Values.configMap }} + {{- else if .Files.Glob "files/*" }} + - name: local-files + configMap: + name: {{ include "mxnet.fullname" . }}-files + {{- else if .Values.cloneFilesFromGit.enabled }} + - name: git-cloned-files + emptyDir: {} + {{- end }} + {{- if .Values.persistence.enabled }} + volumeClaimTemplates: + - metadata: + name: data + labels: + app.kubernetes.io/name: {{ include "mxnet.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + {{- if .Values.persistence.annotations }} + annotations: {{ toYaml .Values.persistence.annotations | nindent 8 }} + {{- end }} + spec: + accessModes: {{ toYaml .Values.persistence.accessModes | nindent 8 }} + {{- if .Values.persistence.storageClass }} + {{- if (eq "-" .Values.persistence.storageClass) }} + storageClassName: "" + {{- else }} + storageClassName: {{ .Values.persistence.storageClass | quote }} + {{- end }} + {{- end }} + resources: + requests: + storage: {{ .Values.persistence.size | quote }} + {{- else }} + - name: data + emptyDir: {} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/bitnami/mxnet/values-production.yaml b/bitnami/mxnet/values-production.yaml new file mode 100644 index 0000000000..27e6eee88f --- /dev/null +++ b/bitnami/mxnet/values-production.yaml @@ -0,0 +1,216 @@ +## Global Docker image parameters +## Please, note that this will override the image parameters, including dependencies, configured to use the global value +## Current available global Docker image parameters: imageRegistry and imagePullSecrets +## +# global: +# imageRegistry: myRegistryName +# imagePullSecrets: +# - myRegistryKeySecretName + +## Bitnami MXNet image version +## ref: https://hub.docker.com/r/bitnami/mxnet/tags/ +## +image: + registry: docker.io + repository: bitnami/mxnet + tag: 1.4.0-r0 + ## Specify a imagePullPolicy + ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' + ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images + ## + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistryKeySecretName + ## + ## Set to true if you would like to see extra information on logs + ## It turns BASH and NAMI debugging in minideb + ## ref: https://github.com/bitnami/minideb-extras/#turn-on-bash-debugging + debug: false + +## Bitnami git image version +## ref: https://hub.docker.com/r/bitnami/git/tags/ +## +git: + registry: docker.io + repository: bitnami/git + tag: latest + pullPolicy: Always + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistryKeySecretName + +## Service for the scheduler node +service: + ## Kubernetes service type, ClusterIP and NodePort are supported at present + type: ClusterIP + +## MXNet configuration +## +## The main entrypoint of your app, this will be executed as: +## python [file] [args] +entrypoint: + file: + workDir: /app + #args: + +## MXNet deployment mode. Can be `standalone` or `distributed` +mode: distributed + +## Number of server nodes (only for distributed mode) +serverCount: 2 + +## Number of worker nodes (only for distributed mode) +workerCount: 4 + +## Pointer a to a secret to mount sensitive data +# existingSecret: + +## The port used to communicate with the scheduler +## MASTER_PORT will be set to this value +## +schedulerPort: 9092 + +## Name of an existing config map containing all the files you want to load in MXNet +## +#configMap: + +## Enable in order to download files from git repository. +## +cloneFilesFromGit: + enabled: false +# repository: +# revision: master + +## Additional environment variables for all node types +## +# commonExtraEnvVars: +# - name: PS_VERBOSE +# value: "1" + +## Additional environment variables for worker nodes +## +# workerExtraEnvVars: +# - name: PS_VERBOSE +# value: "1" + +## Additional environment variables for server nodes +## +# serverExtraEnvVars: +# - name: PS_VERBOSE +# value: "1" + +## Additional environment variables for the scheduler node +## +# schedulerExtraEnvVars: +# - name: PS_VERBOSE +# value: "1" + +## StatefulSet pod management policy +podManagementPolicy: Parallel + +## Node labels for pod assignment +## Ref: https://kubernetes.io/docs/user-guide/node-selection/ +## +nodeSelector: {} + +## Tolerations for pod assignment +## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ +## +tolerations: [] + +## Affinity for pod assignment +## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity +## +affinity: {} + +## Configure resource requests and limits +## ref: http://kubernetes.io/docs/user-guide/compute-resources/ +## +resources: {} + +## Pod Security Context +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ +## +securityContext: + enabled: true + fsGroup: 1001 + runAsUser: 1001 + +## Configure liveness and readiness probes +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes) +## +livenessProbe: + enabled: true + initialDelaySeconds: 5 + periodSeconds: 5 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 5 +readinessProbe: + enabled: true + initialDelaySeconds: 5 + periodSeconds: 5 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 5 + +## Enable persistence using Persistent Volume Claims +## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ +## +persistence: + ## If true, use a Persistent Volume Claim + ## + enabled: false + + ## Data volume mount path + ## + mountPath: /bitnami/mxnet + + ## Persistent Volume Access Mode + ## + accessModes: + - ReadWriteOnce + + ## Persistent Volume size + ## + size: 8Gi + + ## Persistent Volume Storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + # storageClass: "-" + + ## Persistent Volume Claim annotations + ## + annotations: {} + +sidecars: +## Add sidecars to the pod. +## e.g. +# - name: your-image-name + # image: your-image + # imagePullPolicy: Always + # ports: + # - name: portname + # containerPort: 1234 + +initContainers: +## Add init containers to the pod. +## e.g. +# - name: your-image-name + # image: your-image + # imagePullPolicy: Always + # ports: + # - name: portname + # containerPort: 1234 diff --git a/bitnami/mxnet/values.yaml b/bitnami/mxnet/values.yaml new file mode 100644 index 0000000000..e1ee43ae5a --- /dev/null +++ b/bitnami/mxnet/values.yaml @@ -0,0 +1,216 @@ +## Global Docker image parameters +## Please, note that this will override the image parameters, including dependencies, configured to use the global value +## Current available global Docker image parameters: imageRegistry and imagePullSecrets +## +# global: +# imageRegistry: myRegistryName +# imagePullSecrets: +# - myRegistryKeySecretName + +## Bitnami MXNet image version +## ref: https://hub.docker.com/r/bitnami/mxnet/tags/ +## +image: + registry: docker.io + repository: bitnami/mxnet + tag: 1.4.0-r0 + ## Specify a imagePullPolicy + ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' + ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images + ## + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistryKeySecretName + ## + ## Set to true if you would like to see extra information on logs + ## It turns BASH and NAMI debugging in minideb + ## ref: https://github.com/bitnami/minideb-extras/#turn-on-bash-debugging + debug: false + +## Bitnami git image version +## ref: https://hub.docker.com/r/bitnami/git/tags/ +## +git: + registry: docker.io + repository: bitnami/git + tag: latest + pullPolicy: Always + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistryKeySecretName + +## Service for the scheduler node +service: + ## Kubernetes service type, ClusterIP and NodePort are supported at present + type: ClusterIP + +## MXNet configuration +## +## The main entrypoint of your app, this will be executed as: +## python [file] [args] +entrypoint: + file: + workDir: /app + #args: + +## MXNet deployment mode. Can be `standalone` or `distributed` +mode: standalone + +## Number of server nodes (only for distributed mode) +serverCount: 1 + +## Number of worker nodes (only for distributed mode) +workerCount: 1 + +## Pointer a to a secret to mount sensitive data +# existingSecret: + +## The port used to communicate with the scheduler +## MASTER_PORT will be set to this value +## +schedulerPort: 9092 + +## Name of an existing config map containing all the files you want to load in MXNet +## +#configMap: + +## Enable in order to download files from git repository. +## +cloneFilesFromGit: + enabled: false +# repository: +# revision: master + +## Additional environment variables for all node types +## +# commonExtraEnvVars: +# - name: PS_VERBOSE +# value: "1" + +## Additional environment variables for worker nodes +## +# workerExtraEnvVars: +# - name: PS_VERBOSE +# value: "1" + +## Additional environment variables for server nodes +## +# serverExtraEnvVars: +# - name: PS_VERBOSE +# value: "1" + +## Additional environment variables for the scheduler node +## +# schedulerExtraEnvVars: +# - name: PS_VERBOSE +# value: "1" + +## StatefulSet pod management policy +podManagementPolicy: Parallel + +## Node labels for pod assignment +## Ref: https://kubernetes.io/docs/user-guide/node-selection/ +## +nodeSelector: {} + +## Tolerations for pod assignment +## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ +## +tolerations: [] + +## Affinity for pod assignment +## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity +## +affinity: {} + +## Configure resource requests and limits +## ref: http://kubernetes.io/docs/user-guide/compute-resources/ +## +resources: {} + +## Pod Security Context +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ +## +securityContext: + enabled: true + fsGroup: 1001 + runAsUser: 1001 + +## Configure liveness and readiness probes +## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes) +## +livenessProbe: + enabled: true + initialDelaySeconds: 5 + periodSeconds: 5 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 5 +readinessProbe: + enabled: true + initialDelaySeconds: 5 + periodSeconds: 5 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 5 + +## Enable persistence using Persistent Volume Claims +## ref: http://kubernetes.io/docs/user-guide/persistent-volumes/ +## +persistence: + ## If true, use a Persistent Volume Claim + ## + enabled: false + + ## Data volume mount path + ## + mountPath: /bitnami/mxnet + + ## Persistent Volume Access Mode + ## + accessModes: + - ReadWriteOnce + + ## Persistent Volume size + ## + size: 8Gi + + ## Persistent Volume Storage Class + ## If defined, storageClassName: + ## If set to "-", storageClassName: "", which disables dynamic provisioning + ## If undefined (the default) or set to null, no storageClassName spec is + ## set, choosing the default provisioner. (gp2 on AWS, standard on + ## GKE, AWS & OpenStack) + ## + # storageClass: "-" + + ## Persistent Volume Claim annotations + ## + annotations: {} + +sidecars: +## Add sidecars to the pod. +## e.g. +# - name: your-image-name + # image: your-image + # imagePullPolicy: Always + # ports: + # - name: portname + # containerPort: 1234 + +initContainers: +## Add init containers to the pod. +## e.g. +# - name: your-image-name + # image: your-image + # imagePullPolicy: Always + # ports: + # - name: portname + # containerPort: 1234 From 10ba7b650027d23fbceb1f1357ee79f566947cb2 Mon Sep 17 00:00:00 2001 From: Javier Salmeron Garcia Date: Wed, 29 May 2019 18:58:08 +0200 Subject: [PATCH 2/9] Apply requested changes Signed-off-by: Javier Salmeron Garcia --- bitnami/mxnet/templates/NOTES.txt | 8 +----- bitnami/mxnet/templates/deployment-pvc.yaml | 2 +- .../mxnet/templates/scheduler-deployment.yaml | 26 +++++++++---------- .../mxnet/templates/server-statefulset.yml | 26 +++++++++---------- .../templates/standalone-deployment.yaml | 20 +++++++------- .../mxnet/templates/worker-statefulset.yml | 26 +++++++++---------- bitnami/mxnet/values-production.yaml | 6 ++--- bitnami/mxnet/values.yaml | 6 ++--- 8 files changed, 57 insertions(+), 63 deletions(-) diff --git a/bitnami/mxnet/templates/NOTES.txt b/bitnami/mxnet/templates/NOTES.txt index 02b92757d3..7fcd73eeb1 100644 --- a/bitnami/mxnet/templates/NOTES.txt +++ b/bitnami/mxnet/templates/NOTES.txt @@ -1,9 +1,3 @@ -{{- if and (contains "bitnami/" .Values.image.repository) (not (.Values.image.tag | toString | regexFind "-r\\d+$|sha256:")) }} - -WARNING: Rolling tag detected ({{ .Values.image.repository }}:{{ .Values.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment. -+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/ - -{{- end }} {{- if or (.Values.configMap) (.Files.Glob "files/*") (.Values.cloneFilesFromGit.enabled) }} {{- if .Values.entrypoint.file }} The provided file {{ .Values.entrypoint.file }} is being executed. You can see the logs of each running node with: @@ -41,7 +35,7 @@ This chart allows three different methods to load your files: Examples for the different methods can be found in the README. {{- end }} -{{- if and (contains "bitnami/" .Values.image.repository) (not (regexMatch "-r\\d+$" .Values.image.tag)) }} +{{- if and (contains "bitnami/" .Values.image.repository) (not (.Values.image.tag | toString | regexFind "-r\\d+$|sha256:")) }} WARNING: Rolling tag detected ({{ .Values.image.repository }}:{{ .Values.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment. +info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/ diff --git a/bitnami/mxnet/templates/deployment-pvc.yaml b/bitnami/mxnet/templates/deployment-pvc.yaml index 54f891b015..36e5dcbd2d 100644 --- a/bitnami/mxnet/templates/deployment-pvc.yaml +++ b/bitnami/mxnet/templates/deployment-pvc.yaml @@ -1,4 +1,4 @@ -{{- if and .Values.persistence.enabled }} +{{- if .Values.persistence.enabled }} kind: PersistentVolumeClaim apiVersion: v1 metadata: diff --git a/bitnami/mxnet/templates/scheduler-deployment.yaml b/bitnami/mxnet/templates/scheduler-deployment.yaml index feef3f7842..727b7e2c80 100644 --- a/bitnami/mxnet/templates/scheduler-deployment.yaml +++ b/bitnami/mxnet/templates/scheduler-deployment.yaml @@ -56,9 +56,9 @@ spec: - name: git-cloned-files mountPath: /app {{- end }} -{{- if .Values.initContainers }} -{{ toYaml .Values.initContainers | indent 6 }} -{{- end }} + {{- if .Values.initContainers }} + {{- toYaml .Values.initContainers | nindent 6 }} + {{- end }} containers: - name: mxnet workingDir: {{ .Values.entrypoint.workDir }} @@ -68,7 +68,7 @@ spec: - bash - -c - | -{{ include "mxnet.entrypoint" . | indent 10 }} + {{- include "mxnet.entrypoint" . | nindent 10 }} env: - name: DMLC_ROLE value: "scheduler" @@ -82,12 +82,12 @@ spec: fieldPath: status.podIP - name: DMLC_PS_ROOT_PORT value: {{ .Values.schedulerPort | quote }} -{{- if .Values.commonExtraEnvVars }} -{{ include "mxnet.parseEnvVars" .Values.commonExtraEnvVars | indent 8 }} -{{- end }} -{{- if .Values.schedulerExtraEnvVars }} -{{ include "mxnet.parseEnvVars" .Values.schedulerExtraVars | indent 8 }} -{{- end }} + {{- if .Values.commonExtraEnvVars }} + {{- include "mxnet.parseEnvVars" .Values.commonExtraEnvVars | nindent 8 }} + {{- end }} + {{- if .Values.schedulerExtraEnvVars }} + {{- include "mxnet.parseEnvVars" .Values.schedulerExtraVars | nindent 8 }} + {{- end }} ports: - name: mxnet containerPort: {{ .Values.schedulerPort }} @@ -129,9 +129,9 @@ spec: - name: secret-data mountPath: /secrets {{- end }} -{{- if .Values.sidecars }} -{{ toYaml .Values.sidecars | indent 6 }} -{{- end }} + {{- if .Values.sidecars }} + {{- toYaml .Values.sidecars | nindent 6 }} + {{- end }} volumes: {{- if .Values.existingSecret }} - name: secret-data diff --git a/bitnami/mxnet/templates/server-statefulset.yml b/bitnami/mxnet/templates/server-statefulset.yml index a6de5ec73f..1d46fc4571 100644 --- a/bitnami/mxnet/templates/server-statefulset.yml +++ b/bitnami/mxnet/templates/server-statefulset.yml @@ -57,9 +57,9 @@ spec: - name: git-cloned-files mountPath: /app {{- end }} -{{- if .Values.initContainers }} -{{ toYaml .Values.initContainers | indent 6 }} -{{- end }} + {{- if .Values.initContainers }} + {{- toYaml .Values.initContainers | nindent 6 }} + {{- end }} containers: - name: mxnet workingDir: {{ .Values.entrypoint.workDir }} @@ -72,7 +72,7 @@ spec: SERVER_RANK=${POD_NAME##*-} ((SERVER_RANK++)) export SERVER_RANK -{{ include "mxnet.entrypoint" . | indent 10 }} + {{- include "mxnet.entrypoint" . | nindent 10 }} env: - name: POD_NAME valueFrom: @@ -88,12 +88,12 @@ spec: value: {{ include "mxnet.fullname" . }}-scheduler - name: DMLC_PS_ROOT_PORT value: {{ .Values.schedulerPort | quote }} -{{- if .Values.commonExtraEnvVars }} -{{ include "mxnet.parseEnvVars" .Values.commonExtraEnvVars | indent 8 }} -{{- end }} -{{- if .Values.serverExtraEnvVars }} -{{ include "mxnet.parseEnvVars" .Values.serverExtraVars | indent 8 }} -{{- end }} + {{- if .Values.commonExtraEnvVars }} + {{- include "mxnet.parseEnvVars" .Values.commonExtraEnvVars | nindent 8 }} + {{- end }} + {{- if .Values.serverExtraEnvVars }} + {{- include "mxnet.parseEnvVars" .Values.serverExtraVars | nindent 8 }} + {{- end }} {{- if .Values.livenessProbe.enabled }} livenessProbe: exec: @@ -138,9 +138,9 @@ spec: - name: secret-data mountPath: /secrets {{- end }} -{{- if .Values.sidecars }} -{{ toYaml .Values.sidecars | indent 6 }} -{{- end }} + {{- if .Values.sidecars }} + {{- toYaml .Values.sidecars | nindent 6 }} + {{- end }} volumes: {{- if .Values.existingSecret }} - name: secret-data diff --git a/bitnami/mxnet/templates/standalone-deployment.yaml b/bitnami/mxnet/templates/standalone-deployment.yaml index ca79a3d6b8..d8fb841dc0 100644 --- a/bitnami/mxnet/templates/standalone-deployment.yaml +++ b/bitnami/mxnet/templates/standalone-deployment.yaml @@ -56,9 +56,9 @@ spec: - name: git-cloned-files mountPath: /app {{- end }} -{{- if .Values.initContainers }} -{{ toYaml .Values.initContainers | indent 6 }} -{{- end }} + {{- if .Values.initContainers }} + {{- toYaml .Values.initContainers | nindent 6 }} + {{- end }} containers: - name: mxnet workingDir: {{ .Values.entrypoint.workDir }} @@ -68,11 +68,11 @@ spec: - bash - -c - | -{{ include "mxnet.entrypoint" . | indent 10 }} + {{- include "mxnet.entrypoint" . | nindent 10 }} env: -{{- if .Values.commonExtraEnvVars }} -{{ include "mxnet.parseEnvVars" .Values.commonExtraEnvVars | indent 8 }} -{{- end }} + {{- if .Values.commonExtraEnvVars }} + {{- include "mxnet.parseEnvVars" .Values.commonExtraEnvVars | nindent 8 }} + {{- end }} ports: - name: mxnet containerPort: {{ .Values.schedulerPort }} @@ -120,9 +120,9 @@ spec: - name: secret-data mountPath: /secrets {{- end }} -{{- if .Values.sidecars }} -{{ toYaml .Values.sidecars | indent 6 }} -{{- end }} + {{- if .Values.sidecars }} + {{- toYaml .Values.sidecars | nindent 6 }} + {{- end }} volumes: {{- if .Values.existingSecret }} - name: secret-data diff --git a/bitnami/mxnet/templates/worker-statefulset.yml b/bitnami/mxnet/templates/worker-statefulset.yml index 9394023700..f73352f7a8 100644 --- a/bitnami/mxnet/templates/worker-statefulset.yml +++ b/bitnami/mxnet/templates/worker-statefulset.yml @@ -57,9 +57,9 @@ spec: - name: git-cloned-files mountPath: /app {{- end }} -{{- if .Values.initContainers }} -{{ toYaml .Values.initContainers | indent 6 }} -{{- end }} + {{- if .Values.initContainers }} + {{- toYaml .Values.initContainers | nindent 6 }} + {{- end }} containers: - name: mxnet workingDir: {{ .Values.entrypoint.workDir }} @@ -72,7 +72,7 @@ spec: WORKER_RANK=${POD_NAME##*-} ((WORKER_RANK++)) export WORKER_RANK -{{ include "mxnet.entrypoint" . | indent 10 }} + {{- include "mxnet.entrypoint" . | nindent 10 }} env: - name: POD_NAME valueFrom: @@ -88,12 +88,12 @@ spec: value: {{ include "mxnet.fullname" . }}-scheduler - name: DMLC_PS_ROOT_PORT value: {{ .Values.schedulerPort | quote }} -{{- if .Values.commonExtraEnvVars }} -{{ include "mxnet.parseEnvVars" .Values.commonExtraEnvVars | indent 8 }} -{{- end }} -{{- if .Values.workerExtraEnvVars }} -{{ include "mxnet.parseEnvVars" .Values.workerExtraVars | indent 8 }} -{{- end }} + {{- if .Values.commonExtraEnvVars }} + {{- include "mxnet.parseEnvVars" .Values.commonExtraEnvVars | nindent 8 }} + {{- end }} + {{- if .Values.workerExtraEnvVars }} + {{- include "mxnet.parseEnvVars" .Values.workerExtraVars | nindent 8 }} + {{- end }} {{- if .Values.livenessProbe.enabled }} livenessProbe: exec: @@ -138,9 +138,9 @@ spec: - name: secret-data mountPath: /secrets {{- end }} -{{- if .Values.sidecars }} -{{ toYaml .Values.sidecars | indent 6 }} -{{- end }} + {{- if .Values.sidecars }} + {{- toYaml .Values.sidecars | nindent 6 }} + {{- end }} volumes: {{- if .Values.existingSecret }} - name: secret-data diff --git a/bitnami/mxnet/values-production.yaml b/bitnami/mxnet/values-production.yaml index 27e6eee88f..291a6ab992 100644 --- a/bitnami/mxnet/values-production.yaml +++ b/bitnami/mxnet/values-production.yaml @@ -13,7 +13,7 @@ image: registry: docker.io repository: bitnami/mxnet - tag: 1.4.0-r0 + tag: 1.4.0-debian-9-r0 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -37,8 +37,8 @@ image: git: registry: docker.io repository: bitnami/git - tag: latest - pullPolicy: Always + tag: 2.21.0-debian-9-r73 + pullPolicy: IfNotPresent ## Optionally specify an array of imagePullSecrets. ## Secrets must be manually created in the namespace. ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ diff --git a/bitnami/mxnet/values.yaml b/bitnami/mxnet/values.yaml index e1ee43ae5a..dec39674ac 100644 --- a/bitnami/mxnet/values.yaml +++ b/bitnami/mxnet/values.yaml @@ -13,7 +13,7 @@ image: registry: docker.io repository: bitnami/mxnet - tag: 1.4.0-r0 + tag: 1.4.0-debian-9-r0 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images @@ -37,8 +37,8 @@ image: git: registry: docker.io repository: bitnami/git - tag: latest - pullPolicy: Always + tag: 2.21.0-debian-9-r73 + pullPolicy: IfNotPresent ## Optionally specify an array of imagePullSecrets. ## Secrets must be manually created in the namespace. ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ From dfcaff0877b84c0e294e7c35a1415aff7a49c1a9 Mon Sep 17 00:00:00 2001 From: Javier Salmeron Garcia Date: Thu, 30 May 2019 11:44:41 +0200 Subject: [PATCH 3/9] Apply requested changes Signed-off-by: Javier Salmeron Garcia --- bitnami/mxnet/README.md | 6 ++--- bitnami/mxnet/templates/NOTES.txt | 6 ++--- bitnami/mxnet/templates/configmap.yaml | 2 +- .../mxnet/templates/scheduler-deployment.yaml | 22 ++++++++--------- .../mxnet/templates/server-statefulset.yml | 20 +++++++--------- .../templates/standalone-deployment.yaml | 18 +++++++------- .../mxnet/templates/worker-statefulset.yml | 24 +++++++++---------- 7 files changed, 45 insertions(+), 53 deletions(-) diff --git a/bitnami/mxnet/README.md b/bitnami/mxnet/README.md index 39d57477fc..a779bec5c1 100644 --- a/bitnami/mxnet/README.md +++ b/bitnami/mxnet/README.md @@ -80,9 +80,9 @@ The following table lists the configurable parameters of the MinIO chart and the | `sidecars` | Attach additional containers to the pods (scheduler, worker and server nodes) | `nil` | | `initContainers` | Attach additional init containers to the pods (scheduler, worker and server nodes) | `nil` | | `existingSecret` | Name of a secret with sensitive data to mount in the pods | `nil` | -| `nodeSelector` | Node labels for pod assignment | `{}` | -| `tolerations` | Toleration labels for pod assignment | `[]` | -| `affinity` | Map of node/pod affinities | `{}` | +| `nodeSelector` | Node labels for pod assignment (this value is evaluated as a template) | `{}` | +| `tolerations` | Toleration labels for pod assignment (this value is evaluated as a template) | `[]` | +| `affinity` | Map of node/pod affinities (this value is evaluated as a template) | `{}` | | `resources` | Pod resources | `{}` | | `securityContext.enabled` | Enable security context | `true` | | `securityContext.fsGroup` | Group ID for the container | `1001` | diff --git a/bitnami/mxnet/templates/NOTES.txt b/bitnami/mxnet/templates/NOTES.txt index 7fcd73eeb1..fffab4ea59 100644 --- a/bitnami/mxnet/templates/NOTES.txt +++ b/bitnami/mxnet/templates/NOTES.txt @@ -1,4 +1,4 @@ -{{- if or (.Values.configMap) (.Files.Glob "files/*") (.Values.cloneFilesFromGit.enabled) }} +{{- if or .Values.configMap (.Files.Glob "files/*") .Values.cloneFilesFromGit.enabled }} {{- if .Values.entrypoint.file }} The provided file {{ .Values.entrypoint.file }} is being executed. You can see the logs of each running node with: kubectl logs [POD_NAME] @@ -7,7 +7,7 @@ and the list of pods: kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "mxnet.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" {{- else }} You didn't specify any entrypoint to your code. -To run it, you can either deploy again using the `mxnet.entrypoint.file` option to specify your entrypoint, or execute it manually by jumping into the pods: +To run it, you can either re-deploy the chart using the `mxnet.entrypoint.file` option to specify your entrypoint, or execute it manually by jumping into the pods: 1. Get the running pods kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "mxnet.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" @@ -32,7 +32,7 @@ This chart allows three different methods to load your files: 2. Putting your files in a `files` folder in the root of the Chart. 3. Cloning a Git repository with the `cloneFilesFromGit` option. -Examples for the different methods can be found in the README. +Examples for the different methods can be found in the README (see https://github.com/bitnami/charts/blob/master/bitnami/mxnet/README.md). {{- end }} {{- if and (contains "bitnami/" .Values.image.repository) (not (.Values.image.tag | toString | regexFind "-r\\d+$|sha256:")) }} diff --git a/bitnami/mxnet/templates/configmap.yaml b/bitnami/mxnet/templates/configmap.yaml index 738ea7c78f..46a1694574 100644 --- a/bitnami/mxnet/templates/configmap.yaml +++ b/bitnami/mxnet/templates/configmap.yaml @@ -10,4 +10,4 @@ metadata: app.kubernetes.io/managed-by: {{ .Release.Service }} data: {{ (.Files.Glob "files/*").AsConfig | indent 2 }} -{{ end }} +{{- end }} diff --git a/bitnami/mxnet/templates/scheduler-deployment.yaml b/bitnami/mxnet/templates/scheduler-deployment.yaml index 727b7e2c80..6f1c10d8f0 100644 --- a/bitnami/mxnet/templates/scheduler-deployment.yaml +++ b/bitnami/mxnet/templates/scheduler-deployment.yaml @@ -8,7 +8,7 @@ metadata: helm.sh/chart: {{ include "mxnet.chart" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/component: "scheduler" + app.kubernetes.io/component: scheduler spec: replicas: 1 selector: @@ -31,14 +31,14 @@ spec: fsGroup: {{ .Values.securityContext.fsGroup }} runAsUser: {{ .Values.securityContext.runAsUser }} {{- end }} - {{- if .Values.nodeSelector }} - nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }} + {{- with .Values.nodeSelector }} + nodeSelector: {{ tpl (toYaml .) $ | nindent 8 }} {{- end }} - {{- if .Values.tolerations }} - tolerations: {{ toYaml .Values.tolerations | nindent 8 }} + {{- with .Values.tolerations }} + tolerations: {{ tpl (toYaml .) $ | nindent 8 }} {{- end }} - {{- if .Values.affinity }} - affinity: {{ toYaml .Values.affinity | nindent 8 }} + {{- with .Values.affinity }} + affinity: {{ tpl (toYaml .) $ | nindent 8 }} {{- end }} {{- if .Values.cloneFilesFromGit.enabled }} initContainers: @@ -49,9 +49,7 @@ spec: - /bin/sh - -c - | - git clone {{ .Values.cloneFilesFromGit.repository }} /app - cd /app - git checkout {{ .Values.cloneFilesFromGit.revision }} + git clone {{ .Values.cloneFilesFromGit.repository }} --branch {{ .Values.cloneFilesFromGit.revision }} /app volumeMounts: - name: git-cloned-files mountPath: /app @@ -125,10 +123,10 @@ spec: {{- end }} - name: data mountPath: {{ .Values.persistence.mountPath }} - {{- if .Values.existingSecret }} + {{- if .Values.existingSecret }} - name: secret-data mountPath: /secrets - {{- end }} + {{- end }} {{- if .Values.sidecars }} {{- toYaml .Values.sidecars | nindent 6 }} {{- end }} diff --git a/bitnami/mxnet/templates/server-statefulset.yml b/bitnami/mxnet/templates/server-statefulset.yml index 1d46fc4571..d0d7c2a623 100644 --- a/bitnami/mxnet/templates/server-statefulset.yml +++ b/bitnami/mxnet/templates/server-statefulset.yml @@ -8,7 +8,7 @@ metadata: helm.sh/chart: {{ include "mxnet.chart" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/component: "server" + app.kubernetes.io/component: server spec: podManagementPolicy: {{ .Values.podManagementPolicy }} selector: @@ -24,7 +24,7 @@ spec: app.kubernetes.io/name: {{ include "mxnet.name" . }} helm.sh/chart: {{ include "mxnet.chart" . }} app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/component: "server" + app.kubernetes.io/component: server spec: {{- include "mxnet.imagePullSecrets" . | nindent 6 }} {{- if .Values.securityContext.enabled }} @@ -32,14 +32,14 @@ spec: fsGroup: {{ .Values.securityContext.fsGroup }} runAsUser: {{ .Values.securityContext.runAsUser }} {{- end }} - {{- if .Values.nodeSelector }} - nodeSelector: {{ toYaml .Values.server.nodeSelector | nindent 8 }} + {{- with .Values.nodeSelector }} + nodeSelector: {{ tpl (toYaml .) $ | nindent 8 }} {{- end }} - {{- if .Values.tolerations }} - tolerations: {{ toYaml .Values.server.tolerations | nindent 8 }} + {{- with .Values.tolerations }} + tolerations: {{ tpl (toYaml .) $ | nindent 8 }} {{- end }} - {{- if .Values.affinity }} - affinity: {{ toYaml .Values.server.affinity | nindent 8 }} + {{- with .Values.affinity }} + affinity: {{ tpl (toYaml .) $ | nindent 8 }} {{- end }} {{- if .Values.cloneFilesFromGit.enabled }} initContainers: @@ -50,9 +50,7 @@ spec: - /bin/sh - -c - | - git clone {{ .Values.cloneFilesFromGit.repository }} /app - cd /app - git checkout {{ .Values.cloneFilesFromGit.revision }} + git clone {{ .Values.cloneFilesFromGit.repository }} --branch {{ .Values.cloneFilesFromGit.revision }} /app volumeMounts: - name: git-cloned-files mountPath: /app diff --git a/bitnami/mxnet/templates/standalone-deployment.yaml b/bitnami/mxnet/templates/standalone-deployment.yaml index d8fb841dc0..e3af50279e 100644 --- a/bitnami/mxnet/templates/standalone-deployment.yaml +++ b/bitnami/mxnet/templates/standalone-deployment.yaml @@ -23,7 +23,7 @@ spec: helm.sh/chart: {{ include "mxnet.chart" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/component: "standalone" + app.kubernetes.io/component: standalone spec: {{- include "mxnet.imagePullSecrets" . | nindent 6 }} {{- if .Values.securityContext.enabled }} @@ -31,14 +31,14 @@ spec: fsGroup: {{ .Values.securityContext.fsGroup }} runAsUser: {{ .Values.securityContext.runAsUser }} {{- end }} - {{- if .Values.nodeSelector }} - nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }} + {{- with .Values.nodeSelector }} + nodeSelector: {{ tpl (toYaml .) $ | nindent 8 }} {{- end }} - {{- if .Values.tolerations }} - tolerations: {{ toYaml .Values.tolerations | nindent 8 }} + {{- with .Values.tolerations }} + tolerations: {{ tpl (toYaml .) $ | nindent 8 }} {{- end }} - {{- if .Values.affinity }} - affinity: {{ toYaml .Values.affinity | nindent 8 }} + {{- with .Values.affinity }} + affinity: {{ tpl (toYaml .) $ | nindent 8 }} {{- end }} {{- if .Values.cloneFilesFromGit.enabled }} initContainers: @@ -49,9 +49,7 @@ spec: - /bin/sh - -c - | - git clone {{ .Values.cloneFilesFromGit.repository }} /app - cd /app - git checkout {{ .Values.cloneFilesFromGit.revision }} + git clone {{ .Values.cloneFilesFromGit.repository }} --branch {{ .Values.cloneFilesFromGit.revision }} /app volumeMounts: - name: git-cloned-files mountPath: /app diff --git a/bitnami/mxnet/templates/worker-statefulset.yml b/bitnami/mxnet/templates/worker-statefulset.yml index f73352f7a8..3db63b7178 100644 --- a/bitnami/mxnet/templates/worker-statefulset.yml +++ b/bitnami/mxnet/templates/worker-statefulset.yml @@ -24,7 +24,7 @@ spec: app.kubernetes.io/name: {{ include "mxnet.name" . }} helm.sh/chart: {{ include "mxnet.chart" . }} app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/component: "worker" + app.kubernetes.io/component: worker spec: {{- include "mxnet.imagePullSecrets" . | nindent 6 }} {{- if .Values.securityContext.enabled }} @@ -32,14 +32,14 @@ spec: fsGroup: {{ .Values.securityContext.fsGroup }} runAsUser: {{ .Values.securityContext.runAsUser }} {{- end }} - {{- if .Values.nodeSelector }} - nodeSelector: {{ toYaml .Values.server.nodeSelector | nindent 8 }} + {{- with .Values.nodeSelector }} + nodeSelector: {{ tpl (toYaml .) $ | nindent 8 }} {{- end }} - {{- if .Values.tolerations }} - tolerations: {{ toYaml .Values.server.tolerations | nindent 8 }} + {{- with .Values.tolerations }} + tolerations: {{ tpl (toYaml .) $ | nindent 8 }} {{- end }} - {{- if .Values.affinity }} - affinity: {{ toYaml .Values.server.affinity | nindent 8 }} + {{- with .Values.affinity }} + affinity: {{ tpl (toYaml .) $ | nindent 8 }} {{- end }} {{- if .Values.cloneFilesFromGit.enabled }} initContainers: @@ -50,9 +50,7 @@ spec: - /bin/sh - -c - | - git clone {{ .Values.cloneFilesFromGit.repository }} /app - cd /app - git checkout {{ .Values.cloneFilesFromGit.revision }} + git clone {{ .Values.cloneFilesFromGit.repository }} --branch {{ .Values.cloneFilesFromGit.revision }} /app volumeMounts: - name: git-cloned-files mountPath: /app @@ -134,13 +132,13 @@ spec: {{- end }} - name: data mountPath: {{ .Values.persistence.mountPath }} - {{- if .Values.existingSecret }} + {{- if .Values.existingSecret }} - name: secret-data mountPath: /secrets - {{- end }} + {{- end }} {{- if .Values.sidecars }} {{- toYaml .Values.sidecars | nindent 6 }} - {{- end }} + {{- end }} volumes: {{- if .Values.existingSecret }} - name: secret-data From 950ca9162b8c65cf4357054bef31c4e408a28d76 Mon Sep 17 00:00:00 2001 From: Javier Salmeron Garcia Date: Thu, 30 May 2019 12:05:36 +0200 Subject: [PATCH 4/9] Apply extra changes Signed-off-by: Javier Salmeron Garcia --- bitnami/mxnet/templates/scheduler-deployment.yaml | 4 ++-- bitnami/mxnet/templates/scheduler-service.yaml | 4 ++-- bitnami/mxnet/templates/server-statefulset.yml | 2 +- bitnami/mxnet/templates/standalone-deployment.yaml | 4 ++-- bitnami/mxnet/templates/worker-statefulset.yml | 4 ++-- bitnami/mxnet/values-production.yaml | 6 +++--- bitnami/mxnet/values.yaml | 6 +++--- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/bitnami/mxnet/templates/scheduler-deployment.yaml b/bitnami/mxnet/templates/scheduler-deployment.yaml index 6f1c10d8f0..3853d80bdc 100644 --- a/bitnami/mxnet/templates/scheduler-deployment.yaml +++ b/bitnami/mxnet/templates/scheduler-deployment.yaml @@ -15,7 +15,7 @@ spec: matchLabels: app.kubernetes.io/name: {{ include "mxnet.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/component: "scheduler" + app.kubernetes.io/component: scheduler template: metadata: labels: @@ -23,7 +23,7 @@ spec: helm.sh/chart: {{ include "mxnet.chart" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/component: "scheduler" + app.kubernetes.io/component: scheduler spec: {{- include "mxnet.imagePullSecrets" . | nindent 6 }} {{- if .Values.securityContext.enabled }} diff --git a/bitnami/mxnet/templates/scheduler-service.yaml b/bitnami/mxnet/templates/scheduler-service.yaml index d8c5d566c8..21335bf768 100644 --- a/bitnami/mxnet/templates/scheduler-service.yaml +++ b/bitnami/mxnet/templates/scheduler-service.yaml @@ -8,7 +8,7 @@ metadata: helm.sh/chart: {{ include "mxnet.chart" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/component: "scheduler" + app.kubernetes.io/component: scheduler spec: type: {{ .Values.service.type }} ports: @@ -18,5 +18,5 @@ spec: selector: app.kubernetes.io/name: {{ include "mxnet.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/component: "scheduler" + app.kubernetes.io/component: scheduler {{- end }} diff --git a/bitnami/mxnet/templates/server-statefulset.yml b/bitnami/mxnet/templates/server-statefulset.yml index d0d7c2a623..52103aec3c 100644 --- a/bitnami/mxnet/templates/server-statefulset.yml +++ b/bitnami/mxnet/templates/server-statefulset.yml @@ -15,7 +15,7 @@ spec: matchLabels: app.kubernetes.io/name: {{ include "mxnet.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/component: "server" + app.kubernetes.io/component: server replicas: {{ .Values.serverCount }} serviceName: {{ template "mxnet.fullname" . }}-headless template: diff --git a/bitnami/mxnet/templates/standalone-deployment.yaml b/bitnami/mxnet/templates/standalone-deployment.yaml index e3af50279e..fae98d8934 100644 --- a/bitnami/mxnet/templates/standalone-deployment.yaml +++ b/bitnami/mxnet/templates/standalone-deployment.yaml @@ -8,14 +8,14 @@ metadata: helm.sh/chart: {{ include "mxnet.chart" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/component: "standalone" + app.kubernetes.io/component: standalone spec: replicas: 1 selector: matchLabels: app.kubernetes.io/name: {{ include "mxnet.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/component: "standalone" + app.kubernetes.io/component: standalone template: metadata: labels: diff --git a/bitnami/mxnet/templates/worker-statefulset.yml b/bitnami/mxnet/templates/worker-statefulset.yml index 3db63b7178..1d2c112e80 100644 --- a/bitnami/mxnet/templates/worker-statefulset.yml +++ b/bitnami/mxnet/templates/worker-statefulset.yml @@ -8,7 +8,7 @@ metadata: helm.sh/chart: {{ include "mxnet.chart" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/component: "worker" + app.kubernetes.io/component: worker spec: podManagementPolicy: {{ .Values.podManagementPolicy }} serviceName: {{ template "mxnet.fullname" . }}-headless @@ -16,7 +16,7 @@ spec: matchLabels: app.kubernetes.io/name: {{ include "mxnet.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/component: "worker" + app.kubernetes.io/component: worker replicas: {{ .Values.workerCount }} template: metadata: diff --git a/bitnami/mxnet/values-production.yaml b/bitnami/mxnet/values-production.yaml index 291a6ab992..8531481851 100644 --- a/bitnami/mxnet/values-production.yaml +++ b/bitnami/mxnet/values-production.yaml @@ -115,17 +115,17 @@ cloneFilesFromGit: ## StatefulSet pod management policy podManagementPolicy: Parallel -## Node labels for pod assignment +## Node labels for pod assignment (this value is evaluated as a template) ## Ref: https://kubernetes.io/docs/user-guide/node-selection/ ## nodeSelector: {} -## Tolerations for pod assignment +## Tolerations for pod assignment (this value is evaluated as a template) ## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ ## tolerations: [] -## Affinity for pod assignment +## Affinity for pod assignment (this value is evaluated as a template) ## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity ## affinity: {} diff --git a/bitnami/mxnet/values.yaml b/bitnami/mxnet/values.yaml index dec39674ac..8eb5d42fa5 100644 --- a/bitnami/mxnet/values.yaml +++ b/bitnami/mxnet/values.yaml @@ -115,17 +115,17 @@ cloneFilesFromGit: ## StatefulSet pod management policy podManagementPolicy: Parallel -## Node labels for pod assignment +## Node labels for pod assignment (this value is evaluated as a template) ## Ref: https://kubernetes.io/docs/user-guide/node-selection/ ## nodeSelector: {} -## Tolerations for pod assignment +## Tolerations for pod assignment (this value is evaluated as a template) ## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ ## tolerations: [] -## Affinity for pod assignment +## Affinity for pod assignment (this value is evaluated as a template) ## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity ## affinity: {} From 5e0305f88521b9b322808f3aeda2e6516c6be9d2 Mon Sep 17 00:00:00 2001 From: Javier Salmeron Garcia Date: Thu, 30 May 2019 12:17:48 +0200 Subject: [PATCH 5/9] Correction in README Signed-off-by: Javier Salmeron Garcia --- bitnami/mxnet/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitnami/mxnet/README.md b/bitnami/mxnet/README.md index a779bec5c1..4b2d7ad475 100644 --- a/bitnami/mxnet/README.md +++ b/bitnami/mxnet/README.md @@ -60,7 +60,7 @@ The following table lists the configurable parameters of the MinIO chart and the | `git.tag` | Git image tag | `latest` | | `git.pullPolicy` | Git image pull policy | `Always` | | `git.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | -| service.type | Kubernetes service type | `ClusterIP` | +| `service.type` | Kubernetes service type | `ClusterIP` | | `entrypoint.file` | Main entrypoint to your application. If not speficied, it will be a `sleep infinity` command | `''` | | `entrypoint.args` | Args required by your entrypoint | `nil` | | `entrypoint.workDir` | Working directory for launching the entrypoint | `'/app'` | @@ -116,7 +116,7 @@ $ helm install --name my-release \ bitnami/mxnet ``` -The above command create 6 pods for MXNet: one scheduler, two servers and and three workers. +The above command creates 6 pods for MXNet: one scheduler, two servers, and three workers. Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example, From a64910af656e18d7eb90c6f35926608bfa117cad Mon Sep 17 00:00:00 2001 From: Javier Salmeron Garcia Date: Thu, 30 May 2019 14:58:42 +0200 Subject: [PATCH 6/9] Format table Signed-off-by: Javier Salmeron Garcia --- bitnami/mxnet/README.md | 50 ++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/bitnami/mxnet/README.md b/bitnami/mxnet/README.md index 4b2d7ad475..56d338faac 100644 --- a/bitnami/mxnet/README.md +++ b/bitnami/mxnet/README.md @@ -46,12 +46,12 @@ The command removes all the Kubernetes components associated with the chart and The following table lists the configurable parameters of the MinIO chart and their default values. | Parameter | Description | Default | -| ------------------------------------ | -------------------------------------------------------------------------------------------- | ------------------------------------------------------- | +|--------------------------------------|----------------------------------------------------------------------------------------------|---------------------------------------------------------| | `global.imageRegistry` | Global Docker image registry | `nil` | | `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | -| `image.registry` | MXNet image registry | `docker.io` | -| `image.repository` | MXNet image name | `bitnami/MXNet` | -| `image.tag` | MXNet image tag | `{VERSION}` | +| `image.registry` | MXNet image registry | `docker.io` | +| `image.repository` | MXNet image name | `bitnami/MXNet` | +| `image.tag` | MXNet image tag | `{VERSION}` | | `image.pullPolicy` | Image pull policy | `IfNotPresent` | | `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | | `image.debug` | Specify if debug logs should be enabled | `false` | @@ -60,29 +60,29 @@ The following table lists the configurable parameters of the MinIO chart and the | `git.tag` | Git image tag | `latest` | | `git.pullPolicy` | Git image pull policy | `Always` | | `git.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | -| `service.type` | Kubernetes service type | `ClusterIP` | -| `entrypoint.file` | Main entrypoint to your application. If not speficied, it will be a `sleep infinity` command | `''` | +| `service.type` | Kubernetes service type | `ClusterIP` | +| `entrypoint.file` | Main entrypoint to your application. If not speficied, it will be a `sleep infinity` command | `''` | | `entrypoint.args` | Args required by your entrypoint | `nil` | -| `entrypoint.workDir` | Working directory for launching the entrypoint | `'/app'` | -| `podManagementPolicy` | StatefulSet (worker and server nodes) pod management policy | `Parallel` | -| `mode` | Run MXNet in standalone or distributed mode (possible values: `standalone`, `distributed`) | `standalone` | -| `serverCount` | Number of server nodes that will execute your code | `1` | -| `workerCount` | Number of worker nodes that will execute your code | `1` | -| `schedulerPort` | MXNet scheduler port (only for distributed mode) | `49875` | -| `configMap` | Config map that contains the files you want to load in MXNet | `nil` | +| `entrypoint.workDir` | Working directory for launching the entrypoint | `'/app'` | +| `podManagementPolicy` | StatefulSet (worker and server nodes) pod management policy | `Parallel` | +| `mode` | Run MXNet in standalone or distributed mode (possible values: `standalone`, `distributed`) | `standalone` | +| `serverCount` | Number of server nodes that will execute your code | `1` | +| `workerCount` | Number of worker nodes that will execute your code | `1` | +| `schedulerPort` | MXNet scheduler port (only for distributed mode) | `49875` | +| `configMap` | Config map that contains the files you want to load in MXNet | `nil` | | `cloneFilesFromGit.enabled` | Enable in order to download files from git repository | `false` | | `cloneFilesFromGit.repository` | Repository that holds the files | `nil` | | `cloneFilesFromGit.revision` | Revision from the repository to checkout | `master` | -| `commonExtraEnvVars` | Extra environment variables to add to server, scheduler and worker nodes | `nil` | -| `workerExtraEnvVars` | Extra environment variables to add to the worker nodes | `nil` | -| `serverExtraEnvVars` | Extra environment variables to add to the server nodes | `nil` | -| `schedulerExtraEnvVars` | Extra environment variables to add to the scheduler node | `nil` | -| `sidecars` | Attach additional containers to the pods (scheduler, worker and server nodes) | `nil` | -| `initContainers` | Attach additional init containers to the pods (scheduler, worker and server nodes) | `nil` | -| `existingSecret` | Name of a secret with sensitive data to mount in the pods | `nil` | -| `nodeSelector` | Node labels for pod assignment (this value is evaluated as a template) | `{}` | -| `tolerations` | Toleration labels for pod assignment (this value is evaluated as a template) | `[]` | -| `affinity` | Map of node/pod affinities (this value is evaluated as a template) | `{}` | +| `commonExtraEnvVars` | Extra environment variables to add to server, scheduler and worker nodes | `nil` | +| `workerExtraEnvVars` | Extra environment variables to add to the worker nodes | `nil` | +| `serverExtraEnvVars` | Extra environment variables to add to the server nodes | `nil` | +| `schedulerExtraEnvVars` | Extra environment variables to add to the scheduler node | `nil` | +| `sidecars` | Attach additional containers to the pods (scheduler, worker and server nodes) | `nil` | +| `initContainers` | Attach additional init containers to the pods (scheduler, worker and server nodes) | `nil` | +| `existingSecret` | Name of a secret with sensitive data to mount in the pods | `nil` | +| `nodeSelector` | Node labels for pod assignment (this value is evaluated as a template) | `{}` | +| `tolerations` | Toleration labels for pod assignment (this value is evaluated as a template) | `[]` | +| `affinity` | Map of node/pod affinities (this value is evaluated as a template) | `{}` | | `resources` | Pod resources | `{}` | | `securityContext.enabled` | Enable security context | `true` | | `securityContext.fsGroup` | Group ID for the container | `1001` | @@ -99,8 +99,8 @@ The following table lists the configurable parameters of the MinIO chart and the | `readinessProbe.timeoutSeconds` | When the probe times out | `1` | | `readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed. | `1` | | `readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | `5` | -| `persistence.enabled` | Use a PVC to persist data | `false` | -| `persistence.mountPath` | Path to mount the volume at | `/bitnami/mxnet` | +| `persistence.enabled` | Use a PVC to persist data | `false` | +| `persistence.mountPath` | Path to mount the volume at | `/bitnami/mxnet` | | `persistence.storageClass` | Storage class of backing PVC | `nil` (uses alpha storage class annotation) | | `persistence.accessMode` | Use volume as ReadOnly or ReadWrite | `ReadWriteOnce` | | `persistence.size` | Size of data volume | `8Gi` | From 9e670dbb1db7e35a2e60506608fa07813fd7fa8e Mon Sep 17 00:00:00 2001 From: Javier Salmeron Garcia Date: Mon, 3 Jun 2019 12:44:53 +0200 Subject: [PATCH 7/9] Change container version Signed-off-by: Javier Salmeron Garcia --- bitnami/mxnet/values-production.yaml | 2 +- bitnami/mxnet/values.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bitnami/mxnet/values-production.yaml b/bitnami/mxnet/values-production.yaml index 8531481851..2d43d3c5e7 100644 --- a/bitnami/mxnet/values-production.yaml +++ b/bitnami/mxnet/values-production.yaml @@ -13,7 +13,7 @@ image: registry: docker.io repository: bitnami/mxnet - tag: 1.4.0-debian-9-r0 + tag: 1.4.1-debian-9-r0 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images diff --git a/bitnami/mxnet/values.yaml b/bitnami/mxnet/values.yaml index 8eb5d42fa5..1fd1e86319 100644 --- a/bitnami/mxnet/values.yaml +++ b/bitnami/mxnet/values.yaml @@ -13,7 +13,7 @@ image: registry: docker.io repository: bitnami/mxnet - tag: 1.4.0-debian-9-r0 + tag: 1.4.1-debian-9-r0 ## Specify a imagePullPolicy ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' ## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images From 729a3891df5bebb3e8dea4ae2d64aeaced149327 Mon Sep 17 00:00:00 2001 From: Javier Salmeron Garcia Date: Mon, 3 Jun 2019 15:36:16 +0200 Subject: [PATCH 8/9] Add MXNet in README page Signed-off-by: Javier Salmeron Garcia --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 67f566a877..67f023e1d3 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ $ helm search bitnami - [Kubeapps](https://github.com/bitnami/charts/tree/master/bitnami/kubeapps) - [Memcached](https://github.com/bitnami/charts/tree/master/bitnami/memcached) - [Metrics Server](https://github.com/bitnami/charts/tree/master/bitnami/metrics-server) +- [MXNet](https://github.com/bitnami/charts/tree/master/bitnami/mxnet) - [MySQL](https://github.com/bitnami/charts/tree/master/bitnami/mysql) - [nginx](https://github.com/bitnami/charts/tree/master/bitnami/nginx) - [nginx-ingress-controller](https://github.com/bitnami/charts/tree/master/bitnami/nginx-ingress-controller) From 3413cd2b269ec80b5212157b318df271ded83cbc Mon Sep 17 00:00:00 2001 From: Javier Salmeron Garcia Date: Mon, 3 Jun 2019 16:24:57 +0200 Subject: [PATCH 9/9] Increase timeouts in liveness and readiness probes Signed-off-by: Javier Salmeron Garcia --- bitnami/mxnet/values-production.yaml | 4 ++-- bitnami/mxnet/values.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bitnami/mxnet/values-production.yaml b/bitnami/mxnet/values-production.yaml index 2d43d3c5e7..b99997ccbe 100644 --- a/bitnami/mxnet/values-production.yaml +++ b/bitnami/mxnet/values-production.yaml @@ -150,14 +150,14 @@ livenessProbe: enabled: true initialDelaySeconds: 5 periodSeconds: 5 - timeoutSeconds: 5 + timeoutSeconds: 15 successThreshold: 1 failureThreshold: 5 readinessProbe: enabled: true initialDelaySeconds: 5 periodSeconds: 5 - timeoutSeconds: 5 + timeoutSeconds: 15 successThreshold: 1 failureThreshold: 5 diff --git a/bitnami/mxnet/values.yaml b/bitnami/mxnet/values.yaml index 1fd1e86319..88639bb36d 100644 --- a/bitnami/mxnet/values.yaml +++ b/bitnami/mxnet/values.yaml @@ -150,14 +150,14 @@ livenessProbe: enabled: true initialDelaySeconds: 5 periodSeconds: 5 - timeoutSeconds: 5 + timeoutSeconds: 15 successThreshold: 1 failureThreshold: 5 readinessProbe: enabled: true initialDelaySeconds: 5 periodSeconds: 5 - timeoutSeconds: 5 + timeoutSeconds: 15 successThreshold: 1 failureThreshold: 5