-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Run e2e jobs as a single workflow #6310
Run e2e jobs as a single workflow #6310
Conversation
Signed-off-by: vaidikcode <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6310 +/- ##
==========================================
- Coverage 96.14% 96.11% -0.03%
==========================================
Files 356 356
Lines 20476 20476
==========================================
- Hits 19686 19681 -5
- Misses 603 607 +4
- Partials 187 188 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need crossdock and hotrod in this list. Definitely not crossdock, as it's a very special form of tests. Could go both ways on hotrod.
Is it possible to achieve this single workflow without massive copy pasting? For example, do a git move of the existing workflow files into a subfolder (e.g. ../actions/e2e/) and call them from the combined workflow?
@yurishkuro Should I also exclude HotRod? |
Yes, let's exclude hotrod for now. |
Signed-off-by: vaidikcode <[email protected]>
Signed-off-by: vaidikcode <[email protected]>
you can check the validity of the new workflow on the Checks tab https://github.com/jaegertracing/jaeger/actions/runs/12166601553 |
Signed-off-by: vaidikcode <[email protected]>
.github/workflows/cit-workflow.yml
Outdated
|
||
jobs: | ||
badger: | ||
uses: ./.github/actions/e2e/ci-e2e-badger.yaml@main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
try creating a dummy workflow first and referencing it like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i tried but the same error. It seems GitHub Actions expects workflows to be in the .github/workflows directory. How should I proceed with this now. Is the approach to add all the workflows as jobs in a single file ok or is there any other solution to it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the fact that it gives a specific error makes me think that the workflow inclusion is actually supported, that is why I am suggesting:
- try creating two dummy workflows A and B in the workflow dir
- make A include and run B
- check if the runner executes A successfully (with B), but standalone B is not executed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And I would prefer you do these experiments in your own test repo, there is no need to run a battery of expensive jaeger tests while you don't have a solve for the workflows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If including workflow in a workflow does not work, then the alternative is to define the jobs in a combined workflow and use the existing files as actions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this in my test repository, and this approach works perfectly. I just needed to add workflow_call to the CI workflows. Thank you for the feedback!
Signed-off-by: vaidikcode <[email protected]>
Signed-off-by: vaidikcode <[email protected]>
Signed-off-by: vaidikcode <[email protected]>
Signed-off-by: vaidikcode <[email protected]>
Signed-off-by: vaidikcode <[email protected]>
Signed-off-by: vaidikcode <[email protected]>
Signed-off-by: vaidikcode <[email protected]>
Signed-off-by: vaidikcode <[email protected]>
Signed-off-by: vaidikcode <[email protected]>
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ (github.event.pull_request && github.event.pull_request.number) || github.ref || github.run_id }} | ||
group: cit-badger-${{ github.workflow }}-${{ (github.event.pull_request && github.event.pull_request.number) || github.ref || github.run_id }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: instead of hardcoding strings like cit-badger
, could we use some standard variables like workflow-name (which we already use) and job name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${{ github.workflow }}-${{ github.job }}-${{ (github.event.pull_request && github.event.pull_request.number) || github.ref || github.run_id }} you mean like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this be the same for the combined CIT workflow as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good question - what's the granularity of the concurrency settings? Do we need this setting on the combined workflow if individual jobs can cancel themselves as needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might not need concurrency at the combined workflow level unless there are scenarios where concurrent triggers could occur.
- A push to the
main
branch and a PR tomain
happening simultaneously. - Manual trigger while a push event is in progress.
Should we proceed with adding concurrency here, or leave it out for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In those 2 scenarios what would concurrency on combine workflow achieve that won't be covered by the job-level settings? All we want is to cancel a job for a PR or a branch if a new version of the PR or branch is available, so as to not waste the runner resources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking along the same lines—are we agreeing that no concurrency at the combined workflow level is the approach here, relying instead on job-level concurrency to handle redundant jobs efficiently
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${{ github.workflow }}-${{ github.job }}-${{ (github.event.pull_request && github.event.pull_request.number) || github.ref || github.run_id }}
can you try & test this? If you already have a setup in a private repo, the test would be to start a workflow, open some of the runs in a tab, then push a new commit and observe those runs to be cancelled. Then repeat the same for a branch push instead of a PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested both scenarios as discussed, with the following observations:
Scenario 1: PR with Multiple Commits
Initially, used concurrency at the combined level:
combined-cit-${{ github.workflow }}-${{ (github.event.pull_request && github.event.pull_request.number) || github.ref || github.run_id }}
along with reference-level concurrency:
${{ github.workflow }}-${{ github.job }}-${{ (github.event.pull_request && github.event.pull_request.number) || github.ref || github.run_id }}
This setup caused issues—some referenced workflows in the combined workflow were executed while others were cancelled, even on creating a simple PR.
Removed concurrency at the combined level and retained reference-level concurrency as:
cit-badger-${{ github.workflow }}-${{ github.job }}-${{ (github.event.pull_request && github.event.pull_request.number) || github.ref || github.run_id }}
With this, the workflows behaved as expected, and previous jobs were cancelled when new commits were pushed to the PR.
Scenario 2: Branch Push
Tested with no concurrency at the combined level and only the reference-level concurrency:
cit-badger-${{ github.workflow }}-${{ github.job }}-${{ (github.event.pull_request && github.event.pull_request.number) || github.ref || github.run_id }}
The previous jobs were successfully cancelled when new commits were pushed to the branch.
Observations
Keeping or removing concurrency at the combined level didn’t change the outcome, as long as the reference-level concurrency was properly configured.
For the tests to work reliably, the concurrency group needed a prefix like cit-badger or similar. Without this prefix, referenced workflows in the combined workflow might execute inconsistently (some running and others cancelling) even when just creating a PR.
Should we finalize this setup with no concurrency at the combined level and the prefix-based approach at the reference level? wdyt?
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Signed-off-by: vaidikcode [email protected]
Which problem is this PR solving?
Description of the changes
How was this change tested?
Checklist
jaeger
:make lint test
jaeger-ui
:yarn lint
andyarn test