Skip to content

Commit 31ce9fc

Browse files
committed
ci: install criu dependency
install criu in ci to test checkpoint. Signed-off-by: ChengyuZhu6 <[email protected]>
1 parent f6f7819 commit 31ce9fc

File tree

4 files changed

+26
-9
lines changed

4 files changed

+26
-9
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: 5 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
@@ -122,6 +122,7 @@ jobs:
122122
| sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
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 }}
125+
sudo systemctl restart docker
125126
echo "::endgroup::"
126127
else
127128
# FIXME: this is missing runc (see top level workflow note about the state of this)
@@ -153,7 +154,8 @@ jobs:
153154
154155
# FIXME: remove expect when we are done removing unbuffer from tests
155156
echo "::group:: installing test dependencies"
156-
sudo apt-get install -qq expect
157+
sudo add-apt-repository ppa:criu/ppa -y
158+
sudo apt-get install -qq expect criu
157159
echo "::endgroup::"
158160
159161
# 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: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,17 @@ 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
311311
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
312-
expect \
313-
jq \
314-
git \
315-
make
312+
software-properties-common \
313+
gnupg \
314+
gpg-agent \
315+
ca-certificates && \
316+
add-apt-repository ppa:criu/ppa && \
317+
apt-get update -qq && apt-get install -qq --no-install-recommends \
318+
expect \
319+
jq \
320+
git \
321+
make \
322+
criu
316323
# We wouldn't need this if Docker Hub could have "golang:${GO_VERSION}-ubuntu"
317324
COPY --from=build-base /usr/local/go /usr/local/go
318325
ARG TARGETARCH

0 commit comments

Comments
 (0)