redhat-developer / odo

odo - Developer-focused CLI for fast & iterative container-based application development on Podman and Kubernetes. Implementation of the open Devfile standard.
https://odo.dev
Apache License 2.0
792 stars 244 forks source link

odo registry #5524

Closed serenamarie125 closed 2 years ago

serenamarie125 commented 2 years ago

description to be updated by @kadel

/kind user-story

User Story

Acceptance Criteria

Example

$ odo registry                                                                                                                       
Listing all Devfile stacks in registries configured in odo.
NAME                             REGISTRY                  DESCRIPTION                                                         
dotnet50                         DefaultDevfileRegistry    Stack with .NET 5.0                                                 
dotnet50                         StagingRegistry           Stack with .NET 5.0                                                 
dotnet60                         DefaultDevfileRegistry    Stack with .NET 6.0                                                 
dotnet60                         StagingRegistry           Stack with .NET 6.0                                                 
dotnetcore31                     DefaultDevfileRegistry    Stack with .NET Core 3.1                                            
dotnetcore31                     StagingRegistry           Stack with .NET Core 3.1                                            
go                               DefaultDevfileRegistry    Stack with the latest Go version                                    
go                               StagingRegistry           Stack with the latest Go version                                    
java-maven                       DefaultDevfileRegistry    Upstream Maven and OpenJDK 11                                       
java-maven                       StagingRegistry           Upstream Maven and OpenJDK 11                                       
java-openliberty                 DefaultDevfileRegistry    Java application Maven-built stack using the Open Liberty ru...     
java-openliberty                 StagingRegistry           Java application Maven-built stack using the Open Liberty ru...     
java-openliberty-gradle          DefaultDevfileRegistry    Java application Gradle-built stack using the Open Liberty r...     
java-openliberty-gradle          StagingRegistry           Java application Gradle-built stack using the Open Liberty r...     
java-quarkus                     DefaultDevfileRegistry    Quarkus with Java                                                   
java-quarkus                     StagingRegistry           Quarkus with Java                                                   
java-springboot                  DefaultDevfileRegistry    Spring Boot® using Java                                             
java-springboot                  StagingRegistry           Spring Boot® using Java                                             
java-vertx                       DefaultDevfileRegistry    Upstream Vert.x using Java                                          
java-vertx                       StagingRegistry           Upstream Vert.x using Java                                          
java-websphereliberty            DefaultDevfileRegistry    Java application Maven-built stack using the WebSphere Liber...     
java-websphereliberty            StagingRegistry           Java application Maven-built stack using the WebSphere Liber...     
java-websphereliberty-gradle     DefaultDevfileRegistry    Java application Gradle-built stack using the WebSphere Libe...     
java-websphereliberty-gradle     StagingRegistry           Java application Gradle-built stack using the WebSphere Libe...     
java-wildfly                     DefaultDevfileRegistry    Upstream WildFly                                                    
java-wildfly                     StagingRegistry           Upstream WildFly                                                    
java-wildfly-bootable-jar        DefaultDevfileRegistry    Java stack with WildFly in bootable Jar mode, OpenJDK 11 and...     
java-wildfly-bootable-jar        StagingRegistry           Java stack with WildFly in bootable Jar mode, OpenJDK 11 and...     
nodejs                           DefaultDevfileRegistry    Stack with Node.js 14                                               
nodejs                           StagingRegistry           Stack with Node.js 14                                               
nodejs-angular                   DefaultDevfileRegistry    Stack with Angular 12                                               
nodejs-angular                   StagingRegistry           Stack with Angular 12                                               
nodejs-nextjs                    DefaultDevfileRegistry    Stack with Next.js 12                                               
nodejs-nextjs                    StagingRegistry           Stack with Next.js 12                                               
nodejs-nuxtjs                    DefaultDevfileRegistry    Stack with Nuxt.js 2                                                
nodejs-nuxtjs                    StagingRegistry           Stack with Nuxt.js 2                                                
nodejs-react                     DefaultDevfileRegistry    Stack with React 17                                                 
nodejs-react                     StagingRegistry           Stack with React 17                                                 
nodejs-svelte                    DefaultDevfileRegistry    Stack with Svelte 3                                                 
nodejs-svelte                    StagingRegistry           Stack with Svelte 3                                                 
nodejs-vue                       DefaultDevfileRegistry    Stack with Vue 3                                                    
nodejs-vue                       StagingRegistry           Stack with Vue 3                                                    
php-laravel                      DefaultDevfileRegistry    Stack with Laravel 8                                                
php-laravel                      StagingRegistry           Stack with Laravel 8                                                
python                           DefaultDevfileRegistry    Python Stack with Python 3.7                                        
python                           StagingRegistry           Python Stack with Python 3.7                                        
python-django                    DefaultDevfileRegistry    Python3.7 with Django                                               
python-django                    StagingRegistry           Python3.7 with Django                                               
$ odo registry --filter python                                                                                                                 
Listing all Devfile stacks in registries configured in odo that include "python" phrase. 

