Skip to content

Build new notebook container images by snapshotting an interactively created prototype notebook #35

Open
@jiridanek

Description

@jiridanek

We're trying to explore multiple possibilities for user-friendly notebook container building. One approach proposed at 2024-08-15 meeting is to let users snapshot the filesystem of their running notebook pods, upload the result into container registry as a new image, and then many new notebook instances can be created from this image.

My preferred implementation idea follows what Kaniko does (https://github.com/GoogleContainerTools/kaniko/blob/main/docs/designdoc.md). The main difference is that we can (should) use multiple containers in the pod, as we don't need to run any additional commands in the container that's being snapshotted.

  1. create an ephemeral debug container using our snapshotter's image next to the user's container, in the same pod
  2. create another ephemeral debug container using the same base image as the user's container uses, override entrypoint so that nothing actually runs
  3. in the snapshotter, access the filesystems of the other containers through /proc/$PID/root, compute diff between the base image and user's image filesystems using the naive approach described in kaniko design doc, build a tar layer from the changed files, and either upload that directly, or combine it with the original base image to form a new ready-to-be-deployed image.

Skip the same directories that kaniko skips (/proc, ..., also skip any volume mounts).

Kubernetes itself is capable of "checkpointing" of running containers. https://kubernetes.io/blog/2022/12/05/forensic-container-checkpointing-alpha/ this is also an avenue to explore, but it seems to require being a privileged user to perform this operation.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Needs Triage

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions