Skip to content

Conversation

@hqhq
Copy link
Contributor

@hqhq hqhq commented Dec 6, 2014

No description provided.

@crosbymichael
Copy link
Contributor

Thanks, i'll update docker with the libcontainer change soon.

Copy link
Contributor

Choose a reason for hiding this comment

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

We cannot remove this as it will break existing people using this but we can add more values.
flCpusetCpus = cmd.String([]string{"#-cpuset", "-cpuset-cpus"}, "", "CPUs in which to allow execution (0-3, 0,1)")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, I'll change it soon.

@hqhq hqhq force-pushed the hq_add_cpuset_mems branch from af842a5 to eb752a8 Compare December 8, 2014 19:48
@hqhq
Copy link
Contributor Author

hqhq commented Dec 8, 2014

@crosbymichael please review again, I also fixed the tarsum test problem caused by this commit.

@crosbymichael crosbymichael added this to the 1.5.0 milestone Dec 17, 2014
@hqhq
Copy link
Contributor Author

hqhq commented Dec 25, 2014

ping.

@LK4D4
Copy link
Contributor

LK4D4 commented Dec 25, 2014

Isn't this breaking change for API?

@hqhq
Copy link
Contributor Author

hqhq commented Dec 25, 2014

@LK4D4 which API do you mean?

@LK4D4
Copy link
Contributor

LK4D4 commented Dec 25, 2014

@hqhq Docker http API, for which in docs you changed Cpusets for CpusetCpus and CpusetMems

@hqhq
Copy link
Contributor Author

hqhq commented Dec 25, 2014

Yes, but that's internal date, right? the only point that will affect user is the
command option, which is pointed out by crosbymichael, I have updated
to code to leave the option --cpuset as is was, only marked as deprecated.

@SvenDowideit
Copy link
Contributor

The new flags need to be documented in the run and create sections of both cli.md and the man pages, and some further details are needed in run.md

@hqhq hqhq force-pushed the hq_add_cpuset_mems branch from eb752a8 to 9e27075 Compare December 31, 2014 07:56
@hqhq
Copy link
Contributor Author

hqhq commented Dec 31, 2014

@SvenDowideit Thanks for your review, I did miss that, I have updated patches as you said,
but for run.md, I think cpuset.mems can be as simple as cpuset,cpus, what further details
did you mean to be added?

@hqhq
Copy link
Contributor Author

hqhq commented Dec 31, 2014

update: add a patch for test case.

Copy link
Contributor

Choose a reason for hiding this comment

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

mmm, i think you will need to tell the reader what an MEMs is - CPU possibly not - @fredlf ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, I'll add that, thanks.

Copy link
Contributor

Choose a reason for hiding this comment

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

Nah, I don't think we need to define CPU. But yes, we need to define MEMs.

@SvenDowideit
Copy link
Contributor

@hqhq in run.md, we should also give the user an example, and explain what it does.

@LK4D4
Copy link
Contributor

LK4D4 commented Jan 2, 2015

@hqhq Docker API still used by users.

@hqhq
Copy link
Contributor Author

hqhq commented Jan 3, 2015

@LK4D4 Hmmm.... what's your suggestion then? Should we keep using Cpuset
and just add CpusetMems?
Or do we have some deprecated tags for API?

@LK4D4
Copy link
Contributor

LK4D4 commented Jan 3, 2015

@hqhq I don't know actually :) There is way to check API version, but I'm not sure how this can help. Only way I see - deprecation in docs :) Maybe @crosbymichael knows better way

@hqhq
Copy link
Contributor Author

hqhq commented Jan 5, 2015

@crosbymichael @LK4D4 what do you think if we go this way:

  1. add CpusetCpus which has the same function as Cpuset, and keep using Cpuset;
  2. add deprecated notify mechanism for docker http APIs, and mark Cpuset as deprecated;
  3. remove Cpuset after a period of time;

@LK4D4
Copy link
Contributor

LK4D4 commented Jan 5, 2015

@hqhq I am okay with this. But we're not very good with removing things :) Maybe in 2.0.

@fredlf
Copy link
Contributor

fredlf commented Jan 9, 2015

Agree with @SvenDowideit that we need an example in run.md and should define MEMs.

@hqhq hqhq force-pushed the hq_add_cpuset_mems branch from 09efe67 to 368f585 Compare January 12, 2015 01:49
@hqhq
Copy link
Contributor Author

hqhq commented Jan 12, 2015

@SvenDowideit @fredlf @LK4D4 @crosbymichael
Sorry for the delay, rebased and updated, please review again, thanks.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure that it is good idea to change docs for previous versions. ping @SvenDowideit

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, I think we should not change docs for previous version.
For now, change v1.16 and v1.17 is good enought.

@hqhq hqhq force-pushed the hq_add_cpuset_mems branch from 368f585 to 441e945 Compare January 12, 2015 10:37
@hqhq
Copy link
Contributor Author

hqhq commented Jan 12, 2015

updated, remove the change of previous version of docs.

@LK4D4
Copy link
Contributor

LK4D4 commented Jan 12, 2015

@hqhq I'm not sure about 1.16 too, seems like this version was already released.

@hqhq
Copy link
Contributor Author

hqhq commented Jan 20, 2015

No it won't break that, config.Cpuset is still used, you can see the changelog
in my first patch, that's how compatibility works for now.

@LK4D4
Copy link
Contributor

LK4D4 commented Jan 20, 2015

