Skip to content

Embed prebuilt eden-sdn VM image inside the container #1077

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 17, 2025

Conversation

milan-zededa
Copy link
Contributor

@milan-zededa milan-zededa commented Jul 15, 2025

Previously, the lfedge/eden-sdn container included only the SDN "service" layer (sdnagent and its dependencies). This change builds a complete eden-sdn VM image -- including bootloader, kernel, containerd, etc. -- and packages it directly into the container, similar to how EVE images are handled in lfedge/eve.

This significantly speeds up the eden-sdn setup process by eliminating the need to rebuild the VM image during each eden setup.

Additionally, the VM image now uses legacy BIOS boot instead of UEFI, which is perfectly sufficient for eden-sdn and simplifies the boot process.

Finally, eden-sdn now follows its own semantic versioning, independent of eden. Its version is manually defined in sdn/VERSION, ensuring that eden-sdn is not unnecessarily rebuilt and published with a new image tag when unrelated eden components change.

These are initial steps towards integrating eden-sdn into eden tests and github workflows.

@milan-zededa milan-zededa force-pushed the sdn-vm-image branch 3 times, most recently from 50edef7 to 48ac1be Compare July 15, 2025 17:15
@@ -28,7 +28,7 @@ func (vm *SdnVMQemuRunner) Start() error {
var qemuCommand string
qemuOptions := "-display none -nodefaults -no-user-config "
qemuOptions += fmt.Sprintf("-serial chardev:char0 -chardev socket,id=char0,port=%d,"+
"host=localhost,server,nodelay,nowait,telnet,logfile=%s ",
"host=localhost,server=on,nodelay=on,wait=off,telnet=on,logfile=%s ",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we bumping qemu version we're using on host? We have couple of places where we doing this template, ideally this should be aligned across whole code base, would it be possible for you to change it and update readme?

Copy link
Contributor Author

@milan-zededa milan-zededa Jul 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was added unintentionally. I run newer Qemu and was getting some annoying deprecated option warnings.
I removed this change since it is not really related to what this PR is about.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'll create an Issue to keep track of it

@@ -79,12 +79,6 @@ func (openEVEC *OpenEVEC) StartEveQemu(tapInterface string) error {
if err != nil {
return fmt.Errorf("failed to get unused IP subnet: %w", err)
}
imageDir := filepath.Dir(cfg.Sdn.ImageFile)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're saying we don't need firmware anymore on EVE?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No EVE still uses UEFI, this part is for Eden-SDN VM.
But I moved it to a separate StartEdenSDN function now to avoid the confusion.

@uncleDecart
Copy link
Member

LGTM, minor comments, could you also please add in SDN readme how can I build and push image to my local registry?

@milan-zededa
Copy link
Contributor Author

milan-zededa commented Jul 17, 2025

LGTM, minor comments, could you also please add in SDN readme how can I build and push image to my local registry?

Done, documentation added.

Previously, the lfedge/eden-sdn container included only the SDN service layer
(sdnagent and its dependencies). This change builds a complete eden-sdn VM
image—including bootloader, kernel, containerd, etc.—and packages it directly
into the container, similar to how EVE images are handled in lfedge/eve.

This significantly speeds up the eden-sdn setup process by eliminating the need
to rebuild the VM image during each `eden setup`.

Additionally, the VM image now uses legacy BIOS boot instead of UEFI, which is
sufficient for eden-sdn and simplifies the boot process.

Finally, eden-sdn now follows its own semantic versioning, independent of
eden. Its version is manually defined in `sdn/VERSION`, ensuring that
eden-sdn is not unnecessarily rebuilt and published with a new image tag
when unrelated eden components change.

These are initial steps towards integrating eden-sdn into eden tests
and github workflows.

Signed-off-by: Milan Lenco <[email protected]>
@milan-zededa
Copy link
Contributor Author

OK, Apache Yetus is happy now.

@milan-zededa
Copy link
Contributor Author

milan-zededa commented Jul 17, 2025

@uncleDecart Checks completed and they are all green...

@uncleDecart
Copy link
Member

@uncleDecart Checks completed and they are all green...

I see you're pressuring me into merging this :D, fair enough, LGTM

@uncleDecart uncleDecart merged commit b26e5fa into lf-edge:master Jul 17, 2025
44 of 47 checks passed
@milan-zededa
Copy link
Contributor Author

@uncleDecart Checks completed and they are all green...

I see you're pressuring me into merging this :D, fair enough, LGTM

Better merge my PRs, KGB knows where you live comrade!
While you are at it, could you please start eden testing here: lf-edge/eve#5076
No pressure, but do it! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants