This document outlines the structure of a Devfile Registry Repository that’s used as the basis for an OCI Devfile Registry, hosted on Kubernetes. It also outlines how individual files in each stack will get pushed up to the OCI registry.
The following requirements are imposed on the devfile registry repository:
1) A top-level folder called stacks
, which contains folders for each devfile stack.
2) Each devfile stack folder must contain a devfile.yaml
. Other files such as vsx plugins, stack logos, etc. can be included as needed.
3) Any build tools for the registry (such as scripts or Dockerfiles) should not be located at the top-level of the stack, and should reside in their own folder.
4) An optional file called extraDevfileEntries.yaml
can be added under the root of the devfile registry source repository to add samples and stacks from other repositories to the registry. This file contains the location information on where the extra samples and stacks can be found. For example:
Sample extraDevfileEntries.yaml
:
schemaVersion: 1.0.0
samples:
- name: nodejs-basic
displayName: Basic NodeJS
description: A simple Hello World application
icon: nodejsIcon.svg
tags: ["NodeJS", "Express"]
projectType: nodejs
language: nodejs
git:
remotes:
origin: https://github.com/redhat-developer/devfile-sample
- name: vertx-secured-http
displayName: Vert.x with secured HTTP
description: A Vert.x application using secured HTTP
icon: vertxIcon.svg
tags: ["Java", "Vert.x"]
projectType: vertx
language: java
git:
remotes:
origin: https://github.com/openshift-vertx-examples/vertx-secured-http-example-redhat
The devfile/registry repository is a good example of a Devfile Registry source repository that adheres to these requirements.
When devfile stacks are stored in an OCI reigstry, it’s stored as multiple layers, with the following media types defined for each layer:
Devfile
devfile.yaml
→ application/vnd.devfileio.devfile.layer.v2+yaml
VSX Plugins
*.vsx
→ application/vnd.devfileio.vsx.layer.v1.tar
Stack logos
logo.svg
→ image/svg+xml
or
logo.png
→ image/png
Everything else
archive.tar
- application/x-tar
As part of the registry build process that packages the stacks into a container image, any files not belonging to the devfile, vsx or logo media types will be lumped together in a tar archive (using the media type application/x-tar
).
When a devfile registry container image is deployed (or updated), the devfile stacks are pushed to the OCI registry as part of a multi-layer artifact. Each file belonging to one of the above media types (devfile.yaml
, *.vsx
, logo.svg
/logo.png
, archive.tar
) will be treated as separate layers in the artifact.