Skip to content

Commit

Permalink
[sub]chore(builder): waitPostgresqlInitContainer (#764)
Browse files Browse the repository at this point in the history
* fix: builder using builder SA (#754)

* fix: builder using builder SA

Signed-off-by: Guilhem Barthés <[email protected]>

* docs: changelog

Signed-off-by: Guilhem Barthés <[email protected]>

---------

Signed-off-by: Guilhem Barthés <[email protected]>

* chore(charts/substra-backend/templates/statefulset-builder): add init-container waitPostgresqlInitContainer

Signed-off-by: Thibault Camalon <[email protected]>

---------

Signed-off-by: Guilhem Barthés <[email protected]>
Signed-off-by: Thibault Camalon <[email protected]>
Co-authored-by: Guilhem Barthés <[email protected]>
  • Loading branch information
thbcmlowk and guilhem-barthes authored Oct 25, 2023
1 parent fdfca85 commit 0d0b58d
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 45 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Field `asset_type` on `AssetFailureReport` (based on protobuf enum `orchestrator.FailedAssetKind`) ([#727](https://github.com/Substra/substra-backend/pull/727))
- Celery task `FailableTask` that contains the logic to store the failure report, that can be re-used in different assets. ([#727](https://github.com/Substra/substra-backend/pull/727))
- Add `FunctionStatus` enum ([#714](https://github.com/Substra/orchestrator/pull/714))
- BREAKING: Add `status` on `api.Function` (type `FunctionStatus`) ([#714](https://github.com/Substra/substra-backend/pull/714))


### Changed

- `ComputeTaskFailureReport` renamed in `AssetFailureReport` ([#727](https://github.com/Substra/substra-backend/pull/727))
Expand Down
89 changes: 45 additions & 44 deletions charts/substra-backend/templates/statefulset-builder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,52 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ template "substra.fullname" . }}-builder
initContainers:
{{- include "common.waitPostgresqlInitContainer" . | nindent 6 }}
{{- if .Values.privateCa.enabled }}
- name: add-cert
image: {{ include "common.images.name" .Values.privateCa.image }}
imagePullPolicy: {{ .Values.privateCa.image.pullPolicy }}
securityContext:
runAsUser: 0
command: ['sh', '-c']
args:
- |
{{- if .Values.privateCa.image.apkAdd }}
apt update
apt install -y ca-certificates openssl
{{- end }}
update-ca-certificates && cp /etc/ssl/certs/* /tmp/certs/
volumeMounts:
- mountPath: /usr/local/share/ca-certificates/{{ .Values.privateCa.configMap.fileName }}
name: private-ca
subPath: {{ .Values.privateCa.configMap.fileName }}
- mountPath: /tmp/certs/
name: ssl-certs
{{- end }}
- name: wait-minio
image: jwilder/dockerize:0.6.1
command: ['dockerize', '-wait', 'tcp://{{ .Release.Name }}-minio:9000']
{{- if .Values.kaniko.cache.warmer.cachedImages }}
- name: kaniko-cache-warmer
image: {{ include "common.images.name" .Values.kaniko.cache.warmer.image }}
args:
- "--cache-dir=/cache"
{{- range .Values.kaniko.cache.warmer.cachedImages }}
- "--image={{ . }}"
{{- end }}
- "--verbosity=debug"
volumeMounts:
- name: docker-cache
mountPath: /cache
readOnly: False
{{- if .Values.kaniko.dockerConfigSecretName }}
- name: docker-config
mountPath: /kaniko/.docker
{{- end }}
{{- end }}
containers:
- name: builder
- name: builder
image: {{ include "substra-backend.images.name" (dict "img" .Values.builder.image "defaultTag" $.Chart.AppVersion) }}
imagePullPolicy: "{{ .Values.builder.image.pullPolicy }}"
command: ["/bin/bash", "-c"]
Expand Down Expand Up @@ -137,49 +181,6 @@ spec:
{{ end }}
resources:
{{- toYaml .Values.builder.resources | nindent 12 }}
initContainers:
{{- if .Values.privateCa.enabled }}
- name: add-cert
image: {{ include "common.images.name" .Values.privateCa.image }}
imagePullPolicy: {{ .Values.privateCa.image.pullPolicy }}
securityContext:
runAsUser: 0
command: ['sh', '-c']
args:
- |
{{- if .Values.privateCa.image.apkAdd }}
apt update
apt install -y ca-certificates openssl
{{- end }}
update-ca-certificates && cp /etc/ssl/certs/* /tmp/certs/
volumeMounts:
- mountPath: /usr/local/share/ca-certificates/{{ .Values.privateCa.configMap.fileName }}
name: private-ca
subPath: {{ .Values.privateCa.configMap.fileName }}
- mountPath: /tmp/certs/
name: ssl-certs
{{- end }}
- name: wait-minio
image: jwilder/dockerize:0.6.1
command: ['dockerize', '-wait', 'tcp://{{ .Release.Name }}-minio:9000']
{{- if .Values.kaniko.cache.warmer.cachedImages }}
- name: kaniko-cache-warmer
image: {{ include "common.images.name" .Values.kaniko.cache.warmer.image }}
args:
- "--cache-dir=/cache"
{{- range .Values.kaniko.cache.warmer.cachedImages }}
- "--image={{ . }}"
{{- end }}
- "--verbosity=debug"
volumeMounts:
- name: docker-cache
mountPath: /cache
readOnly: False
{{- if .Values.kaniko.dockerConfigSecretName }}
- name: docker-config
mountPath: /kaniko/.docker
{{- end }}
{{- end}}
volumes:
{{- if .Values.privateCa.enabled }}
- name: ssl-certs
Expand Down

0 comments on commit 0d0b58d

Please sign in to comment.