Skip to content

Commit

Permalink
update scripting to check file existence; and exit on non-existence
Browse files Browse the repository at this point in the history
  • Loading branch information
nickmasson committed Jun 26, 2024
1 parent d0906c3 commit 78a7632
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tools/generate_hres_etl_jobs.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
#!/usr/bin/env bash
set -e

JOBS_FILEPATH="ecmwf_workflow_jobs_2024-06-25T14:29:41.log"
JOBS_FILEPATH="ecmwf_workflow_jobs_2024-06-25T14:32:29.log"

echo "checking that files exist for jobs in ${JOBS_FILEPATH}..."
cat ${JOBS_FILEPATH} | xargs -I % sh -c 'gcloud workflows execute event-arc-triggered-workflow-prod --location=us-east1 --data="{\"data\":{\"bucket\":\"contrails-301217-ecmwf-hres-delivery-be\", \"name\":\"%\"}}"; sleep 25'
while read p; do
echo ${p}
LST="$(gsutil ls "gs://contrails-301217-ecmwf-hres-delivery-be/${p}")"
echo ${LST}
done <${JOBS_FILEPATH}

echo "submitting list of jobs to GCP Workflow..."
# cat ${JOBS_FILEPATH} | xargs -I % sh -c 'gcloud workflows execute event-arc-triggered-workflow-prod --location=us-east1 --data="{\"data\":{\"bucket\":\"contrails-301217-ecmwf-hres-delivery-be\", \"name\":\"%\"}}"; sleep 25'

0 comments on commit 78a7632

Please sign in to comment.