-
Notifications
You must be signed in to change notification settings - Fork 1
124 lines (105 loc) · 3.69 KB
/
build_qcow2.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
---
name: build_qcow2
on:
workflow_dispatch:
inputs:
spdk_repos_ref:
description: 'Branch, tag, or ref of SPDK repository'
required: true
default: 'master'
jobs:
source-archive:
runs-on: ubuntu-latest
concurrency:
group: build_qcow2
cancel-in-progress: false
steps:
- name: Checkout SPDK repository
uses: actions/[email protected]
with:
repository: ${{ github.repository_owner }}/${{ vars.SPDK_REPOS_NAME }}
ref: ${{ github.event.inputs.spdk_repos_ref }}
token: ${{ secrets.GHPA_TOKEN }}
submodules: 'recursive'
fetch-depth: 0
path: spdk
- name: Add Information on the SPDK repository state
run: |
cd spdk
CURRENT_REF=$(git rev-parse --short HEAD) # Gets the short commit hash as the ref
REPO_URL="https://github.com/${{ github.repository_owner }}/${{ vars.SPDK_REPOS_NAME }}/commit/$CURRENT_REF"
echo "### Change Information" >> $GITHUB_STEP_SUMMARY
echo "- Using pkgdeb.sh and autotest_setup.sh from [SPDK Repository]($REPO_URL)" >> $GITHUB_STEP_SUMMARY
echo "- Ref: $CURRENT_REF" >> $GITHUB_STEP_SUMMARY
- name: Create a tarball, of the repository, to preserve file permissions
run: |
cd spdk
tar -czf ../repository.tar.gz .
- name: Upload the repository as an artifact
uses: actions/[email protected]
with:
name: repository
path: repository.tar.gz
build-qcow:
needs: source-archive
runs-on: ubuntu-latest
container:
image: ghcr.io/spdk-community-ci/spdk-community-ci:poc
options: --privileged
env:
REPOSITORY_TARBALL_PATH: ${{ github.workspace }}/repository.tar.gz
concurrency:
group: build_qcow2
cancel-in-progress: false
steps:
- name: Download the repository
uses: actions/[email protected]
with:
name: repository
- name: Checkout CI repository
uses: actions/[email protected]
with:
path: ci
- name: Setup CIJOE and pipx
run: |
pipx install cijoe==0.9.45 -f
pipx ensurepath
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Build
run: |
cd ci/cijoe
cijoe \
--monitor \
--config configs/qemuhost-with-guest-fedora-40.toml \
--workflow workflows/build_qcow2_using_qemu.yaml
- name: Upload Artifacts
uses: actions/[email protected]
if: always()
with:
path: ci/cijoe/cijoe-output
name: cloudinit-report
- name: Set up SSH
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_STORAGE_PRIVATE_KEY }}" > $HOME/.ssh/id_storage
echo "${{ secrets.SSH_STORAGE_KNOWN_HOSTS }}" >> $HOME/.ssh/known_hosts
chmod 600 ~/.ssh/id_storage
- name: Change image format and compress
run: |
ls -lha $HOME/guests/fedora_40_x86_64/
for i in $(seq 1 60); do test -f "$HOME/guests/fedora_40_x86_64/guest.pid" || break; sleep 1; done
ls -lha $HOME/guests/fedora_40_x86_64/
qemu-img convert $HOME/guests/fedora_40_x86_64/boot.img fedora_40_x86_64.qcow2 -O qcow2 -c
ls -lha fedora_40_x86_64.qcow2
# This relies on the following secrets: S3_KEY, S3_SECRET, S3_ENDPOINT_URL
- name: Transfer to S3 Compatible Storage
env:
S3_KEY: ${{ secrets.S3_KEY }}
S3_SECRET: ${{ secrets.S3_SECRET }}
S3_ENDPOINT_URL: ${{ secrets.S3_ENDPOINT_URL }}
S3_BUCKET: spdk-community-ci
run : |
./ci/s3_file_upload.py fedora_40_x86_64.qcow2 \
--bucket "$S3_BUCKET" \
--endpoint-url "$S3_ENDPOINT_URL" \
--object-key "system/fedora_40_x86_64.qcow2"