-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Implement containerized native image building for native image bundles #6496
Implement containerized native image building for native image bundles #6496
Conversation
Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA). To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application. When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated. If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public. |
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.
This is an initial review without looking into details.
Please make all commit messages start with an upper-case letter.
substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/BundleSupport.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/BundleSupport.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/BundleSupport.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/BundleSupport.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/BundleSupport.java
Outdated
Show resolved
Hide resolved
@dominikmascherbauer the commit history of your PR seems broken.
It seems that you did your first commits on To fix this I suggest you
rebase all the commits that you want to have on your PR |
substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/BundleSupport.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/BundleSupport.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/BundleSupport.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/BundleSupport.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/BundleSupport.java
Outdated
Show resolved
Hide resolved
@dominikmascherbauer please fill in the description of this PR #6496 (comment) |
substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/NativeImage.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/BundleSupport.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/BundleSupport.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/BundleSupport.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/BundleSupport.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/BundleSupport.java
Outdated
Show resolved
Hide resolved
substratevm/src/com.oracle.svm.driver/src/com/oracle/svm/driver/BundleSupport.java
Outdated
Show resolved
Hide resolved
95cf74a
to
4edb4bb
Compare
Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA). To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application. When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated. If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public. |
…pping containerized builds when not on Linux
…th the BundleLauncher, fix BundleLauncher module path creation
… a container, Tweak ContainerSupport
f6b81ca
to
4ee078e
Compare
Running internal CI gates again |
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.
LGTM, thanks for your contribution!
…mage bundles #6496. PullRequest: graal/14927
This was merged via 525acb0. |
This PR contains two features: containerized native image builds for native image bundles and executable native image bundles
Containerized native image building for native image building:
Native images can be built inside a container when creating or applying native image bundles. Mounts graalvm, classpath and module path into a container, injects environment variable from the native image bundle and initiates the native image build inside a container.
Only works on Linux and supports just docker and podman as container tool as they share a common command line interface.
Uses a default Dockerfile for creating the container which is the same as the base for creating graalvm container https://github.com/graalvm/container. For muslib builds, the default Dockerfile is extended similar to muslib Dockerfiles for graalvm container.
On bundle creation any information related to container builds that is not default variables is stored in a bundle (in input/stage/container.json for tool and version information and input/stage/Dockerfile for the Dockerfile). If bundle is applied with the option "container" the stored information is used except the user specifies something else.
Also specifies a bundle build option for building a bundle without creating a native image. This should then be used instead of the --dry-run for native image bundle builds
Additional options for --bundle-create or --bundle-apply separated with a comma ",".
Executable Bundles
On bundle creation a bundle launcher is injected into the bundle which can then be used to run the bundle as if it was a jar file.
The bundle launcher is set as Main-Class in the bundles Manifest file and loads the classpath and module path from inside the bundle and then executes the bundled application with any jdk.
Environment variables stored in the bundle are injected into the application execution.
All further command line arguments needed for executing the application are stored in the bundle (in input/stage/run.json).
If the bundle is not executable it does not contain the run.json file and the bundle launcher throws an error (e.g. shared library bundles)
The bundle launcher allows two options for launching bundles: