timoni icon indicating copy to clipboard operation
timoni copied to clipboard

Register Timoni Module type with ArtifactHub

Open stefanprodan opened this issue 2 years ago • 10 comments

We should try to add the Timoni Module as a supported type in ArtifactHub. Modules which are published on public container registries could then be listed on https://artifacthub.io.

A Timoni module is an OCI artifact with the following media types:

  • artifact media type application/vnd.oci.image.manifest.v1+json
  • config media type application/vnd.timoni.config.v1+json
  • content media type application/vnd.timoni.content.v1.tar+gzip

ArtifactHub can list the versions of a module by querying the container repository tags.

ArtifactHub can extract the OCI annotations for each module version to display information such as:

  • Description (optional) org.opencontainers.image.description
  • License (optional) org.opencontainers.image.licenses
  • Created date org.opencontainers.image.created
  • Version org.opencontainers.image.revision
  • Source code repo org.opencontainers.image.source
  • Readme markdown link org.opencontainers.image.documentation

The org.opencontainers.image.documentation contains the full URL to the markdown file which can be rendered in ArtifactHub.

Example:

$ crane manifest ghcr.io/stefanprodan/modules/podinfo|jq
{
  "schemaVersion": 2,
  "mediaType": "application/vnd.oci.image.manifest.v1+json",
  "config": {
    "mediaType": "application/vnd.timoni.config.v1+json",
    "size": 233,
    "digest": "sha256:3de741c3faf410c540698083003f86747d5c38fd5c0a217d3a471395c514d217"
  },
  "layers": [
    {
      "mediaType": "application/vnd.timoni.content.v1.tar+gzip",
      "size": 164527,
      "digest": "sha256:a2a86fead1ddb43a219255093ac749e2b15e848d2234ef733b2e7d5388177099"
    }
  ],
  "annotations": {
    "org.opencontainers.image.created": "2023-04-08T11:15:09Z",
    "org.opencontainers.image.description": "A timoni.sh module for deploying Podinfo.",
    "org.opencontainers.image.documentation": "https://github.com/stefanprodan/timoni/blob/main/examples/podinfo/README.md",
    "org.opencontainers.image.revision": "6.3.5",
    "org.opencontainers.image.source": "https://github.com/stefanprodan/podinfo"
  }
}

stefanprodan avatar Apr 12 '23 08:04 stefanprodan

One nice to have feature would be for ArtifactHub to display the default CUE values like it does for Helm. For this, I guess we need to extract the CUE values at push time and store them somewhere, maybe inside the application/vnd.timoni.config.v1+json layer?

stefanprodan avatar Apr 12 '23 09:04 stefanprodan

I can take care of this one ☝️

developer-guy avatar Apr 12 '23 14:04 developer-guy

@developer-guy can ArtifactHub list the versions from OCI tags and extract the infos from the annotations? Can we add more optional annotations like org.opencontainers.image.authors so it gets displayed in sidebar?

stefanprodan avatar Apr 12 '23 14:04 stefanprodan

All I know is this: https://github.com/anchore/syft/pull/876

developer-guy avatar Apr 12 '23 14:04 developer-guy

and this: https://artifacthub.io/docs/topics/repositories/container-images/#container-images-repositories

developer-guy avatar Apr 12 '23 14:04 developer-guy

Ok, I'll try to meet someone that maintains ArtifactHub at KubeCon to get more answers.

stefanprodan avatar Apr 12 '23 14:04 stefanprodan

sounds like a great plan 🤣

developer-guy avatar Apr 12 '23 14:04 developer-guy

that's the sprit of KubeCons 😁

developer-guy avatar Apr 12 '23 14:04 developer-guy

kindly ping, did you find a proper answer to your question at KubeCon? 🙉

developer-guy avatar Apr 25 '23 08:04 developer-guy