이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 3. Customizing the registries


This chapter describes how to build and run custom registries for CodeReady Workspaces.

3.1. Understanding the CodeReady Workspaces registries

CodeReady Workspaces uses two registries: the plug-ins registry and the devfile registry. They are static websites publishing the metadata of CodeReady Workspaces plug-ins and devfiles. When built in offline mode they also include artifacts.

The devfile and plug-in registries run in two separate Pods. Their deployment is part of the CodeReady Workspaces installation.

The devfile and plug-in registries

The devfile registry
The devfile registry holds the definitions of the CodeReady Workspaces stacks. Stacks are available on the CodeReady Workspaces user dashboard when selecting Create Workspace. It contains the list of CodeReady Workspaces technological stack samples with example projects. When built in offline mode it also contains all sample projects referenced in devfiles as zip files.
The plug-in registry
The plug-in registry makes it possible to share a plug-in definition across all the users of the same instance of CodeReady Workspaces. When built in offline mode it also contains all plug-in or extension artifacts.

3.2. Building custom registry images

This section describes how to build an image containing custom devfile and plug-in registry images. The procedure explains how to add a new devfile and plug-in. The devfile registry image contains all sample projects referenced in devfiles. The plug-in registry image contains plug-ins or extensions metadata.

Procedure

  1. Clone the devfile registry repository and check out the version to deploy:

    $ git clone git@github.com:redhat-developer/codeready-workspaces.git
    $ cd codeready-workspaces
    $ git checkout crw-2.6-rhel-8
    Copy to Clipboard Toggle word wrap
  2. In the ./dependencies/che-devfile-registry/devfiles/ directory, create a subdirectory <devfile-name>/ and add the devfile.yaml and meta.yaml files.

    File organization for a devfile

    ./dependencies/che-devfile-registry/devfiles/
    └── <devfile-name>
        ├── devfile.yaml
        └── meta.yaml
    Copy to Clipboard Toggle word wrap

  3. Add valid content in the devfile.yaml file. For a detailed description of the devfile format, see https://access.redhat.com/documentation/en-us/red_hat_codeready_workspaces/2.6/html-single/end-user_guide/index#making-a-workspace-portable-using-a-devfile_crw.
  4. Ensure that the meta.yaml file conforms to the following structure:

    Expand
    Table 3.1. Parameters for a devfile meta.yaml
    AttributeDescription

    description

    Description as it appears on the user dashboard.

    displayName

    Name as it appears on the user dashboard.

    globalMemoryLimit

    The sum of the expected memory consumed by all the components launched by the devfile. This number will be visible on the user dashboard. It is informative and is not taken into account by the CodeReady Workspaces server.

    icon

    Link to an .svg file that is displayed on the user dashboard.

    tags

    List of tags. Tags usually include the tools included in the stack.

    Example 3.1. Example devfile meta.yaml

    displayName: Rust
    description: Rust Stack with Rust 1.39
    tags: ["Rust"]
    icon: https://www.eclipse.org/che/images/logo-eclipseche.svg
    globalMemoryLimit: 1686Mi
    Copy to Clipboard Toggle word wrap
  5. In the ./dependencies/che-devfile-registry/devfiles/ directory, create a subdirectory <devfile-name>/ and add the devfile.yaml and meta.yaml files.

    File organization for a devfile

    ./dependencies/che-devfile-registry/devfiles/
    └── <devfile-name>
        ├── devfile.yaml
        └── meta.yaml
    Copy to Clipboard Toggle word wrap

  6. Add valid content in the devfile.yaml file. For a detailed description of the devfile format, see https://access.redhat.com/documentation/en-us/red_hat_codeready_workspaces/2.6/html-single/end-user_guide/index#making-a-workspace-portable-using-a-devfile_crw.
  7. Ensure that the meta.yaml file conforms to the following structure:

    Expand
    Table 3.2. Parameters for a devfile meta.yaml
    AttributeDescription

    description

    Description as it appears on the user dashboard.

    displayName

    Name as it appears on the user dashboard.

    globalMemoryLimit

    The sum of the expected memory consumed by all the components launched by the devfile. This number will be visible on the user dashboard. It is informative and is not taken into account by the CodeReady Workspaces server.

    icon

    Link to an .svg file that is displayed on the user dashboard.

    tags

    List of tags. Tags usually include the tools included in the stack.

    Example 3.2. Example devfile meta.yaml

    displayName: Rust
    description: Rust Stack with Rust 1.39
    tags: ["Rust"]
    icon: https://www.eclipse.org/che/images/logo-eclipseche.svg
    globalMemoryLimit: 1686Mi
    Copy to Clipboard Toggle word wrap
  8. Build a custom devfile registry image:

    $ cd dependencies/che-devfile-registry
    $ ./build.sh --organization <my-org> \
               --registry <my-registry> \
               --tag <my-tag> \
               --latest-only
    
    $ cd ../../dependencies/che-devfile-registry
    $ ./build.sh --organization <my-org> \
               --registry <my-registry> \
               --tag <my-tag> \
               --latest-only
    Copy to Clipboard Toggle word wrap
    Tip

    To display full options for the build.sh script, use the --help parameter.

    To include the plug-in binaries in the registry image, add the --offline parameter.

