Refactor exec monolith (once more) and create command - #971
Open
cmainas wants to merge 2 commits into
Open
Conversation
Gather everything related to the guest rootfs (along with the preStart) command in once during InitialSetup and store them in monitorResources. Exec simply loads the struct and uses them. No rootfs decision is made in Exec. Signed-off-by: Charalampos Mainas <[email protected]>
Break the large Exec function and the create function into smaller functions that cna be reused: - split createUnikontainer into newUnikontainer (bundle parse and InitialSetup) and the reexec handshake - make SetupNet a standalone function - pull buildUnikernelCommand and execMonitor out of Exec The rationale is to let the later port of libcontainer to use some of this functionality directly instead of duplicating logic. Signed-off-by: Charalampos Mainas <[email protected]>
✅ Deploy Preview for urunc canceled.
|
cmainas
force-pushed
the
ref/pre-libco
branch
2 times, most recently
from
August 13, 2026 17:07
77b0f2a to
e397503
Compare
cmainas
marked this pull request as ready for review
August 13, 2026 18:08
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
This is a pure refactor PR with only goal to minimize the size of the upcoming libcontainer PR. Overall, there are some functionalities in create (cmd) and Exec (of unikontainers) which can be used from the libcontianers migration too. Therefore, for these specific functionalities break these two big functions in smaller reusable ones.
Furthermore,, move more guest rootfs related logic (postSetup and preStart command creation) from Exec to InitialSetup. This change is necessary, because after libcontainer's setup we have no access to the container's spec nor the urunc configuration.
Related issues
How was this tested?
With end-to-end tests
LLM usage
Opus 4.8 to break the functions in smaller ones.
Checklist
make lint).make test_ctr,make test_nerdctl,make test_docker,make test_crictl).