Make the StatefulSets start and stop faster.
[arvados-k8s.git] / charts / arvados / templates / slurm-compute-deployment.yaml
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: Apache-2.0
4
5 apiVersion: apps/v1
6 kind: StatefulSet
7 metadata:
8   name: "arvados-slurm-compute"
9   labels:
10     app: arvados-slurm-compute
11     chart: {{ template "arvados.chart" . }}
12     release: {{ .Release.Name }}
13     heritage: {{ .Release.Service }}
14 spec:
15   replicas: 4
16   podManagementPolicy: Parallel
17   serviceName: arvados-slurm-compute
18   selector:
19     matchLabels:
20       app: arvados-slurm-compute
21       release: {{ .Release.Name }}
22   template:
23     metadata:
24       labels:
25         app: arvados-slurm-compute
26         release: {{ .Release.Name }}
27     spec:
28       terminationGracePeriodSeconds: 1
29       containers:
30         - name: {{ .Chart.Name }}
31           hostname: arvados-slurm-compute
32           image: "cure/arvados-slurm-runtime"
33           imagePullPolicy: {{ .Values.image.pullPolicy }}
34           command:
35             - "sh"
36             - "-c"
37             - "/usr/local/bin/bootstrap.sh python-arvados-python-client={{ .Values.arvados.versions.distribution.pythonArvadosPythonClient }} crunch-run={{ .Values.arvados.versions.distribution.crunchRun }} python-arvados-fuse={{ .Values.arvados.versions.distribution.pythonArvadosFuse }} && mkdir /munge && cp -p /etc/munge/munge.key /munge && chown munge:munge /munge/munge.key && mkdir /var/slurm && chmod 700 /var/slurm && sudo -u munge munged --key-file=/munge/munge.key && /etc/init.d/docker start && slurmd -D"
38           securityContext:
39             privileged: true
40           env:
41             - name : ARVADOS_API_HOST
42               value: "{{ .Values.externalIP }}:444"
43             - name : ARVADOS_API_HOST_INSECURE
44               value: "true"
45             - name : ARVADOS_API_TOKEN
46               value: "{{ .Values.superUserSecret }}"
47           volumeMounts:
48             - name: slurm-configmap
49               mountPath: /etc/slurm-llnl/slurm.conf
50               subPath: slurm.conf
51             - name: slurm-configmap
52               mountPath: /etc/munge/munge.key
53               subPath: munge.key
54             - name: docker-graph-storage
55               mountPath: /var/lib/docker
56
57       volumes:
58         - name: slurm-configmap
59           configMap:
60             name: slurm-configmap
61             defaultMode: 0400
62         - name: docker-graph-storage
63           emptyDir: {}
64
65 #            - "/usr/local/bin/bootstrap.sh crunch-dispatch-slurm={{ .Values.arvados.versions.distribution.crunchDispatchSlurm }} && chown munge /etc/munge/munge.key && chmod 0400 /etc/munge/munge.key && sudo -u munge munged && slurmctld -D && crunch-dispatch-slurm"
66 #            - "/usr/local/bin/bootstrap.sh crunch-dispatch-slurm={{ .Values.arvados.versions.distribution.crunchDispatchSlurm }} && sudo -u munge munged && slurmctld -D && crunch-dispatch-slurm"
67 #            - "/usr/local/bin/bootstrap.sh crunch-dispatch-slurm={{ .Values.arvados.versions.distribution.crunchDispatchSlurm }} && crunch-dispatch-slurm"
68
69 # for slurm client, compute node
70 #            - "/usr/local/bin/bootstrap.sh python-arvados-python-client={{ .Values.arvados.versions.distribution.pythonArvadosPythonClient }} crunch-run={{ .Values.arvados.versions.distribution.crunchRun }} python-arvados-fuse={{ .Values.arvados.versions.distribution.pythonArvadosFuse }} && chown munge /etc/munge/munge.key; chmod 0400 /etc/munge/munge.key; sudo -u munge munged && slurmd -D"