-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add Nim-matrix workflow to run on merge queue #693
Conversation
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 @veaceslavdoina for figuring this out, looks like it wasn't trivial 😄
Is there something we can do to avoid the duplication between ci.yml
and nim-matrix.yml
? They both contain very similar steps, and I'm afraid that we'll forget to update one of them in the future.
99e2f3a
to
cceb77c
Compare
@markspanbroek, it was a long story with lots of experiments 😄 Thank you for the idea. Now we use Reusable workflows for We probably should enable Also, jobs names were changed slightly and now include Nim version to have an unified pattern for |
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 for removing the duplication! It all looks good to me now.
cceb77c
to
3c95558
Compare
|
||
env: | ||
cache_nonce: 0 # Allows for easily busting actions/cache caches | ||
nim_version: v1.6.14, v1.6.16, v1.6.18, v2.0.0, v2.0.2 |
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.
Guys, why do we have 2.x in the compiler matrix? Is Codex supposed to work with 2.x?
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.
yes, we want to start moving to 2.x
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.
oh... but this will fail for now, since we haven't completed the move @veaceslavdoina
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.
That was the idea?
We probably should enable merge queue only after confirmation that builds with Nim v2 passes. We can trigger Nim-matrix workflow manually until that.
Merge queue is not enabled and Nim-matrix
workflow is not used yet, may be just to test how it works. If we want to use it right now, we then should remove v2 from the list.
Should we?
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.
Ah I see, well, if it isn't being used for now, then no harm in keeping it, but as soon as we do, it will break with 2.x and so it would need to be disabled until we port Codex over.
Context
In PR Build improvements #680, we raised the question about building Codex using different Nim versions, but only before the merge to not slow-down existing PR flow and to not waste resources on every push.
We can try to use GitHub merge queue to implement that.
PR
build-status
job toCI
workflow to check matrix execution status - will use it in branch ruleNim-matrix
workflow to run only on merge queue and only on LinuxCI
workflow to cancel previous run at PR next commitsNext steps
branch rules
with justbuild / status
jobmerge queue
inbranch rules
-- Not ready? Just not enable
merge queue
and then runNim-matrix
workflow manually.Known issues
PR
andmerge queue
and this is why we use singlebuild-status
job name for both workflowsNim-matrix
workflow we consume GitHub OrgTotal concurrent jobs
limitNim-matrix
workflow fail very often on BuildJet runners at tests - we use GitHub ones for nowMore details
Implementation
In the current merge queue implementation we can't set branch rules separately for
PR
andmerge queue
checks and this is very confusing. In that way, both workflows should be run onPR
andmerge queue
and we would need to run steps conditionally and that adds some ambiguity.This is why we workaround that by using a single
build-status
job name for both workflows and run them separately. In that way,PR
andmerge queue
checks will pass at their own stages.Basically, flow will be the following
PR
CI
workflow will be triggeredCI
workflow will be finished successfully and auto-merge is enabled, PR will be moved into the merge queueMerge queue
Nim-matrix
workflow will be triggeredNim-matrix
workflow will mark branch as protected (push is not permitted) and willmaster
Nim-matrix
workflow will fail we should press auto-merge button again or start from PR-p.3Nim-matrix
checks will pass, PR will be merged automaticallyMore information can be found in How merge queues work.
Speed
Merge queue will add an additional matrix of jobs to build over different Nim versions. Because they will run in parallel, max merge delay will be equal to the job max execution time.
ubuntu-latest
19m 23s
Free
Free
buildjet-4vcpu-ubuntu-2204
15m 33s
0.128 $/job
0.64 $/run
buildjet-8vcpu-ubuntu-2204
13m 14s
0.224 $/job
1.12 $/run
buildjet-16vcpu-ubuntu-2204
13m 00s
0.416 $/job
2.08 $/run