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

Make container commands more suitable for use as a library #314

Merged
merged 10 commits into from
Sep 24, 2021

Conversation

Furisto
Copy link
Collaborator

@Furisto Furisto commented Sep 20, 2021

The idea behind this PR is to make it easier to use youki as library, so it can be reused in different contexts.

let mut container = ContainerBuilder::new(self.container_id.clone(), syscall.as_ref())
            .build()?;
container.start()?;
container.pause()?;
container.resume()?;
container.kill()?;
container.delete()?;

@Furisto Furisto changed the title Make container commands more suitable for use as a library [WIP] Make container commands more suitable for use as a library Sep 20, 2021
@utam0k
Copy link
Member

utam0k commented Sep 21, 2021

@alfonsoros88 Hi! Maybe you are interested in this PR. so I'll give you the mention.

@codecov-commenter
Copy link

codecov-commenter commented Sep 23, 2021

Codecov Report

Merging #314 (a4bac01) into main (2af5216) will decrease coverage by 2.14%.
The diff coverage is 14.75%.

@@            Coverage Diff             @@
##             main     #314      +/-   ##
==========================================
- Coverage   73.09%   70.94%   -2.15%     
==========================================
  Files          44       46       +2     
  Lines        6541     6811     +270     
==========================================
+ Hits         4781     4832      +51     
- Misses       1760     1979     +219     

@Furisto
Copy link
Collaborator Author

Furisto commented Sep 24, 2021

  • I also have found that some commands used the systemd global option to determine if systemd should be used. Instead the decision has to be made by examining the container state as once the container has been created we have to use the same cgroup manager throughout the lifecycle of the container.
  • Added context to many more results.

@Furisto Furisto changed the title [WIP] Make container commands more suitable for use as a library Make container commands more suitable for use as a library Sep 24, 2021
@Furisto Furisto marked this pull request as ready for review September 24, 2021 10:11
@Furisto Furisto requested a review from utam0k September 24, 2021 10:11
Copy link
Member

@utam0k utam0k left a comment

Choose a reason for hiding this comment

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

perfect!

@utam0k utam0k merged commit 3bb01d2 into youki-dev:main Sep 24, 2021
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.

3 participants