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

Registry devfiles are incompatible with odo dev --debug #5988

Closed
jeffmaury opened this issue Jul 28, 2022 · 10 comments · Fixed by devfile/registry#122
Closed

Registry devfiles are incompatible with odo dev --debug #5988

jeffmaury opened this issue Jul 28, 2022 · 10 comments · Fixed by devfile/registry#122
Assignees
Labels
estimated-size/M (10-20) Rough sizing for Epics. About 1 sprint of work for one person kind/bug Categorizes issue or PR as related to a bug. priority/Medium Nice to have issue. Getting it done before priority changes would be great.
Milestone

Comments

@jeffmaury
Copy link
Member

/kind bug

What versions of software are you using?

Operating System:
Win10Pro

Output of odo version:

C:\work\src\tmp\nodejs-ex>odo version
odo v3.0.0-beta2 (c8e4458f4)

Server: https://api.sandbox-m2.ll9k.p1.openshiftapps.com:6443
Kubernetes: v1.23.5+9ce5071

How did you run odo exactly?

odo dev --debug

Actual behavior

The debug port should be forwarded as well

Expected behavior

Only the application port is forwarded

Any logs, error output, etc?

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Jul 28, 2022
@dgolovin
Copy link
Contributor

@jeffmaury even if it forwarded it is not clear how to distinguish application ports from one should be used to connect debugger.

@jeffmaury
Copy link
Member Author

Plan is to have kind information in odo describe

@kadel kadel added the priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)). label Jul 29, 2022
@kadel kadel added the triage/needs-information Indicates an issue needs more information in order to work on it. label Jul 29, 2022
@cdrage cdrage added the estimated-size/M (10-20) Rough sizing for Epics. About 1 sprint of work for one person label Aug 4, 2022
@rm3l
Copy link
Member

rm3l commented Aug 8, 2022

As discussed with the team:

  • An issue will need to be created on the Devfile side, with a proposal about explicitly declaring debug endpoints in Registry Devfiles
    • The proposal would include a naming convention for such debug endpoint, so it can be identified by tools like odo
  • Once the proposal is accepted, then on the odo side, we would need to update the output of odo describe component (both human-readable and JSON) to include such information

@kadel kadel self-assigned this Aug 10, 2022
@valaparthvi
Copy link
Contributor

valaparthvi commented Aug 18, 2022

AI:

@kadel kadel removed their assignment Aug 18, 2022
@valaparthvi valaparthvi removed the triage/needs-information Indicates an issue needs more information in order to work on it. label Aug 18, 2022
@rm3l rm3l added this to after v3.0.0 Sep 1, 2022
@rm3l rm3l removed this from after v3.0.0 Sep 1, 2022
@rm3l rm3l added this to odo v3.0.0 Sep 1, 2022
@rm3l rm3l removed this from odo v3-beta2 Sep 1, 2022
@rm3l rm3l added priority/Medium Nice to have issue. Getting it done before priority changes would be great. and removed priority/High Important issue; should be worked on before any other issues (except priority/Critical issue(s)). labels Sep 1, 2022
@rm3l
Copy link
Member

rm3l commented Sep 1, 2022

We can start working on adding debug endpoints in the Devfile registry stacks (PR to create in the Devfile registry repo). So I've added this to the v3 board.

#6036 will be addressed after v3 GA.

@rm3l rm3l assigned rm3l and unassigned rm3l Sep 7, 2022
@rm3l
Copy link
Member

rm3l commented Sep 7, 2022

As discussed with @kadel, there is a limitation on the endpoint name: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$. So we cannot use uppercase characters or underscores (_).

Convention for Debug endpoints would then be to have:

  • either a single endpoint named debug
  • or any endpoint with a name starting with debug-

@rm3l
Copy link
Member

rm3l commented Sep 14, 2022

As discussed in the last community call, exposure for such debug endpoint will be set to none; this is what Che does, and it makes sense from the security perspective. And odo dev is trying to emulate a local developer machine.

