redhat-developer / odo

odo - Developer-focused CLI for fast & iterative container-based application development on Podman and Kubernetes. Implementation of the open Devfile standard.
https://odo.dev
Apache License 2.0
787 stars 243 forks source link

add odo debug start command #2013

Closed kadel closed 5 years ago

kadel commented 5 years ago

parent #822 debug proposal in #1995

odo debug start

Enables debug mode for the component. It does this by adding DEBUG_MODE = true environment variable.

After adding environment variables the component (Deployment Config) is restarted. Once the pod is in running state odo debug start executes odo debug port-forward $DEBUG_PORT:$DEBUG_PORT. This process is executed in the background and PID of the process is recorded in ~/.odo/port-forward.json file.

port-forward.json format

[
  {
     "directory": "/path/to/component/",
     "port-forward-pid": 344
  },
  {
     "directory": "/path/to/another/component/",
     "port-forward-pid": 332
  }
]

Flags:

dgolovin commented 5 years ago

@kadel There should be an option to support use case when dev wants to debug the code from the beginning. That would mean 'wait for debugger to attach, then start running my code'.

kadel commented 5 years ago

@kadel There should be an option to support use case when dev wants to debug the code from the beginning. That would mean 'wait for debugger to attach, then start running my code'.

We are changing directions. This command won't be needed. By default, the component will be started in a debug mode. More information in discussion https://github.com/openshift/odo/pull/1995#issuecomment-525259554

We will also provide the capability to set advance options like suspend=n for Java, which suspends the process until the debugger is connected, to allow debugging the startup sequence. But this is an advanced use case that will be added in the following interactions, not in the first implementation.

/close

openshift-ci-robot commented 5 years ago

@kadel: Closing this issue.

In response to [this](https://github.com/openshift/odo/issues/2013#issuecomment-527157262): >> @kadel There should be an option to support use case when dev wants to debug the code from the beginning. That would mean 'wait for debugger to attach, then start running my code'. > >We are changing directions. >This command won't be needed. By default, the component will be started in a debug mode. >More information in discussion https://github.com/openshift/odo/pull/1995#issuecomment-525259554 > >We will also provide the capability to set advance options like `suspend=n` for Java, which suspends the process until the debugger is connected, to allow debugging the startup sequence. >But this is an advanced use case that will be added in the following interactions, not in the first implementation. > > >/close > > Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.