Skip to content

Commit

Permalink
Merge pull request #1384 from broadinstitute/develop
Browse files Browse the repository at this point in the history
dev --> staging
  • Loading branch information
ekiernan authored Oct 9, 2024
2 parents e485b0a + ec91e51 commit 3ff3c74
Show file tree
Hide file tree
Showing 5 changed files with 401 additions and 21 deletions.
191 changes: 191 additions & 0 deletions .github/workflows/test_illumina_genotyping_array.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@

name: Test Illumina Genotyping Array

# Controls when the workflow will run
on:
#run on push to feature branch "kp_GHA_Terra_auth_PD-2682" - REMOVE WHEN DONE TESTING
# push:
# branches:
# - kp_GHA_Terra_auth_PD-2682
pull_request:
branches: [ "develop", "staging", "master" ]
# Only run if files in these paths changed: pipelines/broad/genotyping/illumina, tasks, verification, .github/workflows/test_illumina_genotyping_array.yml
paths:
- 'pipelines/broad/genotyping/illumina/**'
- 'tasks/**'
- 'verification/**'
- '.github/workflows/test_illumina_genotyping_array.yml'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
useCallCache:
description: 'Use call cache (default: true)'
required: false
default: "true"
env:
PROJECT_NAME: WARP
# Github repo name
REPOSITORY_NAME: ${{ github.event.repository.name }}

jobs:
run_pipeline:
runs-on: ubuntu-latest
# Add "id-token" with the intended permissions.
permissions:
contents: 'read'
id-token: 'write'

steps:
# actions/checkout MUST come before auth
- uses: 'actions/checkout@v3'

- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v2'
with:
token_format: 'access_token'
# Centralized in dsp-tools-k8s; ask in #dsp-devops-champions for help troubleshooting
# This is provided by the DevOps team - do not change!
workload_identity_provider: 'projects/1038484894585/locations/global/workloadIdentityPools/github-wi-pool/providers/github-wi-provider'
# This is our tester service account
service_account: '[email protected]'
access_token_lifetime: '3600' #seconds, default is 3600
access_token_scopes: 'profile, email, openid'

# ... further steps are automatically authenticated
- name: Check working directory
run: |
echo "Current directory:"
pwd
ls -lht
- name: Submit job, poll status, and get outputs
id: pipeline_run
run: |
# Set these environment variables
TOKEN="${{ steps.auth.outputs.access_token }}"
NAMESPACE="warp-pipelines"
WORKSPACE="WARP Tests"
PIPELINE_NAME="IlluminaGenotypingArray"
USE_CALL_CACHE="${{ github.event.inputs.useCallCache }}"
# Function to call the Firecloud API using the firecloud_api.py script
firecloud_action() {
python3 scripts/firecloud_api/firecloud_api.py --token "$TOKEN" --namespace "$NAMESPACE" --workspace "$WORKSPACE" --action "$1" "${@:2}"
}
# Create the submission_data.json file
SUBMISSION_DATA_FILE="submission_data.json"
# Convert USE_CALL_CACHE to a boolean-friendly format ("true" -> true, "false" -> false)
if [ "$USE_CALL_CACHE" = "true" ]; then
USE_CALL_CACHE_BOOL=true
else
USE_CALL_CACHE_BOOL=false
fi
# Use a heredoc to generate the JSON file content dynamically
cat <<EOF > "$SUBMISSION_DATA_FILE"
{
"methodConfigurationNamespace": "warp-pipelines",
"methodConfigurationName": "$PIPELINE_NAME",
"useCallCache": $USE_CALL_CACHE_BOOL,
"deleteIntermediateOutputFiles": true,
"useReferenceDisks": true,
"memoryRetryMultiplier": 1.2,
"workflowFailureMode": "NoNewCalls",
"userComment": "Automated submission",
"ignoreEmptyOutputs": false
}
EOF
echo "Created submission data file: $SUBMISSION_DATA_FILE"
# 1. Submit a new workflow using the generated submission_data.json
SUBMISSION_ID=$(firecloud_action submit --submission_data_file "$SUBMISSION_DATA_FILE")
# Check if submission was successful
if [ -z "$SUBMISSION_ID" ]; then
echo "Submission failed." # Log failure to stdout
echo "submission_id=" >> $GITHUB_OUTPUT # Set empty submission id
exit 1
fi
echo "Submission ID: $SUBMISSION_ID"
echo "submission_id=$SUBMISSION_ID" >> $GITHUB_OUTPUT # Write the submission ID to GITHUB_OUTPUT
# 2. Poll submission status and get workflow IDs and statuses
echo "Polling submission status..."
RESPONSE=$(firecloud_action poll_status --submission_id "$SUBMISSION_ID")
# Parse the JSON response to get the workflow ID and statuses
echo "Workflows and their statuses:"
echo "$RESPONSE" | jq
# Check if RESPONSE is empty
if [ -z "$RESPONSE" ]; then
echo "Failed to retrieve Workflow IDs." # Log failure to stdout
exit 1
fi
# Extract workflows and their statuses
WORKFLOW_STATUSES=$(echo "$RESPONSE" | jq -r 'to_entries | map(.key + ": " + .value) | .[]')
echo "workflow_statuses=$WORKFLOW_STATUSES" >> $GITHUB_OUTPUT # Write workflow statuses to GITHUB_OUTPUT
# Generate markdown summary table for workflows and statuses
WORKFLOW_TABLE=$(echo "$RESPONSE" | jq -r 'to_entries | ["Workflow ID | Status", "--- | ---"] + map(.key + " | " + .value) | .[]')
# Print workflow table to stdout
echo "$WORKFLOW_TABLE"
# 3. Iterate over the Workflow IDs to get outputs
OUTPUTS=""
echo "Retrieving workflow outputs..."
for WORKFLOW_ID in $(echo "$RESPONSE" | jq -r 'keys[]'); do
WORKFLOW_OUTPUT=$(firecloud_action get_outputs --submission_id "$SUBMISSION_ID" --workflow_id "$WORKFLOW_ID" --pipeline_name "$PIPELINE_NAME")
OUTPUTS+="$WORKFLOW_OUTPUT"$'\n'
done
echo "Workflow outputs retrieved successfully."
echo "Raw output before jq:"
echo "$OUTPUTS"
echo "outputs=$OUTPUTS" >> $GITHUB_OUTPUT # Write the outputs to GITHUB_OUTPUT
# Handle null values, strings, and numbers in the outputs by converting everything to a string and replacing null with '-'
OUTPUTS_TABLE=$(echo "$OUTPUTS" | jq -r 'to_entries | ["Output | Value", "--- | ---"] + map(.key + " | " + (if .value == null then "-" else (.value | tostring) end)) | .[]')
#print outputs table to stdout
echo "$OUTPUTS_TABLE"
- name: Print Summary on Success
if: success()
run: |
echo "# :white_check_mark: Pipeline Execution Summary :white_check_mark:" >> $GITHUB_STEP_SUMMARY
echo "- **Pipeline Name**: IlluminaGenotypingArray" >> $GITHUB_STEP_SUMMARY
echo "- **Submission ID**: ${{ steps.pipeline_run.outputs.submission_id }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "## Workflows and their statuses" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "${{ steps.pipeline_run.outputs.workflow_statuses }}" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "## Workflow Outputs" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "${{ steps.pipeline_run.outputs.outputs }}" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo " :shipit: " >> $GITHUB_STEP_SUMMARY
- name: Print Summary on Failure
if: failure()
run: |
echo "# :x: Pipeline Execution Summary (on Failure) :x: " >> $GITHUB_STEP_SUMMARY
echo "- **Pipeline Name**: IlluminaGenotypingArray" >> $GITHUB_STEP_SUMMARY
echo "- **Submission ID**: ${{ steps.pipeline_run.outputs.submission_id }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "## Workflows and their statuses (if available)" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "${{ steps.pipeline_run.outputs.workflow_statuses }}" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "## Workflow Outputs (if available)" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
echo "${{ steps.pipeline_run.outputs.outputs }}" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ venv/
.flake8

# Metals server logs and other files (for Scala)
.metals
.metals

