From ef859abc2f1aaaa429ab555808e4ef890281b096 Mon Sep 17 00:00:00 2001 From: Conor Brady Date: Tue, 19 Nov 2024 14:48:54 -0800 Subject: [PATCH] Address issues in pgslice job --- openshift/pgslice/docker/Dockerfile | 2 +- .../oc_provision_fill_partition_job.sh | 1 - openshift/templates/partition_filler_job.yaml | 79 +++++++++---------- 3 files changed, 40 insertions(+), 42 deletions(-) diff --git a/openshift/pgslice/docker/Dockerfile b/openshift/pgslice/docker/Dockerfile index 214dcabdb8..d45936432e 100644 --- a/openshift/pgslice/docker/Dockerfile +++ b/openshift/pgslice/docker/Dockerfile @@ -1,6 +1,6 @@ FROM ankane/pgslice:v0.6.1 -RUN apk update && apk add unzip +RUN apk update && apk add unzip bash # Download the Amazon CLI installer. ADD "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" /tmp/awscliv2.zip diff --git a/openshift/scripts/oc_provision_fill_partition_job.sh b/openshift/scripts/oc_provision_fill_partition_job.sh index 3e89ef96a6..9d0f5e95f8 100755 --- a/openshift/scripts/oc_provision_fill_partition_job.sh +++ b/openshift/scripts/oc_provision_fill_partition_job.sh @@ -22,7 +22,6 @@ JOB="job/fill-partition-data-${SUFFIX}" oc -n ${PROJ_TARGET} process -f ${TEMPLATE_PATH}/partition_filler_job.yaml \ -p SUFFIX=${SUFFIX} \ -p PG_DATABASE=${PG_DATABASE} \ - -p TABLE=${TABLE} \ -p CRUNCHYDB_USER=wps-crunchydb-16-${SUFFIX}-pguser-wps-crunchydb-16-${SUFFIX} \ -p PROJ_TOOLS=${PROJ_TOOLS} | jq '.items[0]' | oc -n ${PROJ_TARGET} create -f - # wait for the job to finish diff --git a/openshift/templates/partition_filler_job.yaml b/openshift/templates/partition_filler_job.yaml index 007b1139fb..6f55387f92 100644 --- a/openshift/templates/partition_filler_job.yaml +++ b/openshift/templates/partition_filler_job.yaml @@ -27,6 +27,7 @@ parameters: value: "prod" - name: PG_DATABASE required: true + value: "wps" - name: CRUNCHYDB_USER required: true objects: @@ -43,43 +44,41 @@ objects: metadata: name: partition-filler-${NAME}-${SUFFIX} spec: - template: - spec: - containers: - - name: partition-filler-${NAME}-${SUFFIX} - image: "image-registry.openshift-image-registry.svc:5000/${PROJ_TOOLS}/pgslice:${TAG_NAME}" - imagePullPolicy: "Always" - command: ["bash", "fill_partition_data.sh", "${PG_DATABASE}"] - env: - - name: PG_USER - valueFrom: - secretKeyRef: - name: ${CRUNCHYDB_USER} - key: user - - name: PG_PASSWORD - valueFrom: - secretKeyRef: - name: ${CRUNCHYDB_USER} - key: password - - name: PG_HOSTNAME - valueFrom: - secretKeyRef: - name: ${CRUNCHYDB_USER} - key: pgbouncer-host - - name: PG_PORT - valueFrom: - secretKeyRef: - name: ${CRUNCHYDB_USER} - key: pgbouncer-port - - name: PG_DATABASE - value: ${PG_DATABASE} - - name: SUFFIX - value: ${SUFFIX} - resources: - limits: - cpu: "1" - memory: 256Mi - requests: - cpu: "500m" - memory: 128Mi - restartPolicy: OnFailure + containers: + - name: partition-filler-${NAME}-${SUFFIX} + image: "image-registry.openshift-image-registry.svc:5000/${PROJ_TOOLS}/pgslice:${TAG_NAME}" + imagePullPolicy: "Always" + command: ["bash", "fill_partition_data.sh", "${PG_DATABASE}"] + env: + - name: PG_USER + valueFrom: + secretKeyRef: + name: ${CRUNCHYDB_USER} + key: user + - name: PG_PASSWORD + valueFrom: + secretKeyRef: + name: ${CRUNCHYDB_USER} + key: password + - name: PG_HOSTNAME + valueFrom: + secretKeyRef: + name: ${CRUNCHYDB_USER} + key: pgbouncer-host + - name: PG_PORT + valueFrom: + secretKeyRef: + name: ${CRUNCHYDB_USER} + key: pgbouncer-port + - name: PG_DATABASE + value: ${PG_DATABASE} + - name: SUFFIX + value: ${SUFFIX} + resources: + limits: + cpu: "1" + memory: 256Mi + requests: + cpu: "500m" + memory: 128Mi + restartPolicy: OnFailure