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 push fails for devfile nodejs, if non default project is used #3151

Closed
dharmit opened this issue May 12, 2020 · 11 comments
Closed

odo push fails for devfile nodejs, if non default project is used #3151

dharmit opened this issue May 12, 2020 · 11 comments
Labels
area/devfile-spec Issues or PRs related to the Devfile specification and how odo handles and interprets it. 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)).

Comments

@dharmit
Copy link
Member

dharmit commented May 12, 2020

/kind bug

What versions of software are you using?

Operating System: all

Output of odo version: master

How did you run odo exactly?

While using a minishift cluster in the backend and having experimental mode enabled, I tried to push a nodejs component.

Actual behavior

$ odo create nodejs
Experimental mode is enabled, use at your own risk
Validation
 ✓  Checking devfile compatibility [29955ns]
 ✓  Validating devfile component [49755ns]
Please use `odo push` command to create the component with source deployed

$ odo push
Validation
 ✓  Validating the devfile [19025ns]
Creating Kubernetes resources for component nodejs
 ✓  Waiting for component to start [7s]
Applying URL changes
 ✓  URLs are synced with the cluster, no changes are required.
Syncing to component nodejs
 ✓  Checking files for pushing [691059ns]
 ✓  Syncing files to the component [186ms]
Executing devfile commands for component nodejs
 ✗  
Unable to exec command [/bin/sh -c cd ${CHE_PROJECTS_ROOT}/nodejs-web-app/app && npm install]: 
/bin/sh: line 0: cd: /projects/nodejs-web-app/app: No such file or directory
 ✗  Executing devbuild command "npm install" [62ms]
 ✗  Failed to start component with name nodejs.
Error: Failed to create the component: unable to execute the build command: error while streaming command: command terminated with exit code 1

Expected behavior

odo push should have succeeded

/priority high
/area devfile

@openshift-ci-robot openshift-ci-robot added 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)). area/devfile-spec Issues or PRs related to the Devfile specification and how odo handles and interprets it. labels May 12, 2020
@adisky
Copy link
Contributor

adisky commented May 12, 2020

as discussed on slack with @dharmit, he is using this project to deploy https://github.com/sclorg/nodejs-ex, the default devfile https://github.com/elsony/devfile-registry/blob/master/devfiles/nodejs/devfile.yaml#L25 is project specific, we should make it generic.

I tried removing the workdir and it worked.

$ odo push --show-log

Validation
 ✓  Validating the devfile [29149ns]

Creating Kubernetes resources for component mynodejs
 ✓  Waiting for component to start [13s]

Applying URL changes
 ✓  URLs are synced with the cluster, no changes are required.

Syncing to component mynodejs
 ✓  Syncing files to the component [194ms]

Executing devfile commands for component mynodejs
 •  Executing devbuild command "npm install"  ...
npm WARN saveError ENOENT: no such file or directory, open '/projects/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/projects/package.json'
npm WARN projects No description
npm WARN projects No repository field.
npm WARN projects No README data
npm WARN projects No license field.

up to date in 2.784s
found 0 vulnerabilities

 ✓  Executing devbuild command "npm install" [3s]
devdebug                                   OK
devrun                                     OK
 ◓  Executing devrun command "nodemon app.js"devrun: started
 ✓  Executing devrun command "nodemon app.js" [1s]

Pushing devfile component mynodejs
 ✓  Changes successfully pushed to component

@adisky adisky changed the title odo push fails for devfile component on minishift odo push fails for devfile nodejs, if non default project is used May 12, 2020
@dharmit
Copy link
Member Author

dharmit commented May 19, 2020

Closing this since my expectation was incorrect.

/close

@openshift-ci-robot
Copy link
Collaborator

@dharmit: Closing this issue.

In response to this:

Closing this since my expectation was incorrect.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@adisky
Copy link
Contributor

adisky commented May 19, 2020

@dharmit why closed it? devfiles should be generic not project specific.

@dharmit
Copy link
Member Author

dharmit commented May 27, 2020

I agree. But using a specific devfile from a specific registry is going to be project specific, no? 🤔

@adisky
Copy link
Contributor

adisky commented May 27, 2020

I agree. But using a specific devfile from a specific registry is going to be project specific, no?

I think no, at least the common one which we are providing is expected to work with multiple projects.

@adisky adisky reopened this May 27, 2020
@dharmit
Copy link
Member Author

dharmit commented May 27, 2020

I think no, at least the common one which we are providing is expected to work with multiple projects.

Is it common among different component types, i.e., nodejs, java, etc.? And where (which registry) is it available from?

@adisky
Copy link
Contributor

adisky commented May 27, 2020

I think no, at least the common one which we are providing is expected to work with multiple projects.

Is it common among different component types, i.e., nodejs, java, etc.? And where (which registry) is it available from?

from common one here i meant not stored in a project repository, no not common for component types, but you should be able to deploy different applications(of same component type) with one devfile.

AFAIK devfiles which are supported by odo, should not be project specific i.e the nodejs devfile should be able to work with other nodejs projects too.
https://github.com/elsony/devfile-registry/blob/master/devfiles/nodejs/devfile.yaml#L9

@girishramnani
Copy link
Contributor

Actually even with s2i components there were a certain conventions that needed to be followed like having a npm start script or the executable file for python was to be named main.py, so we need to have opinionated devfiles designed for specific reasons.

@adisky
Copy link
Contributor

adisky commented Jul 3, 2020

This can be closed now, resolved for v2 devfiles
https://github.com/odo-devfiles/registry/blob/master/devfiles/nodejs/devfile.yaml

Actually for v1 we are expecting a /app folder inside each nodejs app, thus failing for applications that does not have /app folder.
Resolved in new v2 file
https://github.com/elsony/devfile-registry/blob/master/devfiles/nodejs/devfile.yaml#L25

/close

@openshift-ci-robot
Copy link
Collaborator

@adisky: Closing this issue.

In response to this:

This can be closed now, resolved for v2 devfiles
https://github.com/odo-devfiles/registry/blob/master/devfiles/nodejs/devfile.yaml

Actually for v1 we are expecting a /app folder inside each nodejs app, thus failing for applications that does not have /app folder.
Resolved in new v2 file
https://github.com/elsony/devfile-registry/blob/master/devfiles/nodejs/devfile.yaml#L25

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devfile-spec Issues or PRs related to the Devfile specification and how odo handles and interprets it. 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
None yet
Development

No branches or pull requests

4 participants