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

Issue 360 debug ipv4 cat #366

Merged
merged 1 commit into from
Feb 12, 2024
Merged

Issue 360 debug ipv4 cat #366

merged 1 commit into from
Feb 12, 2024

Conversation

anthonydahanne
Copy link
Member

Another to fix #360, without opening a port

Summary

Use Cases

Checklist

  • I have viewed, signed, and submitted the Contributor License Agreement.
  • I have linked issue(s) that this PR should close using keywords or the Github UI (See docs)
  • I have added an integration test, if necessary.
  • I have reviewed the styleguide for guidance on my code quality.
  • I'm happy with the commit history on this PR (I have rebased/squashed as needed).

@anthonydahanne anthonydahanne requested a review from a team as a code owner February 2, 2024 02:49
Copy link

linux-foundation-easycla bot commented Feb 2, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: anthonydahanne / name: Anthony Dahanne (2e4cf6f)

@anthonydahanne anthonydahanne force-pushed the issue-360-debug-ipv4-cat branch 5 times, most recently from 4444853 to d080303 Compare February 4, 2024 19:22
@anthonydahanne anthonydahanne added type:bug A general bug semver:patch A change requiring a patch version bump labels Feb 4, 2024
* use "/sys/module/ipv6/parameters/disable"
@anthonydahanne
Copy link
Member Author

To verify it worked fine, I've been using a logalot version of this branch, that you can see for yourself in https://github.com/anthonydahanne/libjvm/releases/tag/v1.44.360-debugcat3

Create a test (composite) buildpack

Then, I built a bellsoft-liberica out of it, but to do so without publishing a new libjvm, I also relocated all modules to github.com/anthonydahanne/libjvm v1.44.360-debugcat3 . The steps involved some:

  • version = "9.13.2-debugcat3"
  • GOOS="linux" go build -ldflags='-s -w' -o bin/helper github.com/anthonydahanne/libjvm/cmd/helper
  • GOARCH="amd64" scripts/build.sh
  • pack buildpack package pif/bellsoft-liberica:9.13.2-debugcat3 --publish

Then I built a java-lite composite buildpack, the steps involved some:

  • version = "9.14.2-debugcat3"
  • version = "9.13.2-debugcat3"
[[dependencies]]
  uri = "docker://gcr.io/pif/bellsoft-liberica:9.13.2-debugcat3"
  • cp package.toml ~/workspaces/tmp/
  • printf '[buildpack]\nuri = "%s"\n\n[platform]\nos = "%s"\n' "${~/workspaces/tmp/}"/buildpack "linux" >> "${/workspaces/tmp/}"/package.toml
  • create-package --source . --destination ~/workspaces/tmp/buildpack --version 9.14.2-debugcat3
  • pack buildpack package pif/java-lite:9.14.2-debugcat3 --config /Users/anthonyd2/workspaces/tmp/package.toml --publish

Test it out

First, I tested it with the samples/java/maven on a machine with IPv6, to check it was not switching to IPv4

  • pack build mavenapp --env BP_JVM_VERSION=17 -B paketobuildpacks/builder-jammy-buildpackless-tiny -b pif/java-lite:9.14.2-debugcat3
  • docker run --env BPL_DEBUG_ENABLED=true -it mavenapp
Setting Active Processor Count to 8
cool, setting it to default, /sys/module/ipv6/parameters/disable
entering
value is 0
enabled, exting true
Debugging enabled on address *:8000

Then, I tested it on a machine not providing IPv6 support (via tanzu / kpack though) and I got this startup:

Setting Active Processor Count to 4
cool, setting it to default, /sys/module/ipv6/parameters/disable
entering
value is 1
not enabled, exting false
IPv6 does not seem to be enabled in the container, configuring debug agent with 0.0.0.0
Debugging enabled on address 0.0.0.0:9005

That's about it!

Ready for review!

@anthonydahanne anthonydahanne merged commit 09feebe into main Feb 12, 2024
4 checks passed
@anthonydahanne anthonydahanne deleted the issue-360-debug-ipv4-cat branch February 12, 2024 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:patch A change requiring a patch version bump type:bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add detection of IPv6 availability to debug
2 participants