-
Notifications
You must be signed in to change notification settings - Fork 244
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
Wait when Build command fails #6771
Wait when Build command fails #6771
Conversation
✅ Deploy Preview for odo-docusaurus-preview ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
abbc747
to
dac019c
Compare
dac019c
to
20b069a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works great overall - thanks for this refactoring!
One thing I just noticed: when the build command fails on Kubernetes, odo dev
displays the logs and waits (which is expected); but when I tried pressing p
, but it did not retrigger the sync..
$ odo dev --debug --no-watch
__
/ \__ Developing using the "my-nodejs" Devfile
\__/ \ Namespace: default
/ \__/ odo version: v3.9.0
\__/
⚠ You are using "default" namespace, odo may not work as expected in the default namespace.
⚠ You may set a new namespace by running `odo create namespace <name>`, or set an existing one by running `odo set namespace <name>`
↪ Running on the cluster in Dev mode
• Waiting for Kubernetes resources ...
⚠ Pod is Pending
✓ Pod is Running
✓ Syncing files into the container [132ms]
✗ Building your application in container (command: install) [57ms]
Exiting...
Error occurred on Push - watch command was unable to push component: unable to exec command [/bin/sh -c cd ${PROJECT_SOURCE} && (echo Exiting... && exit 1 && npm install) 1>>/proc/1/fd/1 2>>/proc/1/fd/2]: error while streaming command: command terminated with exit code 1
↪ Dev mode
Keyboard Commands:
[Ctrl+c] - Exit and delete resources from the cluster
[p] - Manually apply local changes to the application on the cluster
p
Nothing happened after pressing p
(I tried multiple times at different intervals to check). It works as expected on Podman however.
Is it just me?
It works for me on K8s cluster. But were you using a different kind of project? I used the normal starter project to test this. I need to test it a little extensively, I think. Details
$ odo dev --debug --no-watch
__
/ \__ Developing using the "my-nodejs-app" Devfile
\__/ \ Namespace: default
/ \__/ odo version: v3.9.0
\__/
⚠ You are using "default" namespace, odo may not work as expected in the default namespace.
⚠ You may set a new namespace by running `odo create namespace <name>`, or set an existing one by running `odo set namespace <name>`
↪ Running on the cluster in Dev mode
• Waiting for Kubernetes resources ...
⚠ Pod is Pending
✓ Pod is Running
✓ Syncing files into the container [138ms]
✓ Building your application in container (command: install) [1s]
• Executing the application (command: debug) ...
✓ Waiting for the application to be ready [1s]
- Forwarding from 127.0.0.1:20001 -> 3000
- Forwarding from 127.0.0.1:20002 -> 5858
↪ Dev mode
Keyboard Commands:
[Ctrl+c] - Exit and delete resources from the cluster
[p] - Manually apply local changes to the application on the cluster
pPushing files...
• Waiting for Kubernetes resources ...
✓ Syncing files into the container [65ms]
✓ Building your application in container (command: install) [789ms]
✗ Finished executing the application (command: debug) [35s]
• Executing the application (command: debug) ...
✓ Waiting for the application to be ready [1s]
↪ Dev mode
Keyboard Commands:
[Ctrl+c] - Exit and delete resources from the cluster
[p] - Manually apply local changes to the application on the cluster But, it does not work if I modify the Devfile. I started with an invalid Details
$ odo dev --debug --no-watch
__
/ \__ Developing using the "my-nodejs-app" Devfile
\__/ \ Namespace: default
/ \__/ odo version: v3.9.0
\__/
⚠ You are using "default" namespace, odo may not work as expected in the default namespace.
⚠ You may set a new namespace by running `odo create namespace <name>`, or set an existing one by running `odo set namespace <name>`
↪ Running on the cluster in Dev mode
• Waiting for Kubernetes resources ...
⚠ Pod is Pending
✓ Pod is Running
✓ Syncing files into the container [131ms]
✗ Building your application in container (command: install) [232ms]
Unknown command: "install-non-existent"
To see a list of supported npm commands, run:
npm help
Error occurred on Push - watch command was unable to push component: unable to exec command [/bin/sh -c cd ${PROJECT_SOURCE} && (npm install-non-existent) 1>>/proc/1/fd/1 2>>/proc/1/fd/2]: error while streaming command: command terminated with exit code 1
↪ Dev mode
Keyboard Commands:
[Ctrl+c] - Exit and delete resources from the cluster
[p] - Manually apply local changes to the application on the cluster
pp
p |
@@ -0,0 +1,20 @@ | |||
commands: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file and the others seem to have been pushed accidentally.
I have made a fix. thanks for the catch |
Kudos, SonarCloud Quality Gate passed!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the refactoring and fixes! It works fine now.
Yes, the normal case worked fine for me as well. I tested the second case you mentioned below (which was the scope of the related issue): a Devfile with a failing build command..
|
/override OpenShift-Integration-tests/OpenShift-Integration-tests
|
@feloy: Overrode contexts on behalf of feloy: OpenShift-Integration-tests/OpenShift-Integration-tests In response to this:
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. |
What type of PR is this:
/kind code-refactoring
What does this PR do / why we need it:
this PR refactors the
pkg/dev
package to make more code generic between podman and kubernetes platforms. It changes the behaviour when the Build command fails.Which issue(s) this PR fixes:
Fixes #6671
PR acceptance criteria:
Unit test
Integration test
Documentation
How to test changes / Special notes to the reviewer: