-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* libslirp-dev, needed for new userdev Signed-off-by: Simon A. F. Lund <os@safl.dk>
- Loading branch information
Showing
3 changed files
with
256 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,174 @@ | ||
# | ||
# Build a debian:bullseye based docker image | ||
# Build qemu/x86_64-softmmu on Debian Bullseye | ||
# - Containing the qemu-build | ||
# - Containing latest CIJOE | ||
# - envs, guests and scripts for CIJOE | ||
# | ||
# Uses the qemu from https://github.com/OpenMPDK/qemu.git branch: 'for-xnvme' | ||
# Uses the latest CIJOE available from PyPI | ||
# | ||
name: qemu | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'qemu' | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
|
||
build-qemu: | ||
|
||
runs-on: ubuntu-latest | ||
container: debian:bullseye | ||
|
||
steps: | ||
- name: Prep, 1..4 | ||
run: | | ||
apt-get -qy update | ||
apt-get -qy \ | ||
-o "Dpkg::Options::=--force-confdef" \ | ||
-o "Dpkg::Options::=--force-confold" upgrade | ||
apt-get -qy install \ | ||
apt-utils \ | ||
aptitude \ | ||
pkg-config | ||
apt-get -qy autoclean | ||
- name: Prep, 2..4 | ||
run: | | ||
aptitude -q -y -f install \ | ||
autoconf \ | ||
automake \ | ||
bc \ | ||
bison \ | ||
bridge-utils \ | ||
build-essential \ | ||
ca-certificates \ | ||
cpio \ | ||
flex \ | ||
gawk \ | ||
git \ | ||
rsync | ||
- name: Prep, 3..4 | ||
run: | | ||
aptitude -q -y -f install \ | ||
curl \ | ||
file \ | ||
libaio-dev \ | ||
libglib2.0-0 \ | ||
libglib2.0-dev \ | ||
libguestfs-tools \ | ||
liblzo2-dev \ | ||
libpmem-dev \ | ||
libvirt-dev \ | ||
libvirt0 \ | ||
meson \ | ||
ninja-build \ | ||
python3 \ | ||
python3-dev \ | ||
python3-distutils \ | ||
python3-setuptools \ | ||
texinfo \ | ||
uuid-dev | ||
- name: Prep, 4..4 | ||
run: | | ||
aptitude -q -y -f install \ | ||
libpixman-1-0 \ | ||
libpixman-1-dev \ | ||
libslirp-dev | ||
- name: Grab qemu source | ||
run: | | ||
git clone --recursive https://github.com/OpenMPDK/qemu.git | ||
cd qemu | ||
git checkout for-xnvme | ||
- name: Configure qemu | ||
run: | | ||
mkdir build | ||
mkdir -p /opt/qemu | ||
git -C qemu rev-parse --short HEAD > /opt/qemu/docker_tag.txt | ||
cat /opt/qemu/docker_tag.txt | ||
cd build | ||
../qemu/configure \ | ||
--prefix=/opt/qemu \ | ||
--python=/usr/bin/python3 \ | ||
--audio-drv-list="" \ | ||
--disable-docs \ | ||
--disable-debug-info \ | ||
--disable-opengl \ | ||
--disable-virglrenderer \ | ||
--disable-vte \ | ||
--disable-gtk \ | ||
--disable-sdl \ | ||
--disable-spice \ | ||
--disable-vnc \ | ||
--disable-curses \ | ||
--disable-xen \ | ||
--disable-smartcard \ | ||
--disable-libnfs \ | ||
--disable-libusb \ | ||
--disable-glusterfs \ | ||
--disable-tools \ | ||
--disable-werror \ | ||
--target-list="x86_64-softmmu" | ||
- name: Build qemu | ||
run: | | ||
cd build | ||
make -j $(nproc) | ||
make install | ||
- name: Upload Binaries | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: qemu-binaries | ||
path: /opt/qemu | ||
|
||
build-docker: | ||
needs: build-qemu | ||
|
||
runs-on: ubuntu-latest | ||
env: | ||
TAG_DOCKER: latest | ||
|
||
steps: | ||
- name: Grab sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Create a docker context | ||
run: | | ||
mkdir -p /tmp/docker | ||
- name: Grab the qemu binaries | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: qemu-binaries | ||
path: /tmp/docker/qemu | ||
|
||
- name: Build Docker image | ||
run: | | ||
cat /tmp/docker/qemu/docker_tag.txt | ||
TAG_GIT=$(cat /tmp/docker/qemu/docker_tag.txt) | ||
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/xnvme-qemu | ||
docker build \ | ||
-t ${IMAGE_ID}:${TAG_GIT} \ | ||
-t ${IMAGE_ID}:${TAG_DOCKER} \ | ||
-f qemu-nvme/Dockerfile \ | ||
/tmp/docker | ||
- name: Log into GitHub Container Registry | ||
run: | | ||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin | ||
- name: Push to ghcr.io | ||
run: | | ||
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/xnvme-qemu | ||
docker push ${IMAGE_ID}:${TAG_DOCKER} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
FROM debian:bullseye | ||
|
||
WORKDIR /opt | ||
|
||
COPY qemu qemu | ||
|
||
RUN chmod +x qemu/bin/qemu-system-x86_64 | ||
|
||
RUN apt-get -qy update && \ | ||
apt-get -qy \ | ||
-o "Dpkg::Options::=--force-confdef" \ | ||
-o "Dpkg::Options::=--force-confold" upgrade && \ | ||
apt-get -qy autoclean && \ | ||
apt-get -qy install aptitude | ||
|
||
RUN aptitude -q -y -f install \ | ||
libaio-dev \ | ||
libglib2.0-0 \ | ||
libglib2.0-dev \ | ||
libguestfs-tools \ | ||
liblzo2-dev \ | ||
libpmem-dev \ | ||
libvirt-dev \ | ||
libvirt0 | ||
|
||
RUN aptitude -q -y -f install \ | ||
libpixman-1-0 \ | ||
libpixman-1-dev | ||
|
||
RUN aptitude -q -y -f install \ | ||
bridge-utils \ | ||
cloud-image-utils \ | ||
git \ | ||
htop \ | ||
lshw \ | ||
openssh-server \ | ||
procps \ | ||
ssh \ | ||
time \ | ||
vim | ||
|
||
RUN aptitude -q -y -f install \ | ||
python3 \ | ||
python3-pip | ||
|
||
RUN ln -s /usr/bin/python3.8 /usr/bin/python | ||
|
||
# Install cijoe and the packages example and qemu packages | ||
RUN pip install cijoe cijoe-pkg-qemu || true | ||
RUN pip3 install cijoe cijoe-pkg-qemu || true | ||
|
||
# Setup SSH | ||
RUN echo "PermitRootLogin yes" >> /etc/ssh/sshd_config | ||
RUN systemctl enable ssh | ||
RUN service ssh restart | ||
RUN mkdir -p /root/.ssh | ||
RUN chmod 0700 /root/.ssh | ||
RUN ssh-keygen -b 2048 -t rsa -f /root/.ssh/id_rsa -q -N "" | ||
RUN cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys | ||
|
||
# Don't want any of that hastle | ||
RUN echo "Host *" >> /root/.ssh/config | ||
RUN echo " StrictHostKeyChecking no" >> /root/.ssh/config | ||
RUN echo " NoHostAuthenticationForLocalhost yes" >> /root/.ssh/config | ||
RUN echo " UserKnownHostsFile=/dev/null" >> /root/.ssh/config | ||
RUN chmod 0400 /root/.ssh/config | ||
|
||
# This does not apply when SSH-ing to localhost, then ENV set by this is cleared | ||
ENV PATH="/opt/qemu/bin:$PATH" | ||
# So we also add it to /root/.profile | ||
RUN echo 'PATH="/opt/qemu/bin:$PATH"' > /root/.profile | ||
|
||
# Check that the correct qemu is being called | ||
RUN qemu-system-x86_64 --version | ||
|
||
CMD ["bash"] |