From 2053afc8461dfb9ad8bd46d907c32daf68e033c2 Mon Sep 17 00:00:00 2001 From: Ben Eggers Date: Mon, 18 Mar 2024 16:57:37 -0700 Subject: [PATCH] [ENH] Run the sysdb migration in sh so we can do env var substitition --- go/Dockerfile.migration | 9 +++++++-- k8s/distributed-chroma/templates/sysdb-migration.yaml | 9 ++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/go/Dockerfile.migration b/go/Dockerfile.migration index b93e9cb01c4..c7f230cfa2e 100644 --- a/go/Dockerfile.migration +++ b/go/Dockerfile.migration @@ -1,4 +1,9 @@ -FROM arigaio/atlas:latest -workdir /app +FROM debian:bookworm-slim + +RUN apt update +RUN apt upgrade -y +RUN apt install -y curl +RUN curl -sSf https://atlasgo.sh | sh -s -- --community + COPY ./go/migrations migrations COPY ./go/atlas.hcl atlas.hcl diff --git a/k8s/distributed-chroma/templates/sysdb-migration.yaml b/k8s/distributed-chroma/templates/sysdb-migration.yaml index bb99bb77657..dc62d157603 100644 --- a/k8s/distributed-chroma/templates/sysdb-migration.yaml +++ b/k8s/distributed-chroma/templates/sysdb-migration.yaml @@ -11,11 +11,10 @@ spec: spec: restartPolicy: OnFailure containers: - - args: - - 'migrate' - - 'apply' - - '--url' - - "postgres://{{ .Values.sysdbMigration.username }}:{{ .Values.sysdbMigration.password }}@{{ .Values.sysdbMigration.netloc }}:{{ .Values.sysdbMigration.port }}/{{ .Values.sysdbMigration.dbName }}?sslmode={{ .Values.sysdbMigration.sslmode }}" + - command: + - "/bin/sh" + - "-c" + - "atlas migrate apply --url postgres://{{ .Values.sysdbMigration.username }}:{{ .Values.sysdbMigration.password }}@{{ .Values.sysdbMigration.netloc }}:{{ .Values.sysdbMigration.port }}/{{ .Values.sysdbMigration.dbName }}?sslmode={{ .Values.sysdbMigration.sslmode }}" image: "{{ .Values.sysdbMigration.image.repository }}:{{ .Values.sysdbMigration.image.tag }}" imagePullPolicy: IfNotPresent name: migration