-
Notifications
You must be signed in to change notification settings - Fork 571
zos updates #1273
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
Merged
Merged
zos updates #1273
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,56 @@ | ||
_This document is a work in progress._ | ||
|
||
# <a name="ZOSContainerConfiguration" />z/OS Container Configuration | ||
|
||
This document describes the schema for the [z/OS-specific section](config.md#platform-specific-configuration) of the [container configuration](config.md). | ||
The z/OS container specification uses z/OS UNIX kernel features like namespaces and filesystem jails to fulfill the spec. | ||
|
||
Applications expecting a z/OS environment will very likely expect these file paths to be set up correctly. | ||
|
||
The following filesystems SHOULD be made available in each container's filesystem: | ||
|
||
| Path | Type | | ||
| -------- | ------ | | ||
| /proc | [proc][] | | ||
|
||
## <a name="configZOSNamespaces" />Namespaces | ||
|
||
A namespace wraps a global system resource in an abstraction that makes it appear to the processes within the namespace that they have their own isolated instance of the global resource. | ||
Changes to the global resource are visible to other processes that are members of the namespace, but are invisible to other processes. | ||
For more information, see https://www.ibm.com/docs/zos/latest?topic=planning-namespaces-zos-unix. | ||
|
||
Namespaces are specified as an array of entries inside the `namespaces` root field. | ||
The following parameters can be specified to set up namespaces: | ||
|
||
## <a name="configZOSDevices" />Devices | ||
* **`type`** *(string, REQUIRED)* - namespace type. The following namespace types SHOULD be supported: | ||
* **`pid`** processes inside the container will only be able to see other processes inside the same container or inside the same pid namespace. | ||
* **`mount`** the container will have an isolated mount table. | ||
* **`ipc`** processes inside the container will only be able to communicate to other processes inside the same container via system level IPC. | ||
* **`uts`** the container will be able to have its own hostname and domain name. | ||
* **`path`** *(string, OPTIONAL)* - namespace file. | ||
This value MUST be an absolute path in the [runtime mount namespace](glossary.md#runtime-namespace). | ||
The runtime MUST place the container process in the namespace associated with that `path`. | ||
The runtime MUST [generate an error](runtime.md#errors) if `path` is not associated with a namespace of type `type`. | ||
|
||
**`devices`** (array of objects, OPTIONAL) lists devices that MUST be available in the container. | ||
The runtime MAY supply them however it likes. | ||
If `path` is not specified, the runtime MUST create a new [container namespace](glossary.md#container-namespace) of type `type`. | ||
|
||
Each entry has the following structure: | ||
If a namespace type is not specified in the `namespaces` array, the container MUST inherit the [runtime namespace](glossary.md#runtime-namespace) of that type. | ||
If a `namespaces` field contains duplicated namespaces with same `type`, the runtime MUST [generate an error](runtime.md#errors). | ||
|
||
* **`type`** *(string, REQUIRED)* - type of device: `c`, `b`, `u` or `p`. | ||
* **`path`** *(string, REQUIRED)* - full path to device inside container. | ||
If a file already exists at `path` that does not match the requested device, the runtime MUST generate an error. | ||
* **`major, minor`** *(int64, REQUIRED unless `type` is `p`)* - major, minor numbers for the device. | ||
* **`fileMode`** *(uint32, OPTIONAL)* - file mode for the device. | ||
### Example | ||
|
||
The same `type`, `major` and `minor` SHOULD NOT be used for multiple devices. | ||
```json | ||
"namespaces": [ | ||
{ | ||
"type": "pid", | ||
"path": "/proc/1234/ns/pid" | ||
}, | ||
{ | ||
"type": "mount" | ||
}, | ||
{ | ||
"type": "ipc" | ||
}, | ||
{ | ||
"type": "uts" | ||
} | ||
] | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,27 @@ | ||
{ | ||
"definitions": { | ||
"Major": { | ||
"description": "major device number", | ||
"$ref": "defs.json#/definitions/int64" | ||
}, | ||
"Minor": { | ||
"description": "minor device number", | ||
"$ref": "defs.json#/definitions/int64" | ||
}, | ||
"FileMode": { | ||
"description": "File permissions mode (typically an octal value)", | ||
"type": "integer", | ||
"minimum": 0, | ||
"maximum": 512 | ||
}, | ||
"FileType": { | ||
"description": "Type of a block or special character device", | ||
"NamespaceType": { | ||
"type": "string", | ||
"pattern": "^[cbup]$" | ||
"enum": [ | ||
"mount", | ||
"pid", | ||
"uts", | ||
"ipc" | ||
] | ||
}, | ||
"Device": { | ||
"NamespaceReference": { | ||
"type": "object", | ||
"required": [ | ||
"type", | ||
"path", | ||
"major", | ||
"minor" | ||
], | ||
"properties": { | ||
"path": { | ||
"$ref": "defs.json#/definitions/FilePath" | ||
}, | ||
"type": { | ||
"$ref": "#/definitions/FileType" | ||
"$ref": "#/definitions/NamespaceType" | ||
}, | ||
"major": { | ||
"$ref": "#/definitions/Major" | ||
}, | ||
"minor": { | ||
"$ref": "#/definitions/Minor" | ||
}, | ||
"fileMode": { | ||
"$ref": "#/definitions/FileMode" | ||
}, | ||
"uid": { | ||
"$ref": "defs.json#/definitions/UID" | ||
}, | ||
"gid": { | ||
"$ref": "defs.json#/definitions/GID" | ||
"path": { | ||
"$ref": "defs.json#/definitions/FilePath" | ||
} | ||
} | ||
}, | ||
"required": [ | ||
"type" | ||
] | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
{ | ||
"ociVersion": "0.5.0-dev", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: invalid version There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The ociVersion is the same as used in |
||
"process": { | ||
"terminal": true, | ||
"user": { | ||
"uid": 1, | ||
"gid": 1, | ||
"additionalGids": [ | ||
5, | ||
6 | ||
] | ||
}, | ||
"args": [ | ||
"sh" | ||
], | ||
"env": [ | ||
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/bin", | ||
"TERM=xterm" | ||
], | ||
"cwd": "/", | ||
"rlimits": [ | ||
{ | ||
"type": "RLIMIT_NOFILE", | ||
"hard": 1024, | ||
"soft": 1024 | ||
} | ||
], | ||
"noNewPrivileges": true | ||
}, | ||
"root": { | ||
"path": "rootfs" | ||
}, | ||
"hostname": "slartibartfast", | ||
"mounts": [ | ||
{ | ||
"destination": "/proc", | ||
"type": "proc", | ||
"source": "proc" | ||
}, | ||
{ | ||
"destination": "/dev", | ||
"type": "tfs", | ||
"source": "tmpfs", | ||
"options": [ | ||
"nosuid", | ||
"-p 1755", | ||
"-s 64" | ||
] | ||
} | ||
], | ||
"hooks": { | ||
"prestart": [ | ||
{ | ||
"path": "/usr/bin/fix-mounts", | ||
"args": [ | ||
"fix-mounts", | ||
"arg1", | ||
"arg2" | ||
], | ||
"env": [ | ||
"key1=value1" | ||
] | ||
}, | ||
{ | ||
"path": "/usr/bin/setup-network" | ||
} | ||
], | ||
"createRuntime": [ | ||
{ | ||
"path": "/usr/bin/fix-mounts", | ||
"args": [ | ||
"fix-mounts", | ||
"arg1", | ||
"arg2" | ||
], | ||
"env": [ | ||
"key1=value1" | ||
] | ||
}, | ||
{ | ||
"path": "/usr/bin/setup-network" | ||
} | ||
], | ||
"createContainer": [ | ||
{ | ||
"path": "/usr/bin/mount-hook", | ||
"args": [ | ||
"-mount", | ||
"arg1", | ||
"arg2" | ||
], | ||
"env": [ | ||
"key1=value1" | ||
] | ||
} | ||
], | ||
"startContainer": [ | ||
{ | ||
"path": "/usr/bin/refresh-ldcache" | ||
} | ||
], | ||
"poststart": [ | ||
{ | ||
"path": "/usr/bin/notify-start", | ||
"timeout": 5 | ||
} | ||
], | ||
"poststop": [ | ||
{ | ||
"path": "/usr/sbin/cleanup.sh", | ||
"args": [ | ||
"cleanup.sh", | ||
"-f" | ||
] | ||
} | ||
] | ||
}, | ||
"zos": { | ||
"namespaces": [ | ||
{ | ||
"type": "pid" | ||
}, | ||
{ | ||
"type": "ipc" | ||
}, | ||
{ | ||
"type": "uts" | ||
}, | ||
{ | ||
"type": "mount" | ||
} | ||
] | ||
}, | ||
"annotations": { | ||
"com.example.key1": "value1", | ||
"com.example.key2": "value2" | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.