Skip to content
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

feat(run): enable running LLB images #750

Draft
wants to merge 2 commits into
base: staging
Choose a base branch
from

Conversation

jake-ciolek
Copy link
Contributor

Prerequisite checklist

  • Read the contribution guidelines regarding submitting new changes to the project;
  • Tested your changes against relevant architectures and platforms;
  • Ran make fmt on your commit series before opening this PR;
  • Updated relevant documentation.

Description of changes

WIP

We have to decide how to pass the arch/plat if we are to use docker. As brought up previously, it doesn't allow us to use qemu/fc for OS thus we can't source architecture from this field. Perhaps we could use labels instead.

To use, build the LLB plugin image, prepend a selector to kraft.yaml (tested with app-helloworld at 5845459d):

#syntax=kraftkit.sh/llb:latest

Build the image with:

docker build path/to/helloworld-root -f path/to/helloworld-root/kraft.yaml -t mydockerhelloworld:latest

Run with kraft:

kraft run mydockerhelloworld:latest

This will pull the image from docker image storage, unpack it somewhere in /tmp/ and then we do the usual kraft run stuff.

Waiting for @nderjung to have a look. We also need #727

Create a singleton for the umbrella package manager and use it instead
of global package-scoped maps. Use more dependency injection.

Move the scattered init() calls to RegisterPackageManager into one
place. Create a bootstrap package for handling flag/zip registration.

Use the bootstrapping package in main(). Propagate errors up and report
them if initialization fails.

This should make things a bit more testable in the future.

GitHub-Fixes: unikraft#425

Signed-off-by: Jakub Ciolek <jakub@ciolek.dev>
@jake-ciolek jake-ciolek force-pushed the llb-docker-run branch 2 times, most recently from 07e69e4 to d8820a5 Compare August 28, 2023 11:08
WIP

This introduces a `dockerImage` package to run docker images
containing a unikernel built with the LLB plugin.

The hello world target runs successfully.

A new package manager, "docker", has been added.
If the target OCI image is missing, this package manager
searches for it.

There's an ongoing discussion about how to handle image references,
especially when an image could be in both local/remote OCI storage
and local docker storage.

Currently, the process first checks the OCI storage and then Docker.

In case of conflicts, the user might need to choose.

To-Do:

- Fix targets that don't build due to missing dependencies or artifact
  naming issues.
- Provide architecture/platform info via image, as Docker doesn't
  support non-standard OS like qemu.
- Consider support for remote docker registries.
- Refactor some interfaces; we could make some of them smaller and avoid
  the "not implemented" errors.
- Explore testing approaches for this functionality.

Signed-off-by: Jakub Ciolek <jakub@ciolek.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🧊 Icebox
Development

Successfully merging this pull request may close these issues.

None yet

1 participant