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: add a script for dynamically computing CI job matrix #123451

Merged
merged 3 commits into from
Apr 15, 2024

Conversation

Kobzol
Copy link
Contributor

@Kobzol Kobzol commented Apr 4, 2024

It would be great if was easier to run specific CI workflows locally, and also to allow us to spawn a specific CI workflow by bors, to enable running arbitrary try builds. See discussion here.

This PR is a first step in that direction.

  • Moves the definition of CI runners and (for now) PR jobs into a separate jobs.yml file.
  • Adds a simple Python script that reads the file, decides which jobs should be active for the current CI workflow, and prints them as JSON to their output.
  • The PR job then reads this output and generates its job matrix based on it.

By moving the job definitions from ci.yml into a separate file, we can handle it programmatically, which should make it easier to both do local execution of CI jobs and also to do arbitrary try builds.

@rustbot
Copy link
Collaborator

rustbot commented Apr 4, 2024

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Apr 4, 2024
@Kobzol Kobzol force-pushed the arbitrary-try-build branch 2 times, most recently from ff702ef to db63c8b Compare April 4, 2024 12:26
@rustbot rustbot added the O-wasi Operating system: Wasi, Webassembly System Interface label Apr 4, 2024
@Kobzol Kobzol force-pushed the arbitrary-try-build branch 5 times, most recently from 9aa059b to 8e95f35 Compare April 4, 2024 12:33
@rust-log-analyzer

This comment has been minimized.

@Kobzol Kobzol changed the title CI: allow running arbitrary try builds CI: add a script for dynamically computing CI job matrix Apr 4, 2024
@rust-log-analyzer

This comment has been minimized.

@Kobzol Kobzol marked this pull request as ready for review April 4, 2024 13:30
@Kobzol
Copy link
Contributor Author

Kobzol commented Apr 4, 2024

r? @pietroalbini

Copy link
Member

@pietroalbini pietroalbini left a comment

Choose a reason for hiding this comment

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

r=me after applying the suggestions

src/ci/github-actions/ci.yml Show resolved Hide resolved
src/ci/github-actions/jobs.yml Outdated Show resolved Hide resolved
@Kobzol
Copy link
Contributor Author

Kobzol commented Apr 15, 2024

Added comments.

@pietroalbini
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Apr 15, 2024

📌 Commit 72104e2 has been approved by pietroalbini

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 15, 2024
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Apr 15, 2024
@bors
Copy link
Contributor

bors commented Apr 15, 2024

⌛ Testing commit 72104e2 with merge ccfcd95...

@bors
Copy link
Contributor

bors commented Apr 15, 2024

☀️ Test successful - checks-actions
Approved by: pietroalbini
Pushing ccfcd95 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 15, 2024
@bors bors merged commit ccfcd95 into rust-lang:master Apr 15, 2024
13 checks passed
@rustbot rustbot added this to the 1.79.0 milestone Apr 15, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ccfcd95): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 678.486s -> 678.255s (-0.03%)
Artifact size: 315.96 MiB -> 316.00 MiB (0.01%)

@Kobzol Kobzol deleted the arbitrary-try-build branch April 16, 2024 05:55
@lqd
Copy link
Member

lqd commented Apr 16, 2024

BTW is the procedure described in https://rustc-dev-guide.rust-lang.org/tests/ci.html#using-ci-to-test still recommended? Or should we rather change jobs.toml to temporarily enable PR builders?

@Kobzol
Copy link
Contributor Author

Kobzol commented Apr 16, 2024

Currently jobs.yml needs to be modified to change what is executed on PRs, yeah. I plan to move the rest of the jobs to jobs.yml soon, then this section should be rewritten.

@RalfJung
Copy link
Member

Wow, I had no idea this is possible. Does that mean we can entirely get rid of the ./x.py run step to generate the yml files, and just compute them on-the-fly instead?

Also, this did had some probably unintended side-effect -- the actually relevant jobs for a PR no longer show up at the top of the list, half of them are hidden behind the scrollbar:

image

If there's a way to order these CI / {auto,try,master} down again, that'd be nice. :D

@Kobzol
Copy link
Contributor Author

Kobzol commented Apr 18, 2024

https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/job.20matrix.20re-ordered.20PR.20list It's not possible to reorder, but we plan to get around that by removing the skipped jobs from the list completely.

Yeah, I plan to work on removing the YAML preprocessing step next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. O-wasi Operating system: Wasi, Webassembly System Interface S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants