oracle / graal

GraalVM compiles Java applications into native executables that start instantly, scale fast, and use fewer compute resources 🚀
https://www.graalvm.org
Other
19.99k stars 1.6k forks source link

Add container testing framework #6752

Open jerboaa opened 1 year ago

jerboaa commented 1 year ago

Describe the issue

There is currently little to no coverage for the container detection code as part of substrate. It would be good to have basic coverage of the container detection code which changes PhysicalMemory.size()'s meaning when running in a container. Similarly there is no coverage for the various aspects for what Runtime.getRuntime().availableProcessors() returns for various settings when run in a container with limits applied. There are at least these combinations to consider for CPU:

I propose to write some tests using docker/podman to run a native image (built with -H:+UseContainerSupport, the default) inside a container with given limits expecting for the various sizings to take effect. What's more, those tests should match JFR events such as jdk.ContainerConfiguration from the JDK. That is, the JDK impl and the substrate impl, should not diverge.

jerboaa commented 1 year ago

I'd be happy to contribute this if desired.

jerboaa commented 1 year ago

/cc @pejovica @christianwimmer