eclipse-che/che-plugin-registry

How to install a plugin in an existing registry on kubernetes ?

Closed this issue · 10 comments

Hello,
we succeeded installing Eclipse che on our k8s using chectl.

chectl server:start --platform=k8s --installer=helm --multiuser --domain=${MAAP_DOMAIN} --k8spodwaittimeout=400000 --postgres-pvc-storage-class-name="sata-iac-0b" --workspace-pvc-storage-class-name="sata-iac-0b" --templates=$TEMPLATE_PATH

Based on the default Jupyter plugin provided by default in the plugin repository:
dockerfile: https://github.com/ws-skeleton/che-editor-jupyter
plugin meta: https://github.com/eclipse/che-plugin-registry/blob/master/v3/plugins/ws-skeleton/jupyter/5.7.0/meta.yaml

we built a new one with Jupyter notebook and more pythons plugins https://hub.docker.com/repository/docker/kosted/maap-jupyter

We are trying now to add this new plugin in the default registry.
We created in the che-plugin-registry the folder esa in put inside it our new meta file following the default convention:
cat v3/plugins/esa/maap-jupyter/latest/meta.yaml

apiVersion: v2
publisher: ws-skeleton
name: jupyter
version: 5.7.0
type: Che Editor
displayName: Jupyter Notebook
title: Jupyter Notebook as Editor for Eclipse Che
description: Jupyter Notebook as Editor for Eclipse Che
icon: https://jupyter.org/assets/main-logo.svg
category: Editor
repository: https://gitlab.com/esa/maap-editor-jupyter/
firstPublicationDate: "2019-02-05"
spec:
  endpoints:
   -  name: "jupyter"
      public: true
      targetPort: 8888
      attributes:
        protocol: http
        type: ide
  containers:
   - name: jupyter-notebook
     image: " kosted/maap-jupyter:latest"
     env:
         - name: JUPYTER_NOTEBOOK_DIR
           value: /projects
     mountSources: true
     ports:
         - exposedPort: 8888
     memoryLimit: "512M"

The only command in the che plugin registry doc about kubernetes we have is this one:
https://github.com/eclipse/che-plugin-registry#run-eclipse-che-plugin-registry-on-kubernetes

so when we runs the command:

NAMESPACE="che"
DOMAIN="dev.esa-maap.org"
helm upgrade --install che-plugin-registry \
    --debug \
    --namespace ${NAMESPACE} \
    --set global.ingressDomain=${DOMAIN} \
    ./deploy/kubernetes/che-plugin-registry/

We have this error:

 helm upgrade --install che-plugin-registry \
>     --debug \
>     --namespace ${NAMESPACE} \
>     --set global.ingressDomain=${DOMAIN} \
>     ./deploy/kubernetes/che-plugin-registry/
[debug] Created tunnel using local port: '44446'

[debug] SERVER: "127.0.0.1:44446"

Error: UPGRADE FAILED: configmaps is forbidden: User "system:serviceaccount:kube-system:tiller" cannot list resource "configmaps" in API group "" in the namespace "kube-system"

How could we use chectl or another way to easily add this new plugin ?

You do not need to re-deploy the plugin registry just to add a plugin. You can host the meta.yaml somewhere (GitHub fork, GitHub gist, pastbin, etc.) and reference it in your devfile. Under the components section in the devfile, you add a section as follows:

- type: chePlugin
  reference: <link to meta.yaml file hosted somewhere"

@ericwill thanks for the answer. Thanks

@ericwill I hosted the the meta.yaml file on our gitlab with public access: https://repo.uat.maap-project.org/esa-common/che7/plugins-registry/-/blob/master/v3/plugins/esa/maap-jupyter/latest/meta.txt.

When I start the che I got the error
Error: Failed to start the workspace: "Plugin specified by reference URL 'https://repo.uat.maap-project.org/esa-common/che7/plugins-registry/-/blob/master/v3/plugins/esa/maap-jupyter/latest/meta.yaml' have missing required field 'publisher'."

There is no 'publisher' field in the meta description doc. What did i miss ?

In the doc, url should be like this:
https://raw.githubusercontent.com/<username>/<registryRepository>/v3/plugins/<publisher>/<plug-inName>/<plug-inVersion>/meta.yaml

I just use the raw file and it start downloading the image then failed with this error :

Successfully mounted volumes for pod "workspaceb3j0xt4ldu4mdchz.che-plugin-broker_che(631c7f2b-0efd-11eb-8d12-fa163ee96da3)"

Container image "quay.io/eclipse/che-plugin-metadata-broker:v3.3.0" already present on machine

Created container

Started container

Starting plugin metadata broker

Successfully mounted volumes for pod "workspaceb3j0xt4ldu4mdchz.che-plugin-broker_che(631c7f2b-0efd-11eb-8d12-fa163ee96da3)"

All plugin metadata has been successfully processed

List of plugins and editors to install
- ws-skeleton/jupyter/5.7.0 - Jupyter Notebook as Editor for Eclipse Che
- eclipse/che-machine-exec-plugin/7.18.0 - Che Plug-in with che-machine-exec service to provide creation terminal or tasks for Eclipse Che workspace containers.
- eclipse/che-theia/7.18.0 - Eclipse Theia

Successfully mounted volumes for pod "workspaceb3j0xt4ldu4mdchz.che-workspace-pod-c54cc56cc-xxjnk_che(8fd042de-0efd-11eb-8d12-fa163ee96da3)"

