runtime-tools icon indicating copy to clipboard operation
runtime-tools copied to clipboard

generate: output minimal template in default

Open Mashimiao opened this issue 8 years ago • 11 comments

The runtime-spec doesn't say process in container should have such default capabilities, so remove them.

Signed-off-by: Ma Shimiao [email protected]

Mashimiao avatar May 11 '17 02:05 Mashimiao

On Wed, May 10, 2017 at 07:36:08PM -0700, Ma Shimiao wrote:

The runtime-spec doesn't say process in container should have such default capabilities, so remove them.

‘generate’ is not about spec compliance (that's ‘validate’), it's about creating a useful starting point for users. So runtime-tools maintainers are free to do whatever they like in ‘New()’ if they think it makes life easier for folks who don't have existing opinions about what they want in the spec.

wking avatar May 11 '17 05:05 wking

On 05/11/2017 01:19 PM, W. Trevor King wrote:

‘generate’ is not about spec compliance (that's ‘validate’), it's about creating a useful starting point for users.

Agree. But I think we can't make sure which capability is necessary for user, just leave it alone without default value will be better.

Mashimiao avatar May 11 '17 05:05 Mashimiao

On Wed, May 10, 2017 at 10:53:14PM -0700, Ma Shimiao wrote:

But I think we can't make sure which capability is necessary for user, just leave it alone without default value will be better.

I agree, but with that approach the best default config is probably the minimal one for the platform (e.g. 1) with the additional recommended mounts 2. The current default is really somewhere between “useful for newcomers out of the box” and “demonstrates a bunch of things so you can trim it down”. The latter goal is also served by 3, so maybe this PR is the first stage of a pivot towards a more minimal default?

wking avatar May 11 '17 07:05 wking

In my own opinion, generate should output config info based on what runtime-spec minimally request in default. Any optional or additional fields in config should be specified by users which may be by options of command generate.

Mashimiao avatar May 11 '17 07:05 Mashimiao

On Thu, May 11, 2017 at 12:44:47AM -0700, Ma Shimiao wrote:

In my own opinion, generate should output config info based on what runtime-spec minimally request in default.

So why is this PR just trimming the capabilities? If the goal is minimal (including the SHOULD-level mounts 1?), you could work up a much bigger cut pretty quickly. Are there future plans for that and some reason that taking this one group of properties at a time?

wking avatar May 11 '17 07:05 wking

Before I sent this PR, I haven't think so much about minimal or not. I just found the default caps will cause runtimetest fails, so began to fix it.

Mashimiao avatar May 11 '17 09:05 Mashimiao

We can use templates for minimal.

mrunalp avatar May 12 '17 14:05 mrunalp

@wking @mrunalp PTAL

Mashimiao avatar May 15 '17 03:05 Mashimiao

@wking @mrunalp @hqhq @liangchenye PTAL

Mashimiao avatar Jun 07 '17 08:06 Mashimiao

With this title 'output minial tempalte in default', I prefer to provide template file for 'linux/windows/solaris' directly, just like: https://github.com/opencontainers/runtime-spec/tree/master/schema/test/config/good

Maybe we can add them to runtime-tools/contrib/templates?

liangchenye avatar Jul 06 '17 06:07 liangchenye

Agree, we can supply default good templates. But I think without users' spcified options, generate outputs minimal template is also right.

Mashimiao avatar Jul 06 '17 07:07 Mashimiao