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

Devfile mode: the run command process isn't killed, before starting the debug command process, if 'restart' attribute is set as false #3738

Closed
devang-gaur opened this issue Aug 11, 2020 · 0 comments · Fixed by #3740
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.

Comments

@devang-gaur
Copy link
Contributor

Pre requisite knowledge :

the restart attribute, as illustrated here , enables (when set as true) or disbles (when set as false) the retriggering of a project's build cycle inside the deployed container when odo push is used and newly added or edited files are pushed inside the running app container.

Case when restart attribute to set as true

Using a nodejs project while using the nodejs devfile from the default registry

https://github.com/odo-devfiles/registry/blob/78f685b7476791d9e45a0c9d6bbb8398b93d0216/devfiles/nodejs/devfile.yaml

if you see the logs here, it is ensured that the running commands are forcefully killed before the debug command is started.
image

Case when restart attribute to set as false

Using a quarkus project while using this devfile.

--- 
  commands: 
    - 
      exec: 
        commandLine: "mvn compile"
        component: tools
        id: init-compile
        workingDir: $PROJECTS_ROOT
    - 
      exec:
        attributes:
          restart: "false"
        commandLine: "mvn quarkus:dev"
        component: tools
        group: 
          isDefault: true
          kind: run
        id: dev-run
        workingDir: $PROJECTS_ROOT
    - 
      exec:
        commandLine: "mvn quarkus:dev -Ddebug=${DEBUG_PORT}"
        component: tools
        group: 
          isDefault: true
          kind: debug
        id: dev-debug
        workingDir: $PROJECTS_ROOT
  components: 
    - 
      container: 
        endpoints: 
          - 
            name: 8080/http
            targetPort: 8080
        image: "quay.io/eclipse/che-quarkus:nightly"
        memoryLimit: 1512Mi
        mountSources: true
        name: tools
        volumeMounts: 
          - 
            name: m2
            path: /home/user/.m2
    - 
      volume: 
        name: m2
        size: 3Gi
  events: 
    postStart: 
      - init-compile
  metadata: 
    name: java-quarkus
    version: "1.0.0"
    website: "https://quarkus.io"
  projects: 
    - 
      git: 
        location: "https://github.com/odo-devfiles/quarkus-ex"
      name: quarkus-ex
  schemaVersion: "2.0.0"  

if you see the logs here, the process started by the run command is not killed before starting the debug command process.
image (3)

This leads to an error as the port occupied from the run command is not released for the debug command to start properly.

BUT

When I set the restart attribute as true, the ongoing processes are killed before the debug command starts. Check the logs...

image

@devang-gaur devang-gaur added kind/bug Categorizes issue or PR as related to a bug. area/debug area/devfile-spec Issues or PRs related to the Devfile specification and how odo handles and interprets it. labels Aug 11, 2020
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant