-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GraalVM native image based docker image. (#48)
- Loading branch information
Showing
13 changed files
with
392 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Build | ||
name: Main Branch Build | ||
on: | ||
push: | ||
branches: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...rc/main/resources/META-INF/native-image/io.github.robothy/local-s3-core/proxy-config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[ | ||
{ | ||
"interfaces":["com.robothy.s3.core.service.BucketService"] | ||
}, | ||
{ | ||
"interfaces":["com.robothy.s3.core.service.ObjectService"] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM frolvlad/alpine-glibc:glibc-2.34 | ||
|
||
MAINTAINER Fuxiang Luo <robothyluo@gmail.com> | ||
|
||
WORKDIR /app | ||
|
||
COPY build/bin/s3 /app/s3 | ||
|
||
EXPOSE 80 | ||
|
||
CMD exec ./s3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
## LocalS3 Docker Image | ||
|
||
LocalS3 provides two types of Docker images: `local-s3` and `local-s3-native`. The executable in `local-s3` is a Java application that runs on Java 17, | ||
while the executable in `local-s3-native` is build using GraalVM. The `local-s3-native` image is much smaller than the `local-s3` image. | ||
|
||
### Gradle tasks | ||
|
||
This module contains several Gradle tasks to build and publish the Docker images. | ||
|
||
### Collect reachability metadata | ||
|
||
+ `buildCollectReachabilityMetadataImage` - Builds the Docker image for collecting reachability metadata. | ||
+ `collectReachabilityMetadata` - Collects reachability metadata for building the GraalVM native image. | ||
|
||
Above tasks are not integrated in the CI pipeline. We need to manually run the `collectReachabilityMetadata` task. | ||
Collected reachability metadata files in `build/graalvm-native-image/reachability-metadata` are used to build the GraalVM native image. | ||
|
||
```mermaid | ||
graph BT; | ||
collectReachabilityMetadata --> jar; | ||
buildJava17BasedDockerImage --> jar; | ||
subgraph build Docker images | ||
buildGraalVMNativeImage --> collectReachabilityMetadata; | ||
buildDockerImages --> buildJava17BasedDockerImage | ||
buildGraalVMNativeBasedDockerImage --> buildGraalVMNativeImage | ||
buildDockerImages --> buildGraalVMNativeBasedDockerImage | ||
end | ||
test --> buildDockerImages | ||
pushJava17BasedDockerImage --> test | ||
pushGraalVMNativeBasedDockerImage --> test | ||
subgraph test and publish Docker images | ||
pushLatestDockerImage --> pushJava17BasedDockerImage | ||
pushDockerImages --> pushLatestDockerImage | ||
pushDockerImages --> pushGraalVMNativeBasedDockerImage | ||
end | ||
release --> pushDockerImages | ||
``` | ||
|
||
|
||
`collectReachbilityMetadata` - Collects reachability metadata for building the GraalVM native image. | ||
|
||
```mermaid | ||
graph TD; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.