Skip to content

Commit 20ce369

Browse files
committed
TEMP: test install-tests fix with copy-to-rootful
1 parent 21babe7 commit 20ce369

File tree

2 files changed

+52
-9
lines changed

2 files changed

+52
-9
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ concurrency:
3232
jobs:
3333
# Run basic validation checks (linting, formatting, etc)
3434
validate:
35+
if: false # TEMP: disabled for testing install-tests fix
3536
runs-on: ubuntu-24.04
3637
steps:
3738
- uses: actions/checkout@v6
@@ -41,6 +42,7 @@ jobs:
4142
run: just validate
4243
# Check for security vulnerabilities and license compliance
4344
cargo-deny:
45+
if: false # TEMP: disabled for testing install-tests fix
4446
runs-on: ubuntu-24.04
4547
steps:
4648
- uses: actions/checkout@v6
@@ -65,16 +67,18 @@ jobs:
6567
- name: Integration tests
6668
run: |
6769
set -xeu
68-
# Build images to test; TODO investigate doing single container builds
69-
# via GHA and pushing to a temporary registry to share among workflows?
70-
# Preserve rustup/cargo environment for sudo (rustup needs RUSTUP_HOME to find toolchains)
71-
sudojust() { sudo env PATH="$PATH" CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}" RUSTUP_HOME="${RUSTUP_HOME:-$HOME/.rustup}" just "$@"; }
72-
sudojust build
73-
sudojust build-install-test-image
70+
# Build images as regular user, then copy to root's podman storage
71+
# This avoids cargo cache permission issues when running cargo as root
72+
just build
73+
just build-install-test-image
74+
just copy-to-rootful localhost/bootc
75+
just copy-to-rootful localhost/bootc-install
76+
# Copy bound images (LBI) to root's storage for tests that need them
77+
just copy-to-rootful quay.io/curl/curl:latest
78+
just copy-to-rootful quay.io/curl/curl-base:latest
79+
just copy-to-rootful registry.access.redhat.com/ubi9/podman:latest
7480
sudo podman build -t localhost/bootc-fsverity -f ci/Containerfile.install-fsverity
7581
76-
# Grant permission
77-
sudo chown -R "$(id -u):$(id -g)" /home/runner/work/bootc/bootc
7882
# TODO move into a container, and then have this tool run other containers
7983
cargo build --release -p tests-integration
8084
@@ -110,6 +114,7 @@ jobs:
110114
done
111115
# Test that we can build documentation
112116
docs:
117+
if: false # TEMP: disabled for testing install-tests fix
113118
runs-on: ubuntu-24.04
114119
steps:
115120
- uses: actions/checkout@v6
@@ -119,6 +124,7 @@ jobs:
119124
run: just build-mdbook
120125
# Build packages for each test OS
121126
package:
127+
if: false # TEMP: disabled for testing install-tests fix
122128
strategy:
123129
fail-fast: false
124130
matrix:
@@ -150,6 +156,7 @@ jobs:
150156
# running unit and integration tests (using TMT, leveraging the support for nested virtualization
151157
# in the GHA runners)
152158
test-integration:
159+
if: false # TEMP: disabled for testing install-tests fix
153160
needs: package
154161
strategy:
155162
fail-fast: false
@@ -224,6 +231,7 @@ jobs:
224231
# when run in the same job as test-integration).
225232
# Uses fedora-43 as it's the current stable Fedora release matching CoreOS.
226233
test-coreos:
234+
if: false # TEMP: disabled for testing install-tests fix
227235
needs: package
228236
runs-on: ubuntu-24.04
229237

@@ -264,7 +272,7 @@ jobs:
264272

265273
# Sentinel job for required checks - configure this job name in repository settings
266274
required-checks:
267-
if: always()
275+
if: false # TEMP: disabled for testing install-tests fix
268276
needs: [cargo-deny, validate, package, test-integration, test-coreos]
269277
runs-on: ubuntu-latest
270278
steps:

Justfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,3 +282,38 @@ _keygen:
282282

283283
_build-upgrade-image:
284284
cat tmt/tests/Dockerfile.upgrade | podman build -t {{upgrade_img}} --from={{base_img}} -
285+
286+
# Copy an image from user podman storage to root's podman storage
287+
# This allows building as regular user then running privileged tests
288+
[group('testing')]
289+
copy-to-rootful $image:
290+
#!/bin/bash
291+
set -euxo pipefail
292+
293+
# If already running as root, nothing to do
294+
if [[ "${UID}" -eq "0" ]]; then
295+
echo "Already root, no need to copy image"
296+
exit 0
297+
fi
298+
299+
# Check if the image exists in user storage
300+
if ! podman image exists "${image}"; then
301+
echo "Image ${image} not found in user podman storage" >&2
302+
exit 1
303+
fi
304+
305+
# Get the image ID from user storage
306+
USER_IMG_ID=$(podman images --filter reference="${image}" --format '{{{{.ID}}')
307+
308+
# Check if the same image ID exists in root storage
309+
ROOT_IMG_ID=$(sudo podman images --filter reference="${image}" --format '{{{{.ID}}' 2>/dev/null || true)
310+
311+
if [[ "${USER_IMG_ID}" == "${ROOT_IMG_ID}" ]] && [[ -n "${ROOT_IMG_ID}" ]]; then
312+
echo "Image ${image} already exists in root storage with same ID"
313+
exit 0
314+
fi
315+
316+
# Copy the image from user to root storage
317+
# Use podman save/load via pipe (works on systems without machinectl)
318+
podman save "${image}" | sudo podman load
319+
echo "Copied ${image} to root podman storage"

0 commit comments

Comments
 (0)