Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: upgrade criu 4 #35

Merged
merged 1 commit into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_push_criu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
env:
REGISTRY: ghcr.io
CRIU_IMAGE_NAME: ${{ github.repository }}-criu
CRIU_VERSION: v3.19
CRIU_VERSION: v4.0

jobs:
push_to_registry:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ NAMESPACE := ctrox
INSTALLER_IMAGE := $(REGISTRY)/$(NAMESPACE)/zeropod-installer:dev
MANAGER_IMAGE := $(REGISTRY)/$(NAMESPACE)/zeropod-manager:dev
TEST_IMAGE := $(REGISTRY)/$(NAMESPACE)/zeropod-test:dev
CRIU_VERSION := v3.19
CRIU_VERSION := v4.0
CRIU_IMAGE := $(REGISTRY)/$(NAMESPACE)/zeropod-criu:$(CRIU_VERSION)
DOCKER_SOCK := /var/run/docker.sock
EBPF_IMAGE := $(REGISTRY)/$(NAMESPACE)/zeropod-ebpf:dev
Expand Down
2 changes: 1 addition & 1 deletion cmd/installer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
)

var (
criuImage = flag.String("criu-image", "ghcr.io/ctrox/zeropod-criu:v3.19", "criu image to use.")
criuImage = flag.String("criu-image", "ghcr.io/ctrox/zeropod-criu:v4.0", "criu image to use.")
runtime = flag.String("runtime", "containerd", "specifies which runtime to configure. containerd/k3s/rke2")
hostOptPath = flag.String("host-opt-path", "/opt/zeropod", "path where zeropod binaries are stored on the host")
uninstall = flag.Bool("uninstall", false, "uninstalls zeropod by cleaning up all the files the installer created")
Expand Down
2 changes: 1 addition & 1 deletion config/production/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ patches:
- patch: |-
- op: add
path: /spec/template/spec/initContainers/0/args/-
value: -criu-image=ghcr.io/ctrox/zeropod-criu:v3.19
value: -criu-image=ghcr.io/ctrox/zeropod-criu:v4.0
target:
kind: DaemonSet
apiVersion: kustomize.config.k8s.io/v1beta1
Expand Down
26 changes: 13 additions & 13 deletions criu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# 20.04 seems to be the best compromise for compatibility with most systems.
# For example when building on 22.04, glibc is too recent to work on GKE. It
# would be better to have a fully static build of criu but so far that has
# been a disappointingly unsuccessful endeavour.
FROM ubuntu:20.04 as build
FROM debian:12 as build
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
git build-essential libprotobuf-dev libprotobuf-c-dev \
protobuf-c-compiler protobuf-compiler python3-protobuf \
libcap-dev libnl-3-dev libnet-dev pkg-config curl ca-certificates
git build-essential libprotobuf-dev libprotobuf-c-dev \
protobuf-c-compiler protobuf-compiler python3-protobuf \
libcap-dev libnl-3-dev libnet-dev pkg-config curl ca-certificates \
gnutls-dev

WORKDIR /workspace

RUN git clone https://github.com/checkpoint-restore/criu.git
WORKDIR /workspace/criu
ARG CRIU_VERSION=v3.19
ARG CRIU_VERSION=v4.0
RUN git checkout $CRIU_VERSION
RUN make -j $(nproc)

# copy all libraries that criu needs except libc as replacing libc is not that
# straight-forward.
RUN mkdir criu-libs/ && \
for l in $(ldd criu/criu | awk '{ print $3 }'); do cp $l criu-libs/; done && \
rm criu-libs/libc.so*

# we just add libs and binaries from scratch so this image can be used with
# containerd's client.Install.
FROM scratch AS export-stage
COPY --from=build /workspace/criu/criu/criu /bin/
COPY --from=build /usr/lib/*-linux-gnu/libprotobuf-c.so.1 /lib/
COPY --from=build /lib/*-linux-gnu/libnl-3.so.200 /lib/
COPY --from=build /usr/lib/*-linux-gnu/libnet.so.1 /lib/
COPY --from=build /lib/*-linux-gnu/libjansson.so.4 /lib/
COPY --from=build /workspace/criu/criu-libs /lib/
Loading