-
Notifications
You must be signed in to change notification settings - Fork 532
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] Divide CI into gates #13861
[CI] Divide CI into gates #13861
Conversation
0119012
to
c8f5ceb
Compare
Effect of my changes can be observed on separate pipeline: |
537b554
to
ca7280e
Compare
882751e
to
67753c3
Compare
ac4aac4
to
2cfe5a1
Compare
!ci-build-me |
2 similar comments
!ci-build-me |
!ci-build-me |
99bced3
to
fb3024d
Compare
!ci-build-me |
19b2f5d
to
139763c
Compare
!ci-build-me |
3 similar comments
!ci-build-me |
!ci-build-me |
!ci-build-me |
…fluently describe which jobs should be run.
This reverts commit 19eb5173424b19d30a61fd968aa3381f45afff4d.
1837496
to
38712a8
Compare
!ci-build-me |
1 similar comment
!ci-build-me |
!ci-build-me |
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.
Looks good. I cannot think of any conflicts of concerns.
One item worth noting is that the Tag
and Mode
have adjacent functionality to controls available in webhooks settings within the repo, but I don't think they overlap in current form.
a4475b7
to
c425cb1
Compare
!ci-build-me |
!ci-build-me |
!ci-build-me |
!ci-build-me |
!ci-build-me |
Approving since the changes are only in the buildkite/CI related files |
!approved-for-mainnet |
Explain your changes:
Current Buildkite CI does not distinguish on dhall level if we are running nightly or PullRequest tests. However, from deep dive into logic, there is some work done, which can be extended to control which job should run on nightly. By providing
export BUILDKITE_PIPELINE_MODE=Stable
we can signal Ci that we want to run nightly jobs so Monorepo triage is disabled and all known jobs will be run.However, it's not satisfactory, as we also want to exclude some jobs from PullRequest stage and run only on Stable. Therefore I introduced new attribute of
JobSpec
struct :mode
which by default is set to PullRequest, but in some occasion can be override toStable
. Then code in monorepo traige job analyze it and prevents this jobs from running.Stable (a.k.a Nightly ) logic is unchanged.
Then i went a bit further into CI configuration and was experimenting with splitting pipeline into 2-3 pipeline gates.
As a result i come up with tagging mechanism which can be fluently used to choose which subset of jobs should be run. Imagine situation in which we want to run only fast and lints jobs. In my PR i already tag jobs which duration is less than 10 minutes (with tag: Fast) and marked all linting jobs with tag: Lint. Then, I introduced Filter module which creates collection of tags (for user convenience, it's better to use single value: PIPELINE_FILTER: FastAndLints rather than PIPELINE_TAGS: [Fast, Lint]). Now user can run fast and lint jobs by below setup:
But this is not over. We can define multiple stages using filters and wait command between them. Imagine situation in which we would like to have 3 group of jobs for our pipeline:
We can reach above goal by setup like below (i omitted not important parameters):
The above setup can be used for PR verifications. It will first run fast jobs and lints. If any of them is red, fail the build and won't run long jobs, preserving time and cost.
Explain how you tested your changes:
I tested it on fuzzy zkapp tests job example, which is using $NIGHTLY parameter which on script level control if jobs is empty but evergreen on PullRequest or have actual test run on Stable. I removed that logic from script and put Stable as job mode in dhall. Then verified job is not run.
Checklist: