Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ jobs:
python -m pip install .
- name: "Build documentation and check for consistency"
env:
CHECKSUM: "47721124c7689e9138ec656aecb30367fe9571fc088748e8b802df4aba5ba465"
CHECKSUM: "3b6dab7d80523dce07afcea3a0a0a8b55ca1040398630240fe681fa58b44fc57"
run: |
cd docs
HASH="$(make checksum | tail -n1)"
Expand Down
4 changes: 2 additions & 2 deletions helm/chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: streamflow
description: A Helm chart for StreamFlow
description: A Helm chart for the StreamFlow workflow management system
type: application
version: 0.2.0
appVersion: latest
appVersion: 0.2.0.dev11
43 changes: 40 additions & 3 deletions helm/chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
Expand the name of the chart
*/}}
{{- define "streamflow.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
Expand All @@ -9,7 +9,7 @@ Expand the name of the chart.
{{/*
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.
If release name contains chart name it will be used as a full name
*/}}
{{- define "streamflow.fullname" -}}
{{- if .Values.fullnameOverride -}}
Expand All @@ -25,12 +25,49 @@ If release name contains chart name it will be used as a full name.
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
Create chart name and version as used by the chart label
*/}}
{{- define "streamflow.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Return the proper StreamFlow image name
*/}}
{{- define "streamflow.image" -}}
{{- $registryName := default .Values.image.registry -}}
{{- $repositoryName := .Values.image.repository -}}
{{- $separator := ":" -}}
{{- $termination := default .Chart.AppVersion .Values.image.tag | toString -}}

{{- if not .Values.image.tag }}
{{- if .Chart }}
{{- $termination = .Chart.AppVersion | toString -}}
{{- end -}}
{{- end -}}
{{- if .Values.image.digest }}
{{- $separator = "@" -}}
{{- $termination = .Values.image.digest | toString -}}
{{- end -}}
{{- if $registryName }}
{{- printf "%s/%s%s%s" $registryName $repositoryName $separator $termination -}}
{{- else -}}
{{- printf "%s%s%s" $repositoryName $separator $termination -}}
{{- end -}}
{{- end -}}

{{/*
Return the proper Docker Image Registry Secret Names evaluating values as templates
*/}}
{{- define "streamflow.imagePullSecrets" -}}
{{- if (not (empty .Values.image.pullSecrets)) -}}
imagePullSecrets:
{{- range .Values.image.pullSecrets | uniq }}
- name: {{ . }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Common labels
*/}}
Expand Down
36 changes: 36 additions & 0 deletions helm/chart/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "streamflow.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "streamflow.labels" . | nindent 4 }}
data:
streamflow.yml: |-
version: v1.0
workflows:
{{ .Values.streamflow.workflow.name | default uuidv4 }}:
type: {{ .Values.streamflow.workflow.type }}
{{- if .Values.streamflow.workflow.bindings }}
{{- with .Values.streamflow.workflow.bindings }}
bindings:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- end }}
config:
{{- if eq .Values.streamflow.workflow.type "cwl" }}
file: {{ required "CWL processfile is mandatory" .Values.streamflow.workflow.cwl.processfile }}
{{- if .Values.streamflow.workflow.cwl.jobfile }}
settings: {{ .Values.streamflow.workflow.cwl.jobfile }}
{{- end }}
docker:
- step: /
deployment:
type: kubernetes
config:
inCluster: true
networkPolicy: {{ .Values.streamflow.workflow.cwl.restrictNetworkAccess }}
{{- end }}
{{- if .Values.streamflow.config }}
{{- toYaml .Values.streamflow.config | nindent 4 }}
{{- end }}
63 changes: 49 additions & 14 deletions helm/chart/templates/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,67 @@ spec:
labels:
{{- include "streamflow.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "streamflow.serviceAccountName" . }}
{{- include "streamflow.imagePullSecrets" . | nindent 6 }}
{{- if .Values.podSecurityContext.enabled }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
- name: {{ include "streamflow.fullname" . }}
{{- if .Values.containerSecurityContext.enabled }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
{{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }}
{{- end }}
image: {{ include "streamflow.image" . }}
{{- if .Values.command }}
command: {{ .Values.command }}
{{- end }}
{{- if .Values.args }}
args: {{ .Values.args }}
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.resources }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- end }}
volumeMounts:
- name: streamflow-config
mountPath: /streamflow/results/streamflow.yml
subPath: streamflow.yml
- name: streamflow-metadata
mountPath: /.streamflow
- name: streamflow-outdir
mountPath: /tmp/streamflow
- name: streamflow-workdir
mountPath: /streamflow/results
{{ if .Values.restartPolicy }}
restartPolicy: {{ .Values.restartPolicy }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
volumes:
- name: streamflow-metadata
{{- if .Values.persistence.metadata }}
{{ toYaml .Values.persistence.metadata | nindent 10}}
{{- else }}
emptyDir: {}
{{- end }}
- name: streamflow-outdir
{{- if .Values.persistence.outdir }}
{{ toYaml .Values.persistence.outdir | nindent 10}}
{{- else }}
emptyDir: {}
{{- end }}
- name: streamflow-workdir
{{- if .Values.persistence.workdir }}
{{ toYaml .Values.persistence.workdir | nindent 10}}
{{- else }}
emptyDir: {}
{{- end }}
34 changes: 34 additions & 0 deletions helm/chart/templates/role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "streamflow.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "streamflow.labels" . | nindent 4 }}
rules:
- verbs:
- get
- watch
- list
- create
- delete
apiGroups:
- ''
resources:
- pods
- pods/exec
{{- if eq .Values.streamflow.workflow.type "cwl" }}
{{- if .Values.streamflow.workflow.restrictNetworkAccess }}
- verbs:
- get
- list
- create
- delete
apiGroups:
- networking.k8s.io
resources:
- networkpolicies
{{- end }}
{{- end }}
{{- end }}
17 changes: 17 additions & 0 deletions helm/chart/templates/rolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "streamflow.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "streamflow.labels" . | nindent 4 }}
roleRef:
kind: Role
name: {{ include "streamflow.fullname" . }}
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: {{ include "streamflow.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
1 change: 1 addition & 0 deletions helm/chart/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ metadata:
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
{{- end -}}
Loading
Loading