-
Notifications
You must be signed in to change notification settings - Fork 28
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
Fix the Keycloak memory issue on Podman setting JAVA_OPTS_APPEND #1389
Fix the Keycloak memory issue on Podman setting JAVA_OPTS_APPEND #1389
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jcarranzan Thanks for the PR!
If it's verified the container limit set via the testcontainer's withMemory()
does not work with Podman, but does with Docker, we can go this direction.
As a temporary solution, it works for me as well, but it'd be good to verify whether setting the limit really works with Docker and is not opinionated by available memory on the agent (Docker 16GB vs Podman 8GB).
.../java/io/quarkus/test/services/containers/KeycloakGenericDockerContainerManagedResource.java
Outdated
Show resolved
Hide resolved
6140ae7
to
7c151a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was expecting JAVA_OPTS_APPEND approach to be applied always, no matter if it's podman or docker. Can you elaborate why did you pick if-else approach?
.../java/io/quarkus/test/services/containers/KeycloakGenericDockerContainerManagedResource.java
Outdated
Show resolved
Hide resolved
93e0e92
to
281e7c6
Compare
286db88
to
2cf1b7e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jcarranzan LGTM. I hope the JAVA_OPTS_APPEND
is not set somewhere else. Please, let me know if it works as expected.
Yes @mabartos , it worked when I tested it on the Jenkins Podman job. |
@jcarranzan if this is intended for backport, please set appropriate label |
Summary
This PR addresses the issue quarkus-qe/quarkus-test-suite#2106
where Podman environments were unable to correctly enforce memory limits for Keycloak containers. The solution applies a conditional setting for environments using Podman by adding
container.withEnv("JAVA_OPTS_APPEND", "-XX:MaxRAM=1g");
, ensuring that the Java heap memory allocation respects the 1GB limit in these environments.It won' be necessary this https://github.com/quarkus-qe/quarkus-test-suite/pull/2125/files in test suite.
Please check the relevant options
run tests
phrase in comment)Checklist: