#!/bin/bash
tmm() {
        BRANCH_SHA=$(git rev-parse HEAD)
        BRANCH_NAME=$(git branch --show-current | cut -d'/' -f2)
        if [[ $(echo $BRANCH_NAME | wc -c) -gt 25 ]]
        then
           BRANCH_NAME="pmukundan/test_branch"
        fi
        BASE_SHA=$(git merge-base HEAD origin/develop/sim)
        BASE_NAME="develop/sim"

        echo "================================================================="
        echo "Running $1 for branch $BRANCH_NAME vs $BASE_NAME"
        echo "================================================================="
        echo "COMMAND:"
        echo "bazel run --config=cuda //mined_metric/builder:run_metric_validation -- \
        --metric_id $1 --gitshas="$BRANCH_SHA","$BASE_SHA" \
        --comments="$BRANCH_NAME,$BASE_NAME" --num_workers $2"
        echo ""
        echo "LOG START"
        echo "---------"
        bazel run --config=cuda //mined_metric/builder:run_metric_validation -- \
        --metric_id $1 --gitshas="$BRANCH_SHA","$BASE_SHA" \
        --comments="$BRANCH_NAME,$BASE_NAME" --num_workers $2
        echo "---------"
        echo "LOG END"
        echo ""
}

# tmm converted_agent_offline_small_set 7
tmm converted_agent_offline_challenge_set 193
tmm converted_agent_offline_all_smart_agent 193