Skip to content

Commit 29fb17b

Browse files
author
Knox Lively
authored
Merge pull request #3 from project-ocre/updating_container_format
updated the ocre container format
2 parents 5750a8a + ad96b6d commit 29fb17b

13 files changed

Lines changed: 217 additions & 160 deletions

File tree

docs/architecture/containers/components/binary_objects/index.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

docs/architecture/containers/components/container_configuration/index.md

Lines changed: 0 additions & 47 deletions
This file was deleted.

docs/architecture/containers/components/index.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

docs/architecture/containers/components/webassembly_module/index.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

docs/architecture/containers/container_image_manifest/index.md

Lines changed: 0 additions & 61 deletions
This file was deleted.

docs/architecture/containers/components/Container_Applications_Container_Services.png renamed to docs/architecture/containers/image_components/Container_Applications_Container_Services.png

File renamed without changes.
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
layout: default
3+
title: Image Components
4+
parent: Ocre Containers
5+
nav_order: 1
6+
---
7+
8+
# Image Components
9+
10+
An Ocre container consists of the following **three** components:
11+
12+
| **Component** | **Description** |
13+
|-----------|-------------|
14+
| [`oci-layout`](#oci-layout) | OCI Layout file in JSON format. Specifies the version of the `imageLayoutVersion` in use. Ocre containers must set this value to `1.0.0` |
15+
| [`index.json`](#indexjson) | Image index file in JSON format. Serves as the entry point for the container image. Ocre containers will have one manifest entry with the mediaType of `application/vnd.oci.image.manifest.v1+json` which points to the Ocre artifact. |
16+
| [`blobs/`](#blobs) | Directory containing content-addressable blobs. Blobs are stored as files with the naming convention of `<alg>/<encoded>` which much match the digest format `<alg>:<encoded>`. Ocre containers support the SHA-256 algorithm *only*. |
17+
18+
### oci-layout
19+
20+
The `oci-layout` file identifies this as an Open Container Image Layout. Written in [UTF-8](https://www.w3schools.com/charsets/ref_html_utf8.asp) encoded JSON, it contains a single field `imageLayoutVersion` which must be set to `1.0.0` for Ocre containers. This file follows the `application/vnd.oci.layout.header.v1+json` media type specification as defined [here](https://github.com/opencontainers/image-spec/blob/v1.1.0-rc2/media-types.md).
21+
22+
An **example** of this file is as follows:
23+
```json
24+
{
25+
"imageLayoutVersion": "1.0.0"
26+
}
27+
```
28+
29+
### index.json
30+
31+
The `index.json` file serves as the entry point for the container image. Written in [UTF-8](https://www.w3schools.com/charsets/ref_html_utf8.asp) encoded JSON, it contains a single manifest entry pointing to the Ocre artifact, using the `mediaType` of `application/vnd.oci.image.manifest.v1+json`. This file follows the [OCI Image Index Specification](https://github.com/opencontainers/image-spec/blob/v1.1.0-rc2/image-layout.md#indexjson-file).
32+
33+
An **example** of this file is as follows:
34+
35+
```json
36+
{
37+
"schemaVersion": 2,
38+
"mediaType": "application/vnd.oci.image.index.v1+json",
39+
"manifests": [
40+
{
41+
"mediaType": "application/vnd.oci.image.manifest.v1+json",
42+
"digest": "sha256:b11ba766595f3bf6b1db36019cb09decc88aca35ff44dc5ae70bd88d4f188be4",
43+
"size": 445
44+
}
45+
]
46+
}
47+
```
48+
49+
This illustrates an index that provides a single reference the Ocre container image manifest.
50+
51+
### blobs/
52+
53+
The `blobs` directory contains all content-addressable components of the Ocre container. Files are stored using the format `<alg>/<encoded>`, matching their digest format `<alg>:<encoded>`. Currently, Ocre containers only support the SHA-256 algorithm for these digests.
54+
55+
---
56+
57+
## Learn More
58+
Learn how these components are organized by reading about the [Image Manifest](../image_manifest), which defines the complete structure of an Ocre container.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
layout: default
3+
title: Image Configuration
4+
parent: Ocre Containers
5+
nav_order: 3
6+
---
7+
8+
# Image Configuration
9+
10+
The container configuration (`application/vnd.wasm.config.v0+json`) defines how the container should be run. It is a collection of metadata that controls the container's runtime behavior, including environment variables, execution parameters, hardware permissions, and entry points.
11+
12+
For Ocre containers, this configuration is specifically tailored to WebAssembly modules running in embedded environments, ensuring proper initialization and execution within resource constraints.
13+
14+
---
15+
16+
## Configuration Structure
17+
18+
The configuration file follows the [OCI Image Manifest](https://github.com/opencontainers/image-spec/blob/main/manifest.md) specification with modifications for Wasm and embedded environments. See the example and a detailed description of its elements below.
19+
20+
### Example
21+
22+
```json
23+
{
24+
"architecture": "wasm",
25+
"os": "wasip1",
26+
"layerDigests": [
27+
"sha256:71cb138990af165c4baf0c43361e5c055ed60a5d2632ee547597be56dcfa07e2"
28+
],
29+
"module": {
30+
"entryPoint": "on_init"
31+
}
32+
}
33+
```
34+
35+
## Configuration Elements
36+
37+
Elements within the **configuration** are defined as follows:
38+
39+
| Element | Type | Required | Description |
40+
|---------|------|----------|-------------|
41+
| `architecture` | string | Yes | CPU architecture of the binaries in this image; this value MUST be set to `wasm` |
42+
| `os` | string | Yes | Operating system which this image is built to run on; this MUST be `wasip1` or `wasip2` according to the Wasm target type |
43+
| `layerDigests` | array | Yes | Digests of all of the layers this configuration targets; digests must be in the same order as in the image manifest file |
44+
| `module` | module object | Yes | Specifies the parameters used for execution; `entryPoint` defines the WASM function to call on container start |
45+
46+
---
47+
48+
## Future Enhancements
49+
50+
Ocre will extend its configuration format to better align with OCI standards and support critical runtime elements through the `config` entry. This enhancement will enable control over environment variables, permissions, and additional runtime parameters that are essential for container operation.
51+
52+
Here's an **example** of how these configurations will be structured:
53+
54+
```json
55+
{
56+
"config": {
57+
"Env": [
58+
"name1=val1",
59+
"name2=val2"
60+
],
61+
"Permissions": [
62+
"perm1",
63+
"perm2"
64+
]
65+
}
66+
}
67+
```
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
layout: default
3+
title: Image Format
4+
parent: Ocre Containers
5+
nav_order: 0
6+
---
7+
8+
# Image Format
9+
10+
Ocre container images follow the [Open Container Initiative (OCI)](https://opencontainers.org/) format where possible, with some modifications to support the needs of constrained, embedded devices. The manifest format is modeled after the [OCI Image Manifest](https://github.com/opencontainers/image-spec/blob/main/manifest.md) format and conforms to the [Wasm OCI Artifact](https://tag-runtime.cncf.io/wgs/wasm/deliverables/wasm-oci-artifact/) layout specifications.
11+
12+
Ocre containers can be stored either as a single zip file or as a set of files in a directory, providing flexibility in how they are distributed and managed. The container format uses the Wasm OCI Artifact layout as its `config.mediaType`, ensuring compatibility with standard OCI tooling while maintaining the specific requirements for WebAssembly modules in embedded environments.
13+
14+
15+
---
16+
17+
## Learn More
18+
19+
To fully understand the Ocre container format, explore these detailed specifications.
20+
21+
- [Image Components](../image_components): Learn about the core elements that make up an Ocre container.
22+
- [Image Manifest](../image_manifest): Understand how the manifest file organizes and references container components.
23+
- [Image Configuration](../image_configuration): Discover how to configure container execution, permissions, and runtime behavior.
109 KB
Loading

0 commit comments

Comments
 (0)