diff --git a/.github/workflows/build_push.yml b/.github/workflows/build_push.yml index 66f6269..547dfdc 100644 --- a/.github/workflows/build_push.yml +++ b/.github/workflows/build_push.yml @@ -10,7 +10,7 @@ env: INSTALLER_IMAGE_NAME: ${{ github.repository }}-installer MANAGER_IMAGE_NAME: ${{ github.repository }}-manager CRIU_IMAGE_NAME: ${{ github.repository }}-criu - CRIU_VERSION: 116991736c7641258a5b7f53f5079b90fc80b99e + CRIU_VERSION: v4.2 jobs: push_to_registry: diff --git a/.github/workflows/build_push_commit.yml b/.github/workflows/build_push_commit.yml index 48f01b0..8577526 100644 --- a/.github/workflows/build_push_commit.yml +++ b/.github/workflows/build_push_commit.yml @@ -10,7 +10,7 @@ env: INSTALLER_IMAGE_NAME: ${{ github.repository }}-installer MANAGER_IMAGE_NAME: ${{ github.repository }}-manager CRIU_IMAGE_NAME: ${{ github.repository }}-criu - CRIU_VERSION: 116991736c7641258a5b7f53f5079b90fc80b99e + CRIU_VERSION: v4.2 jobs: push_to_registry: diff --git a/.github/workflows/build_push_criu.yml b/.github/workflows/build_push_criu.yml index f36f2b0..0b9d358 100644 --- a/.github/workflows/build_push_criu.yml +++ b/.github/workflows/build_push_criu.yml @@ -8,7 +8,7 @@ on: env: REGISTRY: ghcr.io CRIU_IMAGE_NAME: ${{ github.repository }}-criu - CRIU_VERSION: 116991736c7641258a5b7f53f5079b90fc80b99e + CRIU_VERSION: v4.2 jobs: push_to_registry: diff --git a/Makefile b/Makefile index 02a5d51..1c12ccb 100644 --- a/Makefile +++ b/Makefile @@ -4,8 +4,7 @@ TAG := dev INSTALLER_IMAGE := $(REGISTRY)/$(NAMESPACE)/zeropod-installer:$(TAG) MANAGER_IMAGE := $(REGISTRY)/$(NAMESPACE)/zeropod-manager:$(TAG) TEST_IMAGE := $(REGISTRY)/$(NAMESPACE)/zeropod-test:$(TAG) -# includes fix for https://github.com/checkpoint-restore/criu/issues/2532 -CRIU_VERSION := 116991736c7641258a5b7f53f5079b90fc80b99e +CRIU_VERSION := v4.2 CRIU_IMAGE := $(REGISTRY)/$(NAMESPACE)/zeropod-criu:$(CRIU_VERSION) DOCKER_SOCK := /var/run/docker.sock EBPF_IMAGE := $(REGISTRY)/$(NAMESPACE)/zeropod-ebpf:$(TAG) diff --git a/cmd/installer/main.go b/cmd/installer/main.go index 97ec1c5..76314dd 100644 --- a/cmd/installer/main.go +++ b/cmd/installer/main.go @@ -32,7 +32,7 @@ import ( ) var ( - criuImage = flag.String("criu-image", "ghcr.io/ctrox/zeropod-criu:116991736c7641258a5b7f53f5079b90fc80b99e", "criu image to use.") + criuImage = flag.String("criu-image", "ghcr.io/ctrox/zeropod-criu:v4.2", "criu image to use.") runtime = flag.String("runtime", "containerd", "specifies which runtime to configure. containerd/k3s/rke2") hostOptPath = flag.String("host-opt-path", defaultOptPath, "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") diff --git a/cmd/manager/Dockerfile b/cmd/manager/Dockerfile index 77b474e..5b4ae66 100644 --- a/cmd/manager/Dockerfile +++ b/cmd/manager/Dockerfile @@ -1,4 +1,4 @@ -ARG CRIU_IMAGE=ghcr.io/ctrox/zeropod-criu:116991736c7641258a5b7f53f5079b90fc80b99e +ARG CRIU_IMAGE=ghcr.io/ctrox/zeropod-criu:v4.2 FROM --platform=$BUILDPLATFORM golang:1.25 AS builder diff --git a/config/production/kustomization.yaml b/config/production/kustomization.yaml index 59319d0..ac35a84 100644 --- a/config/production/kustomization.yaml +++ b/config/production/kustomization.yaml @@ -18,7 +18,7 @@ patches: - patch: |- - op: add path: /spec/template/spec/initContainers/0/args/- - value: -criu-image=ghcr.io/ctrox/zeropod-criu:116991736c7641258a5b7f53f5079b90fc80b99e + value: -criu-image=ghcr.io/ctrox/zeropod-criu:v4.2 target: kind: DaemonSet apiVersion: kustomize.config.k8s.io/v1beta1 diff --git a/criu/always-lazy.patch b/criu/always-lazy.patch index 487e0dc..3119bbc 100644 --- a/criu/always-lazy.patch +++ b/criu/always-lazy.patch @@ -1,10 +1,10 @@ diff --git a/criu/cr-service.c b/criu/cr-service.c -index 61a04c5ff..c0cce482e 100644 +index dccf4ef38..bb30c4c98 100644 --- a/criu/cr-service.c +++ b/criu/cr-service.c -@@ -285,6 +285,12 @@ int exec_rpc_query_external_files(char *name, int sk) - - static char images_dir[PATH_MAX]; +@@ -393,6 +393,12 @@ static int setup_logging_from_req(CriuOpts *req, bool output_changed_by_rpc_conf + return 0; + } +bool file_exists(char *filename) +{ @@ -15,24 +15,24 @@ index 61a04c5ff..c0cce482e 100644 static int setup_opts_from_req(int sk, CriuOpts *req) { struct ucred ids; -@@ -293,6 +299,7 @@ static int setup_opts_from_req(int sk, CriuOpts *req) - char images_dir_path[PATH_MAX]; - char work_dir_path[PATH_MAX]; +@@ -400,6 +406,7 @@ static int setup_opts_from_req(int sk, CriuOpts *req) + socklen_t ids_len = sizeof(struct ucred); + char images_dir_path[PATH_MAX] = ""; char status_fd[PATH_MAX]; + char lazy_pages_socket_path[PATH_MAX]; bool output_changed_by_rpc_conf = false; bool work_changed_by_rpc_conf = false; bool imgs_changed_by_rpc_conf = false; -@@ -554,6 +561,14 @@ static int setup_opts_from_req(int sk, CriuOpts *req) +@@ -522,6 +529,14 @@ static int setup_opts_from_req(int sk, CriuOpts *req) opts.lazy_pages = req->lazy_pages; } -+ strcpy(lazy_pages_socket_path, images_dir); -+ strcat(lazy_pages_socket_path, "/lazy-pages.socket"); -+ -+ if (file_exists(lazy_pages_socket_path)) { -+ // always enable lazy-pages if the socket exists -+ opts.lazy_pages = true; ++ if (resolve_images_dir_path(lazy_pages_socket_path, imgs_changed_by_rpc_conf, req, ids.pid) == 0) { ++ strcat(lazy_pages_socket_path, "/lazy-pages.socket"); ++ if (file_exists(lazy_pages_socket_path)) { ++ // always enable lazy-pages if the socket exists ++ opts.lazy_pages = true; ++ } + } + if (req->has_pre_dump_mode) {