Skip to content
Snippets Groups Projects
Commit cb5cc2b8 authored by Chase Qi's avatar Chase Qi Committed by Andrei Gherzan
Browse files

.oniro-ci/containers/bitbake-builder: add support for runqemu


Part of gcc oeself-test is client/server based. It uses qemu vm for
native tests via ssh. The vm is launched by runqemu command which
requires the following changes in the docker image.

* passwordless sudo permission
* package iptables pre-installed

Signed-off-by: default avatarChase Qi <chase.qi@linaro.org>
parent 7a5149bc
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !127. Comments created here will be created in the context of that merge request.
...@@ -26,8 +26,8 @@ RUN apt-get update -qq \ ...@@ -26,8 +26,8 @@ RUN apt-get update -qq \
bash git-repo git-lfs apt-utils build-essential chrpath cpio diffstat \ bash git-repo git-lfs apt-utils build-essential chrpath cpio diffstat \
gawk git sudo wget language-pack-en-base time locales python-is-python3 \ gawk git sudo wget language-pack-en-base time locales python-is-python3 \
python3-distutils python3-pip libssl-dev iproute2 iputils-ping curl jq \ python3-distutils python3-pip libssl-dev iproute2 iputils-ping curl jq \
lz4 zstd \ lz4 zstd iptables\
&& eatmydata apt-get install -qq -y 'ca-certificates=20210119~20.04.2' \ && eatmydata apt-get install -qq -y 'ca-certificates=20211016~20.04.1' \
&& eatmydata apt-get clean && rm -rf /var/lib/apt/lists/* && eatmydata apt-get clean && rm -rf /var/lib/apt/lists/*
RUN locale-gen RUN locale-gen
RUN pip3 install anybadge RUN pip3 install anybadge
...@@ -36,7 +36,10 @@ RUN pip3 install anybadge ...@@ -36,7 +36,10 @@ RUN pip3 install anybadge
RUN echo "dash dash/sh boolean false" | debconf-set-selections \ RUN echo "dash dash/sh boolean false" | debconf-set-selections \
&& DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash && DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash
RUN useradd --create-home --uid 1000 --shell /usr/bin/bash builder RUN useradd --create-home --uid 1000 --shell /usr/bin/bash builder \
&& usermod -aG sudo builder\
&& echo "builder ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
  • Maintainer

    Can you detail here the need for sudo permissions?

    Edited by Andrei Gherzan
  • Developer

    @agherzan this has been reiterated many times. Bunch of test cases from various test suites require root for operation. LAVA infra does not necessarily.

  • Maintainer

    I would be interested to know which one we hit this on. @bero do you have any details on this?

  • Author Reporter

    In this case, it is runqemu command uses sudo permission to create tun device for the communication between host and vm for vm based gcc testing. I will add a comment in the change.

  • Maintainer

    I see. So it's not about the tests, it's about the virtualization tooling and configuration.

  • Author Reporter

    Yes. comment added.

  • Maintainer

    Can you also give me a link to where we use sudo in the CI script?

  • Author Reporter

    Not in our CI script. It is in oe-core. oe-selftest framework calls runqemu to lunch VM https://github.com/openembedded/openembedded-core/blob/master/meta/lib/oeqa/utils/qemurunner.py#L164

    and runqemu uses sudo to bring up/down network interface https://github.com/openembedded/openembedded-core/blob/master/scripts/runqemu-ifup#L27

  • Maintainer

    Now I remember. Thanks.

  • Please register or sign in to reply
COPY --chown=builder:builder .gitconfig /home/builder/.gitconfig COPY --chown=builder:builder .gitconfig /home/builder/.gitconfig
USER builder USER builder
WORKDIR /home/builder WORKDIR /home/builder
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment