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

[IBCDPE-691] Adds Ability to Retrieve Workflow Task Logs from Tower #29

Merged
merged 20 commits into from
Oct 26, 2023

Conversation

BWMac
Copy link
Contributor

@BWMac BWMac commented Oct 24, 2023

This PR adds functionality to the nextflowtower service to retrieve metadata for the individual tasks in a Tower workflow run, and then to retrieve the execution logs for those individual tasks.

To do this, I implemented the get_workflow_tasks methods in NextflowTowerClient and NextflowTowerOps. client.get_workflow_tasks uses the /workflow/{workflow_id}/tasks Tower API endpoint to retrieve information about all of the tasks. Each individual task dictionary is then converted into a models.WorkflowTask object.

Task logs can now be retrieved by using the get_task_logs methods in client and ops. client.get_task_logs uses the /workflow/{workflow_id}/log/{task_id} Tower API endpoint to retrieve execution logs for an individual task.

Tests and example responses have also been added where necessary for all new methods.

Finally, I have included demo_nf_logs.py as an example of a Metaflow DAG that users can follow to retrieve task logs and evaluate why a workflow task has failed. I am unsure whether this script should belong in this repo, or in orca-recipes, however.

@swarmia
Copy link

swarmia bot commented Oct 24, 2023

@codecov
Copy link

codecov bot commented Oct 25, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7f63c0e) 100.00% compared to head (552e08c) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #29   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           28        28           
  Lines          874       920   +46     
  Branches       138       140    +2     
=========================================
+ Hits           874       920   +46     
Files Coverage Δ
src/orca/services/nextflowtower/client.py 100.00% <100.00%> (ø)
src/orca/services/nextflowtower/models.py 100.00% <100.00%> (ø)
src/orca/services/nextflowtower/ops.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

demo_nf_logs.py Outdated Show resolved Hide resolved
@BWMac BWMac marked this pull request as ready for review October 25, 2023 20:30
@BWMac BWMac requested a review from a team October 25, 2023 20:31
demo_nf_logs.py Outdated Show resolved Hide resolved
Copy link
Contributor

@BryanFauble BryanFauble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM!

Copy link
Collaborator

@thomasyu888 thomasyu888 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

tests/services/nextflowtower/responses.py Show resolved Hide resolved
@sonarcloud
Copy link

sonarcloud bot commented Oct 26, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 7 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@BWMac BWMac merged commit ea1a993 into main Oct 26, 2023
12 checks passed
@BWMac BWMac deleted the bwmac/IBCDPE-691/workflow-tasks-logs branch October 26, 2023 15:39
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.

3 participants