Skip to content

Commit 361b8ff

Browse files
authored
Merge pull request firecracker-microvm#512 from kzys/al2-race-fix
Fix BuildKite's race condition on Amazon Linux
2 parents 71a7d58 + 40ae488 commit 361b8ff

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.buildkite/setup_al2.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,17 @@ cat << EOF > $runtime_config_path
5353
EOF
5454

5555
cp ./runtime/firecracker-runc-config.json.example $dir/config.json
56-
cp ./_submodules/runc/runc $bin_path/runc
56+
57+
# runc uses /run/runc directory by default. Since our Amazon Linux 2 tests on
58+
# BuildKite don't use Docker, sharing the directory across multiple test
59+
# runs causes a race condition.
60+
#
61+
# This wrapper script gives runc /run/runc-$unique_id instead to avoid
62+
# the race condition.
63+
cp ./_submodules/runc/runc "$bin_path/runc.real"
64+
cat > "$bin_path/runc" <<EOF
65+
#! /bin/bash
66+
set -euo pipefail
67+
"$bin_path/runc.real" --root "/run/runc-$unique_id" "\$@"
68+
EOF
69+
chmod +x "$bin_path/runc"

0 commit comments

Comments
 (0)