Skip to content

Commit

Permalink
Expand platform to be more sophisticated
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
hqhq committed May 17, 2017
1 parent 4aed614 commit f6c7508
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 2 deletions.
10 changes: 8 additions & 2 deletions config.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,13 +310,18 @@ For Windows based systems the user structure has the following fields:
The runtime MUST generate an error if it does not support the specified **`arch`**.
Values for **`arch`** SHOULD use, and runtimes SHOULD understand, **`arch`** entries listed in the Go Language document for [`GOARCH`][go-environment].
If an architecture is not included in the `GOARCH` documentation, it SHOULD be submitted to this specification for standardization.
* **`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) this property is RESERVED for future versions of the specification.

### Example

```json
"platform": {
"os": "linux",
"arch": "amd64"
"arch": "amd64",
"variant": "v8"
}
```

Expand All @@ -338,7 +343,8 @@ Runtime implementations MAY support any valid values for platform-specific field
{
"platform": {
"os": "linux",
"arch": "amd64"
"arch": "amd64",
"variant": "v8"
},
"linux": {
"namespaces": [
Expand Down
22 changes: 22 additions & 0 deletions schema/config-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,28 @@
"os": {
"id": "https://opencontainers.org/schema/bundle/platform/os",
"type": "string"
},
"os.version": {
"id": "https://opencontainers.org/schema/bundle/platform/os.version",
"type": "string"
},
"os.features": {
"id": "https://opencontainers.org/schema/bundle/platform/os.features",
"type": "array",
"items": {
"type": "string"
}
},
"variant": {
"id": "https://opencontainers.org/schema/bundle/platform/variant",
"type": "string"
},
"features": {
"id": "https://opencontainers.org/schema/bundle/platform/features",
"type": "array",
"items": {
"type": "string"
}
}
}
},
Expand Down
11 changes: 11 additions & 0 deletions specs-go/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ 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`.
OSVersion string `json:"os.version,omitempry"`
// OSFeatures specifies an array of strings, each specifying a mandatory
// OS feature, for example `win32k`.
OSFeatures []string `json:"os.features,omitempry"`
// Variant specifies the variant of the CPU, for example `v8` to specify
// a perticular CPU variant of the ARM CPU.
Variant string `json:"variant,omitempry"`
// Features specifies an array of strings, each specifying a mandatory
// CPU feature, for example `sse4` or `aes`.
Features []string `json:"features,omitempry"`
}

// Mount specifies a mount for a container.
Expand Down

0 comments on commit f6c7508

Please sign in to comment.