Skip to content

Commit

Permalink
Indexd Migration Script
Browse files Browse the repository at this point in the history
  • Loading branch information
BinamB committed Jul 2, 2024
1 parent 105ba48 commit 635d830
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions kube/services/jobs/indexd-single-table-migration.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
apiVersion: batch/v1
kind: Job
metadata:
name: indexd-single-table-migration
spec:
template:
metadata:
labels:
app: gen3job
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
preference:
matchExpressions:
- key: karpenter.sh/capacity-type
operator: In
values:
- on-demand
- weight: 99
preference:
matchExpressions:
- key: eks.amazonaws.com/capacityType
operator: In
values:
- ONDEMAND
automountServiceAccountToken: false
volumes:
- name: config-volume
secret:
secretName: "indexd-secret" # pragma: allowlist secret
- name: "indexd-creds-volume"
secret:
secretName: "indexd-creds" # pragma: allowlist secret
- name: config-helper
configMap:
name: config-helper
- name: creds-volume-bk
secret:
secretName: "indexd-bk-creds" # pragma: allowlist secret
containers:
- name: indexd
GEN3_INDEXD_IMAGE
env:
- name: START_DID
GEN3_START_DID|-value: ""-|
volumeMounts:
- name: "config-volume"
readOnly: true
mountPath: "/var/www/indexd/local_settings.py"
subPath: "local_settings.py"
- name: "indexd-creds-volume"
readOnly: true
mountPath: "/var/www/indexd/creds.json"
subPath: creds.json
- name: "config-helper"
readOnly: true
mountPath: "/var/www/indexd/config_helper.py"
subPath: config_helper.py
- name: "creds-volume-bk"
readOnly: true
mountPath: /var/www/indexd/creds_bk.json""
subPath: creds.json
imagePullPolicy: Always
command: ["/bin/bash"]
args:
- "-c"
- |
flags="--creds-path /var/www/indexd/creds_bk.json"
if [[ -n "$START_DID" ]]; then
flags="$flags --start-did $START_DID"
fi
time python /indexd/bin/migrate_to_single_table.py $flags
echo "Exit code: $?"
restartPolicy: Never

0 comments on commit 635d830

Please sign in to comment.