|
| 1 | +name: Integration Tests (composefs) |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +concurrency: |
| 10 | + group: integration-composefs-${{ github.head_ref || github.ref }} |
| 11 | + cancel-in-progress: true |
| 12 | + |
| 13 | +env: |
| 14 | + BINK_IMAGES: >- |
| 15 | + ghcr.io/bootc-dev/bink/cluster:latest |
| 16 | + ghcr.io/bootc-dev/bink/node:v1.35-fedora-44-disk-composefs |
| 17 | + ghcr.io/bootc-dev/bink/dns:latest |
| 18 | + EXTERNAL_IMAGES: >- |
| 19 | + quay.io/libpod/busybox:latest |
| 20 | +
|
| 21 | +jobs: |
| 22 | + integration-tests-composefs: |
| 23 | + runs-on: ubuntu-latest |
| 24 | + timeout-minutes: 120 |
| 25 | + |
| 26 | + steps: |
| 27 | + - name: Checkout code |
| 28 | + uses: actions/checkout@v4 |
| 29 | + |
| 30 | + - name: Configure kernel for nested containers |
| 31 | + run: | |
| 32 | + sudo aa-teardown 2>/dev/null || true |
| 33 | + sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 |
| 34 | + sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 |
| 35 | + sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 |
| 36 | +
|
| 37 | + - name: Enable KSM (Kernel Same-page Merging) |
| 38 | + run: | |
| 39 | + sudo sh -c 'echo 1 > /sys/kernel/mm/ksm/run' |
| 40 | + sudo sh -c 'echo 5000 > /sys/kernel/mm/ksm/pages_to_scan' |
| 41 | + cat /sys/kernel/mm/ksm/run |
| 42 | +
|
| 43 | + - name: Set up Go |
| 44 | + uses: actions/setup-go@v5 |
| 45 | + with: |
| 46 | + go-version-file: go.mod |
| 47 | + cache: true |
| 48 | + |
| 49 | + - name: Install system dependencies |
| 50 | + run: | |
| 51 | + sudo apt-get update |
| 52 | + sudo apt-get install -y \ |
| 53 | + podman \ |
| 54 | + libgpgme-dev \ |
| 55 | + libbtrfs-dev \ |
| 56 | + libdevmapper-dev \ |
| 57 | + pkg-config |
| 58 | +
|
| 59 | + - name: Set up KVM |
| 60 | + run: | |
| 61 | + sudo chmod 666 /dev/kvm |
| 62 | + ls -la /dev/kvm |
| 63 | +
|
| 64 | + - name: Configure Podman |
| 65 | + run: | |
| 66 | + podman --version |
| 67 | + sudo mkdir -p /etc/containers |
| 68 | + echo '{"defaultAction":"SCMP_ACT_ALLOW"}' | sudo tee /etc/containers/seccomp.json |
| 69 | + printf '[containers]\napparmor_profile = "unconfined"\nseccomp_profile = "/etc/containers/seccomp.json"\n' | sudo tee /etc/containers/containers.conf |
| 70 | + grep -q '^root:' /etc/subuid || echo 'root:100000:65536' | sudo tee -a /etc/subuid |
| 71 | + grep -q '^root:' /etc/subgid || echo 'root:100000:65536' | sudo tee -a /etc/subgid |
| 72 | + sudo systemctl start podman.socket |
| 73 | + sudo podman info --format '{{.Store.GraphRoot}}' |
| 74 | +
|
| 75 | + - name: Build bink binary |
| 76 | + run: sudo make build-bink |
| 77 | + |
| 78 | + - name: Verify prerequisites |
| 79 | + run: | |
| 80 | + test -f ./bink |
| 81 | + sudo podman images --format "table {{.Repository}}:{{.Tag}}\t{{.Size}}" |
| 82 | + df -h / |
| 83 | + free -h |
| 84 | +
|
| 85 | + - name: Get image digests |
| 86 | + id: digests |
| 87 | + run: | |
| 88 | + ALL_DIGESTS="" |
| 89 | + for img in $BINK_IMAGES $EXTERNAL_IMAGES; do |
| 90 | + digest=$(skopeo inspect --no-creds "docker://${img}" --format '{{.Digest}}') |
| 91 | + echo "${img}: ${digest}" |
| 92 | + ALL_DIGESTS="${ALL_DIGESTS}${digest}" |
| 93 | + done |
| 94 | + echo "hash=$(echo -n "${ALL_DIGESTS}" | sha256sum | cut -d' ' -f1)" >> "$GITHUB_OUTPUT" |
| 95 | +
|
| 96 | + - name: Restore cached images |
| 97 | + id: image-cache |
| 98 | + uses: actions/cache/restore@v4 |
| 99 | + with: |
| 100 | + path: /tmp/podman-image-cache |
| 101 | + key: podman-images-v2-composefs-${{ steps.digests.outputs.hash }} |
| 102 | + |
| 103 | + - name: Load cached images |
| 104 | + if: steps.image-cache.outputs.cache-hit == 'true' |
| 105 | + run: | |
| 106 | + for f in /tmp/podman-image-cache/*.tar; do |
| 107 | + sudo podman load -i "$f" |
| 108 | + done |
| 109 | + sudo podman images --format "table {{.Repository}}:{{.Tag}}\t{{.Size}}" |
| 110 | +
|
| 111 | + - name: Pre-pull container images |
| 112 | + if: steps.image-cache.outputs.cache-hit != 'true' |
| 113 | + run: | |
| 114 | + mkdir -p /tmp/podman-image-cache |
| 115 | + for img in $BINK_IMAGES $EXTERNAL_IMAGES; do |
| 116 | + sudo podman pull "$img" |
| 117 | + name=$(echo "$img" | sed 's|[/:]|_|g') |
| 118 | + sudo podman save -o "/tmp/podman-image-cache/${name}.tar" "$img" |
| 119 | + done |
| 120 | + sudo chown -R $(id -u):$(id -g) /tmp/podman-image-cache |
| 121 | +
|
| 122 | + - name: Save image cache |
| 123 | + if: steps.image-cache.outputs.cache-hit != 'true' |
| 124 | + uses: actions/cache/save@v4 |
| 125 | + with: |
| 126 | + path: /tmp/podman-image-cache |
| 127 | + key: podman-images-v2-composefs-${{ steps.digests.outputs.hash }} |
| 128 | + |
| 129 | + - name: Run composefs integration tests |
| 130 | + run: sudo make test-integration-composefs |
| 131 | + timeout-minutes: 90 |
| 132 | + env: |
| 133 | + CONTAINER_HOST: unix:///run/podman/podman.sock |
| 134 | + BINK_NODE_IMAGE: ghcr.io/bootc-dev/bink/node:v1.35-fedora-44-disk-composefs |
| 135 | + |
| 136 | + - name: Collect logs |
| 137 | + if: failure() |
| 138 | + run: .github/collect-logs.sh |
| 139 | + |
| 140 | + - name: Upload logs |
| 141 | + if: failure() |
| 142 | + uses: actions/upload-artifact@v4 |
| 143 | + with: |
| 144 | + name: test-logs-composefs |
| 145 | + path: /tmp/bink-logs/ |
| 146 | + |
| 147 | + - name: Cleanup test clusters |
| 148 | + if: always() |
| 149 | + run: | |
| 150 | + sudo podman ps -a --filter "name=k8s-test-bink" --format '{{.Names}}' | \ |
| 151 | + xargs -r sudo podman rm -f 2>/dev/null || true |
| 152 | + sudo podman volume prune -f 2>/dev/null || true |
0 commit comments