Skip to content

Commit 05cc852

Browse files
committed
ci: install criu dependency
install criu in ci to test checkpoint. Signed-off-by: ChengyuZhu6 <[email protected]>
1 parent 7d190b4 commit 05cc852

File tree

4 files changed

+26
-10
lines changed

4 files changed

+26
-10
lines changed

.github/workflows/job-test-in-container.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ jobs:
151151
sudo mkdir -p /etc/docker
152152
echo '{"ipv6": true, "fixed-cidr-v6": "2001:db8:1::/64", "experimental": true, "ip6tables": true}' | sudo tee /etc/docker/daemon.json
153153
sudo systemctl restart docker
154+
- name: "Init: enable Docker experimental features"
155+
run: |
156+
sudo mkdir -p /etc/docker
157+
echo '{"experimental": true}' | sudo tee /etc/docker/daemon.json
158+
sudo systemctl restart docker
154159
- name: "Run: integration tests"
155160
run: |
156161
. ./hack/github/action-helpers.sh

.github/workflows/job-test-in-host.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ jobs:
107107
name: "Init (linux): prepare host"
108108
run: |
109109
if [ "${{ contains(inputs.binary, 'docker') }}" == true ]; then
110-
echo "::group:: configure cdi for docker"
110+
echo "::group:: configure cdi and experimentalfor docker"
111111
sudo mkdir -p /etc/docker
112-
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
112+
sudo jq -n '.features.cdi = true | .experimental = true' | sudo tee /etc/docker/daemon.json
113113
echo "::endgroup::"
114114
echo "::group:: downgrade docker to the specific version we want to test (${{ inputs.docker-version }})"
115115
sudo apt-get update -qq
@@ -123,6 +123,10 @@ jobs:
123123
sudo apt-get update -qq
124124
sudo apt-get install -qq --allow-downgrades docker-ce=${{ inputs.docker-version }} docker-ce-cli=${{ inputs.docker-version }}
125125
echo "::endgroup::"
126+
echo "::group:: re-enable Docker experimental features"
127+
sudo systemctl restart docker
128+
docker version --format '{{.Server.Experimental}}'
129+
echo "::endgroup::"
126130
else
127131
# FIXME: this is missing runc (see top level workflow note about the state of this)
128132
echo "::group:: install dependencies"
@@ -153,7 +157,8 @@ jobs:
153157
154158
# FIXME: remove expect when we are done removing unbuffer from tests
155159
echo "::group:: installing test dependencies"
156-
sudo apt-get install -qq expect
160+
sudo add-apt-repository ppa:criu/ppa -y
161+
sudo apt-get install -qq expect criu
157162
echo "::endgroup::"
158163
159164
# This ensures that bridged traffic goes through netfilter

.github/workflows/job-test-unit.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,17 @@ jobs:
6868
go-version: ${{ env.GO_VERSION }}
6969
check-latest: true
7070

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

Dockerfile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,14 @@ FROM base AS test-integration
308308
ARG DEBIAN_FRONTEND=noninteractive
309309
# `expect` package contains `unbuffer(1)`, which is used for emulating TTY for testing
310310
# `jq` is required to generate test summaries
311-
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
312-
expect \
313-
jq \
314-
git \
315-
make
311+
RUN apt-get update -qq && apt-get install -qq --no-install-recommends software-properties-common && \
312+
add-apt-repository ppa:criu/ppa && \
313+
apt-get update -qq && apt-get install -qq --no-install-recommends \
314+
expect \
315+
jq \
316+
git \
317+
make \
318+
criu
316319
# We wouldn't need this if Docker Hub could have "golang:${GO_VERSION}-ubuntu"
317320
COPY --from=build-base /usr/local/go /usr/local/go
318321
ARG TARGETARCH

0 commit comments

Comments
 (0)