# Ignore generated credentials from google-github-actions/auth
gha-creds-*.json
38 changes: 19 additions & 19 deletions pipeline_versions.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
Pipeline Name Version Date of Last Commit
RNAWithUMIsPipeline 1.0.17 2024-09-06
CheckFingerprint 1.0.21 2024-09-06
CramToUnmappedBams 1.1.3 2024-08-02
ExomeReprocessing 3.3.1 2024-09-17
ExternalExomeReprocessing 3.3.1 2024-09-17
ExternalWholeGenomeReprocessing 2.3.1 2024-09-17
WholeGenomeReprocessing 3.3.1 2024-09-17
RNAWithUMIsPipeline 1.0.17 2024-09-06
AnnotationFiltration 1.2.6 2024-09-06
IlluminaGenotypingArray 1.12.22 2024-09-06
UltimaGenomicsWholeGenomeGermline 1.1.0 2024-09-06
ExomeGermlineSingleSample 3.2.1 2024-09-17
WholeGenomeGermlineSingleSample 3.3.1 2024-09-17
ExomeGermlineSingleSample 3.2.1 2024-09-17
JointGenotypingByChromosomePartTwo 1.5.1 2024-09-10
JointGenotypingByChromosomePartOne 1.5.1 2024-09-10
ReblockGVCF 2.3.0 2024-09-06
Expand All @@ -19,24 +13,30 @@ UltimaGenomicsJointGenotyping 1.2.1 2024-09-10
VariantCalling 2.2.2 2024-09-06
UltimaGenomicsWholeGenomeCramOnly 1.0.21 2024-09-06
GDCWholeGenomeSomaticSingleSample 1.3.3 2024-09-06
Imputation 1.1.14 2024-09-06
Arrays 2.6.28 2024-09-06
MultiSampleArrays 1.6.2 2024-08-02
ValidateChip 1.16.6 2024-09-06
BroadInternalRNAWithUMIs 1.0.34 2024-09-06
BroadInternalUltimaGenomics 1.1.0 2024-09-06
BroadInternalImputation 1.1.13 2024-09-06
BroadInternalArrays 1.1.12 2024-09-06
BroadInternalImputation 1.1.13 2024-09-06
Arrays 2.6.28 2024-09-06
ValidateChip 1.16.6 2024-09-06
MultiSampleArrays 1.6.2 2024-08-02
Imputation 1.1.14 2024-09-06
IlluminaGenotypingArray 1.12.22 2024-09-06
ExternalWholeGenomeReprocessing 2.3.1 2024-09-17
ExternalExomeReprocessing 3.3.1 2024-09-17
CramToUnmappedBams 1.1.3 2024-08-02
WholeGenomeReprocessing 3.3.1 2024-09-17
ExomeReprocessing 3.3.1 2024-09-17
BuildIndices 3.0.0 2023-12-06
scATAC 1.3.2 2023-08-03
snm3C 4.0.4 2024-08-06
Multiome 5.7.0 2024-09-24
PairedTag 1.7.0 2024-09-24
MultiSampleSmartSeq2 2.2.22 2024-09-11
MultiSampleSmartSeq2SingleNucleus 2.0.1 2024-09-24
PairedTag 1.7.0 2024-09-24
SmartSeq2SingleSample 5.1.21 2024-09-11
scATAC 1.3.2 2023-08-03
Optimus 7.7.0 2024-09-24
Multiome 5.7.0 2024-09-24
snm3C 4.0.4 2024-08-06
BuildIndices 3.0.0 2023-12-06
atac 2.3.1 2024-09-11
SmartSeq2SingleSample 5.1.21 2024-09-11
SlideSeq 3.4.2 2024-09-24
BuildCembaReferences 1.0.0 2020-11-15
CEMBA 1.1.7 2024-09-06
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@
"Multiome.Atac.num_threads_bwa":"24",
"Multiome.Atac.mem_size_bwa":"175",
"Multiome.gex_nhash_id":"example_1234",
"Multiome.gex_nhash_id":"example_1234"
"Multiome.atac_nhash_id":"example_1234"
}
Loading

0 comments on commit 3ff3c74

Please sign in to comment.