ci: Place datadirs for tests under tmpfs #31182
pull maflcko wants to merge 1 commits into bitcoin:master from maflcko:2410-ci-tmpfs changing 4 files +16 −7-
maflcko commented at 10:12 am on October 30, 2024: memberThis should speed up the tests a bit (see comment below for results).
-
DrahtBot commented at 10:12 am on October 30, 2024: contributor
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Code Coverage & Benchmarks
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31182.
Reviews
See the guideline for information on the review process. A summary of reviews will appear here.
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #31257 (ci: make ctest stop on failure by furszy)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
-
maflcko force-pushed on Oct 30, 2024
-
maflcko force-pushed on Oct 30, 2024
-
maflcko force-pushed on Oct 30, 2024
-
laanwj commented at 11:47 am on October 30, 2024: memberUsing tmpfs for temporary test directories can potentially speed up tests a lot, something to be wary for is that it significantly increases memory usage as well (no idea if this is a problem for the current CI).
-
maflcko force-pushed on Oct 30, 2024
-
maflcko marked this as ready for review on Oct 30, 2024
-
maflcko commented at 12:26 pm on October 30, 2024: member
something to be wary for is that it significantly increases memory usage as well (no idea if this is a problem for the current CI).
I’d say the memory increase shouldn’t matter, because on modern distros the default temp dir is already a tmpfs. So if memory was an issue, then running the tests normally (outside the CI) would already lead to issue reports. (I haven’t seen any, but I may be missing some).
So I think it is fine to enable this by default without an off-switch for now. If there is need, a new env var toggle can be added to disable it.
-
laanwj commented at 12:35 pm on October 30, 2024: member
I’d say the memory increase shouldn’t matter, because on modern distros the default temp dir is already a tmpfs. So if memory was an issue, then running the tests normally (outside the CI) would already lead to issue reports. (I haven’t seen any, but I may be missing some).
i don’t think anyone runs the tests in low-memory/disk conditions 😄 i’ve had some issues on custom RISC-V hardware in the past, but nothing significant enough to create an issue about. At least the CI will start with a clean slate every time so no cruft accumulates in tmpfs.
-
maflcko force-pushed on Oct 30, 2024
-
maflcko commented at 1:51 pm on October 30, 2024: member(force pushed to fix a type bug in the modified Python code, discovered by the Windows CI. I wish this code was written in Rust or another type-safe language, so that issues like this are caught at compile-time, but this can be done in a follow-up)
-
TheCharlatan commented at 7:43 pm on October 30, 2024: contributor
(see comment below for results).
What is this referring to?
-
maflcko marked this as a draft on Oct 31, 2024
-
maflcko commented at 7:55 am on October 31, 2024: member
(see comment below for results).
What is this referring to?
I was still running the commit (and master) twice each for all CI tasks, but I couldn’t find any difference at all.
I checked that the folder is correctly picked up and used by the tests, so I guess modern storage is fast enough to not make a difference? Alternatively, there is an issue I was missing.
It would be good if someone else double checked the code and whether there is a performance difference at all.
For reference (showing no difference):
- Current master
- This pull
-
willcl-ark commented at 11:33 am on November 4, 2024: member
That is odd, and a little disappointing. The code appears correct to me.
I was wondering whether
tmpfs
according to docker might just mean “ephemeral” (but still disk-based), but it appears that it it is both ephemeral and ramdisk based as per the underlying filesystemtmpfs
.I will run the CI on my own self-hosted runner, and see what sort of numbers I get from it…
-
maflcko commented at 11:50 am on November 4, 2024: memberMy plan is to get hold on an HDD (or some other slow storage) and try with that. Any effect should be more pronounced on slower persistent storage.
-
DrahtBot added the label Needs rebase on Nov 11, 2024
-
ci: Place datadirs for tests under tmpfs
Also, includes a fixup to the fuzz/test_runner.py to pass on the env var.
-
maflcko force-pushed on Nov 22, 2024
-
DrahtBot removed the label Needs rebase on Nov 22, 2024
-
DrahtBot renamed this:
ci: Place datadirs for tests under tmpfs
ci: Place datadirs for tests under tmpfs
on Nov 22, 2024 -
DrahtBot added the label Tests on Nov 22, 2024
-
maflcko commented at 12:54 pm on November 22, 2024: member
I tested it on a Pi 4B, with 4GB of memory, Ubuntu 24.04, using 1 CPU thread:
CCACHE_MAXSIZE=1500M MAKEJOBS="-j1" FILE_ENV="./ci/test/00_setup_env_native_nowallet_libbitcoinkernel.sh" /usr/bin/time --format='%U+%S %e (%E)' ./ci/test_run_all.sh
. However, I couldn’t find any difference either. Moreover, withMAKEJOBS="-j4"
, this pull performed worse than the commit prior to it (55min vs 1h5min).Not sure why, but I guess modern Linux will cache the file IO sufficiently to not make a difference for this projects’ CI? Whereas using tmpfs with limited memory may be a pessimization due to the overhead of swap?
Closing for now, until someone can show how to actually improve the performance with this.
-
maflcko closed this on Nov 22, 2024
-
maflcko deleted the branch on Nov 22, 2024
maflcko
DrahtBot
laanwj
TheCharlatan
willcl-ark
Labels
Tests
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-23 09:12 UTC
More mirrored repositories can be found on mirror.b10c.me