#!/bin/bash

# This script launches pipedream jobs to regenerate perception on
# on the TMM chum sets. The updated chum URIs are put on nautilus.

set -euo pipefail

regen_set()
{
  CHUM_SET=$1

  CMD="\
    bazel run //experimental/tsemple/tmm:chum_set_regen_perception --config=cuda -- \
    --chum_set=sim/log_test_converter/testing/chum_sets/$CHUM_SET.txt \
    --pipedream \
    --pipedream_autoretry_budget=5 \
    --mr_extra_bazel_args='--config=cuda' \
    --out_txt_file=/mnt/nautilus_rw/sim/agent_metrics/regen_chum_sets/$CHUM_SET.txt \
    --out_pbtxt_file=/mnt/nautilus_rw/sim/agent_metrics/regen_chum_sets/$CHUM_SET.pbtxt "

  echo 
  echo regen $CHUM_SET
  echo
  echo $CMD
  echo

  $CMD
}

regen_set chum_set_small_7
regen_set chum_set_drew_67
regen_set chum_set_challenge_193
regen_set chum_set_echu_348
regen_set chum_set_pmav_40
regen_set chum_set_eatd_17
