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

Expand platform to be more sophisticated #830

Closed
wants to merge 1 commit into from

Conversation

hqhq
Copy link
Contributor

@hqhq hqhq commented May 16, 2017

Currently support is not sufficient for many platforms,
such as ARM, we need more information to identify a
specific platform.

Image-spec already had these entries, so I just picked
them up and applied to runtime-spec.

Signed-off-by: Qiang Huang h.huangqiang@huawei.com

config.md Outdated
* **`os.version`** (string, OPTIONAL) specifies the operating system version, for example `10.0.10586`.
* **`os.features`** (array of strings, OPTIONAL) specifies an array of strings, each specifying a mandatory OS feature, for example `win32k`.
* **`variant`** (string, OPTIONAL) specifies the variant of the CPU, for example `v8` to specify a perticular CPU variant of the ARM CPU.
* **`features`** (array of strings, OPTIONAL) specifies an array of strings, each specifying a mandatory CPU feature, for example `sse4` or `aes`.
Copy link
Member

Choose a reason for hiding this comment

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

This is being removed opencontainers/image-spec#672

Choose a reason for hiding this comment

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

Yes, please remove this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see why you remove this field, it's a fair point to me, I'll update. Thanks.

@wking
Copy link
Contributor

wking commented May 16, 2017 via email

Currently support is not sufficient for many platforms,
such as ARM, we need more information to identify a
specific platform.

Image-spec already had these entries, so I just picked
them up and applied to runtime-spec.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
@hqhq hqhq force-pushed the expand_platform branch 2 times, most recently from f6c7508 to 68c84e7 Compare May 17, 2017 06:58
@stevvooe
Copy link

Should runtime-spec adopt the platform specification from the image-spec? Are these even used in the runtime spec? What would be the impact of making that change? I think the only addition is to have architecture instead of arch.

@crosbymichael
Copy link
Member

Maybe we remove this from runtime spec as we do not consume it anywhere nor intended to when we initially added the fields? We could leave this as an image-spec concern.

@wking
Copy link
Contributor

wking commented May 22, 2017

Maybe we remove this from runtime spec as we do not consume it anywhere…

We currently consume it for validation, which is one instance of “the config you're looking at may target a different platform than your current host”. Without platform.os, you don't know if platform.apparmorProfile is legal or not. But as long as there is some way to select your compliance track, I'm fine dropping the rest of platform.

@tianon
Copy link
Member

tianon commented May 22, 2017

I'd definitely be +1 to punting the platform object to the image-spec -- maintaining that list in one place makes a lot of sense (and it's definitely more relevant to the image-spec).

@hqhq
Copy link
Contributor Author

hqhq commented May 23, 2017

Are we talking about keep Platform as is or remove it from runtime-spec?

@crosbymichael
Copy link
Member

Ya, talking about removing it. I remember when we added it we were never going to use it in the runtime, it was an informational field. But this was before the image spec. If we don't have any real usecases for a runtime to consume it, its worth considering removing it.

@cyphar
Copy link
Member

cyphar commented May 23, 2017

At the very least we should make it an annotation.

@mattspencer-arm
Copy link

I agree with the sentiment of having this defined in one place. Currently the image-spec references the runtime spec for the definition of platform.architecture and platform.os. I would suggest as above removing platform from the runtime-spec and having the image spec being the canonical definition.

@dqminh
Copy link
Contributor

dqminh commented May 23, 2017

Ya, talking about removing it. I remember when we added it we were never going to use it in the runtime, it was an informational field. But this was before the image spec. If we don't have any real usecases for a runtime to consume it, its worth considering removing it.

platform.os should at least be useful in config validation though ? Like the current way we are using / wording it

