Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After a lot of fumbling around with my weird local distro I finally was able to get cgroups v2 working properly to test this. I tested this by creating the container with youki directly(following the youki tutorial in the README) where I set the memory limits in the config.json directly. I was able to observe the values being set appropriately in the cgroup files.
Notice 1: I do not have systemd installed locally and I cannot get the systemd crate to build properly as I cannot get libsystemd installed locally without a lot of hassle. What I did was I made the systemd create an optional dependency and included it as a default feature, so for default builds things should work exactly the same for everyone else but this gives me the option of building and testing with the
--no-default-options
cargo flag. I implement thebooted
function from the crate inline with the only place it is used, which is the only use we have for this dependecy currently. The function will simply return an error indicating you are using a build that does not have this dependency. I think this will also be useful for cases where we want to create builds for platforms which are NOT using systemd, this would include Alpine Linux which is a very popular distro for small embedded devices and I think it's useful for youki to support these distros as systemd does not currently compile against alternative C libraries(eg musl) which are commonly used for these smaller embedded distros.Notice 2: I had been away for a while and the history of my branch had lagged far behind that of the main branch. With that I decided to just reapply my changes over to a new branch which is directly branched off the main branch as of making this PR. I will therefore close PR #95 in favor of this PR.