@hqhq sorry if I doesn't get, but here:
hqhq@bfea793#diff-6ce9e79ddb91a3f06352abe1f2c72ecbR280
I see that now config.Cpuset is not passed to execdriver. So, if I understand right then Cpuset is still present in config but not used for container setup. Maybe I just don't understand what's going on :) ping @crosbymichael

@hqhq
Copy link
Contributor Author

hqhq commented Jan 20, 2015

Yes, it is not passed to execdriver, config.Cpuset is only set for showing
users the config info, because the value is the same as hostconfig.CpusetCpus,
so in other parts of docker code, we use hostconfig.CpusetCpus instead.

One exception is that when users use CpusetCpus in jaon for their http APIs,
we won't setup config.Cpuset because the user won't expect that.

@LK4D4
Copy link
Contributor

LK4D4 commented Jan 20, 2015

@hqhq I'm talking about case when use use Cpuset in json. There is no code which setups CpusetCpus from this, it was before in merge, but now I don't see it :/

hqhq added 3 commits January 20, 2015 15:10
As we will add CpusetMems, CpusetCpus is definitely a better name, but some
users are already using Cpuset in their http APIs, so we need time to change
it, right now we just make it compatible.

A significant change is that we add CpusetCpus in hostConfig, not Config,
because it's host dependent.

For compatibility, the main idea is keep using Cpuset in Config Struct, and
make it has the same value as CpusetCpus, but not always, some scenarios:
 - Users use --cpuset in docker command, it can setup cpuset.cpus and can
   get Cpuset field from docker inspect or other http API which will get
   config info.
 - Users use --cpuset-cpus in docker command, ditto.
 - Users use Cpuset field in their http APIs, ditto.
 - Users use CpusetCpus field in their http APIs, they won't get Cpuset field
   in Config info, because by then, they should already know what happens
   to Cpuset.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
@hqhq hqhq force-pushed the hq_add_cpuset_mems branch from 19049b3 to 0319b1a Compare January 20, 2015 09:28
@hqhq
Copy link
Contributor Author

hqhq commented Jan 20, 2015

@LK4D4 Yep, that's the point I've missed in this version, sorry about that,
since we don't put CpusetCpus in config, so merge function is no longer
the right place, I put the sync in ContainerHostConfigFromJob, when
container start, CpusetCpus will get the right value if people still use Cpuset.

Update:

  • add sync for CpusetCpus and Cpuset, when people use Cpuset in json,
    it will still be workable.

@LK4D4
Copy link
Contributor

LK4D4 commented Jan 20, 2015

Now seems legit :)

@crosbymichael
Copy link
Contributor

@LK4D4 @unclejack shouldn't we wait until we can move all the resource config options to the hostconfig instead of having 6 on Config and 2 on hostconfig?

@unclejack
Copy link
Contributor

@crosbymichael Fair enough, I'll remove my approval.

@crosbymichael
Copy link
Contributor

This is something that we will have to do(carry the pr) because @hqhq has already helped alot and has been awesome on expanding cgroup support for docker.

@hqhq sorry for the confusion with this PR. Cgroup resource options have been on the Config since forever. They are host specific options so being on a config makes images not portable as this can be committed to an image. HostConfig is the correct place for this but I just want to make sure when we make the switch we don't have any regressions and we move everything so that it's not confusing to the user, as these structs are also used in the API.

Let us discuss a little more about a game plan for these resource settings and we can do the work if any more changes are required.

Thanks again!!

@hqhq
Copy link
Contributor Author

hqhq commented Jan 21, 2015

@crosbymichael agreed, we should stop all the confusion of cgroup resource options, but this might be done step by step, and I think this PR is a good place to start.

What we need to do now is to confirm a proper way to do the compatibility work, don't have any regressions and make sure people can know how to use it the right way. So we can copy it to all other options. And I'd like to do this work :)

What do you think? BTW, do you think the compatibility work in this PR is good enough for all other options?

@crosbymichael
Copy link
Contributor

@hqhq that would be awesome if you are interested in doing this work.

I think at the API request level we should do the copy from Config to HostConfig for compatibility then null out the fields on Config.

Then if you just move all the cgroup resource options to hostconfig and make sure it's copied at the API level it would be good to go.

Thanks for your help on this!

@crosbymichael crosbymichael modified the milestone: 1.5.0 Jan 21, 2015
@SvenDowideit
Copy link
Contributor

TBH, the text of the docs is now sufficiently detailed, that an example isn't going to be useful - great job! If we were to add an example, it would draw more attention to it from readers that do not have a NUMA system, and we should not make them (aka the majority) jealous :)

Docs LGTM - @fredlf @jamtur01

@jamtur01
Copy link
Contributor

Should there be something in the run.md docs? Otherwise LGTM.

@hqhq
Copy link
Contributor Author

hqhq commented Jan 27, 2015

Thanks for all your reviews, let's wait for PR #10298 right now.

Copy link
Contributor

Choose a reason for hiding this comment

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

four, processes, Docker

@fredlf
Copy link
Contributor

fredlf commented Jan 28, 2015

Copy edits, otherwise LGTM. Agree with Sven, example no longer really needed.

@crosbymichael
Copy link
Contributor

We will close this one for now in favor of the work being done in #10298 to allow this change to be merged.

@unclejack
Copy link
Contributor

@crosbymichael Can we reopen this PR now? #10298 has been merged.

@hqhq
Copy link
Contributor Author

hqhq commented Apr 7, 2015

@unclejack codes are quite different, I just send a new PR to support cpuset.mems, #12139, please take a look.

@hqhq hqhq deleted the hq_add_cpuset_mems branch April 16, 2015 00:55
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.

9 participants