Skip to content

Refactor exec monolith (once more) and create command - #971

Open
cmainas wants to merge 2 commits into
mainfrom
ref/pre-libco
Open

Refactor exec monolith (once more) and create command#971
cmainas wants to merge 2 commits into
mainfrom
ref/pre-libco

Conversation

@cmainas

@cmainas cmainas commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

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

  • 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 July 29, 2026 15:40
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]>
@netlify

netlify Bot commented Aug 13, 2026

Copy link
Copy Markdown

Deploy Preview for urunc canceled.

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

@cmainas
cmainas force-pushed the ref/pre-libco branch 2 times, most recently from 77b0f2a to e397503 Compare August 13, 2026 17:07
@cmainas
cmainas marked this pull request as ready for review August 13, 2026 18:08
@cmainas
cmainas requested a review from ananos August 13, 2026 18:08
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.

1 participant