Skip to content

Consider using the org.opencontainers.image.title to define filename for binary layer files #58

@amisevsk

Description

@amisevsk

Description

The current spec uses model-spec-specific annotations to define file metadata such as file name and path.

Podman recently added support for mounting generic OCI artifacts as volumes, where the filename for the layer is defined via the org.opencontainers.image.title annotation on layer, e.g.

{
  "schemaVersion": 2,
  "mediaType": "application/vnd.oci.image.manifest.v1+json",
  "artifactType": "application/vnd.cnai.model.manifest.v1+json",
  "config": {
    "mediaType": "application/vnd.oci.empty.v1+json",
    "digest": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
    "size": 2,
    "data": "e30="
  },
  "layers": [
    {
      "mediaType": "application/vnd.cnai.model.weight.v1.raw",
      "digest": "sha256:97c8eb053060713dc121b36c0d6e1e72c1d8dd8455e5e0e0a67026610533b2f9",
      "size": 27,
      "annotations": {
        "org.opencontainers.image.title": "test.txt"
      }
    }
  ]
}

Executing

# This is the manifest above
podman run -it --rm \
    --mount type=artifact,src=quay.io/amisevsk0/oci-artifacts:podman-raw-data-empty-config,dst=/data \
    fedora:latest \
    /bin/bash

will mount a file to /data/test.txt in the fedora:latest container.

Note that in podman's case, the blob referred to by the layer's descriptor is mounted as-is, directly from artifact storage (i.e. read-only); the mediaType is currently ignored as far as I can tell and there is no extraction of tarballs, etc.

Should we instead adopt the behaviour podman has defined for OCI artifact mounts for better interoperability?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions