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 with alternate --run-command should push complete file set upon new pod creation #3918

Closed
scottkurz opened this issue Sep 9, 2020 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@scottkurz
Copy link
Contributor

/kind bug

What versions of software are you using?

Operating System: Win10

Output of odo version: This is close to 1.2.6, with #3478 built in

How did you run odo exactly?

Roughly the workflow is:

  1. $ odo create java-openliberty --starter
  2. $ odo push
  3. <edit a .java file>
  4. $ odo push --run-command run-test-off

I say "roughly" because with some devfile syntax tweaks the starter devfile keeps getting broken at a fixed level of 'odo' by devfile changes. So you might have to adjust this a bit to recreate.

Actual behavior

With the new run command, the deployment spec changes, so k8s starts a new pod, but the problem is that only the one .java file I changed gets copied into the new container, not the whole project. My new container only has: /projects/src/...my.java not the pom.xml even to build it. I can force the whole proj. to get copied with odo push -f but that's not obvious.

Expected behavior

Since this is a new pod, 'odo' should sync the entire project into the new pod, not just the delta/changed file set.

Any logs, error output, etc?

Executing devfile commands for component java-openliberty
 <  Executing devbuild command "if [ -e /projects/.disable-bld-cmd ]; then echo \"found the disable file\" && echo \"devBuild command will not run\" && exit 0; else echo \"will run the devBuild command\" && echo \"...moving liberty\" && mkdir -p /projects/target/liberty  
 
 ...

  X  Executing devbuild command "if [ -e /projects/.disable-bld-cmd ]; then echo \"found the disable file\" && echo \"devBuild command will not run\" && exit 0; else echo \"will run the devBuild command\" && echo \"...moving liberty\" && mkdir -p /projects/target/liberty && mvn -Dmaven.repo.local=/mvn/repository package && mv /opt/ol/wlp /projects/target/liberty && touch ./.disable-bld-cmd; fi", if not running [4s]
 X  Failed to start component with name java-openliberty. Error: Failed to create the component: command execution failed: unable to execute the run command: unable to exec command [/bin/sh -c cd /projects && if [ -e /projects/.disable-bld-cmd ]; then echo "found the disable file" && echo "devBuild command will not run" && exit 0; else echo "will run the devBuild command" && echo "...moving liberty" && mkdir -p /projects/target/liberty && mvn -Dmaven.repo.local=/mvn/repository package && mv /opt/ol/wlp /projects/target/liberty && touch ./.disable-bld-cmd; fi]:
will run the devBuild command
...moving liberty
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.111 s
[INFO] Finished at: 2020-09-09T11:26:16Z
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/projects). Please verify you invoked Maven from the correct directory. -> [Help 1]

I could zip up the -v 9 logs if it helps.

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Sep 9, 2020
@johnmcollier
Copy link
Member

johnmcollier commented Sep 9, 2020

I can't reproduce @scottkurz 😕

Can you check to see if the branch of odo you're using has the fix from #3838 in it (commit id a7408ed)? This sounds similar to the bug that it fixed. Basically, we weren't detecting that the component pod had restarted and that the source code needed to be re-synced. It looks like a similar thing is happening here.

Because we're changing the run command, the run command env var in the container is changing and the container gets restarted, but it looks like odo is not properly detecting that the container has restarted, and not force-syncing as required. I would expect the fix from #3838 to catch this, I think.

@scottkurz
Copy link
Contributor Author

Can you check to see if the branch of odo you're using has the fix from #3838 in it (commit id a7408ed)?

Guessing not based on the dates. I'll wait and try this on the beta release. Thanks.

@scottkurz
Copy link
Contributor Author

Seems fixed on the odo v2.0.0-beta-1.

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.
Projects
None yet
Development

No branches or pull requests

3 participants