2016-08-27 01:03:56 +03:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2018-03-29 22:47:37 +03:00
|
|
|
# this script runs in the context of env vars imported inside of a
|
|
|
|
# Docker run env, thus disable ref but not assigned shellcheck warnings.
|
|
|
|
# shellcheck disable=SC2154
|
|
|
|
|
2016-08-27 01:03:56 +03:00
|
|
|
set -e
|
|
|
|
set -o pipefail
|
|
|
|
|
2017-09-30 00:59:15 +03:00
|
|
|
# login to registry servers (do not specify -e as creds have been decrypted)
|
|
|
|
./registry_login.sh
|
2017-10-22 23:59:00 +03:00
|
|
|
# singularity registries will be imported via env
|
2017-09-30 00:59:15 +03:00
|
|
|
|
2016-08-27 01:03:56 +03:00
|
|
|
# ensure we're in the proper directory
|
|
|
|
cd /opt/batch-shipyard
|
|
|
|
|
|
|
|
# add timing markers
|
2018-09-18 00:47:53 +03:00
|
|
|
if [[ -n ${SHIPYARD_TIMING+x} ]]; then
|
2019-06-10 20:35:28 +03:00
|
|
|
if [ "$is_start_task" -eq 1 ]; then
|
|
|
|
# backfill node prep start
|
|
|
|
# shellcheck disable=SC2086
|
|
|
|
python3 perf.py nodeprep start --prefix "$prefix" --ts "$npstart" --message "offer=$offer,sku=$sku"
|
|
|
|
# backfill docker run pull start
|
|
|
|
# shellcheck disable=SC2086
|
|
|
|
python3 perf.py shipyard pull-start --prefix "$prefix" --ts "$drpstart"
|
|
|
|
# mark docker run pull end
|
|
|
|
# shellcheck disable=SC2086
|
|
|
|
python3 perf.py shipyard pull-end --prefix "$prefix" --ts "$drpend"
|
|
|
|
# mark node prep finished
|
|
|
|
# shellcheck disable=SC2086
|
|
|
|
python3 perf.py nodeprep end --prefix "$prefix" --ts "$npend"
|
|
|
|
fi
|
2016-08-27 01:03:56 +03:00
|
|
|
# mark cascade start time
|
2018-05-02 20:00:15 +03:00
|
|
|
# shellcheck disable=SC2086
|
2019-06-10 20:35:28 +03:00
|
|
|
python3 perf.py cascade start --prefix "$prefix" --message "mode=$cascade_mode"
|
2016-08-27 01:03:56 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
# execute cascade
|
2018-05-02 20:00:15 +03:00
|
|
|
# shellcheck disable=SC2086
|
2019-06-10 20:35:28 +03:00
|
|
|
python3 cascade.py --mode "$cascade_mode" --concurrent "$concurrent_source_downloads" --prefix "$prefix" --log-directory "$log_directory"
|