Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

Ignite wrapper #481

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Ignite wrapper #481

wants to merge 2 commits into from

Conversation

chanwit
Copy link
Member

@chanwit chanwit commented Oct 16, 2019

This PR introduce ignitew, a self-contained binary bundling ignite and CNI plugin binaries together.

ignitew can be used as a drop-in replacement of ignite OOTB without user manually installing CNI plugins.

It uses the excellent warp-packer https://github.com/dgiagio/warp to create the self contained binary. It uses no sandbox, so that the behaviour could be expected to be similar to the normal ignite.

Example:

$ sudo ls -al /opt/cni/bin/bridge
ls: cannot access '/opt/cni/bin/bridge': No such file or directory
$ sudo ls -al /opt/cni/bin/loopback
ls: cannot access '/opt/cni/bin/loopback': No such file or directory
$ ./ignitew version
Ignite version: version.Info{Major:"0", Minor:"6+", GitVersion:"v0.6.0-108+472f5f5d9ca49f", GitCommit:"472f5f5d9ca49f63d55bf2433d
e7eeafc946787b", GitTreeState:"clean", BuildDate:"2019-10-16T12:19:41Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"linux/am
d64"}
Firecracker version: v0.18.0
Runtime: containerd
$ sudo ./ignitew run weaveworks/ignite-ubuntu --ssh
INFO[0001] Created VM with ID "eee36d65bf8d132c" and name "little-forest" 
INFO[0001] Networking is handled by "cni"               
INFO[0001] Started Firecracker VM "eee36d65bf8d132c" in a container with ID "ignite-eee36d65bf8d132c" 
$ sudo ./ignitew exec little-forest -- uname -a
Linux localhost.localdomain 4.19.47 #1 SMP Tue Jul 16 18:57:23 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
$ sudo ./ignitew rm -f little-forest
INFO[0000] Removing the container with ID "ignite-eee36d65bf8d132c" from the "cni" network 
INFO[0000] Removed VM with name "little-forest" and ID "eee36d65bf8d132c" 

@chanwit chanwit requested a review from stealthybox October 16, 2019 12:34
@chanwit chanwit requested a review from twelho as a code owner October 16, 2019 12:34
@chanwit chanwit removed the request for review from twelho October 16, 2019 12:34
Copy link
Contributor

@stealthybox stealthybox left a comment

Choose a reason for hiding this comment

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

I'm concerned about the need to maintain this and distribute CNI in this manner.
User's machine may already have CNI installed which may cause some strange interactions.

I'm also willing to consider this as default behavior since the parent CNI project does not yet have mature packaging.

The k8s project has been distributing debs and rpm's themselves which they are planning to change.

More discussion in the recording from: https://docs.google.com/document/d/1fv8_WD6qXfvlIq7Bb5raCGyBvc42dNF-l8uaoZzoUYI/edit#heading=h.3x3r3cf1tpzj

@@ -265,6 +265,12 @@ serve-docs: build-docs
@echo Stating docs website on http://localhost:${DOCS_PORT}/_build/html/index.html
@$(DOCKER) run -i --rm -p ${DOCS_PORT}:8000 -e USER_ID=$$UID ignite-docs

build-ignitew: build-all
Copy link
Contributor

Choose a reason for hiding this comment

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

we can change this to ignite instead of build-all

checks = append(checks, ExistingFileChecker{filePath: dependency})
// In case of using ignitew, we put CNI plugin binaries relatively to the executable
exeDir := filepath.Dir(os.Args[0])
if _, err := os.Stat(exeDir); err == nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this may always be true -- it doesn't indicate that the binary is actually ignitew

Perhaps there's a warp native way to detect that the binaries have been unpacked for us

@stealthybox
Copy link
Contributor

The Makefile needs to be updated to output ignitew to the proper bin/arch directories with a symlink.

We should make note whether this also supports ARM64 builds.

@stealthybox
Copy link
Contributor

A build shows that the resulting binary size of ignitew:ignite is 51M vs. 35M.

This is likely just the size of the CNI binaries themselves. It's unfortunate because I believe every one of those is an independent Go binary 😅

@fire-ant
Copy link

This is a pretty cool all-in-one solution, has it just dropped to the bottom of the backlog?

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

Successfully merging this pull request may close these issues.

3 participants