Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Conversation

@avagin
Copy link
Contributor

@avagin avagin commented Dec 18, 2014

This series is the second step to support the new API. Now an init process is actually executed in a new container. This series doesn't change code about creating containers, it only reworks code according with new API.

We are not going to save backward compatibility with old API, aren't we?

@vmarmol
Copy link
Contributor

vmarmol commented Dec 18, 2014

Merged the other PR, feel free to rebase. I'll start the review in the meantime.

I think breaking backwards compat is probably fine. Clients (outside of Docker) don't really use the "API" in the same way. Docker has theirs versioned anyways. @crosbymichael can chime in if that is completely off-base :)

Makefile Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not a maintainer here, but I really don't like glog. In docker we're using logrus.

Copy link
Contributor

Choose a reason for hiding this comment

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

What don't you like about glog?

I'm biased :)

Copy link
Contributor

Choose a reason for hiding this comment

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

When I tried to use it - it made my binary not static :) Also configuration is much more opaque, then in logrus. This is just my opinion, but I know that @crosbymichael like logrus too.

Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting, we never had the static issue in cAdvisor. I think it was because we were already asking for cgo code to be statically linked. Maybe I'm just used to glog's configuration since it is identical to what we use in Google.

@vmarmol
Copy link
Contributor

vmarmol commented Dec 18, 2014

Some comments, but nothing major. Looks good overall. Thanks for all the changes @avagin!

@crosbymichael
Copy link
Contributor

@vmarmol yes, docker has libcontainer vendored so we can itterate and change things right now. After we get the api branch up and stable I can update docker so that we can test.

Feel free to break backards compat just as long as we do it right and won't have to make more breaking changes in the future ;)

@vmarmol
Copy link
Contributor

vmarmol commented Dec 18, 2014

@crosbymichael awesome! Full steam ahead then.

factory.go Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we just make this private?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We can't use fork() from go code. When we want to start a new container, we need to execute a program in a new set of namespaces. This program must execute namespace.Init() and then execute a specified program. So the answer on your question depends on who should create this program. I don't see any problem to provide this program together with libcontainer, but I'm afraid it isn't the golang way, is it? If we decide that a user should create this program, we need to provide StartInitialization() for him.

We are going to import the namespaces package into libcontainer,
so libcontainer should not be imported into namespaces.

Signed-off-by: Andrey Vagin <[email protected]>
We are going to import the namespaces package into libcontainer,
so libcontainer should not be imported into namespaces.

Signed-off-by: Andrey Vagin <[email protected]>
Signed-off-by: Andrey Vagin <[email protected]>
Use namespace.Exec() and namespace.Init() to execute processes in CT.

Now an init process is actually executed in a new container. This series
doesn't change code about creating containers, it only reworks code according
with new API.

Signed-off-by: Andrey Vagin <[email protected]>
Could someone explain why we should close this fds? Usually users
cares about closing them or not.
For example exec.Cmd declares them as io.Reader.

Signed-off-by: Andrey Vagin <[email protected]>
@vmarmol
Copy link
Contributor

vmarmol commented Dec 19, 2014

LGTM, merging.

vmarmol added a commit that referenced this pull request Dec 19, 2014
Use namespace.Exec() and namespace.Init() to execute processes in CT
@vmarmol vmarmol merged commit e1b4ec3 into docker-archive:api Dec 19, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants