Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mercury] prevent silent failures #648

Merged
merged 2 commits into from
Oct 17, 2024
Merged

[Mercury] prevent silent failures #648

merged 2 commits into from
Oct 17, 2024

Conversation

sage-wright
Copy link
Member

@sage-wright sage-wright commented Oct 15, 2024

This PR closes #615

πŸ—‘οΈ This dev branch should be deleted after merging to main.

🧠 Summary

Causes the task to fail if the Mercury script fails.

⚑ Impacted Workflows/Tasks

  • Mercury_Prep_N_Batch

This PR may lead to different results in pre-existing outputs: No

This PR uses an element that could cause duplicate runs to have different results: No

πŸ› οΈ Changes

Adds set -euo pipefail to the top of the script to catch all potential errors so that the workflow fails as expected, preventing silent failures. Should greatly help in troubleshooting.

βš™οΈ Algorithm

➑️ Inputs

None

⬅️ Outputs

None

πŸ§ͺ Testing

Testing here with files that were already uploaded -- expecting error due to lack of deletion permissions.

Suggested Scenarios for Reviewer to Test

πŸ”¬ Final Developer Checklist

  • The workflow/task has been tested and results, including file contents, are as anticipated
  • The CI/CD has been adjusted and tests are passing (Theiagen developers)
  • Code changes follow the style guide
  • Documentation and/or workflow diagrams have been updated if applicable (Theiagen developers only)

🎯 Reviewer Checklist

  • All changed results have been confirmed
  • You have tested the PR appropriately (see the testing guide for more information)
  • All code adheres to the style guide
  • MD5 sums have been updated
  • The PR author has addressed all comments
  • The documentation has been updated

@sage-wright sage-wright marked this pull request as ready for review October 15, 2024 19:50
@sage-wright sage-wright requested a review from a team as a code owner October 15, 2024 19:50
@AndrewLangvt
Copy link
Contributor

Code change is minor & correct syntax; looks good to merge. @kapsakcj would you be able to run the few tests you were hoping to run in the next day or two so we can get this merged, perhaps by Friday?

@kapsakcj
Copy link
Contributor

Yes, I'll launch a test or 2 today and ping back here with the workflow links when they fail successfully.

@kapsakcj
Copy link
Contributor

OK here's 2 tests I launched where the mercury task failed as expected, instead of the downstream genbank_trim_fastas step in the workflow:

  1. https://app.terra.bio/#workspaces/cdph-terrabio-taborda-manual/CDPH_Support_Sandbox/job_history/2112b397-8188-4bc6-986d-08d75fcc725f
    a. Expected failure due to user (me) improperly setting optional input variable single_end to false and thus Mercury did not find a column called read2_dehosted since this is ClearLabs/nanopore data and that column doesn't exist.

Second attempt on same dataset: Expected success βœ… instead of failure. I set single_end to true and re-ran the wf on the same set. Want to also ensure this wf runs successfully with these code changes! https://app.terra.bio/#workspaces/cdph-terrabio-taborda-manual/CDPH_Support_Sandbox/job_history/afdd2366-bc12-4960-9667-616ee2c36efb


  1. https://app.terra.bio/#workspaces/cdph-terrabio-taborda-manual/CDPH_Support_Sandbox/job_history/791b9b12-e32e-44f0-8d15-930e7c1f2a13
    a. expected failure due to inability to delete objects off sra transfer bucket. This previously failed for the original user on the genbank_trim_fasta step instead of the expected mercury step. Running as Curtis' theiagen.cloud account to ensure theaccount does not have object admin privileges to delete objects off the bucket
    b. It failed as expected during mercury task due to GCP permission error

@AndrewLangvt AndrewLangvt merged commit 6f33550 into main Oct 17, 2024
4 checks passed
@AndrewLangvt AndrewLangvt deleted the smw-mercury-dev branch October 17, 2024 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[mercury] improve error handling in mercury task
3 participants