-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: add a qemu/arm64 VM to GH workflows #515
base: main
Are you sure you want to change the base?
Conversation
8e8ef96
to
2bcd897
Compare
Codecov Report
@@ Coverage Diff @@
## main #515 +/- ##
==========================================
+ Coverage 11.89% 13.77% +1.87%
==========================================
Files 40 40
Lines 5733 5671 -62
==========================================
+ Hits 682 781 +99
+ Misses 4929 4762 -167
- Partials 122 128 +6 see 2 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
2c53128
to
8ca5e27
Compare
.github/workflows/qemu.yaml
Outdated
cp /usr/share/AAVMF/AAVMF_CODE.fd . | ||
cp /usr/share/AAVMF/AAVMF_VARS.fd . | ||
|
||
randmac=$(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/:$//') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we randomly assigning a MAC? qemu will auto allocate one for you (it is already well known and we don't really care).
.github/workflows/qemu.yaml
Outdated
-display none \ | ||
-drive if=pflash,format=raw,readonly=on,file=AAVMF_CODE.fd \ | ||
-drive if=pflash,format=raw,file=AAVMF_VARS.fd \ | ||
-drive if=none,file=jammy-server-cloudimg-arm64.img,id=hd0 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-drive if=none,file=jammy-server-cloudimg-arm64.img,id=hd0 \ | |
-drive if=none,file=jammy-server-cloudimg-arm64.img,id=hd0,cache=unsafe \ |
No need to use sync writes since we just read data out of the VM
.github/workflows/qemu.yaml
Outdated
-drive if=none,file=jammy-server-cloudimg-arm64.img,id=hd0 \ | ||
-drive file=user-data.img,format=raw \ | ||
-device virtio-blk-device,drive=hd0 \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-drive if=none,file=jammy-server-cloudimg-arm64.img,id=hd0 \ | |
-drive file=user-data.img,format=raw \ | |
-device virtio-blk-device,drive=hd0 \ | |
-drive if=none,file=jammy-server-cloudimg-arm64.img,id=hd0,cache=unsafe \ | |
-device virtio-blk-device,drive=hd0 \ | |
-drive file=user-data.img,format=raw,media=cdrom,id=cd0 \ | |
-device virtio-blk-device,drive=cd0 \ |
I think you're missing a -device to map the cdrom drive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting 'jammy-snapshot.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=off compression_type=zlib size=214748364800 backing_file=jammy-server-cloudimg-arm64.img backing_fmt=qcow2 lazy_refcounts=off refcount_bits=16
qemu-system-aarch64: -drive file=user-data.img,format=raw,media=cdrom,id=cd0: Drive 'cd0' is already in use because it has been automatically connected to another device (did you need 'if=none' in the drive options?)
Error: Process completed with exit code 1.
.github/workflows/qemu.yaml
Outdated
-drive file=user-data.img,format=raw \ | ||
-device virtio-blk-device,drive=hd0 \ | ||
-netdev type=user,id=net0,hostfwd=tcp::22225-:22 \ | ||
-device virtio-net-device,netdev=net0,mac=$randmac \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-device virtio-net-device,netdev=net0,mac=$randmac \ | |
-device virtio-net-device,netdev=net0 \ |
qemu will autogenerate a mac
jobs: | ||
build-linux-arm64: | ||
runs-on: ubuntu-22.04 | ||
steps: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know if we can use the githubToken thing to save the state of the image after we do all of the steps to prep for running the VM?
# speeds up builds by storing container images in a GitHub package registry.
githubToken: ${{ github.token }}
Wasn't sure if that's only used in that run-on-arch-action
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specific to that action iinm
ea50457
to
e1ab829
Compare
debug1: Exit status 0 real 4m9.407s On my local machine, it takes about 4mins to make a successful connection to qemu VM. |
Signed-off-by: Ramkumar Chinchani <[email protected]>
What type of PR is this?
Which issue does this PR fix:
What does this PR do / Why do we need it:
If an issue # is not available please add repro steps and logs showing the issue:
Testing done on this change:
Automation added to e2e:
Will this break upgrades or downgrades?
Does this PR introduce any user-facing change?:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.