Skip to content

Commit

Permalink
Address issues in pgslice job (#4114)
Browse files Browse the repository at this point in the history
- Docker image missing bash because it uses alpine
- Job yaml misconfigured
- Unnecessary TABLE parameter
  • Loading branch information
conbrad authored Nov 19, 2024
1 parent d5cb753 commit 3967088
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 42 deletions.
2 changes: 1 addition & 1 deletion openshift/pgslice/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion openshift/scripts/oc_provision_fill_partition_job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
79 changes: 39 additions & 40 deletions openshift/templates/partition_filler_job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ parameters:
value: "prod"
- name: PG_DATABASE
required: true
value: "wps"
- name: CRUNCHYDB_USER
required: true
objects:
Expand All @@ -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

0 comments on commit 3967088

Please sign in to comment.