Skip to content

Commit

Permalink
Merge branch 'master' into chore/fix-google-replication
Browse files Browse the repository at this point in the history
  • Loading branch information
MaribelleHGomez authored Jan 14, 2025
2 parents 72e44a7 + fef3d7c commit 278f669
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 9 deletions.
4 changes: 0 additions & 4 deletions gen3/bin/kube-setup-gen3-user-data-library.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ setup_database() {
gen3_log_info "gen3userdatalibrary-g3auto secret already configured"
return 0
fi
if [[ -n "$JENKINS_HOME" || ! -f "$(gen3_secrets_folder)/creds.json" ]]; then
gen3_log_err "skipping db setup in non-adminvm environment"
return 0
fi
# Setup .env file that gen3-user-data-library service consumes
if [[ ! -f "$secretsFolder/gen3-user-data-library.env" || ! -f "$secretsFolder/base64Authz.txt" ]]; then
local secretsFolder="$(gen3_secrets_folder)/g3auto/gen3userdatalibrary"
Expand Down
29 changes: 27 additions & 2 deletions kube/services/jobs/indexd-single-table-migration-job.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Setup for running this migration https://github.com/uc-cdis/indexd/blob/master/docs/migration_to_single_table_indexd.md
# Need to apply PriorityClass before running this job. Run kubectl apply -f indexd-single-table-migration-priority-class.yaml
apiVersion: batch/v1
kind: Job
metadata:
Expand All @@ -9,6 +10,7 @@ spec:
labels:
app: gen3job
spec:
priorityClassName: indexd-single-table-migration-priority # Assigning the priority class
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
Expand Down Expand Up @@ -46,6 +48,12 @@ spec:
env:
- name: START_DID
GEN3_START_DID|-value: ""-|
- name: BATCH_SIZE
GEN3_BATCH_SIZE|-value: ""-|
- name: OFFSET_VALUE
GEN3_OFFSET_VALUE|-value: ""-|
- name: USE_DEFAULT_CREDS
GEN3_USE_DEFAULT_CREDS|-value: "false"-|
volumeMounts:
- name: "config-volume"
readOnly: true
Expand All @@ -72,11 +80,28 @@ spec:
args:
- "-c"
- |
flags="--creds-path /var/www/indexd/creds_new.json"
$flags=""
if [[ "$USE_DEFAULT_CREDS" == "false" ]]; then
echo "Using new creds"
flags="$flags --creds-file /var/www/indexd/creds_new.json"
else
echo "using default creds"
flags="$flags --creds-file /var/www/indexd/creds.json"
fi
if [[ -n "$START_DID" ]]; then
flags="$flags --start-did $START_DID"
fi
time poetry run python /indexd/bin/migrate_to_single_table.py $flags
if [[ -n "$BATCH_SIZE" ]]; then
flags="$flags --batch-size $BATCH_SIZE"
fi
if [[ -n "$OFFSET_VALUE" ]]; then
flags="$flags --start-offset $OFFSET_VALUE"
fi
time python /indexd/bin/migrate_to_single_table.py $flags
echo "Exit code: $?"
restartPolicy: Never

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: indexd-single-table-migration-priority
value: 100000 # High value for high priority
globalDefault: false
description: "Priority class for Indexd migration job"
3 changes: 0 additions & 3 deletions kube/services/spark/spark-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,6 @@ spec:
args:
- "-c"
- |
# get /usr/local/share/ca-certificates/cdis-ca.crt into system bundle
ssh server sudo /etc/init.d/ssh start
update-ca-certificates
python run_config.py
hdfs namenode -format
hdfs --daemon start namenode
Expand Down

0 comments on commit 278f669

Please sign in to comment.