[**`platform.os`**](#platform) is used to lookup further platform-specific configuration.

@wking
Copy link
Contributor

wking commented May 23, 2017 via email

@crosbymichael
Copy link
Member

@dqminh either that or on validation you just pass in the platform you want to validate for.

runtime-tools validate --platform linux <config.json>

It would actually be more robust for validation that you validate what you expect, not what the spec says it is.

@cyphar they are annotations, you can put whatever you want there, that's way its a map[string]string

@wking
Copy link
Contributor

wking commented May 23, 2017

… on validation you just pass in the platform you want to validate for.

I don't see a robustness difference, but I'm fine with this approach (and completely dropping platform from the config) too.

@@ -108,6 +108,14 @@ type Platform struct {
OS string `json:"os"`
// Arch is the architecture
Arch string `json:"arch"`
// OSVersion specifies the operating system version, for example `10.0.10586`.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd pick a more up to date build. And it's actually a quad-tuple these days (it was a triplet). eg 10.0.14393.1198 is the current fully-patched Windows Server 2016 RS1 build number.

Copy link
Contributor

Choose a reason for hiding this comment

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

(Historical - 10586 was a pre-release, IIRC Technical Preview 4 of Windows Server 2016)

Copy link
Contributor

@wking wking May 23, 2017

Choose a reason for hiding this comment

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

I'd pick a more up to date build.

My take on the discussion is that runtime-spec will likely drop platform or keep only platform.os. Either way, this line is unlikely to land in runtime-spec, so we probably don't need to worry about it.

And the image-spec analog got a quad-tuple in the recently-landed opencontainers/image-spec#651.

hqhq added a commit to hqhq/runtime-spec that referenced this pull request May 24, 2017
Close: opencontainers#725

See discussion in opencontainers#830 , the full platform can be maintained
in image-spec, but since we have platform-specific configurations
in runtime-spec, I think it makes sence we keep a general simple
definition for platform.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
@hqhq hqhq mentioned this pull request May 24, 2017
@hqhq
Copy link
Contributor Author

hqhq commented May 24, 2017

Thanks for all your comments, I think we have conclusion not to expand platform and sync with image-spec, I opened a new PR to simply it in #850 , I'll close this PR.

@hqhq hqhq closed this May 24, 2017
@hqhq hqhq deleted the expand_platform branch May 24, 2017 02:12
hqhq added a commit to hqhq/runtime-spec that referenced this pull request May 24, 2017
Close: opencontainers#725

See discussion in opencontainers#830 , the full platform can be maintained
in image-spec, but since we have platform-specific configurations
in runtime-spec, I think it makes sence we keep a general simple
definition for platform.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
hqhq added a commit to hqhq/runtime-spec that referenced this pull request May 24, 2017
Close: opencontainers#725

See discussion in opencontainers#830 , the full platform can be maintained
in image-spec, but since we have platform-specific configurations
in runtime-spec, I think it makes sence we keep a general simple
definition for platform.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
@stevvooe
Copy link

I think we have conclusion not to expand platform and sync with image-spec,

How did we arrive at this conclusion? #850 is pretty insufficient.

I would favor just removing this altogether rather than make this just a string.

@tianon
Copy link
Member

tianon commented May 24, 2017

@stevvooe and then use the per-platform objects to differentiate for validation? (and update them to all be mutually-exclusive directly, rather than mutually-exclusive based on the value of platform.os)

ie, if the windows property is set, the linux and solaris properties MUST NOT be, etc (rather than the current language which hinges around platform.os)

@wking
Copy link
Contributor

wking commented May 24, 2017 via email

@tianon
Copy link
Member

tianon commented May 24, 2017

If I don't need any of the platform-specific properties for a given bundle, isn't that like saying that the bundle doesn't care which platform it runs on? It seems safe enough to me, especially since we already don't make any guarantees about the "runnability" of the binaries in the rootfs (since that's really more of an image-spec / distribution concern). I don't see any reason to need to require one of them, but making them mutually exclusive is probably a good idea.

@wking
Copy link
Contributor

wking commented May 24, 2017 via email

@wking
Copy link
Contributor

wking commented May 24, 2017 via email

hqhq added a commit to hqhq/runtime-spec that referenced this pull request Jun 15, 2017
Close: opencontainers#725

See discussion in opencontainers#830 and dev-weekly-meeting discussion
in http://ircbot.wl.linuxfoundation.org/meetings/opencontainers/2017/opencontainers.2017-06-14-21.03.log.txt

We don't use this field in runc, and mostly only
image-spec cares about this, we can assume tools know
what specific platform this spec is built for.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
hqhq added a commit to hqhq/runtime-spec that referenced this pull request Jun 16, 2017
Close: opencontainers#725

See discussion in opencontainers#830 and dev-weekly-meeting discussion
in http://ircbot.wl.linuxfoundation.org/meetings/opencontainers/2017/opencontainers.2017-06-14-21.03.log.txt

We don't use this field in runc, and mostly only
image-spec cares about this, we can assume tools know
what specific platform this spec is built for.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
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.

10 participants