#!/usr/bin/env bash

set -euo pipefail

{

script_location="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
archive_dest=${script_location}/canary.tgz
/usr/bin/env python ${ZOOX_WORKSPACE_ROOT}/pipedream/common/archive/bazel_build_archive.py \
    --archive-dest=${archive_dest} \
    --target=//pipedream/monitoring/canary:canary

builtin cd ${ZOOX_WORKSPACE_ROOT}/infra/ansible
ansible-playbook -i inventory/slurm/production \
    --extra-vars "archive_location=${archive_dest}" -l tag_Role_slurm_master_production_primary  --tags canary slurm_cluster.yml

}
