Problem/Motivation
Not sure if this is a good idea, but opening to document.
Our scheduled pipelines run tests against multiple environments, this results in dozens of simultaneous gitlab jobs, which means a spike in AWS resources every day.
Potentially, we could run each environment in sequence (probably by making environments depend on other environments or similar), and this would then use less runners, but for a longer period of time, smoothing out the peak usage. It doesn't lower the CPU overall, but it might mean more re-use of spot instances.
Steps to reproduce
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 3404487-nr-bot.txt | 90 bytes | needs-review-queue-bot |
| #5 | Screenshot 2023-11-29 at 16.42.14.png | 51.49 KB | fjgarlin |
| #4 | Screenshot 2023-11-29 at 16.35.26.png | 43.15 KB | fjgarlin |
Issue fork drupal-3404487
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
fjgarlin commentedBased on some tests that we did while monitoring resources, I think this is a good idea. Only automatic / scheduled runs should be affected. And single child pipeline runs should remain unchanged (and therefore around 10 mins total).
So +1 on doing this.
Comment #4
fjgarlin commentedI think this is ready to review.
MR: https://git.drupalcode.org/project/drupal/-/merge_requests/5584/diffs
Things I did in the MR:
The MR scenario is easy to test, with this issue's MR. ie: https://git.drupalcode.org/issue/drupal-3404487/-/pipelines/56778
I wanted to test the "on-push", so I created a new branch, without MR linked to it, and added a special workflow rule like this: https://git.drupalcode.org/issue/drupal-3404487/-/blob/3404487-test-comm... and also
COMPOSER_ROOT_VERSION: "11.x-dev"for this test.We can see the pipeline running as expected and with the expected jobs: https://git.drupalcode.org/issue/drupal-3404487/-/pipelines/56789. The jobs also ran in order, first default, then the next, then the next.
First:

Second (which was triggered right after the first one finished):

Comment #5
fjgarlin commentedComment #6
smustgrave commentedBased on the screenshots this seems fine?
Comment #7
longwaveShould we merge
run-on-mrrules into thedefaultblock? Then we can removerun-on-mrfrom each of the main MR jobs, and override the rules for the default, commit and daily cases?edit: no, because this would break or need overriding in the build and lint jobs
Comment #8
longwaveAs with a lot of these CI changes the only real way to test is to run with them in production for a while and see what happens.
Committed and pushed fe8bed7bbe to 11.x and 327ddf5a56 to 10.2.x. Thanks!
Comment #11
longwaveHm, the problem now is that if we have a random failure, it appears to stop the subsequent jobs from trying to run: https://git.drupalcode.org/project/drupal/-/pipelines/56988
Comment #12
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #13
fjgarlin commentedRe #11, we could maybe put
allow: failurein the sequence, but then we wouldn't be able to tell the difference with real failures.We could also maybe have a
retry, but again, no way to know real failures from random ones.The random ones are being worked on #3403162: [investigation] get metrics of request to see which settings need to be changed for random failures. I'm planning to leave an MR ready where I think I'm fixing some of them, but probably not all. I'll leave the
markTestSkippedfor those that I can't fix so far.Comment #14
longwaveIf
allow: failurejust means the job can continue but we still get a green tick in the pipeline UI if the previous job succeeded, and a red cross otherwise, I think that might be ok for the commit/daily tests? We don't want that for the MR tests though.Comment #15
fjgarlin commentedComment #17
fjgarlin commentedTesting https://git.drupalcode.org/project/drupal/-/merge_requests/5609
In the test-branch here: https://git.drupalcode.org/issue/drupal-3404487/-/pipelines/57171
Now hoping for a fail somewhere in the chain...
If what I've done does what I believe should do. Fail on the default pipeline on MR will show up as fail, but fails in on-push or daily will just show up as warnings.
Comment #18
fjgarlin commentedIt worked as I expected. The whole pipeline run even if the second one had a fail. That marks the parent pipeline as "Warning", which I think it's what we want here.
https://git.drupalcode.org/issue/drupal-3404487/-/pipelines
Comment #19
catchI think we could consider halting the child runs on a fail (to save 10 environments telling us we made a bad commit), but we probably only once we've got very infrequent random test failures, so +1 for doing this.
Comment #20
longwaveYep, this seems like the best compromise for now.
Committed and pushed e687d46ec7 to 11.x and 4ae3c26580 to 10.2.x. Thanks!
Comment #23
andypostPlease close MRs