-
Notifications
You must be signed in to change notification settings - Fork 1
Implement containerization from scratch #11
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
base: main
Are you sure you want to change the base?
Conversation
Of course hitting an issue reproducible only on Github Actions 😭
Rootless podman works fine, so either:
|
OK, it's AppArmor.
is a sufficient workaround. Will think of something better, but I might stick to it if I'm out of options. |
83c7c83
to
e6b848e
Compare
e6b848e
to
d4ff284
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
d4ff284
to
fb41d71
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r2.
Reviewable status: 1 of 4 files reviewed, 2 unresolved discussions (waiting on @copilot-pull-request-reviewer[bot])
Cargo.toml
line 33 at r2 (raw file):
oci-client = { version = "0.14", default-features = false, features = ["rustls-tls"] } # libcontainer fails to build with newer versions. Not a direct dependency of # icedragon.
link to a bug?
Cargo.toml
line 56 at r2 (raw file):
# https://github.com/youki-dev/youki/issues/3144 # https://github.com/youki-dev/youki/pull/3146 libcontainer = { git = "https://github.com/vadorovsky/youki", branch = "cgroupfs-rootless-warning" }
this should probably wait until these are resolved in some way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 of 4 files reviewed, 2 unresolved discussions (waiting on @copilot-pull-request-reviewer[bot] and @tamird)
Cargo.toml
line 33 at r2 (raw file):
Previously, tamird (Tamir Duberstein) wrote…
link to a bug?
Good call, I didn't make one before:
checkpoint-restore/rust-criu#25
Cargo.toml
line 56 at r2 (raw file):
Previously, tamird (Tamir Duberstein) wrote…
this should probably wait until these are resolved in some way?
Might take very long, given no response.
Actually, given that working with youki crates turns out to be a bit annoying, I might try going even deeper and creating a "container" by issuing bunch of unshare
syscalls myself, avoiding to use these deps. I will give it a though today and if I get convinced that's not too crazy, I will do that.
To be precise, the annoying things are:
- Hard dependency on systemd.
- The protobuf issue.
- Lack of possibility to pass a
Spec
without saving it on disk.
Drop the dependency on container engines like Docker or Podman by using `unshare` syscall to implement rootless containers, `oci-spec` crate to read OCI image specifications, `reqwest` and `tar-rs` to download the images. This way, we can keep all the container logic in our binary. That solves the major problem we had with Docker - file ownership in bind mounted volumes - where new files created inside container in a volume with source code were owned by `root` and therefore inaccessible for a regular user calling `icedragon`. After this change, regular container engines are still used for building the images. Fixes #7
fb41d71
to
e9843a0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 1 of 4 files reviewed, 2 unresolved discussions (waiting on @copilot-pull-request-reviewer[bot] and @tamird)
Cargo.toml
line 56 at r2 (raw file):
Previously, vadorovsky (Michal Rostecki) wrote…
Might take very long, given no response.
Actually, given that working with youki crates turns out to be a bit annoying, I might try going even deeper and creating a "container" by issuing bunch of
unshare
syscalls myself, avoiding to use these deps. I will give it a though today and if I get convinced that's not too crazy, I will do that.To be precise, the annoying things are:
- Hard dependency on systemd.
- The protobuf issue.
- Lack of possibility to pass a
Spec
without saving it on disk.
I managed to get rid of youki/libcontainer and do everything with mount
and unshare
through nix! \o/
Going zzz now. My last push will be most likely red, I will polish it tomorrow.
libcontainer
for running containers
Drop the dependency on container engines like Docker or Podman by using
unshare
syscall to implement rootless containers,oci-spec
crate toread OCI image specifications,reqwest
andtar-rs
to download the images. This way, we can keep all the container logic in our binary.That solves the major problem we had with Docker - file ownership in bind mounted volumes - where new files created inside container in a volume with source code were owned by
root
and therefore inaccessible for a regular user callingicedragon
.After this change, regular container engines are still used for building the images.
Fixes #7
This change is