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

[ci] refactor cloudwatch metric publishing to avoid needing changes i… #2974

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

siddvenk
Copy link
Contributor

@siddvenk siddvenk commented Jan 31, 2024

…n primary workflows

Description

TLDR: Fixes cw metric publishing for scheduled workflow runs

The problem with the previous implementation of publishing metrics to cw for failed builds is that there is no simple way to parse the overall status of an in progress workflow (previous implementation is broken). To do so, we'd need to annotate each step with an id and parse the steps context, or have each step output it's status and parse all the outputs to determine the status.

Instead, we can use a workflow triggered by the workflow_run event for completed workflows. This triggered workflow can parse the status, name, and repo of the triggering workflow and use that to publish reliable metrics to CloudWatch.

I have tested this in a personal repo here https:/siddvenk/github-workflow-testing/actions/workflows/forking-workflow.yml, and it works as expected.

The other benefit here is we don't have to change any of the existing workflows, or new workflows to include a step to publish metrics. The CW publishing workflow only runs for workflows triggered by the scheduled event on the master branch of the repo.

One thing this does not achieve is publishing fine-grained metrics indicating which step of a workflow failed. That could be nice, but I think it's not necessary since we really just need to be alerted whenever a workflow fails.

@siddvenk siddvenk requested review from zachgk, frankfliu and a team as code owners January 31, 2024 18:21
@siddvenk siddvenk force-pushed the fix-cw-actions branch 2 times, most recently from 18412a4 to 2733533 Compare January 31, 2024 18:52
@codecov-commenter
Copy link

codecov-commenter commented Jan 31, 2024

Codecov Report

Attention: 1337 lines in your changes are missing coverage. Please review.

Comparison is base (bb5073f) 72.08% compared to head (bd1c443) 72.29%.
Report is 980 commits behind head on master.

Files Patch % Lines
...va/ai/djl/modality/nlp/generate/TextGenerator.java 2.81% 276 Missing ⚠️
.../java/ai/djl/modality/nlp/generate/SeqBatcher.java 0.75% 132 Missing ⚠️
...ity/nlp/generate/ContrastiveSeqBatchScheduler.java 2.97% 98 Missing ⚠️
...i/djl/modality/nlp/generate/SeqBatchScheduler.java 9.83% 55 Missing ⚠️
.../java/ai/djl/modality/cv/BufferedImageFactory.java 40.96% 47 Missing and 2 partials ⚠️
...a/ai/djl/modality/nlp/generate/StepGeneration.java 2.04% 48 Missing ⚠️
api/src/main/java/ai/djl/ndarray/NDArray.java 43.42% 39 Missing and 4 partials ⚠️
...n/java/ai/djl/modality/cv/output/CategoryMask.java 22.00% 39 Missing ⚠️
...i/src/main/java/ai/djl/ndarray/NDArrayAdapter.java 71.21% 31 Missing and 7 partials ⚠️
.../cv/translator/SemanticSegmentationTranslator.java 37.50% 35 Missing ⚠️
... and 74 more

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2974      +/-   ##
============================================
+ Coverage     72.08%   72.29%   +0.20%     
- Complexity     5126     7289    +2163     
============================================
  Files           473      722     +249     
  Lines         21970    32513   +10543     
  Branches       2351     3392    +1041     
============================================
+ Hits          15838    23506    +7668     
- Misses         4925     7386    +2461     
- Partials       1207     1621     +414     

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

@siddvenk siddvenk merged commit 2e97dd5 into deepjavalibrary:master Jan 31, 2024
5 checks passed
@siddvenk siddvenk deleted the fix-cw-actions branch January 31, 2024 21:15
frankfliu pushed a commit that referenced this pull request Apr 26, 2024
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