Skip to content

Add osversion and osvariant to platform specification#1534

Merged
aaronlehmann merged 1 commit intodistribution:masterfrom
jstarks:windows_platform
Mar 21, 2016
Merged

Add osversion and osvariant to platform specification#1534
aaronlehmann merged 1 commit intodistribution:masterfrom
jstarks:windows_platform

Conversation

@jstarks
Copy link
Copy Markdown
Contributor

@jstarks jstarks commented Mar 16, 2016

These are needed to differentiate incompatible Windows versions. In the short run, Windows will need os, osvariant, and osversion matching. Eventually we should be able to avoid matching on osvariant.

cc/@aaronlehmann

@friism
Copy link
Copy Markdown

friism commented Mar 16, 2016

cc @dmp42

@dmp42
Copy link
Copy Markdown
Contributor

dmp42 commented Mar 16, 2016

@docker/core-distribution-maintainers please take a look at this

@dmp42
Copy link
Copy Markdown
Contributor

dmp42 commented Mar 16, 2016

@jstarks be sure to validate the design of this with @aaronlehmann @dmcgowan and @RichardScothern

@jstarks
Copy link
Copy Markdown
Contributor Author

jstarks commented Mar 16, 2016

Since last night I thought about this some more, and I think osvariant is a mistake -- it's too coarse. What would be best would be either:

  • osfeatures: An array of OS features that the image requires to run. For Windows, the first feature we would need would be the presence or absence of the graphics stack, which is what keeps Server Core images from working on Nano Server.
  • features: Use the existing features, but namespace it, e.g. we could have a feature "windows:graphics" or "os:graphics" or something like that.

Thoughts?

Comment thread manifest/manifestlist/manifestlist.go Outdated

// OSVersion is an optional field specifying the operating system
// version, for example `10.0.10586`.
OSVersion string `json:"osversion"`
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Let's mark this one omitempty too. There will be a lot of cases where OS version requirements are unspecified, such as most Linux images.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oops, yes that was my intention.

@aaronlehmann
Copy link
Copy Markdown

I agree that having a set of OS features is better than having a single string. I don't have much of a preference either way between using the existing features array or adding a new one for OS-specific feature requirements. Does anyone else have thoughts on this?

@jstarks
Copy link
Copy Markdown
Contributor Author

jstarks commented Mar 16, 2016

I've updated the PR with a proposal that expands the meaning of features (and fixed the missing omitempty, which also fixes CI).

@codecov-io
Copy link
Copy Markdown

Current coverage is 51.22%

Merging #1534 into master will decrease coverage by -6.71% as of 5b0a484

@@            master   #1534   diff @@
======================================
  Files          122     122       
  Stmts        10612   10605     -7
  Branches       838     744    -94
  Methods          0       0       
======================================
- Hit           6148    5432   -716
+ Partial        838     744    -94
- Missed        3626    4429   +803

Review entire Coverage Diff as of 5b0a484


Uncovered Suggestions

  1. +0.30% via .../driver/s3-aws/s3.go#730...761
  2. +0.28% via .../driver/s3-aws/s3.go#266...295
  3. +0.21% via .../driver/s3-aws/s3.go#882...904
  4. See 7 more...

Powered by Codecov. Updated on successful CI builds.

Comment thread docs/spec/manifest-v2-2.md Outdated
The os field specifies the operating system, for example
`linux` or `windows`.

- **`osversion`** *string*
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

"os.version" 🏠 🚲

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm open to that, but it's a little strange since . is the field separator in most languages. This means that if you were manipulating this in JavaScript, for example, you couldn't write p.os.version, you'd have to write p["os.version"]. But AFAIK, if it's osversion, you can just write p.osversion.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Agreed.

If we can come up with a way to namespace the properties as under "os", that would be sufficient. I don't have a suggestion off the top of my head.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Does os_version fit the bill?

Ultimately this is up to you all. I'm happy to choose os.version if that's what you'd like.

@jstarks
Copy link
Copy Markdown
Contributor Author

jstarks commented Mar 17, 2016

I've updated the branch with os.version and os.features. I'm not sure if the bikeshedding is complete or not ;)

@stevvooe
Copy link
Copy Markdown
Collaborator

@jstarks I didn't see your comment earlier. I found you point about p.osversion value, although, I prefer this.

Comment thread docs/spec/manifest-v2-2.md Outdated
- **`os.features`** *array*

The optional os.features field specifies an array of strings,
each listing a required CPU feature (for example on Windows
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm a little confused here. Are these CPU features or features provided by the os? Maybe some documentation on this would help to clarify.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oops, sorry, that should say OS feature.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Whew! Thought I had misunderstood and had you going around making new fields.

Awesome. LGTM after correction!

@stevvooe
Copy link
Copy Markdown
Collaborator

LGTM

There are some clarifications of the role of "os.features" but the naming looks fine.

These changes are needed to differentiate Windows images.

Signed-off-by: John Starks <[email protected]>
@aaronlehmann
Copy link
Copy Markdown

LGTM

aaronlehmann pushed a commit that referenced this pull request Mar 21, 2016
Add osversion and osvariant to platform specification
@aaronlehmann aaronlehmann merged commit c8d8e7e into distribution:master Mar 21, 2016
@aslanpour
Copy link
Copy Markdown

Hi All,

I am still not sure where the values for os.features come from in a Linux OS. Is that equivalent to the values for CPU features in "cat /proc/cpuinfo"?

@milosgajdos
Copy link
Copy Markdown
Member

Hi All,

I am still not sure where the values for os.features come from in a Linux OS. Is that equivalent to the values for CPU features in "cat /proc/cpuinfo"?

You might wanna ask in https://github.com/moby/moby/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants