/kind bug
Operating System: all
Output of odo version: master
While using a minishift cluster in the backend and having experimental mode enabled, I tried to push a nodejs component.
$ 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
odo push should have succeeded
/priority high
/area devfile
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
Closing this since my expectation was incorrect.
/close
@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.
@dharmit why closed it? devfiles should be generic not project specific.
I agree. But using a specific devfile from a specific registry is going to be project specific, no? :thinking:
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.
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?
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
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.
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
@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.yamlActually 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.
Most helpful comment
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
workdirand it worked.