From: Petr Vorel <pvorel@suse.cz>
To: Richard Palethorpe <rpalethorpe@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [RFC PATCH] Add simple Alpine container
Date: Wed, 27 Sep 2023 08:27:16 +0200 [thread overview]
Message-ID: <20230927062716.GF205174@pevik> (raw)
In-Reply-To: <20230926090101.7565-1-rpalethorpe@suse.com>
Hi all,
> Can be built with `docker/podman build .`. Then run with `podman -it
> run sh`. It contains Kirk in /opt/kirk. So `cd /opt/kirk && ./kirk -f
> ltp --run-suite syscalls` will run some tests.
> ---
> Hello,
> This builds and installs the LTP and Kirk inside an Alpine
> container. The idea is to use a standard container workflow to build
> and run the LTP from source. This helps with testing LTP itself and
> running tests inside a container.
> I'd like to add some container files to upstream to help with various
> workflows.
> The container has a number of problems:
> 1. If the Git directory has build artifacts in it, these are copied
> into the container (.dockerignore may help)
> 2. The resulting container is quite large (possibly due to debug symbols)
> 3. Where should we put container files and how should we name them?
> 4. Making the slightest change results in a complete container rebuild
> Note that SUSE publishes a TW container based on our packaging system:
> https://build.opensuse.org/project/show/benchmark:ltp:devel
> https://registry.opensuse.org/cgi-bin/cooverview?srch_term=project%3D%5Ebenchmark+container%3D.*
> Also, for developing tests, it may be better to build the LTP outside
> of a container then copy in the files.
> +++ b/Containerfile
> @@ -0,0 +1,35 @@
> +FROM alpine:3.18 AS build
Maybe we could use ARG and ENV to allow user to decide which distro to use.
https://stackoverflow.com/questions/76091578/is-it-possible-to-use-an-environment-variable-in-the-from-instruction-of-a-docke
This way we could use various scripts in ci.
> +ARG LTPROOT=/opt/ltp
> +
> +RUN mkdir /build
> +WORKDIR /build
> +COPY . /build
> +RUN ./ci/alpine.sh
> +RUN ./build.sh -p $LTPROOT -i
> +
> +FROM alpine:3.18
Also here.
> +ARG LTPROOT=/opt/ltp
> +ARG KIRKROOT=/opt/kirk
> +
> +RUN apk add \
> + acl \
> + keyutils \
> + libaio \
> + libacl \
> + libcap \
> + libselinux \
> + libsepol \
> + libtirpc \
> + numactl \
> + openssl \
> + py3-msgpack
This somehow emulates ./ci/alpine.sh (i.e. ./ci/alpine.sh has keyutils-dev,
which should install also keyutils as a dependency). We could add a mechanism to
ci scripts to install runtime dependencies (e.g. './ci/alpine.sh runtime' would
install all runtime dependencies, './ci/alpine.sh runtime-syscalls' would
install only runtime dependencies for syscalls).
But better would be to move runtime dependencies to kirk. But unfortunately this
part from original Cyril's perl based runltp-ng was not ported to new Andrea's
python based runltp-ng/kirk.
Kind regards,
Petr
> +
> +COPY --from=build $LTPROOT $LTPROOT
> +ENV LTPROOT=$LTPROOT
> +ENV PATH=$LTPROOT/testcases/bin:$LTPROOT/bin:$PATH
> +
> +RUN mkdir -p $KIRKROOT
> +COPY --from=build /build/tools/kirk $KIRKROOT
> +
> +RUN adduser -D -g "Unprivileged LTP user" ltp
> +RUN su ltp
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2023-09-27 6:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-26 9:01 [LTP] [RFC PATCH] Add simple Alpine container Richard Palethorpe via ltp
2023-09-26 10:51 ` Marius Kittler
2023-09-27 7:00 ` Richard Palethorpe
2023-09-27 6:27 ` Petr Vorel [this message]
2023-09-27 7:29 ` Richard Palethorpe
2023-09-27 9:05 ` Petr Vorel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230927062716.GF205174@pevik \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
--cc=rpalethorpe@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox