Skip to content

Commit

Permalink
Run libseccomp tests in parallel
Browse files Browse the repository at this point in the history
Backport a commit that allows us to run the libseccomp tests in
parallel. This lets us build runc image in 30-40 seconds instead
of 4-5 minutes.

The bash script uses `tail` options that is not supported in busybox
tail so pull in `tail` from coreutils.

Signed-off-by: Natanael Copa <[email protected]>
(cherry picked from commit 165d4da)
  • Loading branch information
ncopa authored and github-actions[bot] committed Nov 14, 2024
1 parent 87de102 commit cfb297f
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions embedded-bins/runc/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,33 @@ ARG BUILDIMAGE
FROM $BUILDIMAGE AS build

RUN apk add build-base git \
curl linux-headers gperf bash pkgconf
curl linux-headers gperf bash pkgconf cmd:tail

ENV GOPATH=/go

ARG LIBSECCOMP_VERSION=2.5.5
RUN curl --proto '=https' --tlsv1.2 -L https://github.com/seccomp/libseccomp/releases/download/v$LIBSECCOMP_VERSION/libseccomp-$LIBSECCOMP_VERSION.tar.gz \
| tar -C / -zx

RUN cd /libseccomp-$LIBSECCOMP_VERSION && ./configure --sysconfdir=/etc --enable-static

RUN make -j$(nproc) -C /libseccomp-$LIBSECCOMP_VERSION
RUN make -j$(nproc) -C /libseccomp-$LIBSECCOMP_VERSION check
RUN make -C /libseccomp-$LIBSECCOMP_VERSION install
WORKDIR /libseccomp-$LIBSECCOMP_VERSION
# tests: add basic support for running tests in parallel
RUN curl -L https://github.com/seccomp/libseccomp/commit/2380f5788c692796f75e464c61aa877e5c4eb882.patch \
| git apply
# tests: limit the number of bpf-sim-fuzz test iterations
# https://github.com/seccomp/libseccomp/commit/5878cf2383ccedca3536f47155b13145809ae08e
# the patch didnt apply due to commit touches .travis/
# Use sed instead
RUN sed -i -e 's/50$/5/' tests/*-sim-*.tests

# tests: add support for the LIBSECCOMP_TSTCFG_JOBS env variable
RUN curl -L https://github.com/seccomp/libseccomp/commit/4c19425fa69cfb4f7de5225d676a26ef0b442e28.patch \
| git apply
RUN ./configure --sysconfdir=/etc --enable-static

RUN make -j$(nproc)
RUN make -j$(nproc) check-build
RUN make -C tests check LIBSECCOMP_TSTCFG_JOBS=$(nproc)
RUN make install

ARG VERSION
RUN mkdir -p $GOPATH/src/github.com/opencontainers/runc
Expand Down

0 comments on commit cfb297f

Please sign in to comment.