Skip to content
Merged
Prev Previous commit
Next Next commit
ci: install criu dependency
install criu in ci to test checkpoint.

Signed-off-by: ChengyuZhu6 <hudson@cyzhu.com>
  • Loading branch information
ChengyuZhu6 committed Oct 22, 2025
commit d12925ed91091080c93064128df9efecc0e9c042
12 changes: 11 additions & 1 deletion .github/workflows/job-test-in-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,17 @@ jobs:
sudo sysctl -w net.ipv4.ip_forward=1
# Enable IPv6 for Docker, and configure docker to use containerd for gha
sudo mkdir -p /etc/docker
echo '{"ipv6": true, "fixed-cidr-v6": "2001:db8:1::/64", "experimental": true, "ip6tables": true}' | sudo tee /etc/docker/daemon.json
echo '{"ipv6": true, "fixed-cidr-v6": "2001:db8:1::/64", "ip6tables": true}' | sudo tee /etc/docker/daemon.json
Comment thread
ChengyuZhu6 marked this conversation as resolved.
- name: "Init: enable Docker experimental features"
run: |
sudo mkdir -p /etc/docker
if [ -f /etc/docker/daemon.json ]; then
tmpfile="$(sudo mktemp)"
sudo jq '.experimental = true' /etc/docker/daemon.json | sudo tee "$tmpfile" >/dev/null
sudo mv "$tmpfile" /etc/docker/daemon.json
else
echo '{"experimental": true}' | sudo tee /etc/docker/daemon.json >/dev/null
fi
sudo systemctl restart docker
- name: "Run: integration tests"
run: |
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/job-test-in-host.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ jobs:
name: "Init (linux): prepare host"
run: |
if [ "${{ contains(inputs.binary, 'docker') }}" == true ]; then
echo "::group:: configure cdi for docker"
echo "::group:: configure cdi and experimental for docker"
sudo mkdir -p /etc/docker
sudo jq '.features.cdi = true' /etc/docker/daemon.json | sudo tee /etc/docker/daemon.json.tmp && sudo mv /etc/docker/daemon.json.tmp /etc/docker/daemon.json
sudo jq -n '.features.cdi = true | .experimental = true' | sudo tee /etc/docker/daemon.json
echo "::endgroup::"
echo "::group:: downgrade docker to the specific version we want to test (${{ inputs.docker-version }})"
sudo apt-get update -qq
Expand All @@ -122,6 +122,7 @@ jobs:
| sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update -qq
sudo apt-get install -qq --allow-downgrades docker-ce=${{ inputs.docker-version }} docker-ce-cli=${{ inputs.docker-version }}
sudo systemctl restart docker
echo "::endgroup::"
else
# FIXME: this is missing runc (see top level workflow note about the state of this)
Expand Down Expand Up @@ -153,7 +154,8 @@ jobs:

# FIXME: remove expect when we are done removing unbuffer from tests
echo "::group:: installing test dependencies"
sudo apt-get install -qq expect
sudo add-apt-repository ppa:criu/ppa -y
sudo apt-get install -qq expect criu
echo "::endgroup::"

# This ensures that bridged traffic goes through netfilter
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/job-test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,17 @@ jobs:
go-version: ${{ env.GO_VERSION }}
check-latest: true

# Install CNI
# Install CNI and CRIU
- if: ${{ env.GO_VERSION != '' }}
name: "Init: set up CNI"
name: "Init: set up CNI and CRIU"
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
GOPATH=$(go env GOPATH) WINCNI_VERSION=${{ inputs.windows-cni-version }} ./hack/provisioning/windows/cni.sh
elif [ "$RUNNER_OS" == "Linux" ]; then
./hack/provisioning/linux/cni.sh install "${{ inputs.linux-cni-version }}" "amd64" "${{ inputs.linux-cni-sha }}"
sudo apt-get update -qq
sudo add-apt-repository ppa:criu/ppa -y
sudo apt-get install -qq criu
fi

- if: ${{ env.GO_VERSION != '' }}
Expand Down
15 changes: 11 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,17 @@ ARG DEBIAN_FRONTEND=noninteractive
# `expect` package contains `unbuffer(1)`, which is used for emulating TTY for testing
# `jq` is required to generate test summaries
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
expect \
jq \
git \
make
software-properties-common \
gnupg \
gpg-agent \
ca-certificates && \
add-apt-repository ppa:criu/ppa && \
apt-get update -qq && apt-get install -qq --no-install-recommends \
expect \
jq \
git \
make \
criu
# We wouldn't need this if Docker Hub could have "golang:${GO_VERSION}-ubuntu"
COPY --from=build-base /usr/local/go /usr/local/go
ARG TARGETARCH
Expand Down