stefanprodan / timoni

Timoni is a package manager for Kubernetes, powered by CUE and inspired by Helm.
https://timoni.sh
Apache License 2.0
1.55k stars 68 forks source link

Register Timoni Module type with ArtifactHub #73

Open stefanprodan opened 1 year ago

stefanprodan commented 1 year ago

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:

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:

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 commented 1 year ago

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?

developer-guy commented 1 year ago

I can take care of this one ☝️

stefanprodan commented 1 year ago

@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?

developer-guy commented 1 year ago

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

developer-guy commented 1 year ago

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

stefanprodan commented 1 year ago

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

developer-guy commented 1 year ago

sounds like a great plan 🤣

developer-guy commented 1 year ago

that's the sprit of KubeCons 😁

developer-guy commented 1 year ago

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