ref: Select the rootfs in the create step instead of Exec#817
Open
cmainas wants to merge 3 commits into
Open
Conversation
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>
✅ Deploy Preview for urunc canceled.
|
8e29191 to
c0586fd
Compare
361fbc8 to
3285315
Compare
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>
3285315 to
fede36b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Move the
chooseRootfsfunction from reexec to the create process. In this way we can perform thepreSetupfunction 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 thepreSetupstep.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
chooseRootfstakes place inurunc create, we need to disable the same operation from the shim which takes place afterurunc createfinishes 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
tryDecodefunction 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
make lint).make test_ctr,make test_nerdctl,make test_docker,make test_crictl).