From 25893ddc31a61a6e8bf2b1609e5245f414c31eaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Og=C3=BCn=20Y=C3=B6r=C3=BCk?= <59279577+barisoyoruk@users.noreply.github.com> Date: Tue, 8 Oct 2024 13:23:59 +0100 Subject: [PATCH] fix antithesis trigger (#7315) --- .circleci/config.yml | 2 +- .../circle-ci/trigger-antithesis-simulation.sh | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 075d6d1ace2..71b6930d79a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -139,7 +139,7 @@ jobs: - run: command: | # hack - notion of "owners" isn't supported in Circle 2 - if [ $CIRCLE_PROJECT_USERNAME = 'palantir' ] && [ -z $CIRCLE_PR_NUMBER ] && [ $CIRCLE_TAG ]; then + if [ $CIRCLE_PROJECT_USERNAME = 'palantir' ] && [ -z $CIRCLE_PR_NUMBER ]; then ./scripts/circle-ci/publish-images-to-antithesis.sh ./scripts/circle-ci/trigger-antithesis-simulation.sh fi diff --git a/scripts/circle-ci/trigger-antithesis-simulation.sh b/scripts/circle-ci/trigger-antithesis-simulation.sh index 4f913657758..2f9924ef6c8 100755 --- a/scripts/circle-ci/trigger-antithesis-simulation.sh +++ b/scripts/circle-ci/trigger-antithesis-simulation.sh @@ -5,6 +5,18 @@ if [[ -z "${ANTITHESIS_WEBHOOK_PASSWORD}" ]]; then exit 1 fi -WEBHOOK_LOCATOR="palantir_atlasdb__baseline__latest" -echo "Triggering simulation on Antithesis via the ${WEBHOOK_LOCATOR} webhook." -curl -v -u "palantir:${ANTITHESIS_WEBHOOK_PASSWORD}" -X POST https://palantir.antithesis.com/api/v1/launch_experiment/${WEBHOOK_LOCATOR} +if [[ -z "${ANTITHESIS_REPORT_RECIPIENT}" ]]; then + echo "Antithesis report recipient is not set as an environment variable, exiting." + exit 1 +fi + +WEBHOOK_LOCATOR="atlasdb" +TEST_DURATION=$([ -n "${CIRCLE_TAG}" ] && echo "12" || echo "3") +echo "Triggering simulation on Antithesis via the ${WEBHOOK_LOCATOR} webhook with a test duration of ${TEST_DURATION} hours." +curl -v -u "palantir:${ANTITHESIS_WEBHOOK_PASSWORD}" -X POST https://palantir.antithesis.com/api/v1/launch_experiment/${WEBHOOK_LOCATOR} -d \ +'{ "params": { + "antithesis.images":"cassandra:latest;timelock-server-distribution:latest;atlasdb-workload-server-distribution:latest", + "antithesis.config_image":"atlasdb-workload-server-antithesis:latest", + "custom.duration":"'${TEST_DURATION}'", + "antithesis.report.recipients":"'${ANTITHESIS_REPORT_RECIPIENT}'" +} }'