Repository navigation
CLDSRV-1120: Speed up the CI - #6417
nicolas2bert wants to merge 4 commits into
Conversation
Each shard runs half of the functional suites on its own runner, so the mongo, file and s3c jobs end in about 7 minutes instead of 12. The split doubles the jobs that pull images, so we retry docker compose up when ghcr.io drops a pull. We also set fail-fast to false, so a failed shard doesn't cancel the others and we can rerun only that shard.
Hello nicolas2bert,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Incorrect fix versionThe
Considering where you are trying to merge, I ignored possible hotfix versions and I expected to find:
Please check the |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files
@@ Coverage Diff @@
## development/9.4 #6417 +/- ##
===================================================
- Coverage 86.90% 86.85% -0.05%
===================================================
Files 214 214
Lines 14764 14764
===================================================
- Hits 12830 12823 -7
- Misses 1934 1941 +7
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Request integration branchesWaiting for integration branch creation to be requested by the user. To request integration branches, please comment on this pull request with the following command: Alternatively, the |
| echo "Attempt ${attempt} failed: $*" >&2 | ||
| [ "${attempt}" -lt 3 ] && sleep 15 | ||
| done | ||
| exit 1 |
There was a problem hiding this comment.
| echo "Attempt ${attempt} failed: $*" >&2 | |
| [ "${attempt}" -lt 3 ] && sleep 15 | |
| done | |
| exit 1 | |
| rc=$? | |
| echo "Attempt ${attempt} failed (exit ${rc}): $*" >&2 | |
| [ "${attempt}" -lt 3 ] && sleep 15 | |
| done | |
| exit ${rc} |
You could print and return the command's exit code
There was a problem hiding this comment.
Good idea, done. A failure now shows the real exit code instead of always 1.
| "ft_test_shard1": "npm-run-all -s ft_awssdk_object ft_node", | ||
| "ft_test_shard2": "npm-run-all -s ft_awssdk_no_object ft_s3cmd ft_s3curl ft_healthchecks ft_management ft_util ft_backbeat", |
There was a problem hiding this comment.
I'd rename shard 1 and 2 with more descriptive names like shardObject shardOther and carry them over through the CI so we know more easily what's running in each.
There was a problem hiding this comment.
I thought about it, but I'd keep the numbers. The split is by time, not by topic. For example, ft_node is in shard 1 only to balance the two halves, it has nothing to do with objects. If we move a suite one day to rebalance, a name like "object" becomes wrong. The comment above the jobs already says what each shard runs. Does that work for you?
There was a problem hiding this comment.
image build is more advanced in more recent branches, will need some work in the waterflow branch
Keep the 9.5 build job as it is and drop build-federation. A separate PR will handle 9.5.
I suggest doing it the other way : first a PR in 9.5, then this PR can resolve the conflicts once.
- Reverting in waterflow means the change is not available in future branches, and relies on developers to make the change again later (which is exactly what waterflow aims to avoid in the first place)
- As far as git conflicts resolution, it means that when you are done with both PRs, the federation job first added here will conflict with the federation job that you will reintroduce in the second PR. Fine as far as you are concerned, but will bite the next person modifying the job in 9.4 branch
| packages: write | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 |
There was a problem hiding this comment.
checkout v4 is outdated (currently at v7)
There was a problem hiding this comment.
same for other actions setup-buildx-action@v4, docker/login-action@v4, docker/build-push-action@v7
There was a problem hiding this comment.
Fair point, but the whole file uses these versions, on 9.4 and even on 9.7. I only copied them for the new job. Bumping all the actions should be its own change, I'd rather not mix it in here. Anyway this job goes away, see my last comment.
|
|
||
| # The federation image starts from the cloudserver image, so we build it | ||
| # after the build job. No test uses it, so the tests don't wait for it. | ||
| build-federation: |
There was a problem hiding this comment.
this does not only "build-federation", it also build Oras "dashboard" images.
either move these back to "build", their own job, or rename this job
(I'd prefer the first one, so build generate the complete docker image + dashboard package; but not sure what the impact on build time is)
There was a problem hiding this comment.
Good catch.
Nothing to change anymore though: I removed the federation job, so the dashboards stay in build like today.
| sudo touch /logs/server-access.log && sudo chmod 0666 /logs/server-access.log | ||
| - name: Setup CI services | ||
| run: docker compose --profile mongo up -d | ||
| run: bash ../scripts/retry.bash docker compose --profile mongo up -d |
There was a problem hiding this comment.
bash should not be needed as long as the script is executable, as it is in the shbang already
There was a problem hiding this comment.
Right, the script is already executable. I removed the bash prefix everywhere.
|
I'll remove the federation commit |
The federation split only saved about 1 minute, and it conflicts with the build job on 9.5 and later. It will come as its own change, starting from 9.5.
The script is executable, so the workflow calls it without bash.
Issue: CLDSRV-1120
What changed
CI only:
.github/workflows/tests.yaml, test scripts inpackage.json, a new.github/scripts/retry.bash. The server code and the Dockerfile don't change.docker compose upis retried up to 3 times, because the shards pull twice as many images.fail-fast: falseon the split jobs, so we rerun only the failed shard.Numbers