3.3. Running custom registries

Prerequisites

The my-plug-in-registry and my-devfile-registry images used in this section are built using the docker command. This section assumes that these images are available on the OpenShift cluster where CodeReady Workspaces is deployed.

These images can be then pushed to:

  • A public container registry such as quay.io, or the DockerHub.
  • A private registry.

3.3.1. Deploying registries in OpenShift

Procedure

An OpenShift template to deploy the plug-in registry is available in the deploy/openshift/ directory of the GitHub repository.

  1. To deploy the plug-in registry using the OpenShift template, run the following command:

    NAMESPACE=<namespace-name>  
    1
    
    IMAGE_NAME="my-plug-in-registry"
    IMAGE_TAG="latest"
    oc new-app -f openshift/che-plugin-registry.yml \
     -n "$\{NAMESPACE}" \
     -p IMAGE="$\{IMAGE_NAME}" \
     -p IMAGE_TAG="$\{IMAGE_TAG}" \
     -p PULL_POLICY="Always"
    Copy to Clipboard Toggle word wrap
    1
    If installed using crwctl, the default CodeReady Workspaces project is openshift-workspaces. The OperatorHub installation method deploys CodeReady Workspaces to the users current project.
  2. The devfile registry has an OpenShift template in the deploy/openshift/ directory of the GitHub repository. To deploy it, run the command:

    NAMESPACE=<namespace-name>  
    1
    
    IMAGE_NAME="my-devfile-registry"
    IMAGE_TAG="latest"
    oc new-app -f openshift/che-devfile-registry.yml \
     -n "$\{NAMESPACE}" \
     -p IMAGE="$\{IMAGE_NAME}" \
     -p IMAGE_TAG="$\{IMAGE_TAG}" \
     -p PULL_POLICY="Always"
    Copy to Clipboard Toggle word wrap
    1
    If installed using crwctl, the default CodeReady Workspaces project is openshift-workspaces. The OperatorHub installation method deploys CodeReady Workspaces to the users current project.

Verification steps

  1. To verify that the new plug-in is correctly published to the plug-in registry, make a request to the registry path /v3/plugins/index.json (or /devfiles/index.json for the devfile registry).

    $ URL=$(oc  get route -l app=che,component=plugin-registry \
      -o 'custom-columns=URL:.spec.host' --no-headers)
    $ INDEX_JSON=$(curl -sSL http://${URL}/v3/plugins/index.json)
    $ echo ${INDEX_JSON} | jq '.[] | select(.name == "my-plug-in")'
    {
     "id": "my-org/my-plug-in/1.0.0",
     "displayName":"This is my first plug-in for CodeReady Workspaces",
     "version":"1.0.0",
     "type":"VS Code extension",
     "name":"my-plug-in",
     "description":"This plugins shows that we are able to add plugins to the registry...",
     "publisher":"my-org",
     "links": {"self":"/v3/plugins/my-org/my-plug-in/1.0.0"}
    }
    --
    --
    {
     "id": "my-org/my-plug-in/latest",
     "displayName":"This is my first plug-in for CodeReady Workspaces",
     "version":"latest",
     "type":"VS Code extension",
     "name":"my-plug-in",
     "description":"This plugins shows that we are able to add plugins to the registry...",
     "publisher":"my-org",
     "links": {"self":"/v3/plugins/my-org/my-plug-in/latest" }
    }
    Copy to Clipboard Toggle word wrap
  2. Verify that the CodeReady Workspaces server points to the URL of the registry. To do so, compare the value of the CHE_WORKSPACE_PLUGIN__REGISTRY__URL parameter in the che ConfigMap (or CHE_WORKSPACE_DEVFILE__REGISTRY__URL for the devfile registry):

    $ oc  get cm/che \
      -o "custom-columns=URL:.data['CHE_WORKSPACE_PLUGIN__REGISTRY__URL']" \
      --no-headers
    URL
    http://che-plugin-registry-che.192.168.99.100.nip.io/v3
    Copy to Clipboard Toggle word wrap

    with the URL of the route:

    $ oc  get route -l app=che,component=plugin-registry \
      -o 'custom-columns=URL: .spec.host' --no-headers
    che-plugin-registry-che.192.168.99.100.nip.io
    Copy to Clipboard Toggle word wrap
    1. If they do not match, update the ConfigMap and restart the CodeReady Workspaces server.

      $ oc  edit cm/che
      (...)
      $ oc  scale --replicas=0 deployment/che
      $ oc  scale --replicas=1 deployment/che
      Copy to Clipboard Toggle word wrap
  3. When the new plugin registry is deployed and the CodeReady Workspaces server is configured to use them, UI should be reflected in the following places:

    1. The new plug-ins are available in the completion to chePlugin components in Devfile tab of a workspace details;
    2. The new plug-ins are available in the Plugin Theia view of a workspace.
  4. When the new devfile registry is deployed the CodeReady Workspaces server is configured to use them, the new devfiles are displayed in the Get Started and Create Custom Workspace tab of the user dashboard.
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat