Skip to content

ref: Select the rootfs in the create step instead of Exec#817

Open
cmainas wants to merge 3 commits into
mainfrom
ref_choose_rootfs_in_create
Open

ref: Select the rootfs in the create step instead of Exec#817
cmainas wants to merge 3 commits into
mainfrom
ref_choose_rootfs_in_create

Conversation

@cmainas

@cmainas cmainas commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Description

Move the chooseRootfs function from reexec to the create process. In this way we can perform the preSetup function of a block based rootfs before creating any namespace. This was a block for the adoption of libcontainers, because when we use libcontainers for the monitor execution environment, we will not be able to perform such operations like the preSetup step.

This will also allow us to immediately unmount the rootfs created by containerd before creating any mount namespaces and having troubles with mount events and their propagation.

Furthermore, since chooseRootfs takes place inurunc create, we need to disable the same operation from the shim which takes place after urunc create finishes and therefore it might fail since in block-based rootfs the rootfs will get unmounted. However, this is a temporary solution and related to #816. The rootfs handling needs better control from the create task of the shim and hence we need to get deeper in the shim for a proper solution.

At last, give this opportunity, remove the tryDecode function from printing the annotations when we get them from the Spec.

Related issues

How was this tested?

Running the e2e tests

LLM usage

N/A

Checklist

  • I have read the contribution guide.
  • The linter passes locally (make lint).
  • The e2e tests of at least one tool pass locally (make test_ctr, make test_nerdctl, make test_docker, make test_crictl).
  • If LLMs were used: I have read the llm policy.

cmainas added 2 commits June 29, 2026 10:38
Move the chooseRootfs function from reexec to the create process. In
this way we can perform the `preSetup` function of a block based rootfs
before creating any namespace. This was a block for the adoption of
libcontainers, because when we use libcontainers for the monitor
execution environment, we will not be able to perform such operations
like the `preSetup` step.

This will also allow us to immediately unmount the rootfs created by
containerd before creating any mount namespaces and having troubles with
mount events and their propagation.

Signed-off-by: Charalampos Mainas <cmainas@nubificus.co.uk>
When we read the annotations directly from the container spec, then
these annotations are not base64 decoded and hence we should not use the
`tryDecode` function to print them in the debug logs.

Signed-off-by: Charalampos Mainas <cmainas@nubificus.co.uk>
@netlify

netlify Bot commented Jul 10, 2026

Copy link
Copy Markdown

Deploy Preview for urunc canceled.

Name Link
🔨 Latest commit fede36b
🔍 Latest deploy log https://app.netlify.com/projects/urunc/deploys/6a51322587bbb80007982aa1

@cmainas cmainas force-pushed the ref_choose_rootfs_in_create branch from 8e29191 to c0586fd Compare July 10, 2026 15:48
@cmainas cmainas force-pushed the ref_choose_rootfs_in_create branch 3 times, most recently from 361fbc8 to 3285315 Compare July 10, 2026 17:54
Since we perform the rootfs selection in `urunc create`, the shim will
fail to redo the same operation, because in case of block-based rootfs,
the rootfs will get unmounted.

Signed-off-by: Charalampos Mainas <cmainas@nubificus.co.uk>
@cmainas cmainas force-pushed the ref_choose_rootfs_in_create branch from 3285315 to fede36b Compare July 10, 2026 17:55
@cmainas cmainas marked this pull request as ready for review July 10, 2026 18:11
@cmainas cmainas requested a review from ananos July 10, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move the rootfs choice and preSetup step from reexec process to create process

1 participant