From 6ce7c67a27138bf472e914083223388b7dc43811 Mon Sep 17 00:00:00 2001
From: Martin Weise <martin.weise@tuwien.ac.at>
Date: Thu, 2 Jan 2025 07:56:32 +0100
Subject: [PATCH] Need different directory for cache

---
 dbrepo-storage-service/init/Dockerfile | 2 ++
 dbrepo-storage-service/init/init.sh    | 4 ++--
 helm/dbrepo/templates/storage-job.yaml | 2 +-
 helm/dbrepo/values.yaml                | 2 +-
 4 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/dbrepo-storage-service/init/Dockerfile b/dbrepo-storage-service/init/Dockerfile
index 4f4f0c7974..2521637549 100644
--- a/dbrepo-storage-service/init/Dockerfile
+++ b/dbrepo-storage-service/init/Dockerfile
@@ -10,4 +10,6 @@ WORKDIR /app
 
 COPY --chown=1001 --chmod=0744 ./init.sh /app/init.sh
 
+RUN mkdir -p /app/config
+
 ENTRYPOINT [ "bash", "-c", "/app/init.sh" ]
diff --git a/dbrepo-storage-service/init/init.sh b/dbrepo-storage-service/init/init.sh
index 4cadc05677..50ead671db 100644
--- a/dbrepo-storage-service/init/init.sh
+++ b/dbrepo-storage-service/init/init.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-cat << EOF > /app/.s3cfg
+cat << EOF > /app/config/.s3cfg
 access_key = ${S3_ACCESS_KEY_ID}
 secret_key = ${S3_SECRET_ACCESS_KEY}
 # Setup endpoint
@@ -9,4 +9,4 @@ use_https = False
 # Enable S3 v4 signature APIs
 signature_v2 = False
 EOF
-s3cmd --config=/app/.s3cfg mb s3://${S3_BUCKET}
\ No newline at end of file
+s3cmd --config=/app/config/.s3cfg mb s3://${S3_BUCKET}
\ No newline at end of file
diff --git a/helm/dbrepo/templates/storage-job.yaml b/helm/dbrepo/templates/storage-job.yaml
index f24e9afa33..92174539af 100644
--- a/helm/dbrepo/templates/storage-job.yaml
+++ b/helm/dbrepo/templates/storage-job.yaml
@@ -50,7 +50,7 @@ spec:
                   key: STORAGE_ENDPOINT
           volumeMounts:
             - name: app-cache
-              mountPath: /app
+              mountPath: /app/config
           {{- if .Values.storageservice.init.resources }}
           resources: {{- toYaml .Values.storageservice.init.resources | nindent 12 }}
           {{- else if ne .Values.storageservice.init.resourcesPreset "none" }}
diff --git a/helm/dbrepo/values.yaml b/helm/dbrepo/values.yaml
index 9ac022cdf1..9119a13dd5 100644
--- a/helm/dbrepo/values.yaml
+++ b/helm/dbrepo/values.yaml
@@ -721,7 +721,7 @@ storageservice:
   init:
     image:
       ## @skip storageservice.init.image.name
-      name: registry.datalab.tuwien.ac.at/dbrepo/storage-service-init:1.6.0rc2
+      name: registry.datalab.tuwien.ac.at/dbrepo/storage-service-init:1.6.0rc6
     s3:
       ## @param storageservice.init.s3.endpoint The S3-capable endpoint the microservice connects to.
       endpoint: http://storage-service-s3:8333
-- 
GitLab