From b987f0a50276e01ec992f668fc5ef60735610ffa Mon Sep 17 00:00:00 2001 From: Scott Collins Date: Fri, 14 Apr 2023 11:09:11 -0700 Subject: [PATCH] Updated integration test scripts for R2 PGEs to support v2.0.0-rc.1.0 --- .ci/scripts/test_int_cslc_s1.sh | 25 +++++++++++++------------ .ci/scripts/test_int_rtc_s1.sh | 18 +++++++++++++----- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/.ci/scripts/test_int_cslc_s1.sh b/.ci/scripts/test_int_cslc_s1.sh index 05c4a592..52c0c5c4 100755 --- a/.ci/scripts/test_int_cslc_s1.sh +++ b/.ci/scripts/test_int_cslc_s1.sh @@ -26,9 +26,9 @@ SAMPLE_TIME=15 # Test data should be uploaded to s3://operasds-dev-pge/${PGE_NAME}/ [ -z "${WORKSPACE}" ] && WORKSPACE=$(realpath "$(dirname "$(realpath "$0")")"/../..) [ -z "${PGE_TAG}" ] && PGE_TAG="${USER}-dev" -[ -z "${INPUT_DATA}" ] && INPUT_DATA="delivery_cslc_s1_beta_0.1_input_data.zip" -[ -z "${EXPECTED_DATA}" ] && EXPECTED_DATA="delivery_cslc_s1_beta_0.1_expected_output_dir.zip" -[ -z "${RUNCONFIG}" ] && RUNCONFIG="delivery_cslc_s1_beta_0.1_runconfig.yaml" +[ -z "${INPUT_DATA}" ] && INPUT_DATA="delivery_cslc_s1_gamma_0.1_input_data.zip" +[ -z "${EXPECTED_DATA}" ] && EXPECTED_DATA="delivery_cslc_s1_gamma_0.1_expected_output.zip" +[ -z "${RUNCONFIG}" ] && RUNCONFIG="cslc_s1_sample_runconfig-v2.0.0-rc.1.0.yaml" [ -z "${TMP_ROOT}" ] && TMP_ROOT="$DEFAULT_TMP_ROOT" # Create the test output directory in the workspace @@ -44,10 +44,10 @@ test_int_setup_test_data trap test_int_trap_cleanup EXIT # Pull in validation script from S3. -# Current source is https://raw.githubusercontent.com/opera-adt/COMPASS/c77b1a681e85d44c19baf2cf1eaf88f901b12bc9/src/compass/utils/validate_cslc.py -local_validate_cslc=${TMP_DIR}/validate_cslc.py -echo "Downloading s3://operasds-dev-pge/${PGE_NAME}/validate_cslc.py to $local_validate_cslc" -aws s3 cp s3://operasds-dev-pge/${PGE_NAME}/validate_cslc.py "$local_validate_cslc" +# Current source is https://raw.githubusercontent.com/opera-adt/COMPASS/main/src/compass/utils/validate_product.py +local_validate_script=${TMP_DIR}/validate_product.py +echo "Downloading s3://operasds-dev-pge/${PGE_NAME}/validate_product.py to $local_validate_script" +aws s3 cp s3://operasds-dev-pge/${PGE_NAME}/validate_product.py "$local_validate_script" # overall_status values and their meanings # 0 - pass @@ -87,7 +87,7 @@ metrics_collection_start "$PGE_NAME" "$container_name" "$TEST_RESULTS_DIR" "$SAM echo "Running Docker image ${PGE_IMAGE}:${PGE_TAG}" -docker run --rm -u $UID:"$(id -g)" -w /home/compass_user --name $container_name \ +docker run --rm -u $UID:"$(id -g)" -w /home/compass_user/output_dir --name $container_name \ -v "${runconfig_dir}":/home/compass_user/runconfig:ro \ -v "${input_dir}":/home/compass_user/input_dir:ro \ -v "${output_dir}":/home/compass_user/output_dir \ @@ -103,7 +103,7 @@ if [ $docker_exit_status -ne 0 ]; then echo "docker exit indicates failure: ${docker_exit_status}" overall_status=1 else - echo "Compare Resultvalidate_cslc.py output" >> "$RESULTS_FILE" + echo "Compare Resultvalidate_product.py output" >> "$RESULTS_FILE" declare -a burst_ids=( "t064_135518_iw1" "t064_135518_iw2" "t064_135518_iw3" @@ -141,17 +141,18 @@ else burst_id_replace_underscores=${burst_id_uppercase//_/-} burst_id_pattern="*_${burst_id_replace_underscores}_*.h5" output_file=`ls $output_dir/$burst_id_pattern` - echo "Ouput file matching burst id is $output_file" + echo "Output file matching burst id is $output_file" - ref_product="/exp/${burst_id}/20220501/${burst_id}_20220501_VV.h5" + ref_product="/exp/${burst_id}/20220501/${burst_id}_20220501.h5" sec_product="/out/$(basename ${output_file})" + # TODO: add additional call to validate static layers docker_out=$(docker run --rm -u compass_user:compass_user \ -v "${TMP_DIR}":/working:ro \ -v "${output_dir}":/out:ro \ -v "${expected_dir}":/exp:ro \ --entrypoint /home/compass_user/miniconda3/envs/COMPASS/bin/python3 \ ${PGE_IMAGE}:"${PGE_TAG}" \ - /working/validate_cslc.py \ + /working/validate_product.py \ --ref-product ${ref_product} \ --sec-product ${sec_product} 2>&1) || docker_exit_status=$? diff --git a/.ci/scripts/test_int_rtc_s1.sh b/.ci/scripts/test_int_rtc_s1.sh index fbc50c13..88357b11 100755 --- a/.ci/scripts/test_int_rtc_s1.sh +++ b/.ci/scripts/test_int_rtc_s1.sh @@ -27,9 +27,9 @@ SAMPLE_TIME=15 # RUNCONFIG should be the name of the runconfig in s3://operasds-dev-pge/${PGE_NAME}/ [ -z "${WORKSPACE}" ] && WORKSPACE="$(realpath "$(dirname "$(realpath "$0")")"/../..)" [ -z "${PGE_TAG}" ] && PGE_TAG="${USER}-dev" -[ -z "${INPUT_DATA}" ] && INPUT_DATA="rtc_s1_delivery_2_beta_0.2_expected_input.zip" -[ -z "${EXPECTED_DATA}" ] && EXPECTED_DATA="rtc_s1_delivery_2_beta_0.2_expected_output.zip" -[ -z "${RUNCONFIG}" ] && RUNCONFIG="rtc_s1_delivery_2_beta_0.2_runconfig.yaml" +[ -z "${INPUT_DATA}" ] && INPUT_DATA="rtc_s1_delivery_3_gamma_0.3_expected_input.zip" +[ -z "${EXPECTED_DATA}" ] && EXPECTED_DATA="rtc_s1_delivery_3_gamma_0.3_expected_output.zip" +[ -z "${RUNCONFIG}" ] && RUNCONFIG="rtc_s1_sample_runconfig-v2.0.0-rc.1.0.yaml" [ -z "${TMP_ROOT}" ] && TMP_ROOT="$DEFAULT_TMP_ROOT" # Create the test output directory in the work space @@ -45,6 +45,7 @@ test_int_setup_test_data trap test_int_trap_cleanup EXIT # Pull in product compare script from S3. +# Current source is https://raw.githubusercontent.com/opera-adt/RTC/main/app/rtc_compare.py local_compare_script=${TMP_DIR}/rtc_compare.py echo "Downloading s3://operasds-dev-pge/${PGE_NAME}/rtc_compare.py to ${local_compare_script}" aws s3 cp s3://operasds-dev-pge/${PGE_NAME}/rtc_compare.py "$local_compare_script" @@ -138,13 +139,19 @@ else burst_id_uppercase=${burst_id^^} burst_id_replace_underscores=${burst_id_uppercase//_/-} + burst_id_remove_T=${burst_id_replace_underscores//T/} burst_id_pattern="*_${burst_id_replace_underscores}_*.h5" + expected_burst_id_pattern="*_${burst_id_remove_T}_*.h5" # shellcheck disable=SC2086 - output_file=$(ls $output_dir/$burst_id_pattern) + output_file=$(ls ${output_dir}/${burst_id_pattern}) + + # shellcheck disable=SC2086 + expected_file=$(ls ${expected_dir}/${burst_id}/${expected_burst_id_pattern}) echo "output file: $output_file" - expected_file=${expected_dir}/${burst_id}/rtc_product_v0.2.h5 + echo "expected_file: $expected_file" + compare_output=$(python3 "${local_compare_script}" "${expected_file}" "${output_file}") echo "Results of compare: $compare_output" @@ -159,6 +166,7 @@ else # remove ansi colors from string compare_output="$(echo "$compare_output" | sed -e 's/\x1b\[[0-9;]*m//g')" + # add html breaks to newlines compare_output=${compare_output//$'\n'/
$'\n'} echo "${compare_result}${compare_output}" >> "$RESULTS_FILE"