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

odo create --s2i flag shows Warning message on 4.6 cluster #4016

Closed
prietyc123 opened this issue Sep 22, 2020 · 11 comments · Fixed by #4070, #4215 or #4229
Closed

odo create --s2i flag shows Warning message on 4.6 cluster #4016

prietyc123 opened this issue Sep 22, 2020 · 11 comments · Fixed by #4070, #4215 or #4229
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)).
Projects

Comments

@prietyc123
Copy link
Contributor

prietyc123 commented Sep 22, 2020

/kind bug

What versions of software are you using?

Operating System:
All supported

Output of odo version:
master

How did you run odo exactly?

Steps:

Validation
Warning: nodejs is not fully supported by odo, and it is not guaranteed to work
 ✓  Validating component [4s]

Please use `odo push` command to create the component with source deployed

However there is no warning message reflects on 4.5

$ odo create --s2i nodejs
Validation
 ✓  Validating component [1s]

Please use `odo push` command to create the component with source deployed

Actual behavior

Shows warning message Warning: nodejs is not fully supported by odo, and it is not guaranteed to work on 4.6

Expected behavior

Functionality of component create should not depend on cluster.

Any logs, error output, etc?

@prietyc123 prietyc123 added the priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)). label Sep 22, 2020
@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Sep 22, 2020
@prietyc123
Copy link
Contributor Author

So, I dug little bit more into the issue and the point of hitting warning message is the image difference on 4.5 and 4.6 . The latest image on 4.6 (registry.redhat.io/ubi8/nodejs-12) is unsupported whereas on 4.5 (registry.redhat.io/rhscl/nodejs-12-rhel7) has supported one according to https://github.com/openshift/odo-init-image/blob/master/language-scripts/image-mappings.json

Logs:

Creating component on 4.6 cluster and image description

$ odo project create blah
 ✓  Project 'blah' is ready for use ✓  New project created and now using project: blah

$ odo create --s2i nodejs --project blah
Validation
Warning: nodejs is not fully supported by odo, and it is not guaranteed to work
 ✓  Validating component [817ms]

Please use `odo push` command to create the component with source deployed

$ oc -n openshift get is nodejs -o yaml
apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
  annotations:
    openshift.io/display-name: Node.js
    openshift.io/image.dockerRepositoryCheck: "2020-09-23T06:14:48Z"
    samples.operator.openshift.io/version: 4.6.0-0.nightly-2020-09-22-213802
  labels:
    samples.operator.openshift.io/managed: "true"
  name: nodejs
  namespace: openshift
spec:
  lookupPolicy:
    local: false
  tags:
  - annotations:
      [...]
  - annotations:
      description: |-
        Build and run Node.js applications on UBI. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-nodejs-container/blob/master/12/README.md.

        WARNING: By selecting this tag, your application will automatically update to use the latest version of Node.js available on OpenShift, including major version updates.
      iconClass: icon-nodejs
      openshift.io/display-name: Node.js (Latest)
      openshift.io/provider-display-name: Red Hat, Inc.
      sampleRepo: https://github.com/sclorg/nodejs-ex.git
      supports: nodejs
      tags: builder,nodejs
    from:
      kind: ImageStreamTag
      name: 12-ubi8
    importPolicy: {}
    name: latest
    referencePolicy:
      type: Local
status:
  dockerImageRepository: image-registry.openshift-image-registry.svc:5000/openshift/nodejs
  tags:
  [...]
  - items:
    - created: "2020-09-23T06:14:48Z"
      dockerImageReference: registry.redhat.io/ubi8/nodejs-12@sha256:1175006938852dff3ac21cdcab0939b65e0499a6ba0c4d1586869b3f31465f3f
      generation: 2
      image: sha256:1175006938852dff3ac21cdcab0939b65e0499a6ba0c4d1586869b3f31465f3f
    tag: latest

Creating component on 4.5 cluster and image description

$ odo project create blah
 ✓  Project 'blah' is ready for use
 ✓  New project created and now using project: blah

$ odo create --s2i nodejs --project blah
Validation
 ✓  Validating component [724ms]

Please use `odo push` command to create the component with source deployed

$ oc -n openshift get is nodejs -o yaml
apiVersion: image.openshift.io/v1
kind: ImageStream
metadata:
  annotations:
    openshift.io/display-name: Node.js
    openshift.io/image.dockerRepositoryCheck: "2020-09-23T07:55:01Z"
    samples.operator.openshift.io/version: 4.5.0-0.ci-2020-09-22-154858
  labels:
    samples.operator.openshift.io/managed: "true"
  name: nodejs
  namespace: openshift
  selfLink: /apis/image.openshift.io/v1/namespaces/openshift/imagestreams/nodejs
spec:
  lookupPolicy:
    local: false
  tags:
  - annotations:
      [...]
  - annotations:
      description: |-
        Build and run Node.js applications on RHEL 7. For more information about using this builder image, including OpenShift considerations, see https://github.com/sclorg/s2i-nodejs-container/blob/master/12/README.md.

        WARNING: By selecting this tag, your application will automatically update to use the latest version of Node.js available on OpenShift, including major version updates.
      iconClass: icon-nodejs
      openshift.io/display-name: Node.js (Latest)
      openshift.io/provider-display-name: Red Hat, Inc.
      sampleRepo: https://github.com/sclorg/nodejs-ex.git
      supports: nodejs
      tags: builder,nodejs
    from:
      kind: ImageStreamTag
      name: "12"
    importPolicy: {}
    name: latest
    referencePolicy:
      type: Local
status:
  dockerImageRepository: image-registry.openshift-image-registry.svc:5000/openshift/nodejs
  tags:
  - items:
    [...]
  - items:
    - created: "2020-09-23T07:55:01Z"
      dockerImageReference: registry.redhat.io/rhscl/nodejs-12-rhel7@sha256:2bfd71b41a1591a1ea19513cb92e5c1f43d235bbdf15b114b8fddd5521e99482
      generation: 2
      image: sha256:2bfd71b41a1591a1ea19513cb92e5c1f43d235bbdf15b114b8fddd5521e99482
    tag: latest

@kadel @girishramnani Should we add the latest image pointed in 4.6 as supported? Please let me know your suggestions.

@kadel
Copy link
Member

kadel commented Sep 25, 2020

@kadel @girishramnani Should we add the latest image pointed in 4.6 as supported? Please let me know your suggestions.

yes, we need to test odo with registry.redhat.io/ubi8/nodejs-12 and if everything works properly add it to supported images.

@prietyc123
Copy link
Contributor Author

prietyc123 commented Oct 2, 2020

I have tested odo with some of the command on nodejs image registry.redhat.io/ubi8/nodejs-12 and everything looks good to me so far. I will be sending PR to add this image as supported.

Commands verified on image registry.redhat.io/ubi8/nodejs-12
devfile commands:

$ oc version
   Client Version: 4.4.0-0.ci-2020-02-26-215902
   Server Version: 4.6.0-0.nightly-2020-10-01-041253
   Kubernetes Version: v1.19.0+beb741b

$ odo create nodejs
   Validation
   ✓  Checking devfile existence [458972ns]
   ✓  Creating a devfile component from registry: DefaultDevfileRegistry [373044ns]
   ✓  Validating devfile component [229417ns]
   Please use `odo push` command to create the component with source deployed

$ odo url create --host console-openshift-console.apps.rhamilto46.devcluster.openshift.com --port 3000 --ingress
   ✓  URL nodejs-3000 created for component: nodejs
   To apply the URL configuration changes, please use `odo push`

$ odo push
   Validation
   ✓  Validating the devfile [87065ns]
   Creating Kubernetes resources for component nodejs
   ✓  Waiting for component to start [37s]
   Applying URL changes
   ✓  URL http-3000: http://http-3000-nodejs-blah.apps.rhamilto46.devcluster.openshift.com/ created
   ✓  URL nodejs-3000: http://nodejs-3000.console-openshift-console.apps.rhamilto46.devcluster.openshift.com/ created
   Syncing to component nodejs
   ✓  Checking files for pushing [1ms]
   ✓  Syncing files to the component [6s]
   Executing devfile commands for component nodejs
   ✓  Executing install command "npm install" [6s]
   ✓  Executing run command "npm start" [3s]
   Pushing devfile component nodejs
   ✓  Changes successfully pushed to component

$ odo watch
   Waiting for something to change in /Users/pkumari/go/src/github.com/openshift/odo/testdevfile/project
   File /Users/pkumari/go/src/github.com/openshift/odo/testdevfile/project/server.js changed
   Pushing files...
   Validation
   ✓  Validating the devfile [7ms]
   Creating Kubernetes resources for component nodejs
   ✓  Waiting for component to start [288ms]
   Applying URL changes
   ✓  URLs are synced with the cluster, no changes are required.
   Syncing to component nodejs
   ✓  Checking file changes for pushing [3ms]
   ✓  Syncing files to the component [7s]
   Executing devfile commands for component nodejs
   ✓  Executing install command "npm install" [4s]
   ✓  Executing run command "npm start" [3s]
   Waiting for something to change in /Users/pkumari/go/src/github.com/openshift/odo/testdevfile/project

$ odo push --debug
   Validation
   ✓  Validating the devfile [58561ns]
   [...] ✓  Changes successfully pushed to component<br />$ odo log --debug
   time="2020-10-01T19:51:23Z" level=info msg="create process:devrun" 
   time="2020-10-01T19:51:23Z" level=info msg="create process:debugrun" 
   [...]
   ODO_COMMAND_DEBUG is npm run debug
   Changing directory to /project

$ odo describe
   Component Name: nodejs
   Type: nodejs
   Environment Variables:
   · PROJECTS_ROOT=/project
   · PROJECT_SOURCE=/project
   · DEBUG_PORT=5858 
   [...] 

Devfile registry and s2i commands also works fine.

@kadel
Copy link
Member

kadel commented Oct 2, 2020

@prietyc123 what you did is not correct and you are not testing registry.redhat.io/ubi8/nodejs-12 ❗ ❗ ❗
You are using Devfile not s2i.

You need to use --s2i.

The important part is to test that debugging with this image works. hint: For debug to work with s2i component and this new image you will have to use new init image container with changes in https://github.com/openshift/odo-init-image/pull/72/files

@prietyc123
Copy link
Contributor Author

You need to use --s2i.

@kadel Though I have not mentioned all the commands that I verifies. Yes, For s2i I have used --s2i on 4.6 cluster where the default latest image is ubi8/nodejs-12 and it works fine with --s2i too. Here in comment I have only mentioned the devfile commands however I verified with lots of scenarios.

@dharmit
Copy link
Member

dharmit commented Oct 5, 2020

Would it add value if there was a script that would test the various scenarios automatically for a provided image name? For example,

$ script.sh --s2i nodejs some.registry.io/nodejs:sometag
$ script.sh --s2i java some.registry.io/some-java-framework:sometag

$ script.sh --devfile nodejs some.registry.io/nodejs:sometag
$ script.sh --devfile java some.registry.io/some-java-framework:sometag

I'm asking this because if I understand correctly, we are soon going to focus on growing odo horizontally (add support for more frameworks) than just growing it vertically (adding more features.)

WDYT @kadel ?

EDIT: I don't meant to add it as a part of this PR. It should be a separate task if we think it's worth spending time doing it.

@kadel
Copy link
Member

kadel commented Oct 5, 2020

@kadel Though I have not mentioned all the commands that I verifies. Yes, For s2i I have used --s2i on 4.6 cluster where the default latest image is ubi8/nodejs-12 and it works fine with --s2i too

and debugiung worked with ubi8/nodejs-12 and default init image ?

@kadel
Copy link
Member

kadel commented Oct 5, 2020

@prietyc123

Here in comment I have only mentioned the devfile commands however I verified with lots of scenarios.

The problem that those commands are completely unrelated to this issue. When you are using this sequence of commands it doesn't use s2i builder images. So you can't say that you tested ubi8/nodejs-12 with those commands.

@dharmit

Would it add value if there was a script that would test the various scenarios automatically for a provided image name? For example,

$ script.sh --s2i nodejs some.registry.io/nodejs:sometag
$ script.sh --s2i java some.registry.io/some-java-framework:sometag

$ script.sh --devfile nodejs some.registry.io/nodejs:sometag
$ script.sh --devfile java some.registry.io/some-java-framework:sometag

I'm asking this because if I understand correctly, we are soon going to focus on growing odo horizontally (add support for more frameworks) than just growing it vertically (adding more features.)

I see the same confusing as with Priti's comment. Devfile components doesn't use s2i builder images.
script.sh --devfile nodejs some.registry.io/nodejs:sometag this command wouldn't make any sense.

@dharmit
Copy link
Member

dharmit commented Oct 7, 2020

I see the same confusing as with Priti's comment. Devfile components doesn't use s2i builder images.
script.sh --devfile nodejs some.registry.io/nodejs:sometag this command wouldn't make any sense.

Ah. This is likely a better question for the devfile-registry repo? My intention here is for us to be able to have a framework that would make adding support for new component types easier and more automated.

@prietyc123 prietyc123 added this to For consideration in Sprint 191 via automation Oct 7, 2020
@prietyc123 prietyc123 moved this from For consideration to To do in Sprint 191 Oct 7, 2020
@prietyc123 prietyc123 moved this from To do to In progress in Sprint 191 Oct 8, 2020
@prietyc123
Copy link
Contributor Author

AFAIU I have added the image ubi8/nodejs-12as supported via PR #4070 and redhat-developer/odo-init-image#72 . However not sure why it fails on odo-init-image travis CI claiming the image as unsupported.
Failure : https://travis-ci.com/github/openshift/odo-init-image/jobs/394059776#L18974-L18983 explains the image as unsupported.
@girishramnani @kadel I am bit lost at this point. Could you please let me know what am I missing.

@prietyc123 prietyc123 added this to For consideration in Sprint 192 via automation Oct 26, 2020
@prietyc123 prietyc123 removed this from In progress in Sprint 191 Oct 26, 2020
@prietyc123 prietyc123 moved this from For consideration to In progress in Sprint 192 Oct 26, 2020
@prietyc123
Copy link
Contributor Author

Tests for ubi8/nodejs-12 is failing on prow due to context content verification within dc environment variable ODO_S2I_SRC_BIN_PATH . However I tried debugging the failure and observed those contents within ODO_S2I_DEPLOYMENT_DIR. This is really a weird behavior but reason could be some change in the image which has not been handled in odo properly. @kadel is looking into it further. Till then we are blocked on this issue.

Detailed failure log: https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/openshift_odo/4070/pull-ci-openshift-odo-master-v4.5-integration-e2e/1323912242453811200#1:build-log.txt%3A1405

@prietyc123 prietyc123 added the status/blocked Denotes an issue or PR that is blocked on something (e.g., issue/PR in different repo) label Nov 4, 2020
@prietyc123 prietyc123 moved this from In progress to For review in Sprint 192 Nov 5, 2020
@prietyc123 prietyc123 removed the status/blocked Denotes an issue or PR that is blocked on something (e.g., issue/PR in different repo) label Nov 5, 2020
Sprint 192 automation moved this from For review to Done Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)).
Projects
No open projects
Sprint 192
  
Done
4 participants