NAME                             REGISTRY                  DESCRIPTION                                                         
python                           DefaultDevfileRegistry    Python Stack with Python 3.7                                        
python                           StagingRegistry           Python Stack with Python 3.7                                        
python-django                    DefaultDevfileRegistry    Python3.7 with Django                                               
python-django                    StagingRegistry           Python3.7 with Django         
$ odo registry --details
# this would print details for all devfile stacks that you can see in `odo registry` output

$ odo registry --details --filter python-django

Name: python
Display name: Python
Registry: DefaultDevfileRegistry
Registry url: https://registry.devfile.io/
Version: 1.0.0
Description: Python Stack with Python 3.7
Tags: Python, pip
Project Type: python
Language: python
Starter Projects:
 - python-example
Supported odo features:
  - dev: true
  - deploy: false
  - debug: true

Name: python
Display name: Python
Registry: StagingRegistry
Registry url: https://registry.stage.devfile.io/
Version: 1.0.0
Description: Python Stack with Python 3.7
Tags: Python, pip
Project Type: python
Language: python
Starter Projects:
 - python-example
Supported odo features:
  - dev: true
  - deploy: false
  - debug: true
$ odo registry --details --devfile python-django --devfile-registry StagingRegistry

Name: python
Display name: Python
Registry: StagingRegistry
Registry url: https://registry.devfile.io/
Version: 1.0.0
Description: Python Stack with Python 3.7
Tags: Python, pip
Project Type: python
Language: python
Starter Projects:
 - python-example
Supported odo features:
  - dev: true
  - deploy: false
  - debug: true
$ odo registry --devfile python --devfile-registry StagingRegistry
Listing all Devfile stacks in "StagingRegistry" registry in odo that match name "python" . 

NAME                             REGISTRY                  DESCRIPTION                                                         
python                           StagingRegistry    Python Stack with Python 3.7 
dharmit commented 2 years ago

I find odo registry list a little weird command to list the devfile stacks. Thinking out loud, I suggest we consider/discuss:

# to list only the registries
$ odo list registry

# to list only the stacks
$ odo list registry --stacks

# to fileter stacks (this one looks bad)
$ odo list registry --stacks --filter python

# to list them all
$ odo list registry --all

Users could have a private devfile registry deployed on their cluster. So registry, in that sense, is something that can be either on the cluster or on the cluster.

kadel commented 2 years ago

The intention that we have for odo list is that it will list devfile components and their parts like endpoints, services, bindings etc... In another word, it will list users applications and their parts. Devfile registry is not part of the devfile component It is a separate construct that doesn't affect how the actual application is running. For that reason, it is not a good fit for odo list command.

As we discussed during the cabal call we will change what is described in this issue. It won't be odo registry list but just odo registry to alight it with odo catalog command. Commands for adding and removing devfile registries into odo will be under odo preference (odo preference add/remove registry) I tried to capture this in https://github.com/redhat-developer/odo/issues/5535

dharmit commented 2 years ago

@kadel could you add the scenario we discussed during triage call about allowing a way to show details for only one stack from the list shown by odo registry?

cdrage commented 2 years ago

Been experimenting with the implementation so far.

What do you all think of this? @dharmit @kadel @serenamarie125

This is SPECIFICALLY only for --details instead of the "listed" output.

I've been using the table library for unified output and it can easily be changed to a list.

This has been implemented in my PR: https://github.com/redhat-developer/odo/pull/5667

go/src/odo  add-registry-command ✔                                                                                                                                                                                                                                                                                                                                 30m  ⍉
▶ odo registry --filter python
 NAME           REGISTRY                DESCRIPTION
 python         Test                    Python Stack with Python 3.7
 python         DefaultDevfileRegistry  Python Stack with Python 3.7
 python-django  Test                    Python3.7 with Django
 python-django  DefaultDevfileRegistry  Python3.7 with Django

go/src/odo  add-registry-command ✗                                                                                                                                                                                                                                                                                                                             18h32m ⚑
▶ odo registry --details --filter python
┌────────────────┬──────────────────────────────────────────┬──────────────────────┬─────┬────────┬───────┬──────────────────────────────┬────────────────┐
│ NAME / VERSION │ REGISTRY / URL                           │ LANGUAGE / TAGS      │ DEV │ DEPLOY │ DEBUG │ DESCRIPTION                  │ STARTER PROJ.  │
├────────────────┼──────────────────────────────────────────┼──────────────────────┼─────┼────────┼───────┼──────────────────────────────┼────────────────┤
│ python         │ Test (https://registry.devfile.io)       │ python (Python, pip) │  Y  │    Y   │   Y   │ Python Stack with Python 3.7 │ python-example │
│ Python         │                                          │                      │     │        │       │                              │                │
│ 1.0.0          │                                          │                      │     │        │       │                              │                │
│                ├──────────────────────────────────────────┤                      ├─────┼────────┼───────┤                              │                │
│                │ DefaultDevfileRegistry                   │                      │  Y  │    Y   │   Y   │                              │                │
│                │ (https://registry.devfile.io)            │                      │     │        │       │                              │                │
│                │                                          │                      │     │        │       │                              │                │
├────────────────┼──────────────────────────────────────────┼──────────────────────┼─────┼────────┼───────┼──────────────────────────────┼────────────────┤
│ python-django  │ Test (https://registry.devfile.io)       │ python (Python, pip, │  Y  │    Y   │   Y   │ Python3.7 with Django        │ django-example │
│ Django         │                                          │ Django)              │     │        │       │                              │                │
│ 1.0.0          │                                          │                      │     │        │       │                              │                │
│                ├──────────────────────────────────────────┤                      ├─────┼────────┼───────┤                              │                │
│                │ DefaultDevfileRegistry                   │                      │  Y  │    Y   │   Y   │                              │                │
│                │ (https://registry.devfile.io)            │                      │     │        │       │                              │                │
│                │                                          │                      │     │        │       │                              │                │
└────────────────┴──────────────────────────────────────────┴──────────────────────┴─────┴────────┴───────┴──────────────────────────────┴────────────────┘
dharmit commented 2 years ago

@cdrage I really liked the tabular output! It looks really pleasing to the eyes. I have left some review comments on the PR.

kadel commented 2 years ago

I find the tabular output quite unreadable :-( It is really wide, and unless you have full-screen terminal it is unreadable. image

And that terminal is already pretty wide.

@cdrage please stick to the original agreed-upon structure.

cdrage commented 2 years ago

I find the tabular output quite unreadable :-( It is really wide, and unless you have full-screen terminal it is unreadable. image

And that terminal is already pretty wide.

@cdrage please stick to the original agreed-upon structure.

Done in the PR! Was only a quick experiment to see the formatting.

It looks like this now:

Name: python-django
Display Name: Django
Registry: DefaultDevfileRegistry
Registry URL: https://registry.devfile.io
Version: 1.0.0
Description: Python3.7 with Django
Tags: Python, pip, Django
Project Type: django
Language: python
Starter Projects:
  - django-example
Supported odo features:
  - dev: Y
  - deploy: Y
  - debug: Y
feloy commented 2 years ago

To display odo supported features, you can use the function libdevfile.Has*Command added from the (merged) PR https://github.com/redhat-developer/odo/pull/5658

cdrage commented 2 years ago

@feloy you're right, just noticed it got merged in. I'll implement it now!