mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 17:46:29 +09:00
ci/eval: improve api when calling in steps
Previously, `eval.full` organized the results for the supported systems in a specific layout, i.e. with a folder with one subfolder per system. Then, `eval.combine` relied on that. When using `eval.singleSystem` and `eval.combine` directly, the caller was responsible to recreate the same layout. This is annoying and error-prone to do, when downloading artifacts from CI to recreate some steps locally. With this change, all the artifacts can be downloaded and extracted into the same folder - because the result from `eval.singleSystem` already contains the <system-name>/ subfolder.
This commit is contained in:
parent
82396d1f48
commit
eccd9564ab
2 changed files with 19 additions and 16 deletions
2
.github/workflows/eval.yml
vendored
2
.github/workflows/eval.yml
vendored
|
@ -95,6 +95,7 @@ jobs:
|
|||
with:
|
||||
pattern: intermediate-*
|
||||
path: intermediate
|
||||
merge-multiple: true
|
||||
|
||||
- name: Check out the PR at the test merge commit
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
@ -158,6 +159,7 @@ jobs:
|
|||
with:
|
||||
name: result
|
||||
path: targetResult
|
||||
merge-multiple: true
|
||||
github-token: ${{ github.token }}
|
||||
run-id: ${{ steps.targetRunId.outputs.targetRunId }}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
runCommand,
|
||||
writeShellScript,
|
||||
writeText,
|
||||
linkFarm,
|
||||
symlinkJoin,
|
||||
time,
|
||||
procps,
|
||||
nixVersions,
|
||||
|
@ -147,7 +147,7 @@ let
|
|||
chunkCount=$(( (attrCount - 1) / chunkSize + 1 ))
|
||||
echo "Chunk count: $chunkCount"
|
||||
|
||||
mkdir $out
|
||||
mkdir -p $out/${evalSystem}
|
||||
|
||||
# Record and print stats on free memory and swap in the background
|
||||
(
|
||||
|
@ -156,11 +156,11 @@ let
|
|||
freeSwap=$(free -b | grep Swap | awk '{print $4}')
|
||||
echo "Available memory: $(( availMemory / 1024 / 1024 )) MiB, free swap: $(( freeSwap / 1024 / 1024 )) MiB"
|
||||
|
||||
if [[ ! -f "$out/min-avail-memory" ]] || (( availMemory < $(<$out/min-avail-memory) )); then
|
||||
echo "$availMemory" > $out/min-avail-memory
|
||||
if [[ ! -f "$out/${evalSystem}/min-avail-memory" ]] || (( availMemory < $(<$out/${evalSystem}/min-avail-memory) )); then
|
||||
echo "$availMemory" > $out/${evalSystem}/min-avail-memory
|
||||
fi
|
||||
if [[ ! -f $out/min-free-swap ]] || (( availMemory < $(<$out/min-free-swap) )); then
|
||||
echo "$freeSwap" > $out/min-free-swap
|
||||
if [[ ! -f $out/${evalSystem}/min-free-swap ]] || (( availMemory < $(<$out/${evalSystem}/min-free-swap) )); then
|
||||
echo "$freeSwap" > $out/${evalSystem}/min-free-swap
|
||||
fi
|
||||
sleep 4
|
||||
done
|
||||
|
@ -176,18 +176,18 @@ let
|
|||
mkdir "$chunkOutputDir"/{result,stats,timestats,stderr}
|
||||
|
||||
seq -w 0 "$seq_end" |
|
||||
command time -f "%e" -o "$out/total-time" \
|
||||
command time -f "%e" -o "$out/${evalSystem}/total-time" \
|
||||
xargs -I{} -P"$cores" \
|
||||
${singleChunk} "$chunkSize" {} "$evalSystem" "$chunkOutputDir"
|
||||
|
||||
cp -r "$chunkOutputDir"/stats $out/stats-by-chunk
|
||||
cp -r "$chunkOutputDir"/stats $out/${evalSystem}/stats-by-chunk
|
||||
|
||||
if (( chunkSize * chunkCount != attrCount )); then
|
||||
# A final incomplete chunk would mess up the stats, don't include it
|
||||
rm "$chunkOutputDir"/stats/"$seq_end"
|
||||
fi
|
||||
|
||||
cat "$chunkOutputDir"/result/* > $out/paths
|
||||
cat "$chunkOutputDir"/result/* > $out/${evalSystem}/paths
|
||||
'';
|
||||
|
||||
combine =
|
||||
|
@ -247,14 +247,15 @@ let
|
|||
quickTest ? false,
|
||||
}:
|
||||
let
|
||||
results = linkFarm "results" (
|
||||
map (evalSystem: {
|
||||
name = evalSystem;
|
||||
path = singleSystem {
|
||||
results = symlinkJoin {
|
||||
name = "results";
|
||||
paths = map (
|
||||
evalSystem:
|
||||
singleSystem {
|
||||
inherit quickTest evalSystem chunkSize;
|
||||
};
|
||||
}) evalSystems
|
||||
);
|
||||
}
|
||||
) evalSystems;
|
||||
};
|
||||
in
|
||||
combine {
|
||||
resultsDir = results;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue