You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The packaged agent must comply with the [OCI image spec](https://github.com/opencontainers/image-spec). The entrypoint can either
9
-
be a manifest JSON file or an index JSON file.
9
+
be a [manifest](https://github.com/opencontainers/image-spec/blob/main/manifest.md#oci-image-manifest-specification) JSON file or an [index](https://github.com/opencontainers/image-spec/blob/main/image-index.md#oci-image-index-specification) JSON file, but for AC we expect the entrypoint to be an `index`. That's the way OCI supports multi-arch.
10
10
11
-
The [index](https://github.com/opencontainers/image-spec/blob/main/image-index.md#oci-image-index-specification) file includes a list of manifest files, and it's handy to support multiple environments. Agents that want to integrate with AC should use this approach.
11
+
> [!NOTE]
12
+
> The OCI spec has some [rough edges, at least around the multi-arch topic](https://github.com/oras-project/oras/issues/1538).
13
+
14
+
The `index` file includes a list of manifest files. AC expects:
15
+
16
+
* each manifest entry in the array to have a `platform` section with the `architecture` and `os` fields
17
+
18
+
Check fields and possible values in the [Image Index Property Descriptions section of the spec](https://github.com/opencontainers/image-spec/blob/main/image-index.md#image-index-property-descriptions). However, to know if AC supports a specific architecture and os, we must look at the [oci_client crate support](https://docs.rs/oci-client/latest/oci_client/manifest/struct.Platform.html) and the [AC compatibility section](https://docs.newrelic.com/docs/new-relic-control/agent-control/overview/#requirements-and-compatibility). If it appears on both, then it's supported.
19
+
20
+
The section is automatically handled by the [oci_client](https://github.com/oras-project/rust-oci-client/blob/4541487ec759eef2a511e385d95e72e78aa37f69/src/client.rs#L974), which automatically detects the platform and retrieves the correct manifest from the index.
12
21
13
22
> [!NOTE]
14
-
> AC uses an [OCI client that supports every architecture and os in the spec](https://docs.rs/oci-client/latest/oci_client/manifest/struct.Platform.html).
15
-
> To make sure the platform is supported by AC and not only the OCI client, check out [AC compatibility section](https://docs.newrelic.com/docs/new-relic-control/agent-control/overview/#requirements-and-compatibility).
23
+
> The `artifactType` field in a given manifest entry of the `index` is not verified by AC, nor by the [client](https://docs.rs/oci-client/latest/oci_client/manifest/struct.ImageIndexEntry.html).
24
+
25
+
Other than that, it must follow the OCI spec.
16
26
17
27
Example:
18
28
@@ -55,21 +65,32 @@ Example:
55
65
}
56
66
```
57
67
58
-
Then we have the [manifest](https://github.com/opencontainers/image-spec/blob/main/manifest.md#oci-image-manifest-specification) file, which includes the package data and metadata.
68
+
Then we have the `manifest` file, which includes the package data and metadata.
59
69
60
70
> [!NOTE]
61
71
> AC can handle artifacts regardless of the entrypoint (manifest or index).
62
-
> However, AC suggests using the index approach. If the author of an agent decides to use a manifest, acknowledge that AC might behave in strange ways.
72
+
> However, AC suggests using the index approach. If the author of an agent decides to use a manifest as the entrypoint, they must understand that AC might behave in strange ways.
63
73
64
74
There, AC expects to find some specific keys and values.
65
75
76
+
*`config` must exist, have value `application/vnd.oci.image.config.v1+json` and contain the `architecture` and `os`[properties](https://github.com/opencontainers/image-spec/blob/main/config.md#properties)
77
+
78
+
```json
79
+
{
80
+
"architecture": "amd64",
81
+
"os": "linux"
82
+
}
83
+
```
84
+
85
+
This is not required by AC itself. However, it adds support for external tooling. For example, [oras](https://github.com/oras-project/oras).
86
+
66
87
*`artifactType` must exist and have value `application/vnd.newrelic.agent.v1`
67
88
68
89
*`layers/mediaType` must take one of the following values:
0 commit comments