|
19 | 19 | VMLINUX_CACHE_PATH: kernel-cache/vmlinux |
20 | 20 | VMLINUX_RELEASE_PATH: deploy/one-click/assets/kernel-artifacts/vmlinux |
21 | 21 | KERNEL_TAG: 6.6.119-49.6 |
| 22 | + PVM_KERNEL_TAG: 6.6.69-1.cubesandbox |
| 23 | + PVM_VMLINUX_CACHE_PATH: kernel-cache/vmlinux-pvm |
| 24 | + PVM_VMLINUX_RELEASE_PATH: deploy/one-click/assets/kernel-artifacts/vmlinux-pvm |
22 | 25 |
|
23 | 26 | jobs: |
| 27 | + build_pvm_guest_vmlinux: |
| 28 | + name: Build PVM guest vmlinux for release |
| 29 | + runs-on: ubuntu-latest |
| 30 | + |
| 31 | + steps: |
| 32 | + - name: Checkout |
| 33 | + uses: actions/checkout@v4 |
| 34 | + |
| 35 | + - name: Compute PVM vmlinux cache metadata |
| 36 | + id: pvm_vmlinux_metadata |
| 37 | + run: | |
| 38 | + source_hash="$( |
| 39 | + sha256sum \ |
| 40 | + deploy/pvm/build-pvm-guest-vmlinux.sh \ |
| 41 | + deploy/pvm/common.sh \ |
| 42 | + deploy/pvm/configs/pvm_guest \ |
| 43 | + | sha256sum \ |
| 44 | + | awk '{print $1}' |
| 45 | + )" |
| 46 | + echo "source_hash=${source_hash}" >> "${GITHUB_OUTPUT}" |
| 47 | + echo "cache_key=vmlinux-pvm-${PVM_KERNEL_TAG}-${source_hash}-ubuntu-latest" >> "${GITHUB_OUTPUT}" |
| 48 | + echo "artifact_name=vmlinux-pvm-${PVM_KERNEL_TAG}-${source_hash}" >> "${GITHUB_OUTPUT}" |
| 49 | +
|
| 50 | + - name: Restore cached PVM vmlinux |
| 51 | + id: restore_pvm_vmlinux |
| 52 | + uses: actions/cache/restore@v4 |
| 53 | + with: |
| 54 | + path: ${{ env.PVM_VMLINUX_CACHE_PATH }} |
| 55 | + key: ${{ steps.pvm_vmlinux_metadata.outputs.cache_key }} |
| 56 | + |
| 57 | + - name: Build PVM guest vmlinux |
| 58 | + if: steps.restore_pvm_vmlinux.outputs.cache-hit != 'true' |
| 59 | + run: | |
| 60 | + WORK_DIR="${GITHUB_WORKSPACE}/pvm-guest-build" \ |
| 61 | + OUTPUT_DIR="${GITHUB_WORKSPACE}/pvm-guest-build/output" \ |
| 62 | + bash deploy/pvm/build-pvm-guest-vmlinux.sh |
| 63 | + install -D -m 0644 \ |
| 64 | + "${GITHUB_WORKSPACE}/pvm-guest-build/output/vmlinux" \ |
| 65 | + "${PVM_VMLINUX_CACHE_PATH}" |
| 66 | +
|
| 67 | + - name: Verify PVM vmlinux |
| 68 | + run: | |
| 69 | + test -f "${PVM_VMLINUX_CACHE_PATH}" |
| 70 | + file "${PVM_VMLINUX_CACHE_PATH}" |
| 71 | +
|
| 72 | + - name: Save PVM vmlinux cache |
| 73 | + if: steps.restore_pvm_vmlinux.outputs.cache-hit != 'true' |
| 74 | + uses: actions/cache/save@v4 |
| 75 | + with: |
| 76 | + path: ${{ env.PVM_VMLINUX_CACHE_PATH }} |
| 77 | + key: ${{ steps.pvm_vmlinux_metadata.outputs.cache_key }} |
| 78 | + |
| 79 | + - name: Stage PVM vmlinux artifact payload |
| 80 | + run: | |
| 81 | + rm -rf pvm-vmlinux-artifact |
| 82 | + install -D -m 0644 "${PVM_VMLINUX_CACHE_PATH}" pvm-vmlinux-artifact/vmlinux-pvm |
| 83 | +
|
| 84 | + - name: Upload PVM vmlinux artifact |
| 85 | + uses: actions/upload-artifact@v4 |
| 86 | + with: |
| 87 | + name: ${{ steps.pvm_vmlinux_metadata.outputs.artifact_name }} |
| 88 | + path: pvm-vmlinux-artifact/vmlinux-pvm |
| 89 | + if-no-files-found: error |
| 90 | + retention-days: 14 |
| 91 | + |
24 | 92 | release: |
25 | 93 | runs-on: ubuntu-latest |
| 94 | + needs: build_pvm_guest_vmlinux |
26 | 95 |
|
27 | 96 | steps: |
28 | 97 | - name: Checkout |
@@ -134,6 +203,35 @@ jobs: |
134 | 203 | test -f "${VMLINUX_RELEASE_PATH}" |
135 | 204 | file "${VMLINUX_RELEASE_PATH}" |
136 | 205 |
|
| 206 | + - name: Compute PVM vmlinux cache metadata |
| 207 | + id: pvm_vmlinux_metadata |
| 208 | + run: | |
| 209 | + source_hash="$( |
| 210 | + sha256sum \ |
| 211 | + deploy/pvm/build-pvm-guest-vmlinux.sh \ |
| 212 | + deploy/pvm/common.sh \ |
| 213 | + deploy/pvm/configs/pvm_guest \ |
| 214 | + | sha256sum \ |
| 215 | + | awk '{print $1}' |
| 216 | + )" |
| 217 | + echo "source_hash=${source_hash}" >> "${GITHUB_OUTPUT}" |
| 218 | + echo "cache_key=vmlinux-pvm-${PVM_KERNEL_TAG}-${source_hash}-ubuntu-latest" >> "${GITHUB_OUTPUT}" |
| 219 | + echo "artifact_name=vmlinux-pvm-${PVM_KERNEL_TAG}-${source_hash}" >> "${GITHUB_OUTPUT}" |
| 220 | +
|
| 221 | + - name: Download PVM vmlinux artifact |
| 222 | + uses: actions/download-artifact@v4 |
| 223 | + with: |
| 224 | + name: ${{ steps.pvm_vmlinux_metadata.outputs.artifact_name }} |
| 225 | + path: downloaded-pvm-vmlinux |
| 226 | + |
| 227 | + - name: Stage PVM vmlinux |
| 228 | + run: | |
| 229 | + install -D -m 0644 \ |
| 230 | + downloaded-pvm-vmlinux/vmlinux-pvm \ |
| 231 | + "${PVM_VMLINUX_RELEASE_PATH}" |
| 232 | + test -f "${PVM_VMLINUX_RELEASE_PATH}" |
| 233 | + file "${PVM_VMLINUX_RELEASE_PATH}" |
| 234 | +
|
137 | 235 | - name: Log in to GitHub Container Registry |
138 | 236 | uses: docker/login-action@v3 |
139 | 237 | with: |
|
0 commit comments