From 615d13153d0aadfdfcd4f752c45c275833d64138 Mon Sep 17 00:00:00 2001 From: bshifaw Date: Thu, 27 Apr 2023 14:06:17 -0400 Subject: [PATCH 1/7] first draft of carrot automated wdl test --- .github/workflows/carrot_push.yml | 36 +++ .github/workflows/carrot_weekly.yml | 36 +++ wdl_test/FileMetadata.wdl | 53 ++++ .../NA24385_downsampled/eval_input.json | 1 + .../NA24385_downsampled/test_input.json | 21 ++ wdl_test/PBCCSWholeGenome/eval.wdl | 229 ++++++++++++++++++ .../PBCCSWholeGenome/eval_input_defaults.json | 29 +++ .../PBCCSWholeGenome/test_input_defaults.json | 15 ++ wdl_test/README.md | 13 + 9 files changed, 433 insertions(+) create mode 100644 .github/workflows/carrot_push.yml create mode 100644 .github/workflows/carrot_weekly.yml create mode 100644 wdl_test/FileMetadata.wdl create mode 100644 wdl_test/PBCCSWholeGenome/NA24385_downsampled/eval_input.json create mode 100644 wdl_test/PBCCSWholeGenome/NA24385_downsampled/test_input.json create mode 100644 wdl_test/PBCCSWholeGenome/eval.wdl create mode 100644 wdl_test/PBCCSWholeGenome/eval_input_defaults.json create mode 100644 wdl_test/PBCCSWholeGenome/test_input_defaults.json create mode 100644 wdl_test/README.md diff --git a/.github/workflows/carrot_push.yml b/.github/workflows/carrot_push.yml new file mode 100644 index 000000000..1f7727810 --- /dev/null +++ b/.github/workflows/carrot_push.yml @@ -0,0 +1,36 @@ +# Runs workflow tests from the branch when commits have been pushed to a PR +# the workflows to be tested are specified by the "test_names" +# parameter as string seperated by space. + +name: carrot-test-on-push +on: [push] +jobs: + publish-test: + runs-on: ubuntu-latest + steps: + + # https://github.com/google-github-actions/setup-gcloud#service-account-key-json + - id: auth + uses: google-github-actions/auth@v0 + with: + credentials_json: ${{ secrets.CARROT_SA_KEY }} + + - name: Set up Cloud SDK + uses: google-github-actions/setup-gcloud@v0 + + # https://cloud.google.com/pubsub/docs/publisher#publish_messages + - name: Use gcloud CLI + run: > + gcloud pubsub topics publish ${{ secrets.CARROT_TOPIC_NAME }} + --message='{"source":"github", + "author":"${{ github.triggering_actor }}", + "owner":"${{ github.repository_owner }}", + "wdl_tests_dir":"wdl_test", + "repo_url":"${{ github.repositoryUrl }}", + "branch_name":"${{ github.ref_name }}", + "commit":"${{ github.sha }}", + "repo":"${{ github.repository }}", + "test_names": "PBCCSWholeGenome", + "issue_number":"", + "software_name":"" + }' \ No newline at end of file diff --git a/.github/workflows/carrot_weekly.yml b/.github/workflows/carrot_weekly.yml new file mode 100644 index 000000000..492a71639 --- /dev/null +++ b/.github/workflows/carrot_weekly.yml @@ -0,0 +1,36 @@ +# Runs all workflow tests every Sunday + +name: carrot-test-weekly +on: + schedule: + - cron: '0 7 * * 0' # Run every Sunday at 7am +jobs: + publish-test: + runs-on: ubuntu-latest + steps: + + # https://github.com/google-github-actions/setup-gcloud#service-account-key-json + - id: auth + uses: google-github-actions/auth@v0 + with: + credentials_json: ${{ secrets.CARROT_SA_KEY }} + + - name: Set up Cloud SDK + uses: google-github-actions/setup-gcloud@v0 + + # https://cloud.google.com/pubsub/docs/publisher#publish_messages + - name: Use gcloud CLI + run: > + gcloud pubsub topics publish ${{ secrets.CARROT_TOPIC_NAME }} + --message='{"source":"github", + "author":"${{ github.triggering_actor }}", + "owner":"${{ github.repository_owner }}", + "wdl_tests_dir":"wdl_test", + "repo_url":"${{ github.repositoryUrl }}", + "branch_name":"${{ github.ref_name }}", + "commit":"${{ github.sha }}", + "repo":"${{ github.repository }}", + "test_names": "", + "issue_number":"", + "software_name":"" + }' \ No newline at end of file diff --git a/wdl_test/FileMetadata.wdl b/wdl_test/FileMetadata.wdl new file mode 100644 index 000000000..d075a2a2a --- /dev/null +++ b/wdl_test/FileMetadata.wdl @@ -0,0 +1,53 @@ +version 1.0 + +task CheckFileUpdatedDateGCP { + + meta { + description: "Checks if file was updated within a specified time (default: 1 day)" + note: "Specific to GCP" + } + + + input { + Array[String] file_paths + Int days_back = 1 + String image_to_use + } + + #FILE_DATE description: get file info | grep the 'Update Time' row | parse the date info | reformat date info + + command <<< + set -eu pipefail + + GS_BUCKET_PATHS=("~{sep='" "' file_paths}") + MINIMUM_DATE=`date -d '~{days_back} day ago' +%Y-%m-%d` + return_code=0 + echo -e "FileName\tFileUpdatedDate\tMinimumUpdateDate\tValid" + + for GS_FILE in ${GS_BUCKET_PATHS[@]}; + do + FILE_DATE=`gsutil stat ${GS_FILE} | grep "Update time" | awk -F '[,][ .]+' '{print $2}' | awk '{print "date -d\""$1FS$2FS$3"\" +%Y-%m-%d"}'| bash` + + if [[ $FILE_DATE >= $MINIMUM_DATE ]] ; then + echo -e "$GS_FILE\t$FILE_DATE\t$MINIMUM_DATE\tTrue" + else + echo "ERROR: Date for $GS_FILE" >&2 + echo "$FILE_DATE is less than $MINIMUM_DATE" >&2 + + echo -e "$GS_FILE\t$FILE_DATE\t$MINIMUM_DATE\tFalse" + return_code=1 + fi + done + + if [ $return_code == 1 ]; then + exit 1 + fi + + >>> + runtime { + docker: image_to_use + } + output { + File file_date_result = stdout() + } +} diff --git a/wdl_test/PBCCSWholeGenome/NA24385_downsampled/eval_input.json b/wdl_test/PBCCSWholeGenome/NA24385_downsampled/eval_input.json new file mode 100644 index 000000000..9e26dfeeb --- /dev/null +++ b/wdl_test/PBCCSWholeGenome/NA24385_downsampled/eval_input.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/wdl_test/PBCCSWholeGenome/NA24385_downsampled/test_input.json b/wdl_test/PBCCSWholeGenome/NA24385_downsampled/test_input.json new file mode 100644 index 000000000..de6df2ba7 --- /dev/null +++ b/wdl_test/PBCCSWholeGenome/NA24385_downsampled/test_input.json @@ -0,0 +1,21 @@ +{ + "PBCCSWholeGenome.aligned_bais": [ + "gs://broad-dsp-lrma-pipeline-test-data/NA24385/downsampled_bam_01/m64020e_220303_2002560.01.downsample.bai", + "gs://broad-dsp-lrma-pipeline-test-data/NA24385/downsampled_bam_01/m64218e_220328_1613170.01.downsample.bai", + "gs://broad-dsp-lrma-pipeline-test-data/NA24385/downsampled_bam_01/m64218e_220330_0132120.01.downsample.bai", + "gs://broad-dsp-lrma-pipeline-test-data/NA24385/downsampled_bam_01/m64297e_220215_1930240.01.downsample.bai", + "gs://broad-dsp-lrma-pipeline-test-data/NA24385/downsampled_bam_01/m64297e_220218_1550340.01.downsample.bai", + "gs://broad-dsp-lrma-pipeline-test-data/NA24385/downsampled_bam_01/m64297e_220220_0052040.01.downsample.bai", + "gs://broad-dsp-lrma-pipeline-test-data/NA24385/downsampled_bam_01/m64297e_220303_1959350.01.downsample.bai" + ], + + "PBCCSWholeGenome.aligned_bams": [ + "gs://broad-dsp-lrma-pipeline-test-data/NA24385/downsampled_bam_01/m64020e_220303_2002560.01.downsample.bam", + "gs://broad-dsp-lrma-pipeline-test-data/NA24385/downsampled_bam_01/m64218e_220328_1613170.01.downsample.bam", + "gs://broad-dsp-lrma-pipeline-test-data/NA24385/downsampled_bam_01/m64218e_220330_0132120.01.downsample.bam", + "gs://broad-dsp-lrma-pipeline-test-data/NA24385/downsampled_bam_01/m64297e_220215_1930240.01.downsample.bam", + "gs://broad-dsp-lrma-pipeline-test-data/NA24385/downsampled_bam_01/m64297e_220218_1550340.01.downsample.bam", + "gs://broad-dsp-lrma-pipeline-test-data/NA24385/downsampled_bam_01/m64297e_220220_0052040.01.downsample.bam", + "gs://broad-dsp-lrma-pipeline-test-data/NA24385/downsampled_bam_01/m64297e_220303_1959350.01.downsample.bam" + ] +} diff --git a/wdl_test/PBCCSWholeGenome/eval.wdl b/wdl_test/PBCCSWholeGenome/eval.wdl new file mode 100644 index 000000000..656602f1c --- /dev/null +++ b/wdl_test/PBCCSWholeGenome/eval.wdl @@ -0,0 +1,229 @@ +version 1.0 + +workflow eval_workflow { + input { + + #Floats + + Float aligned_read_length_N50 + Float aligned_num_reads + Float aligned_frac_bases + Float aligned_num_bases + Float aligned_read_length_stdev + Float average_identity + Float aligned_est_fold_cov + Float aligned_read_length_mean + Float median_identity + Float aligned_read_length_median + + #Files + + String pbsv_tbi + String sniffles_vcf + String clair_gtbi + String dvp_tbi + String dvp_g_tbi + String dvp_vcf + String clair_vcf + String pbsv_vcf + String aligned_pbi + String aligned_bai + String dvp_phased_vcf + #String bed_cov_summary # this ends up being 'null' so not including in array of files for now + String dvp_phased_tbi + String clair_tbi + String clair_gvcf + String aligned_bam + String sniffles_tbi + String dvp_g_vcf + + } + + Array[Float] workflow_out_floats = [ + aligned_read_length_N50, + aligned_num_reads, + aligned_frac_bases, + aligned_num_bases, + aligned_read_length_stdev, + average_identity, + aligned_est_fold_cov, + aligned_read_length_mean, + median_identity, + aligned_read_length_median + ] + Array[String] workflow_out_files = [ + pbsv_tbi, + sniffles_vcf, + clair_gtbi, + dvp_tbi, + dvp_g_tbi, + dvp_vcf, + clair_vcf, + pbsv_vcf, + aligned_pbi, + aligned_bai, + dvp_phased_vcf, + dvp_phased_tbi, + clair_tbi, + clair_gvcf, + aligned_bam, + sniffles_tbi, + dvp_g_vcf + ] + + String ubuntu_image = "marketplace.gcr.io/google/ubuntu2004:latest" + String gcloud_slim_image = "gcr.io/google.com/cloudsdktool/cloud-sdk:slim" + +################ + ## Compairing test and expected Floats + ## Json inputs like "eval_workflow.workflow_out_floats": [{"Left":1.0,"Right":1.0},{"Left":2.2,"Right":3.2}] + ## With Array[Pair[Float,Float]] workflow_out_floats + +# Array[Boolean] scattered_float_match = [] +# scatter (pair in workflow_out_floats){ +# if (pair.left != pair.right) { +# Boolean scattered_float_match = false +# call CheckerWorkflowError{ +# input: +# message = "Expected Float "+pair.right+" but got "+pair.left, +# image_to_use = ubuntu_image +# } +# } +# } +################ + + ## Confirm float does not equal to zero test and expected Floats + Array[Boolean] scattered_float_match = [] + scatter (in_float in workflow_out_floats){ + if (in_float == 0.0) { + Boolean scattered_float_match = false + call CheckerWorkflowError{ + input: + message = "Error: Expected a non-zero float but got "+in_float+" .", + image_to_use = ubuntu_image + } + } + } + + + call CheckFileUpdatedDateGCP { + input: + file_paths = workflow_out_files, + image_to_use = gcloud_slim_image + } +} + +task CheckFileUpdatedDateGCP { + + meta { + description: "Checks if file was updated within a specified time (default: 1 day)" + note: "Specific to GCP" + } + + + input { + Array[String] file_paths + Int days_back = 1 + String image_to_use + } + + #FILE_DATE description: get file info | grep the 'Update Time' row | parse the date info | reformat date info + + command <<< + set -eu pipefail + + GS_BUCKET_PATHS=("~{sep='" "' file_paths}") + EMPTY_MD5="d41d8cd98f00b204e9800998ecf8427e" + return_code=0 + echo -e "FilePath\tFileMD5\tValid" + + for GS_FILE in ${GS_BUCKET_PATHS[@]}; + do + FILE_MD5=`gsutil hash -hm ${GS_FILE} | grep "md5" | awk -F '[:][\t]+' '{print $2}'` + + if [[ $FILE_MD5 != $EMPTY_MD5 ]] ; then + echo -e "$GS_FILE\t$FILE_MD5\tTrue" + else + echo "ERROR: MD5 for $GS_FILE equals md5sum of an empty file: $EMPTY_MD5" >&2 + + echo -e "$GS_FILE\t$FILE_MD5\tFalse" + return_code=1 + fi + done + + if [ $return_code == 1 ]; then + exit 1 + fi + + >>> + runtime { + docker: image_to_use + } + output { + File file_date_result = stdout() + } +} + +task CheckerWorkflowError { + + input { + String message + String image_to_use + } + command <<< + set -eu pipefail + + echo ~{message} + exit 1 + + >>> + runtime { + docker: image_to_use + } + output { + Boolean errmessage = stdout() + } +} + +task ValidFloatOutput { + + input { + Array[Pair[Float,Float]] workflow_out_floats + String image_to_use + } + command <<< + + echo ~{workflow_out_floats} + + >>> + runtime { + docker: image_to_use + } + output { + Boolean comparison_result = read_boolean(stdout()) + } +} + +task ValidMd5SumOutput { + input { + File data_file + String expectedMd5sum + } + command <<< + + md5sum helloworld.txt | sed "s/|/ /" | awk "{print $1, $8}" | read filemd5 + + if [$filemd5 == $expectedMd5sum] + then + echo "true" + else + echo "false" + fi + >>> + runtime { + docker: "quay.io/agduncan94/my-md5sum" + } + output { + File comparison_result = stdout() + } +} \ No newline at end of file diff --git a/wdl_test/PBCCSWholeGenome/eval_input_defaults.json b/wdl_test/PBCCSWholeGenome/eval_input_defaults.json new file mode 100644 index 000000000..349090aaf --- /dev/null +++ b/wdl_test/PBCCSWholeGenome/eval_input_defaults.json @@ -0,0 +1,29 @@ +{ + "eval_workflow.aligned_read_length_N50": "test_output:PBCCSWholeGenome.aligned_read_length_N50", + "eval_workflow.aligned_num_reads": "test_output:PBCCSWholeGenome.aligned_num_reads", + "eval_workflow.aligned_frac_bases": "test_output:PBCCSWholeGenome.aligned_frac_bases", + "eval_workflow.aligned_num_bases": "test_output:PBCCSWholeGenome.aligned_num_bases", + "eval_workflow.aligned_read_length_stdev": "test_output:PBCCSWholeGenome.aligned_read_length_stdev", + "eval_workflow.average_identity": "test_output:PBCCSWholeGenome.average_identity", + "eval_workflow.aligned_est_fold_cov": "test_output:PBCCSWholeGenome.aligned_est_fold_cov", + "eval_workflow.aligned_read_length_mean": "test_output:PBCCSWholeGenome.aligned_read_length_mean", + "eval_workflow.median_identity": "test_output:PBCCSWholeGenome.median_identity", + "eval_workflow.aligned_read_length_median": "test_output:PBCCSWholeGenome.aligned_read_length_median", + "eval_workflow.pbsv_tbi": "test_output:PBCCSWholeGenome.pbsv_tbi", + "eval_workflow.sniffles_vcf": "test_output:PBCCSWholeGenome.sniffles_vcf", + "eval_workflow.clair_gtbi": "test_output:PBCCSWholeGenome.clair_gtbi", + "eval_workflow.dvp_tbi": "test_output:PBCCSWholeGenome.dvp_tbi", + "eval_workflow.dvp_g_tbi": "test_output:PBCCSWholeGenome.dvp_g_tbi", + "eval_workflow.dvp_vcf": "test_output:PBCCSWholeGenome.dvp_vcf", + "eval_workflow.clair_vcf": "test_output:PBCCSWholeGenome.clair_vcf", + "eval_workflow.pbsv_vcf": "test_output:PBCCSWholeGenome.pbsv_vcf", + "eval_workflow.aligned_pbi": "test_output:PBCCSWholeGenome.aligned_pbi" , + "eval_workflow.aligned_bai": "test_output:PBCCSWholeGenome.aligned_bai" , + "eval_workflow.dvp_phased_vcf": "test_output:PBCCSWholeGenome.dvp_phased_vcf", + "eval_workflow.dvp_phased_tbi": "test_output:PBCCSWholeGenome.dvp_phased_tbi", + "eval_workflow.clair_tbi":"test_output:PBCCSWholeGenome.clair_tbi", + "eval_workflow.clair_gvcf": "test_output:PBCCSWholeGenome.clair_gvcf", + "eval_workflow.aligned_bam": "test_output:PBCCSWholeGenome.aligned_bam", + "eval_workflow.sniffles_tbi": "test_output:PBCCSWholeGenome.sniffles_tbi", + "eval_workflow.dvp_g_vcf":"test_output:PBCCSWholeGenome.dvp_g_vcf" +} diff --git a/wdl_test/PBCCSWholeGenome/test_input_defaults.json b/wdl_test/PBCCSWholeGenome/test_input_defaults.json new file mode 100644 index 000000000..e2e67b554 --- /dev/null +++ b/wdl_test/PBCCSWholeGenome/test_input_defaults.json @@ -0,0 +1,15 @@ +{ + "PBCCSWholeGenome.aligned_bais": ["gs://broad-gp-pacbio-outgoing/results/PBFlowcell/m64297e_220215_193024/reads/ccs/aligned/m64297e_220215_193024.bam.bai", "gs://broad-gp-pacbio-outgoing/results/PBFlowcell/m64297e_220218_155034/reads/ccs/aligned/m64297e_220218_155034.bam.bai","gs://broad-gp-pacbio-outgoing/results/PBFlowcell/m64020e_220303_200256/reads/ccs/aligned/m64020e_220303_200256.bam.bai","gs://broad-gp-pacbio-outgoing/results/PBFlowcell/m64297e_220303_195935/reads/ccs/aligned/m64297e_220303_195935.bam.bai", "gs://broad-gp-pacbio-outgoing/results/PBFlowcell/m64297e_220220_005204/reads/ccs/aligned/m64297e_220220_005204.bam.bai", "gs://broad-gp-pacbio-outgoing/results/PBFlowcell/m64218e_220328_161317/reads/ccs/aligned/m64218e_220328_161317.bam.bai", "gs://broad-gp-pacbio-outgoing/results/PBFlowcell/m64218e_220330_013212/reads/ccs/aligned/m64218e_220330_013212.bam.bai"], + "PBCCSWholeGenome.aligned_bams": ["gs://broad-gp-pacbio-outgoing/results/PBFlowcell/m64297e_220215_193024/reads/ccs/aligned/m64297e_220215_193024.bam", "gs://broad-gp-pacbio-outgoing/results/PBFlowcell/m64297e_220218_155034/reads/ccs/aligned/m64297e_220218_155034.bam", "gs://broad-gp-pacbio-outgoing/results/PBFlowcell/m64020e_220303_200256/reads/ccs/aligned/m64020e_220303_200256.bam", "gs://broad-gp-pacbio-outgoing/results/PBFlowcell/m64297e_220303_195935/reads/ccs/aligned/m64297e_220303_195935.bam", "gs://broad-gp-pacbio-outgoing/results/PBFlowcell/m64297e_220220_005204/reads/ccs/aligned/m64297e_220220_005204.bam", "gs://broad-gp-pacbio-outgoing/results/PBFlowcell/m64218e_220328_161317/reads/ccs/aligned/m64218e_220328_161317.bam", "gs://broad-gp-pacbio-outgoing/results/PBFlowcell/m64218e_220330_013212/reads/ccs/aligned/m64218e_220330_013212.bam"], + "PBCCSWholeGenome.call_small_variants": true, + "PBCCSWholeGenome.call_small_vars_on_mitochondria": false, + "PBCCSWholeGenome.dvp_memory": 128, + "PBCCSWholeGenome.dvp_threads": 32, + "PBCCSWholeGenome.fast_less_sensitive_sv": true, + "PBCCSWholeGenome.gcs_out_root_dir": "gs://broad-dsp-lrma-pipeline-tests-cromwell/workflow_out_root_dir", + "PBCCSWholeGenome.participant_name": "NA24385", + "PBCCSWholeGenome.ref_map_file": "gs://broad-dsde-methods-long-reads/resources/references/grch38_noalt/grch38_noalt.txt", + "PBCCSWholeGenome.ref_scatter_interval_list_ids": "gs://broad-dsde-methods-long-reads/resources/references/grch38_noalt/size_balanced_interva_lists_ids.txt", + "PBCCSWholeGenome.ref_scatter_interval_list_locator": "gs://broad-dsde-methods-long-reads/resources/references/grch38_noalt/size_balanced_interva_lists.txt", + "PBCCSWholeGenome.run_dv_pepper_analysis": true +} diff --git a/wdl_test/README.md b/wdl_test/README.md new file mode 100644 index 000000000..6a2519f77 --- /dev/null +++ b/wdl_test/README.md @@ -0,0 +1,13 @@ +# Pipeline Testing + +## Testing Schedule +- Run all available WDL workflows once a week +- Run a handful of important workflows when a push is made to feature branch + + +Note: Call caching is enabled so that if a wdl hasn't changed then its tests will not run. + +### Questions + +- If an utils task is changed, theoretically, it affects all pipelines that use the utils task. Do we want to test all pipelines? Or do we want to have multiple tests for that task covering all scenarios? +- This *should* be handled by the feature branch test. The test will attempt to run a workflow, if that workflow imports a util task that has been changed then cromwell should not call cache that imported workflow/task and instead and run the workflow from scratch. From 7f4c7667daf8d1e6d3d1089d7c8941a6f66d0568 Mon Sep 17 00:00:00 2001 From: bshifaw Date: Wed, 3 May 2023 14:43:11 -0400 Subject: [PATCH 2/7] minor new line fix --- .github/workflows/carrot_push.yml | 2 +- .github/workflows/carrot_weekly.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/carrot_push.yml b/.github/workflows/carrot_push.yml index 1f7727810..29b47b532 100644 --- a/.github/workflows/carrot_push.yml +++ b/.github/workflows/carrot_push.yml @@ -33,4 +33,4 @@ jobs: "test_names": "PBCCSWholeGenome", "issue_number":"", "software_name":"" - }' \ No newline at end of file + }' diff --git a/.github/workflows/carrot_weekly.yml b/.github/workflows/carrot_weekly.yml index 492a71639..b8e2b1b1e 100644 --- a/.github/workflows/carrot_weekly.yml +++ b/.github/workflows/carrot_weekly.yml @@ -33,4 +33,4 @@ jobs: "test_names": "", "issue_number":"", "software_name":"" - }' \ No newline at end of file + }' From f0e91d48f214d5355187a70e9b7be45f648adb88 Mon Sep 17 00:00:00 2001 From: bshifaw Date: Thu, 4 May 2023 16:41:45 -0400 Subject: [PATCH 3/7] fixed dir for wdl_test example --- .../NA24385_downsampled/eval_input.json | 0 .../NA24385_downsampled/test_input.json | 0 wdl_test/PBCCSWholeGenome/{ => basic_output_valdation}/eval.wdl | 0 .../{ => basic_output_valdation}/eval_input_defaults.json | 0 .../{ => basic_output_valdation}/test_input_defaults.json | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename wdl_test/PBCCSWholeGenome/{ => basic_output_valdation}/NA24385_downsampled/eval_input.json (100%) rename wdl_test/PBCCSWholeGenome/{ => basic_output_valdation}/NA24385_downsampled/test_input.json (100%) rename wdl_test/PBCCSWholeGenome/{ => basic_output_valdation}/eval.wdl (100%) rename wdl_test/PBCCSWholeGenome/{ => basic_output_valdation}/eval_input_defaults.json (100%) rename wdl_test/PBCCSWholeGenome/{ => basic_output_valdation}/test_input_defaults.json (100%) diff --git a/wdl_test/PBCCSWholeGenome/NA24385_downsampled/eval_input.json b/wdl_test/PBCCSWholeGenome/basic_output_valdation/NA24385_downsampled/eval_input.json similarity index 100% rename from wdl_test/PBCCSWholeGenome/NA24385_downsampled/eval_input.json rename to wdl_test/PBCCSWholeGenome/basic_output_valdation/NA24385_downsampled/eval_input.json diff --git a/wdl_test/PBCCSWholeGenome/NA24385_downsampled/test_input.json b/wdl_test/PBCCSWholeGenome/basic_output_valdation/NA24385_downsampled/test_input.json similarity index 100% rename from wdl_test/PBCCSWholeGenome/NA24385_downsampled/test_input.json rename to wdl_test/PBCCSWholeGenome/basic_output_valdation/NA24385_downsampled/test_input.json diff --git a/wdl_test/PBCCSWholeGenome/eval.wdl b/wdl_test/PBCCSWholeGenome/basic_output_valdation/eval.wdl similarity index 100% rename from wdl_test/PBCCSWholeGenome/eval.wdl rename to wdl_test/PBCCSWholeGenome/basic_output_valdation/eval.wdl diff --git a/wdl_test/PBCCSWholeGenome/eval_input_defaults.json b/wdl_test/PBCCSWholeGenome/basic_output_valdation/eval_input_defaults.json similarity index 100% rename from wdl_test/PBCCSWholeGenome/eval_input_defaults.json rename to wdl_test/PBCCSWholeGenome/basic_output_valdation/eval_input_defaults.json diff --git a/wdl_test/PBCCSWholeGenome/test_input_defaults.json b/wdl_test/PBCCSWholeGenome/basic_output_valdation/test_input_defaults.json similarity index 100% rename from wdl_test/PBCCSWholeGenome/test_input_defaults.json rename to wdl_test/PBCCSWholeGenome/basic_output_valdation/test_input_defaults.json From 763d0ed3cca8a39dcbfac3eb67f5cb2666414ea1 Mon Sep 17 00:00:00 2001 From: bshifaw Date: Thu, 24 Aug 2023 14:57:38 -0400 Subject: [PATCH 4/7] Note about having gcloud installed --- .../basic_output_valdation/test_input_defaults.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wdl_test/PBCCSWholeGenome/basic_output_valdation/test_input_defaults.json b/wdl_test/PBCCSWholeGenome/basic_output_valdation/test_input_defaults.json index e2e67b554..e7e491a50 100644 --- a/wdl_test/PBCCSWholeGenome/basic_output_valdation/test_input_defaults.json +++ b/wdl_test/PBCCSWholeGenome/basic_output_valdation/test_input_defaults.json @@ -11,5 +11,5 @@ "PBCCSWholeGenome.ref_map_file": "gs://broad-dsde-methods-long-reads/resources/references/grch38_noalt/grch38_noalt.txt", "PBCCSWholeGenome.ref_scatter_interval_list_ids": "gs://broad-dsde-methods-long-reads/resources/references/grch38_noalt/size_balanced_interva_lists_ids.txt", "PBCCSWholeGenome.ref_scatter_interval_list_locator": "gs://broad-dsde-methods-long-reads/resources/references/grch38_noalt/size_balanced_interva_lists.txt", - "PBCCSWholeGenome.run_dv_pepper_analysis": true + "PBCCSWholeGenome.run_dv_pepper_analysis": false } From a048f9acad533dd8e488827b334969952708acd2 Mon Sep 17 00:00:00 2001 From: bshifaw Date: Thu, 31 Aug 2023 09:30:27 -0400 Subject: [PATCH 5/7] fixed run_dv_pepper option --- .../basic_output_valdation/test_input_defaults.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wdl_test/PBCCSWholeGenome/basic_output_valdation/test_input_defaults.json b/wdl_test/PBCCSWholeGenome/basic_output_valdation/test_input_defaults.json index e7e491a50..e2e67b554 100644 --- a/wdl_test/PBCCSWholeGenome/basic_output_valdation/test_input_defaults.json +++ b/wdl_test/PBCCSWholeGenome/basic_output_valdation/test_input_defaults.json @@ -11,5 +11,5 @@ "PBCCSWholeGenome.ref_map_file": "gs://broad-dsde-methods-long-reads/resources/references/grch38_noalt/grch38_noalt.txt", "PBCCSWholeGenome.ref_scatter_interval_list_ids": "gs://broad-dsde-methods-long-reads/resources/references/grch38_noalt/size_balanced_interva_lists_ids.txt", "PBCCSWholeGenome.ref_scatter_interval_list_locator": "gs://broad-dsde-methods-long-reads/resources/references/grch38_noalt/size_balanced_interva_lists.txt", - "PBCCSWholeGenome.run_dv_pepper_analysis": false + "PBCCSWholeGenome.run_dv_pepper_analysis": true } From 125ed95b5200f27f869bd5f71d15eace79f71294 Mon Sep 17 00:00:00 2001 From: bshifaw Date: Thu, 31 Aug 2023 10:24:37 -0400 Subject: [PATCH 6/7] Have it so that push carrot test can occur on workflow dispatch --- .github/workflows/carrot_push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/carrot_push.yml b/.github/workflows/carrot_push.yml index 29b47b532..60891c7ef 100644 --- a/.github/workflows/carrot_push.yml +++ b/.github/workflows/carrot_push.yml @@ -3,7 +3,7 @@ # parameter as string seperated by space. name: carrot-test-on-push -on: [push] +on: [push, workflow_dispatch] jobs: publish-test: runs-on: ubuntu-latest From 3be7babd7472b3f51a479e17be35fb4c1941eb03 Mon Sep 17 00:00:00 2001 From: bshifaw Date: Thu, 19 Oct 2023 11:34:27 -0400 Subject: [PATCH 7/7] rm FileMetadata.wdl, made docker tag a parameter instead of docker image --- wdl_test/FileMetadata.wdl | 53 ------------------- .../NA24385_downsampled/eval_input.json | 2 +- .../basic_output_valdation/eval.wdl | 19 ++++--- 3 files changed, 13 insertions(+), 61 deletions(-) delete mode 100644 wdl_test/FileMetadata.wdl diff --git a/wdl_test/FileMetadata.wdl b/wdl_test/FileMetadata.wdl deleted file mode 100644 index d075a2a2a..000000000 --- a/wdl_test/FileMetadata.wdl +++ /dev/null @@ -1,53 +0,0 @@ -version 1.0 - -task CheckFileUpdatedDateGCP { - - meta { - description: "Checks if file was updated within a specified time (default: 1 day)" - note: "Specific to GCP" - } - - - input { - Array[String] file_paths - Int days_back = 1 - String image_to_use - } - - #FILE_DATE description: get file info | grep the 'Update Time' row | parse the date info | reformat date info - - command <<< - set -eu pipefail - - GS_BUCKET_PATHS=("~{sep='" "' file_paths}") - MINIMUM_DATE=`date -d '~{days_back} day ago' +%Y-%m-%d` - return_code=0 - echo -e "FileName\tFileUpdatedDate\tMinimumUpdateDate\tValid" - - for GS_FILE in ${GS_BUCKET_PATHS[@]}; - do - FILE_DATE=`gsutil stat ${GS_FILE} | grep "Update time" | awk -F '[,][ .]+' '{print $2}' | awk '{print "date -d\""$1FS$2FS$3"\" +%Y-%m-%d"}'| bash` - - if [[ $FILE_DATE >= $MINIMUM_DATE ]] ; then - echo -e "$GS_FILE\t$FILE_DATE\t$MINIMUM_DATE\tTrue" - else - echo "ERROR: Date for $GS_FILE" >&2 - echo "$FILE_DATE is less than $MINIMUM_DATE" >&2 - - echo -e "$GS_FILE\t$FILE_DATE\t$MINIMUM_DATE\tFalse" - return_code=1 - fi - done - - if [ $return_code == 1 ]; then - exit 1 - fi - - >>> - runtime { - docker: image_to_use - } - output { - File file_date_result = stdout() - } -} diff --git a/wdl_test/PBCCSWholeGenome/basic_output_valdation/NA24385_downsampled/eval_input.json b/wdl_test/PBCCSWholeGenome/basic_output_valdation/NA24385_downsampled/eval_input.json index 9e26dfeeb..0967ef424 100644 --- a/wdl_test/PBCCSWholeGenome/basic_output_valdation/NA24385_downsampled/eval_input.json +++ b/wdl_test/PBCCSWholeGenome/basic_output_valdation/NA24385_downsampled/eval_input.json @@ -1 +1 @@ -{} \ No newline at end of file +{} diff --git a/wdl_test/PBCCSWholeGenome/basic_output_valdation/eval.wdl b/wdl_test/PBCCSWholeGenome/basic_output_valdation/eval.wdl index 656602f1c..08c43bd38 100644 --- a/wdl_test/PBCCSWholeGenome/basic_output_valdation/eval.wdl +++ b/wdl_test/PBCCSWholeGenome/basic_output_valdation/eval.wdl @@ -71,8 +71,8 @@ workflow eval_workflow { dvp_g_vcf ] - String ubuntu_image = "marketplace.gcr.io/google/ubuntu2004:latest" - String gcloud_slim_image = "gcr.io/google.com/cloudsdktool/cloud-sdk:slim" + String ubuntu_image_tag = "latest" + String gcloud_slim_image_tag = "slim" ################ ## Compairing test and expected Floats @@ -100,7 +100,7 @@ workflow eval_workflow { call CheckerWorkflowError{ input: message = "Error: Expected a non-zero float but got "+in_float+" .", - image_to_use = ubuntu_image + image_tag = ubuntu_image_tag } } } @@ -109,7 +109,7 @@ workflow eval_workflow { call CheckFileUpdatedDateGCP { input: file_paths = workflow_out_files, - image_to_use = gcloud_slim_image + image_tag = gcloud_slim_image_tag } } @@ -124,9 +124,11 @@ task CheckFileUpdatedDateGCP { input { Array[String] file_paths Int days_back = 1 - String image_to_use + String image_tag } + String image_to_use = "gcr.io/google.com/cloudsdktool/cloud-sdk:" + image_tag + #FILE_DATE description: get file info | grep the 'Update Time' row | parse the date info | reformat date info command <<< @@ -168,8 +170,11 @@ task CheckerWorkflowError { input { String message - String image_to_use + String image_tag } + + String image_to_use = "marketplace.gcr.io/google/ubuntu2004:" + image_tag + command <<< set -eu pipefail @@ -226,4 +231,4 @@ task ValidMd5SumOutput { output { File comparison_result = stdout() } -} \ No newline at end of file +}