Skip to content

Add a --pid=host feature to expose the host PID space to the container - #1011

Merged
aanand merged 2 commits into
docker:masterfrom
sdake:master
Apr 7, 2015
Merged

aanand merged 2 commits into
docker:masterfrom
sdake:master

Conversation

@sdake

@sdake sdake commented Feb 24, 2015

Copy link
Copy Markdown

Docker 1.5.0 introduces a --pid=host feature which is fantastic for monitoring
containers from the baremetal system or atomically upgrading or rolling back
a deployed application.

For more details of a real-life use case, check out:
http://sdake.io/2015/01/28/an-atomic-upgrade-process-for-openstack-compute-nodes/

Docker-DCO-1.1-Signed-off-by: Steven Dake [email protected] sdake@github

@sdake

sdake commented Mar 12, 2015

Copy link
Copy Markdown
Author

Would a maintainer mind adding feedback on this pull request?

Thanks
-steve

Comment thread compose/container.py Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I believe this line is unnecessary

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Reading the docker-py client.py code, it may be appear your correct. I did actually test this in a real world environment, and I thought everything was necessary at the time, but I was doing the job at 3am, so its possible I made an error.

iI'll test without it next week and either submit results or submit a patch revision with this change reverted.

@sdake

sdake commented Mar 12, 2015

Copy link
Copy Markdown
Author

@dnephin Thanks a whole bunch for the review! I'll either fix the changes or provide a rationale why line

@dnephin

dnephin commented Mar 12, 2015

Copy link
Copy Markdown

Great, thanks for the contribution!

@aanand

aanand commented Mar 13, 2015

Copy link
Copy Markdown

Looks fine, but blocking on Jenkins :( soon, hopefully.

@aanand aanand changed the title A docs-first review for: Add a --pid=host feature to expose the host PID space to the container Add a --pid=host feature to expose the host PID space to the container Mar 19, 2015
@sdake

sdake commented Mar 19, 2015

Copy link
Copy Markdown
Author

@dnephin I addressed your comments and have tested the rebased master works properly for the pid:host use case.

Regards
-steve

Comment thread Dockerfile Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We still want to test against older versions, but I think we can disable the tests that we expect to fail when the version is older.

If we accept api version from the environment then we can set it based on the version we're testing against.

@sdake

sdake commented Mar 21, 2015

Copy link
Copy Markdown
Author

This patch has been rebased onto master which runs docker-dev downloaded from curl.

@sdake

sdake commented Mar 28, 2015

Copy link
Copy Markdown
Author

@dnephin Any chance you can take another look and merge this pull request? I think it is ready to go.

Regards
-steve

@dnephin

dnephin commented Mar 28, 2015

Copy link
Copy Markdown

LGTM

I'll wait for @aanand to have another look and merge

@aanand

aanand commented Mar 31, 2015

Copy link
Copy Markdown

I like it - just needs a rebase and an integration test.

Docker 1.5.0+ introduces a --pid=host feature which allows sharing of PID
namespaces between baremetal and containers.  This is useful for atomic
upgrades, atomic rollbacks, and monitoring.

For more details of a real-life use case, check out:
http://sdake.io/2015/01/28/an-atomic-upgrade-process-for-openstack-compute-nodes/

Signed-off-by: Steven Dake <[email protected]>
@sdake

sdake commented Apr 6, 2015

Copy link
Copy Markdown
Author

@aanand rebased and passing master test cases - will add functional test today/tomorrow.

Allow docker-compsoe to use the docker --pid=host API available in 1.17

Signed-off-by: Steven Dake <[email protected]>
@sdake

sdake commented Apr 6, 2015

Copy link
Copy Markdown
Author

@aanand Added two integration tests. One tests that the docker daemon returns a pidmode=net when passed the pid=host operation via service creation, and one tests that docker daemon returns '' for pidmode when passed None (which is the other condition the service creates. Testing that pidMode actually works correctly is a job for the docker test cases - I think we are covered there.

Please advise if you would like additional work.

Thanks!
-steve

@aanand

aanand commented Apr 7, 2015

Copy link
Copy Markdown

Yes, absolutely - if the container has the right configuration set, Compose has done its job as far as testing goes. Thanks.

LGTM

aanand added a commit that referenced this pull request Apr 7, 2015
Add a --pid=host feature to expose the host PID space to the container
@aanand
aanand merged commit 619e783 into docker:master Apr 7, 2015
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
Add a --pid=host feature to expose the host PID space to the container
Signed-off-by: Yuval Kohavi <[email protected]>
yuval-k pushed a commit to yuval-k/compose that referenced this pull request Apr 10, 2015
Add a --pid=host feature to expose the host PID space to the container
Signed-off-by: Yuval Kohavi <[email protected]>
@aanand aanand added this to the 1.3.0 milestone Apr 27, 2015
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