Doing so however requires updating odo to no longer ignore endpoints with 'exposure: none': scope of #6119

I've just created a PR on the Devfile registry side to add such debug endpoints: devfile/registry#122

I'll close this issue once devfile/registry#122 is merged.

@rm3l
Copy link
Member

rm3l commented Sep 15, 2022

/status blocked

Blocked until devfile/registry#122 is merged and available in the default registry.

@rm3l rm3l added the status/blocked Denotes an issue or PR that is blocked on something (e.g., issue/PR in different repo) label Sep 15, 2022
@valaparthvi valaparthvi moved this to In Progress in odo v3.0.0 Sep 20, 2022
@rm3l rm3l moved this from In Progress to Done in odo v3.0.0 Sep 21, 2022
@rm3l rm3l moved this to Done in after v3.0.0 Sep 21, 2022
@rm3l rm3l added this to odo Project Sep 29, 2022
@rm3l rm3l added the v3 label Oct 7, 2022
@rm3l
Copy link
Member

rm3l commented Nov 8, 2022

devfile/registry#122 has been merged on the Devfile registry side. And it looks like it is also available in both staging and production registries.

I just tested it against the default production Devfile registry, and both the application and debug ports are being forwarded:

$ odo init --name odo-debug-endpoint-test --devfile java-springboot --devfile-registry DefaultDevfileRegistry --starter springbootproject
$ odo dev --debug

...
 •  Executing the application (command: debug)  ...
 -  Forwarding from 127.0.0.1:40001 -> 8080

 -  Forwarding from 127.0.0.1:40002 -> 5858

$ jdb -attach localhost:40002
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
Initializing jdb ...
> threadgroups
1. (java.lang.ThreadGroup)5173 system
2. (java.lang.ThreadGroup)5177 main
3. (java.lang.ThreadGroup)5178 InnocuousThreadGroup
> 

/remove-status blocked

Closing this issue as complete then.

/close

Next related steps for us:

But those issues do not prevent registry Devfiles from being used with odo dev --debug.

@openshift-ci
Copy link

openshift-ci bot commented Nov 8, 2022

@rm3l: Closing this issue.

In response to this:

devfile/registry#122 has been merged on the Devfile registry side. And it looks like it is also available in both staging and production registries.

I just tested it against the default production Devfile registry, and both the application and debug ports are being forwarded:

$ odo init --name odo-debug-endpoint-test --devfile java-springboot --devfile-registry DefaultDevfileRegistry --starter springbootproject
$ odo dev --debug

...
•  Executing the application (command: debug)  ...
-  Forwarding from 127.0.0.1:40001 -> 8080

-  Forwarding from 127.0.0.1:40002 -> 5858

$ jdb -attach localhost:40002
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
Initializing jdb ...
> threadgroups
1. (java.lang.ThreadGroup)5173 system
2. (java.lang.ThreadGroup)5177 main
3. (java.lang.ThreadGroup)5178 InnocuousThreadGroup
> 

/remove-status blocked

Closing this issue as complete then.

/close

Next related steps for us:

But those issues do not prevent registry Devfiles from being used with odo dev --debug.

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.

@openshift-ci openshift-ci bot closed this as completed Nov 8, 2022
@openshift-ci openshift-ci bot moved this to Done ✅ in odo Project Nov 8, 2022
@rm3l rm3l removed the status/blocked Denotes an issue or PR that is blocked on something (e.g., issue/PR in different repo) label Nov 8, 2022
@rm3l rm3l added this to the v3.3.0 🚀 milestone Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
estimated-size/M (10-20) Rough sizing for Epics. About 1 sprint of work for one person kind/bug Categorizes issue or PR as related to a bug. priority/Medium Nice to have issue. Getting it done before priority changes would be great.
Projects
Archived in project
Status: Done
Status: Done
Development

Successfully merging a pull request may close this issue.

6 participants