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

docs: add more details on rich container #1440

Merged

Conversation

allencloud
Copy link
Collaborator

Signed-off-by: Allen Sun [email protected]

Ⅰ. Describe what this PR did

This pr tries to add a graph to explicitly show the architecture of rich container. And some illustration of rich container as well.

Ⅱ. Does this pull request fix one issue?

none

Ⅲ. Describe how you did it

none

Ⅳ. Describe how to verify it

none

Ⅴ. Special notes for reviews

none

@codecov-io
Copy link

codecov-io commented May 31, 2018

Codecov Report

Merging #1440 into master will increase coverage by 22.52%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #1440       +/-   ##
===========================================
+ Coverage   16.26%   38.79%   +22.52%     
===========================================
  Files         206      256       +50     
  Lines       13759    16808     +3049     
===========================================
+ Hits         2238     6520     +4282     
+ Misses      11365     9459     -1906     
- Partials      156      829      +673
Impacted Files Coverage Δ
daemon/logger/logmessage.go 100% <0%> (ø)
apis/metrics/metrics.go 100% <0%> (ø)
storage/volume/driver/remote.go 75.4% <0%> (ø)
storage/volume/core_util.go 19.73% <0%> (ø)
storage/volume/core.go 37.13% <0%> (ø)
cri/stream/remotecommand/errors.go 0% <0%> (ø)
storage/quota/grpquota.go 0% <0%> (ø)
storage/quota/prjquota.go 0% <0%> (ø)
pkg/serializer/serialize.go 9.52% <0%> (ø)
cri/stream/httpstream/spdy/upgrade.go 0% <0%> (ø)
... and 113 more

Copy link
Contributor

@houstar houstar left a comment

Choose a reason for hiding this comment

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

See the Section [Using systemd or sbin-init]

pouch run -d -v /tmp:/tmp --privileged --rich --rich-mode systemd --initscript /tmp/1.sh registry.hub.docker.com/library/centos:latest sleep 10000

  1. I don't know that why we need --initscript here ? I think systemd is the init application that integrated in the CentOS and is enough to startup the rich container.
    i.e. We only need to --rich systemd to start the rich container.

  2. From this User Case, you also specified -v /tmp:/tmp,
    I have question that If there're content in the container image's /tmp and /run , how did you handle this case ?

  3. If we're running Systemd inside pouch ( so-called rich container), did we support pouch stop [container_id] has the same process as 'systemctl stop' inside pouch?

Thanks for your reply since I'm going to launch rich container to support our traditional software that using systemd.

@allencloud
Copy link
Collaborator Author

Thanks a lot for your feedback. I will try to answer your question. While feel free to share more information if there is something missing in our docs. @houstar

I don't know that why we need --initscript here ? I think systemd is the init application that integrated in the CentOS and is enough to startup the rich container.
i.e. We only need to --rich systemd to start the rich container.

--initscript is used to add a prestart hook in the container which will be executed before the systemd starts. --rich is used to choose one type of the rich container mode from systemd, dumbint.

From this User Case, you also specified -v /tmp:/tmp,
I have question that If there're content in the container image's /tmp and /run , how did you handle this case ?

This will handle it like the docker way. In most cases, it will override the inner container path.

If we're running Systemd inside pouch ( so-called rich container), did we support pouch stop [container_id] has the same process as 'systemctl stop' inside pouch

I do not think rich container will do the systemctl stop, since in the original way, pouchd would send a terminal signal to the pid=1 process in the rich container which is systemd.

@houstar
Copy link
Contributor

houstar commented May 31, 2018

In reply to @allencloud ,

--initscript` is used to add a prestart hook in the container which will be executed before the systemd starts. --rich is used to choose one type of the rich container mode from systemd, dumbint.

I'd like to --initscript is invisible to user and pre-defined the hook within /usr/libexec/pouch/hook.d directory. This pre-defined hook will be executed if the CMD is either systemd/init or dumbinit

From this User Case, you also specified -v /tmp:/tmp,
I have question that If there're content in the container image's /tmp and /run , how did you handle this case ?

This will handle it like the docker way. In most cases, it will override the inner container path.

If there're contents in container images's /tmp and not specified -v /tmp:/tmp, did we'll move container images's /tmp content into temporary directory and then mount tmpfs in /tmp, lastly move back the content from temporary dirtectoy to /tmp ?

I do not think rich container will do the systemctl stop, since in the original way, pouchd would send a terminal signal to the pid=1 process in the rich container which is systemd.

There're some applications needs to be gracefully shutdown. e.g. The Storage App.
I mentioned this since there're argues between Systemd and Docker.
See Systemd vs. Docker

@allencloud
Copy link
Collaborator Author

There're some applications needs to be gracefully shutdown. e.g. The Storage App.
I mentioned this since there're argues between Systemd and Docker.

I have to say systemd has no this functionality to pass the SIGTERM to its sub processes. While what I wanna say is that dumb-init supports this. @houstar


Rich container mode is not the default mode Pouch provides. It is an additional mode pouch brings to extend users' container experience. Users can still manage ordinary containers by switching rich container flag off.

In a word, rich container can help enterprise to achieve the following two goals:

* be compatible with legacy operation system;
Copy link
Contributor

Choose a reason for hiding this comment

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

operation system -> operating system ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks. Updated. PTAL @Letty5411

@allencloud allencloud force-pushed the polish-rich-container-doc branch from 57545d1 to b0db23e Compare June 14, 2018 05:48
@Letty5411
Copy link
Contributor

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
areas/docs LGTM one maintainer or community participant agrees to merge the pull reuqest. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants