-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
[GR-48121] Native image compilation fails in Gitlab container environment. #7182
Comments
If it's the case that GraalVM can't find available memory referencing |
Similar issues also posted for Kubernetes: Seems to be related to cgroup access with certain configurations in Kubernetes clusters. This bug has been fixed in OpenJDK as far as I understand, but is obviously still present in GraalVM JDK. |
Printout of cgroup of the container when running in Gitlab in the Kubernetes cluster.
|
Thank you for reaching out about this issue, we'll take a look into it shortly |
I get a similar stacktrace when trying to use a minimal |
I can confirm that this issue has been fixed in Oracle GraalVM JDK 21. I have not tested the CE version. |
What's the status for GraalVM 17? We still see the problem in the latest release even though the upstream fix was already made in 17.0.1. We didn't have the problem in GraalVM 22.3.1 for JDK 11. |
Answering my own question: The bug is still present in GraalVM 17. It was fixed in OpenJDK and the fix is in the labs JDK build used by GraalVM but GraalVM 17 uses its own version of the cgroups code. GraalVM 21 uses the JDK version so it benefits from the upstream fix. |
Describe the issue
I'm trying to compile a native image in our build pipeline which is running in a container in Gitlab which in turn runs inside our Kubernetes cluster. The
native-image
tool crashes with the stacktrace below. I've tried using two different container images with both the GraalVM CE JDK and the Oracle GraalVM JDK and get errors in both cases. When running the containers locally in Docker on my Ubuntu machine everything works fine.Steps to reproduce the issue
Setup a build pipeline in Gitlab. Our Gitlab instance runs in Kubernetes. Then create container images (Dockerfiles) which can be used to build the application inside Gitlab. I'm using these two Dockerfiles:
GraalVM CE JDK Dockerfile
Oracle GraalVM JDK Dockerfile
Then inside the running container in the Gitlab pipeline first build a fat jar of your application and then use the
native-image
tool to compile it. I'm using the following parameters:native-image -jar target/my-app-1.0-SNAPSHOT-jar-with-dependencies.jar -H:ConfigurationFileDirectories=graalvm/tracing-agent -o target/app --no-fallback -H:+AddAllCharsets --enable-preview -H:+ReportExceptionStackTraces -H:+StaticExecutableWithDynamicLibC -R:MinHeapSize=128m -R:MaxHeapSize=768m
The native-image tool then immediately crashes with stacktrace below.
Describe GraalVM and your environment:
More details
Stacktrace when building with the Oracle GraalVM JDK:
Stacktrace when building with the GraalVM CE JDK:
The text was updated successfully, but these errors were encountered: