Skip to content

Commit a646aa2

Browse files
committed
fix(ci): isolate wheel builder storage
Signed-off-by: AlpinDale <alpindale@gmail.com>
1 parent c1279d7 commit a646aa2

4 files changed

Lines changed: 12 additions & 7 deletions

File tree

‎.github/scripts/build_nightly_commits.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ for commit in "${commits[@]}"; do
176176

177177
write_commit_index "$commit" "$wheel_name" "$digest"
178178
rm -f "$wheel"
179-
docker buildx prune --force \
179+
docker buildx prune --builder default --force \
180180
--filter type=regular \
181181
--max-used-space 25gb
182182
fi

‎.github/scripts/ensure_rocm_builder.sh‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ builder_name="${ROCM_BUILDER_NAME:-sonar-rocm}"
1010
container_name="${ROCM_BUILDKIT_CONTAINER:-sonar-rocm-buildkit}"
1111
cache_size="${ROCM_BUILDKIT_CACHE_SIZE:-300g}"
1212
builder_port="${ROCM_BUILDKIT_PORT:-12351}"
13+
# The rootless image does not use /var/lib/buildkit.
14+
builder_state_dir="/home/user/.local/share/buildkit"
1315
dind_address="$(
1416
docker --host "$host_control" inspect --format \
1517
'{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' \
@@ -34,7 +36,7 @@ container_ports="$(
3436
if [[ -n "$container_args" ]] &&
3537
{ [[ "$container_args" != *"tcp://0.0.0.0:1234"* ]] ||
3638
[[ "$container_args" != *"--oci-worker-gc=false"* ]] ||
37-
[[ "$container_mounts" != *'"/var/lib/buildkit"'* ]] ||
39+
[[ "$container_mounts" != *"\"${builder_state_dir}\""* ]] ||
3840
[[ "$container_ports" != *"${builder_port}"* ]]; }; then
3941
docker --host "$control_host" rm --force "$container_name" >/dev/null
4042
container_args=""
@@ -46,7 +48,7 @@ if [[ -z "$container_args" ]]; then
4648
--security-opt seccomp=unconfined \
4749
--security-opt apparmor=unconfined \
4850
--publish "${builder_port}:1234" \
49-
--tmpfs "/var/lib/buildkit:rw,size=${cache_size},mode=1777" \
51+
--tmpfs "${builder_state_dir}:rw,size=${cache_size},mode=1777" \
5052
moby/buildkit:rootless \
5153
--oci-worker-no-process-sandbox \
5254
--oci-worker-gc=false \

‎.github/workflows/platform-wheel.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
shell: bash
9090
run: |
9191
rm -f wheels/main/*.whl
92-
docker buildx prune --force \
92+
docker buildx prune --builder default --force \
9393
--filter type=regular \
9494
--max-used-space 25gb
9595
@@ -319,7 +319,7 @@ jobs:
319319
- name: Limit ROCm build cache
320320
if: ${{ always() }}
321321
run: |
322-
docker buildx prune --force \
322+
docker buildx prune --builder sonar-rocm --force \
323323
--filter type=regular \
324324
--max-used-space 100gb
325325

‎.github/workflows/release-wheel.yml‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
shell: bash
7373
run: |
7474
rm -f wheels/main/*.whl
75-
docker buildx prune --force \
75+
docker buildx prune --builder default --force \
7676
--filter type=regular \
7777
--max-used-space 25gb
7878
@@ -250,7 +250,10 @@ jobs:
250250

251251
- name: Limit ROCm build cache
252252
if: ${{ always() }}
253-
run: docker buildx prune --force --max-used-space 300gb
253+
run: |
254+
docker buildx prune --builder sonar-rocm --force \
255+
--filter type=regular \
256+
--max-used-space 100gb
254257
255258
publish-platform-wheels:
256259
name: Publish platform wheels

0 commit comments

Comments
 (0)