Container image "quay.io/eclipse/che-theia-endpoint-runtime-binary:7.18.0" already present on machine

Created container

Started container

Container image "quay.io/eclipse/che-plugin-artifacts-broker:v3.3.0" already present on machine

Created container

Started container

Starting plugin artifacts broker

Saving log of installed plugins

All plugin artifacts have been successfully downloaded

Container image "quay.io/eclipse/che-jwtproxy:0.10.0" already present on machine

Created container

Started container

Container image "kosted/maap-jupyter:latest" already present on machine

Created container

Started container

Container image "quay.io/eclipse/che-machine-exec:7.18.0" already present on machine

Created container

Started container

Container image "quay.io/eclipse/che-theia:7.18.0" already present on machine

Created container

Started container

Successfully mounted volumes for pod "workspaceb3j0xt4ldu4mdchz.che-workspace-pod-c54cc56cc-xxjnk_che(8fd042de-0efd-11eb-8d12-fa163ee96da3)"

Container image "kosted/maap-jupyter:latest" already present on machine

Error: Failed to run the workspace: "The following containers have terminated:
jupyter-notebookdg5: reason = 'Error', exit code = 1, message = 'null'"


@ericwill this is my devfile. How could i tell to eclipse that this chePlugin is a cheEditor ?

metadata:
  name: python-jupyter
projects:
  - name: python-hello-world
    source:
      location: 'https://github.com/che-samples/python-hello-world.git'
      type: git
      branch: master
components:
  - type: chePlugin
    reference: >-
      https://repo.uat.maap-project.org/esa-common/che7/plugins-registry/-/raw/master/v3/plugins/esa/maap-jupyter/latest/meta.yaml
apiVersion: 1.0.0

I see, you are trying to a load an editor. That just means you need to specify type as cheEditor instead of chePlugin:

- type: cheEditor
  reference: <link to meta.yaml file hosted somewhere"

You can find an example here.

@ericwill thanks for your previous answer. We succeeded building new Jupyter with our stack and test it with this devfile.

metadata:
        generateName: esa-jupyter-
projects:
 - name: python-hello-world
   source:
     location: 'https://github.com/che-samples/python-hello-world.git'
     type: git
     branch: master
components:
  - type: cheEditor
    reference: https://repo.uat.maap-project.org/esa-common/che7/plugins-registry/-/raw/master/v3/plugins/esa/maap-jupyter/latest/meta.yaml
apiVersion: 1.0.0

But now we want to make it ready to use like default stacks provide by che:
image

So we follow this doc: https://www.eclipse.org/che/docs/che-7/contributor-guide/building-a-custom-devfile-registry/
We added the folder Jupyter in the devfiles folder and created inside it two files: the devfile and the meta.

With this command we deployed a custom devifile registry:

NAMESPACE="che"
DOMAIN="dev.esa-maap.org"
 helm upgrade --install devfile-registry-5578964f5-dvtr5 \
 --debug     --namespace ${NAMESPACE}  \
 --set global.ingressDomain=${DOMAIN} \
 ./deploy/kubernetes/che-devfile-registry/

1. Why I dont' have my devfile in this registry ? After entering inside it i don't see the folder Jupyter

/usr/local/apache2 # ls /usr/local/apache2/htdocs/devfiles/
angular                  dotnet               java-gradle      java-web-vertx  php-laravel     python-django
apache-camel-k           dotnet-asp.net       java-maven       nodejs          php-mysql       quarkus
apache-camel-springboot  external_images.txt  java-mongo       nodejs-mongo    php-symfony     quarkus-command-mode
che4z                    go                   java-mysql       nodejs-react    php-web-simple  rust
cpp                      index.json           java-web-spring  nodejs-yarn     python          scala-sbt

2. The helm command deploys a new registry, so we have two registries with same contents. How to use the registry deployed by chectl to host our jupyter devfile and make it available to all users ?

kc get pods -n che
NAME                                    READY   STATUS             RESTARTS   AGE
che-876cc6ffc-kv46g                     1/1     Running            0          147m
che-devfile-registry-69847dcd44-4lhlk   1/1     Running            0          13m (The new one created by helm)
devfile-registry-5578964f5-dvtr5        1/1     Running            0          147m (The devfile created by chectl during install)
jaeger-649756db7d-mjmqm                 0/1     CrashLoopBackOff   33         147m
keycloak-7f4bb64896-v9hw8               1/1     Running            0          147m
plugin-registry-8669fc7ff9-dc8r8        1/1     Running            0          147m
postgres-748444bb55-n7x4h               1/1     Running            0          147m

3. In the case, we couldn't reuse default registry, how to link che with the new registry ? The documentation is not clear about this step.

Thanks in advance.

Before you go down the road of using your own Jupyter editor, did you check whether the built-in one works? AFAIK Che already comes with support for the Jupyter editor -- it's selectable from the list of editors in the default devfile registry.

@ericwill the built-in works well, but we need to upgrade it and add our stack and security stuff inside it.
The platform we are working on is for NASA and ESA scientists, so we have to add paticular stuff inside it. Thats's why we are trying to do this.
The next step will be to create another devfile and just NASA plugins for Theia editor.

That's why we need to create devfiles, to allow users to have ready to use workspaces with these particular configuration.

i explain the solution here : eclipse-che/che#14691 (comment)