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

built image with openj9 jvm with tiny builder fails to run #144

Open
3 tasks done
cmdjulian opened this issue Nov 19, 2021 · 1 comment
Open
3 tasks done

built image with openj9 jvm with tiny builder fails to run #144

cmdjulian opened this issue Nov 19, 2021 · 1 comment
Labels
type:bug A general bug

Comments

@cmdjulian
Copy link

cmdjulian commented Nov 19, 2021

What happened?

I'm trying to use the buildpack in combination with the tiny stack. unfortunately it doesn't work quite right. Build succeeds but running the image fails.

  • What were you attempting to do?
    Run the build image

  • What did you expect to happen?
    Building AND running does work without a problem.

  • What was the actual behavior? Please provide log output, if possible.

Attaching to application
application  | Setting Active Processor Count to 8
application  | WARNING: Unable to convert memory limit "max" from path "/sys/fs/cgroup/memory.max" as int: memory size "max" does not match pattern "^([\\d]+)([kmgtKMGT]?)$"
application  | Calculating JVM memory based on 10985408K available memory
application  | Calculated JVM Memory Configuration: -XX:MaxDirectMemorySize=10M -Xmx10572041K -XX:MaxMetaspaceSize=106166K -XX:ReservedCodeCacheSize=240M -Xss1M (Total Memory: 10985408K, Thread Count: 50, Loaded Class Count: 16330, Headroom: 0%)
application  | Enabling Java Native Memory Tracking
application  | Adding 128 container CA certificates to JVM truststore
application  | Spring Cloud Bindings Enabled
application  | Failed to find VM - aborting
application  | failed to open </layers/paketo-buildpacks_eclipse-openj9/jre/lib/default/libjvm.so> - reason: <libstdc++.so.6: cannot open shared object file: No such file or directory>
application exited with code 255

When using the following command, without openj9 jvm, it works to build and to run without an issue:

pack build image:test \
  --path build/libs/application.jar \
  --env BP_JVM_VERSION=11 \
  --env BPE_SPRING_PROFILES_ACTIVE=prod \
  --env BPL_SPRING_CLOUD_BINDINGS_ENABLED=true \
  --builder paketobuildpacks/builder:tiny \
  --buildpack paketo-buildpacks/java

Build Configuration

pack build image:test \
  --path build/libs/application.jar \
  --env BP_JVM_VERSION=11 \
  --env BPE_SPRING_PROFILES_ACTIVE=prod \
  --env BPL_SPRING_CLOUD_BINDINGS_ENABLED=true \
  --builder paketobuildpacks/builder:tiny \
  --buildpack paketo-buildpacks/eclipse-openj9 \
  --buildpack paketo-buildpacks/java
  • What platform (pack, kpack, tekton buildpacks plugin, etc.) are you
    using? Please include a version.
    pack in version v0.22.0+git-7698938

  • What buildpacks are you using? Please include versions.

  • What builder are you using? If custom, can you provide the output from pack inspect-builder <builder>?
    Default tiny builder: paketobuildpacks/builder:tiny

Checklist

  • I have included log output.
  • The log output includes an error message.
  • I have included steps for reproduction.
@dmikusa
Copy link
Contributor

dmikusa commented Nov 19, 2021

The tiny stack is very limited in what shared libraries are included. It appears that OpenJ9 needs some additional libraries beyond the other JVMs that we ship.

<libstdc++.so.6: cannot open shared object file: No such file or directory>

Short term, there's not a lot you could do besides make your own custom build/run images based on Tiny that includes the missing shared libraries.

The contents of that image are here. It's not that difficult to create a stack and a builder from that stack. It's more work to keep them up-to-date though, which typically requires automation.

Long term, you could open an issue against the tiny stack and request the libraries you need to be added. I can help with that process, but it can be difficult to get stuff into tiny as the intent is to keep it very small/minimal, so adding anything is typically difficult. You'd want to make a case as to why it's needed & call out how much it impacts the size of the image in the issue you open.

Hope that helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants