mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-17 16:47:50 +00:00
scripts: improve layer caching of container builds
The scripts installing dependencies are now copied and executed before copying the full source tree. This allows to cache the dependency installation layers as long as these scripts remain unchanged. Previously, copying the entire repository invalidated the cache on every source change. While our CI intentionally doesn't preserve cached layers across independent runs, the changes in this patch help with local testing when investigating issues. Examples: - sudo -E make -C scripts/ci alpine GCC=1 - sudo -E make -C scripts/ci alpine CLANG=1 Suggested-by: Andrei Vagin <avagin@google.com> Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
This commit is contained in:
parent
941f9b108b
commit
a72bf212ec
11 changed files with 45 additions and 25 deletions
|
|
@ -1,11 +1,12 @@
|
||||||
FROM alpine
|
FROM alpine
|
||||||
ARG CC=gcc
|
ARG CC=gcc
|
||||||
|
|
||||||
|
COPY contrib/dependencies/apk-packages.sh /criu/contrib/dependencies/apk-packages.sh
|
||||||
|
RUN apk add --no-cache "$CC" && /criu/contrib/dependencies/apk-packages.sh
|
||||||
|
|
||||||
COPY . /criu
|
COPY . /criu
|
||||||
WORKDIR /criu
|
WORKDIR /criu
|
||||||
|
|
||||||
RUN apk add --no-cache "$CC" && /criu/contrib/dependencies/apk-packages.sh
|
|
||||||
|
|
||||||
RUN make mrproper && date && make -j $(nproc) CC="$CC" && date
|
RUN make mrproper && date && make -j $(nproc) CC="$CC" && date
|
||||||
|
|
||||||
# The rpc test cases are running as user #1000, let's add the user
|
# The rpc test cases are running as user #1000, let's add the user
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,11 @@ ARG CC=gcc
|
||||||
# Initialize machine ID
|
# Initialize machine ID
|
||||||
RUN systemd-machine-id-setup
|
RUN systemd-machine-id-setup
|
||||||
|
|
||||||
COPY . /criu
|
COPY contrib/dependencies/pacman-packages.sh /criu/contrib/dependencies/pacman-packages.sh
|
||||||
WORKDIR /criu
|
WORKDIR /criu
|
||||||
|
RUN pacman -Syu --noconfirm "$CC" && /criu/contrib/dependencies/pacman-packages.sh
|
||||||
|
|
||||||
RUN pacman -Syu --noconfirm "$CC" && contrib/dependencies/pacman-packages.sh
|
COPY . /criu
|
||||||
|
|
||||||
RUN make mrproper && date && make -j $(nproc) CC="$CC" && date
|
RUN make mrproper && date && make -j $(nproc) CC="$CC" && date
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,12 @@
|
||||||
ARG CC=gcc
|
ARG CC=gcc
|
||||||
|
|
||||||
COPY . /criu
|
COPY contrib/dependencies/dnf-packages.sh /criu/contrib/dependencies/dnf-packages.sh
|
||||||
|
COPY scripts/ci/prepare-for-fedora-rawhide.sh /criu/scripts/ci/prepare-for-fedora-rawhide.sh
|
||||||
|
# prepare-for-fedora-rawhide.sh assumes we are in the criu directory
|
||||||
WORKDIR /criu
|
WORKDIR /criu
|
||||||
|
RUN dnf install -y "$CC" && /criu/scripts/ci/prepare-for-fedora-rawhide.sh
|
||||||
|
|
||||||
RUN dnf install -y "$CC" && scripts/ci/prepare-for-fedora-rawhide.sh
|
COPY . /criu
|
||||||
|
|
||||||
RUN make mrproper && date && make -j $(nproc) CC="$CC" && date
|
RUN make mrproper && date && make -j $(nproc) CC="$CC" && date
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
FROM docker.io/library/eclipse-temurin:11-alpine
|
FROM docker.io/library/eclipse-temurin:11-alpine
|
||||||
ARG CC=gcc
|
ARG CC=gcc
|
||||||
|
|
||||||
COPY . /criu
|
COPY contrib/dependencies/apk-packages.sh /criu/contrib/dependencies/apk-packages.sh
|
||||||
WORKDIR /criu
|
WORKDIR /criu
|
||||||
|
RUN apk add --no-cache maven "$CC" && /criu/contrib/dependencies/apk-packages.sh
|
||||||
|
|
||||||
RUN apk add --no-cache maven "$CC" && contrib/dependencies/apk-packages.sh
|
COPY . /criu
|
||||||
|
|
||||||
RUN make mrproper && make -j $(nproc) CC="$CC"
|
RUN make mrproper && make -j $(nproc) CC="$CC"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,12 @@
|
||||||
FROM docker.io/library/eclipse-temurin:11-jammy
|
FROM docker.io/library/eclipse-temurin:11-jammy
|
||||||
ARG CC=gcc
|
ARG CC=gcc
|
||||||
|
|
||||||
COPY . /criu
|
COPY contrib/dependencies/apt-packages.sh /criu/contrib/dependencies/apt-packages.sh
|
||||||
|
COPY contrib/apt-install /criu/contrib/apt-install
|
||||||
WORKDIR /criu
|
WORKDIR /criu
|
||||||
|
RUN /criu/contrib/apt-install maven "$CC" && contrib/dependencies/apt-packages.sh
|
||||||
|
|
||||||
RUN contrib/apt-install maven "$CC" && contrib/dependencies/apt-packages.sh
|
COPY . /criu
|
||||||
|
|
||||||
RUN make mrproper && make -j $(nproc) CC="$CC"
|
RUN make mrproper && make -j $(nproc) CC="$CC"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
ARG CC=gcc
|
ARG CC=gcc
|
||||||
|
|
||||||
COPY . /criu
|
COPY contrib/dependencies/apt-cross-packages.sh /criu/contrib/dependencies/apt-cross-packages.sh
|
||||||
|
COPY contrib/apt-install /criu/contrib/apt-install
|
||||||
WORKDIR /criu
|
WORKDIR /criu
|
||||||
|
RUN /criu/contrib/apt-install "$CC" && /criu/contrib/dependencies/apt-packages.sh
|
||||||
|
|
||||||
RUN contrib/apt-install "$CC" && contrib/dependencies/apt-packages.sh
|
COPY . /criu
|
||||||
|
|
||||||
RUN uname -m && setarch linux32 uname -m && setarch --list
|
RUN uname -m && setarch linux32 uname -m && setarch --list
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
FROM docker.io/library/ibm-semeru-runtimes:open-11-jdk-jammy
|
FROM docker.io/library/ibm-semeru-runtimes:open-11-jdk-jammy
|
||||||
ARG CC=gcc
|
ARG CC=gcc
|
||||||
|
|
||||||
|
COPY contrib/dependencies/apt-packages.sh /criu/contrib/dependencies/apt-packages.sh
|
||||||
|
COPY contrib/apt-install /criu/contrib/apt-install
|
||||||
|
WORKDIR /criu
|
||||||
|
RUN /criu/contrib/apt-install maven "$CC" && /criu/contrib/dependencies/apt-packages.sh
|
||||||
|
|
||||||
RUN mkdir -p /etc/criu && echo 'ghost-limit 16777216' > /etc/criu/default.conf
|
RUN mkdir -p /etc/criu && echo 'ghost-limit 16777216' > /etc/criu/default.conf
|
||||||
COPY . /criu
|
COPY . /criu
|
||||||
WORKDIR /criu
|
|
||||||
|
|
||||||
RUN contrib/apt-install maven "$CC" && contrib/dependencies/apt-packages.sh
|
|
||||||
|
|
||||||
RUN make mrproper && make -j $(nproc) CC="$CC"
|
RUN make mrproper && make -j $(nproc) CC="$CC"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,11 @@ ENV CROSS_COMPILE=${CROSS_TRIPLET}- \
|
||||||
ENV PATH="${PATH}:${CROSS_ROOT}/bin" \
|
ENV PATH="${PATH}:${CROSS_ROOT}/bin" \
|
||||||
PKG_CONFIG_PATH=/usr/lib/${CROSS_TRIPLET}/pkgconfig
|
PKG_CONFIG_PATH=/usr/lib/${CROSS_TRIPLET}/pkgconfig
|
||||||
|
|
||||||
COPY . /criu
|
COPY contrib/dependencies/apt-cross-packages.sh /criu/contrib/dependencies/apt-cross-packages.sh
|
||||||
|
COPY contrib/apt-install /criu/contrib/apt-install
|
||||||
WORKDIR /criu
|
WORKDIR /criu
|
||||||
|
RUN /criu/contrib/dependencies/apt-cross-packages.sh
|
||||||
|
|
||||||
RUN contrib/dependencies/apt-cross-packages.sh
|
COPY . /criu
|
||||||
|
|
||||||
RUN make mrproper && date && make -j $(nproc) zdtm && date
|
RUN make mrproper && date && make -j $(nproc) zdtm && date
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,12 @@ ENV CROSS_COMPILE=${CROSS_TRIPLET}- \
|
||||||
ENV PATH="${PATH}:${CROSS_ROOT}/bin" \
|
ENV PATH="${PATH}:${CROSS_ROOT}/bin" \
|
||||||
PKG_CONFIG_PATH=/usr/lib/${CROSS_TRIPLET}/pkgconfig
|
PKG_CONFIG_PATH=/usr/lib/${CROSS_TRIPLET}/pkgconfig
|
||||||
|
|
||||||
COPY . /criu
|
COPY contrib/dependencies/apt-cross-packages.sh /criu/contrib/dependencies/apt-cross-packages.sh
|
||||||
|
COPY contrib/apt-install /criu/contrib/apt-install
|
||||||
WORKDIR /criu
|
WORKDIR /criu
|
||||||
|
RUN /criu/contrib/dependencies/apt-cross-packages.sh
|
||||||
|
|
||||||
RUN contrib/dependencies/apt-cross-packages.sh
|
COPY . /criu
|
||||||
|
|
||||||
# amdgpu_plugin with armv7 is not supported
|
# amdgpu_plugin with armv7 is not supported
|
||||||
RUN make mrproper && date && \
|
RUN make mrproper && date && \
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
ARG CC=gcc
|
ARG CC=gcc
|
||||||
|
|
||||||
COPY . /criu
|
|
||||||
WORKDIR /criu
|
|
||||||
|
|
||||||
# On Ubuntu, kernel modules such as ip_tables and xt_mark may not be loaded by default
|
# On Ubuntu, kernel modules such as ip_tables and xt_mark may not be loaded by default
|
||||||
# We need to install kmod to enable iptables to load these modules for us.
|
# We need to install kmod to enable iptables to load these modules for us.
|
||||||
RUN contrib/apt-install "$CC" && contrib/dependencies/apt-packages.sh
|
COPY contrib/dependencies/apt-packages.sh /criu/contrib/dependencies/apt-packages.sh
|
||||||
|
COPY contrib/apt-install /criu/contrib/apt-install
|
||||||
|
WORKDIR /criu
|
||||||
|
RUN /criu/contrib/apt-install "$CC" && /criu/contrib/dependencies/apt-packages.sh
|
||||||
|
|
||||||
|
COPY . /criu
|
||||||
|
|
||||||
RUN git clean -dfx && date && \
|
RUN git clean -dfx && date && \
|
||||||
# Check single object build
|
# Check single object build
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,11 @@ ENV CROSS_COMPILE=${CROSS_TRIPLET}- \
|
||||||
ENV PATH="${PATH}:${CROSS_ROOT}/bin" \
|
ENV PATH="${PATH}:${CROSS_ROOT}/bin" \
|
||||||
PKG_CONFIG_PATH=/usr/lib/${CROSS_TRIPLET}/pkgconfig
|
PKG_CONFIG_PATH=/usr/lib/${CROSS_TRIPLET}/pkgconfig
|
||||||
|
|
||||||
COPY . /criu
|
COPY contrib/dependencies/apt-cross-packages.sh /criu/contrib/dependencies/apt-cross-packages.sh
|
||||||
|
COPY contrib/apt-install /criu/contrib/apt-install
|
||||||
WORKDIR /criu
|
WORKDIR /criu
|
||||||
|
RUN /criu/contrib/dependencies/apt-cross-packages.sh
|
||||||
|
|
||||||
RUN contrib/dependencies/apt-cross-packages.sh
|
COPY . /criu
|
||||||
|
|
||||||
RUN make mrproper && date && make -j $(nproc) zdtm && date
|
RUN make mrproper && date && make -j $(nproc) zdtm && date
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue