Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Architectures in odo registry #6959

Conversation

rm3l
Copy link
Member

@rm3l rm3l commented Jul 7, 2023

What type of PR is this:
/kind feature
/area registry

What does this PR do / why we need it:
This displays the Devfile stacks architectures in the odo registry output (both human-readable and JSON).
It also makes the --filter flag search in the architectures.

Which issue(s) this PR fixes:
Fixes #6804

PR acceptance criteria:

How to test changes / Special notes to the reviewer:
Some examples:

odo registry
$ odo registry --devfile-registry Staging                                     
 NAME                          REGISTRY  DESCRIPTION                                  ARCHITECTURES          VERSIONS                   
 dotnet50                      Staging   .NET 5.0 application                                                1.0.3                      
 dotnet60                      Staging   .NET 6.0 application                                                1.0.2                      
 dotnetcore31                  Staging   .NET Core 3.1 application                                           1.0.3                      
 go                            Staging   Go is an open source programming languag...                         1.0.2, 1.1.0, 2.0.0, 2.1.0 
 java-maven                    Staging   Java application based on Maven 3.6 and ...                         1.2.0                      
 java-openliberty              Staging   Java application based on Java 11 and Ma...  amd64, ppc64le, s390x  0.9.0                      
 java-openliberty-gradle       Staging   Java application based on Java 11, Gradl...  amd64, ppc64le, s390x  0.4.0                      
 java-quarkus                  Staging   Java application using Quarkus and OpenJ...                         1.3.0                      
 java-springboot               Staging   Spring Boot using Java                                              1.2.0, 2.0.0               
 java-vertx                    Staging   Java application using Vert.x and OpenJD...                         1.2.0                      
 java-websphereliberty         Staging   Java application based Java 11 and Maven...  amd64, ppc64le, s390x  0.9.0                      
 java-websphereliberty-gradle  Staging   Java application based on Java 11 and Gr...  amd64, ppc64le, s390x  0.4.0                      
 java-wildfly                  Staging   Java application based on Java 11, using...                         1.1.0                      
 java-wildfly-bootable-jar     Staging   Java application using WildFly in bootab...                         1.1.0                      
 nodejs                        Staging   Node.js application                                                 2.1.1, 2.2.0               
 nodejs-angular                Staging   Angular is a development platform, built...                         2.0.2, 2.1.0, 2.2.0        
 nodejs-nextjs                 Staging   Next.js gives you the best developer exp...                         1.0.3, 1.1.0, 1.2.0        
 nodejs-nuxtjs                 Staging   Nuxt is the backbone of your Vue.js proj...                         1.0.3, 1.1.0, 1.2.0        
 nodejs-react                  Staging   React is a free and open-source front-en...                         2.0.2, 2.1.0, 2.2.0        
 nodejs-svelte                 Staging   Svelte is a radical new approach to buil...                         1.0.3, 1.1.0, 1.2.0        
 nodejs-vue                    Staging   Vue is a JavaScript framework for buildi...                         1.0.2, 1.1.0, 1.2.0        
 php-laravel                   Staging   Laravel is an open-source PHP framework,...                         1.0.1, 2.0.0               
 python                        Staging   Python is an interpreted, object-oriente...                         2.1.0, 3.0.0               
 python-django                 Staging   Django is a high-level Python web framew...                         2.1.0                      
 udi                           Staging   Universal Developer Image provides vario...                         1.0.0                      
odo registry --details --devfile java-openliberty --devfile-registry Staging
$ odo registry list --devfile-registry Staging --devfile java-openliberty --details
Name: java-openliberty
Display Name: Open Liberty Maven
Registry: Staging
Registry URL: https://registry.stage.devfile.io
Version: 0.9.0
Description: Java application based on Java 11 and Maven 3.8, using the Open Liberty runtime 22.0.0.1 
Tags: Java, Maven
Project Type: Open Liberty
Language: Java
Starter Projects:
  - rest
Supported odo Features:
  - Dev: Y
  - Deploy: N
  - Debug: Y
Architectures:
  - amd64
  - ppc64le
  - s390x
Versions:
  - 0.9.0        
Filtering by architecture
$ odo registry list --devfile-registry StagingRegistry --filter ppc              
 NAME                          REGISTRY         DESCRIPTION                                  ARCHITECTURES          VERSIONS                   
 dotnet50                      StagingRegistry  .NET 5.0 application                                                1.0.3                      
 dotnet60                      StagingRegistry  .NET 6.0 application                                                1.0.2                      
 dotnetcore31                  StagingRegistry  .NET Core 3.1 application                                           1.0.3                      
 go                            StagingRegistry  Go is an open source programming languag...                         1.0.2, 1.1.0, 2.0.0, 2.1.0 
 java-maven                    StagingRegistry  Java application based on Maven 3.6 and ...                         1.2.0                      
 java-openliberty              StagingRegistry  Java application based on Java 11 and Ma...  amd64, ppc64le, s390x  0.9.0                      
 java-openliberty-gradle       StagingRegistry  Java application based on Java 11, Gradl...  amd64, ppc64le, s390x  0.4.0                      
 java-quarkus                  StagingRegistry  Java application using Quarkus and OpenJ...                         1.3.0                      
 java-springboot               StagingRegistry  Spring Boot using Java                                              1.2.0, 2.0.0               
 java-vertx                    StagingRegistry  Java application using Vert.x and OpenJD...                         1.2.0                      
 java-websphereliberty         StagingRegistry  Java application based Java 11 and Maven...  amd64, ppc64le, s390x  0.9.0                      
 java-websphereliberty-gradle  StagingRegistry  Java application based on Java 11 and Gr...  amd64, ppc64le, s390x  0.4.0                      
 java-wildfly                  StagingRegistry  Java application based on Java 11, using...                         1.1.0                      
 java-wildfly-bootable-jar     StagingRegistry  Java application using WildFly in bootab...                         1.1.0                      
 nodejs                        StagingRegistry  Node.js application                                                 2.1.1, 2.2.0               
 nodejs-angular                StagingRegistry  Angular is a development platform, built...                         2.0.2, 2.1.0, 2.2.0        
 nodejs-nextjs                 StagingRegistry  Next.js gives you the best developer exp...                         1.0.3, 1.1.0, 1.2.0        
 nodejs-nuxtjs                 StagingRegistry  Nuxt is the backbone of your Vue.js proj...                         1.0.3, 1.1.0, 1.2.0        
 nodejs-react                  StagingRegistry  React is a free and open-source front-en...                         2.0.2, 2.1.0, 2.2.0        
 nodejs-svelte                 StagingRegistry  Svelte is a radical new approach to buil...                         1.0.3, 1.1.0, 1.2.0        
 nodejs-vue                    StagingRegistry  Vue is a JavaScript framework for buildi...                         1.0.2, 1.1.0, 1.2.0        
 php-laravel                   StagingRegistry  Laravel is an open-source PHP framework,...                         1.0.1, 2.0.0               
 python                        StagingRegistry  Python is an interpreted, object-oriente...                         2.1.0, 3.0.0               
 python-django                 StagingRegistry  Django is a high-level Python web framew...                         2.1.0                      
 udi                           StagingRegistry  Universal Developer Image provides vario...                         1.0.0                      

Note that Devfiles with no architectures are supposed to be compatible with all known architectures; that's why the output above returns Devfiles with no architectures.

@netlify
Copy link

netlify bot commented Jul 7, 2023

🔨 Deploy Preview deleted from internal cluster!

Name Link
🔨 Latest commit d69b092
😎 Deploy Preview https://odo-dev-pr-6959.odo-test-kubernete-449701-49529fc6e6a4a9fe7ebba9a3db5b55c4-0000.eu-de.containers.appdomain.cloud/

@openshift-ci openshift-ci bot added the kind/feature Categorizes issue as a feature request. For PRs, that means that the PR is the implementation label Jul 7, 2023
@rm3l rm3l temporarily deployed to internal July 7, 2023 12:10 — with GitHub Actions Inactive
@openshift-ci openshift-ci bot added the area/registry Issues or PRs related to Devfile registries label Jul 7, 2023
@openshift-ci openshift-ci bot requested review from anandrkskd and kadel July 7, 2023 12:10
@rm3l rm3l requested review from feloy and removed request for kadel and anandrkskd July 7, 2023 12:11
@odo-robot
Copy link

odo-robot bot commented Jul 7, 2023

OpenShift Unauthenticated Tests on commit 1e07818 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jul 7, 2023

NoCluster Tests on commit 1e07818 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jul 7, 2023

Unit Tests on commit 1e07818 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jul 7, 2023

Validate Tests on commit 1e07818 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jul 7, 2023

Windows Tests (OCP) on commit 1e07818 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jul 7, 2023

Kubernetes Tests on commit 1e07818 finished successfully.
View logs: TXT HTML

@odo-robot
Copy link

odo-robot bot commented Jul 7, 2023

Kubernetes Docs Tests on commit ebe003e finished with errors.
View logs: TXT HTML

@feloy
Copy link
Contributor

feloy commented Jul 7, 2023

As the devfiles with no architecture delacred are compatible with all architectures, I think the result needs to include all the devfiles with no architecture.

@rm3l
Copy link
Member Author

rm3l commented Jul 7, 2023

As the devfiles with no architecture delacred are compatible with all architectures, I think the result needs to include all the devfiles with no architecture.

You mean when using --filter?
Since we are filtering with strings.Contains, I guess doing so would return such devfiles with no architectures, regardless of the actual filter. For example, running odo registry --filter some-random-string would return such devfiles, which might sound confusing, no? Unless we decide to validate that the filter is a valid architecture string (or part of a valid architecture, to support cases like --filter ppc).
What do you think?

@feloy
Copy link
Contributor

feloy commented Jul 7, 2023

As the devfiles with no architecture delacred are compatible with all architectures, I think the result needs to include all the devfiles with no architecture.

You mean when using --filter? Since we are filtering with strings.Contains, I guess doing so would return such devfiles with no architectures, regardless of the actual filter. For example, running odo registry --filter some-random-string would return such devfiles, which might sound confusing, no? Unless we decide to validate that the filter is a valid architecture string (or part of a valid architecture, to support cases like --filter ppc). What do you think?

Yes I agree that it would be confusing for other, non-arch, strings.

The search would need to work on a "copy" of the devfiles indexes with the arch field set to the list of all arches when it is empty, but I'm not sure it is feasible

@rm3l
Copy link
Member Author

rm3l commented Jul 7, 2023

As the devfiles with no architecture delacred are compatible with all architectures, I think the result needs to include all the devfiles with no architecture.

You mean when using --filter? Since we are filtering with strings.Contains, I guess doing so would return such devfiles with no architectures, regardless of the actual filter. For example, running odo registry --filter some-random-string would return such devfiles, which might sound confusing, no? Unless we decide to validate that the filter is a valid architecture string (or part of a valid architecture, to support cases like --filter ppc). What do you think?

Yes I agree that it would be confusing for other, non-arch, strings.

The search would need to work on a "copy" of the devfiles indexes with the arch field set to the list of all arches when it is empty, but I'm not sure it is feasible

Okay, that would be a good approach. Let me look into that. Thanks.

rm3l and others added 3 commits July 7, 2023 16:31
Devfiles with no architecture declared are supposed to be compatible
with all known architectures.

Co-authored-by: Philippe Martin <[email protected]>
@rm3l rm3l temporarily deployed to internal July 7, 2023 14:34 — with GitHub Actions Inactive
@rm3l
Copy link
Member Author

rm3l commented Jul 7, 2023

As the devfiles with no architecture delacred are compatible with all architectures, I think the result needs to include all the devfiles with no architecture.

You mean when using --filter? Since we are filtering with strings.Contains, I guess doing so would return such devfiles with no architectures, regardless of the actual filter. For example, running odo registry --filter some-random-string would return such devfiles, which might sound confusing, no? Unless we decide to validate that the filter is a valid architecture string (or part of a valid architecture, to support cases like --filter ppc). What do you think?

Yes I agree that it would be confusing for other, non-arch, strings.
The search would need to work on a "copy" of the devfiles indexes with the arch field set to the list of all arches when it is empty, but I'm not sure it is feasible

Okay, that would be a good approach. Let me look into that. Thanks.

Changes done in 0052f5c (#6959) - please take a look when you get a chance.

@odo-robot
Copy link

odo-robot bot commented Jul 7, 2023

OpenShift Tests on commit 1e07818 finished successfully.
View logs: TXT HTML

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 7, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. Required by Prow. label Jul 7, 2023
@openshift-merge-robot openshift-merge-robot merged commit 5bf6a92 into redhat-developer:main Jul 7, 2023
@openshift-merge-robot openshift-merge-robot temporarily deployed to internal July 7, 2023 16:57 — with GitHub Actions Inactive
@rm3l rm3l deleted the 6804-odo-registry-filtering-devfile-stacks-based-on-the-architecture-field-in-metadata branch July 7, 2023 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/registry Issues or PRs related to Devfile registries kind/feature Categorizes issue as a feature request. For PRs, that means that the PR is the implementation lgtm Indicates that a PR is ready to be merged. Required by Prow.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

odo registry: Filtering devfile stacks based on the architecture field in metadata
3 participants