Skip to content

Commit a3cfd7d

Browse files
authored
Merge pull request #303 from graalvm/ni-demos-refactoring-2
[GR-60094] Refactor demo for Native Image Containerization guide (Jibber example)
2 parents b7c4786 + 2cf4565 commit a3cfd7d

File tree

17 files changed

+361
-903
lines changed

17 files changed

+361
-903
lines changed

.github/workflows/spring-native-image.yml renamed to .github/workflows/native-image-containerize.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
name: spring-native-image
1+
name: native-image/containerize
22
on:
33
push:
44
paths:
5-
- 'spring-native-image/**'
6-
- '.github/workflows/spring-native-image.yml'
5+
- 'native-image/containerize/**'
6+
- '.github/workflows/native-image-containerize.yml'
77
pull_request:
88
paths:
9-
- 'spring-native-image/**'
10-
- '.github/workflows/spring-native-image.yml'
9+
- 'native-image/containerize/**'
10+
- '.github/workflows/native-image-containerize.yml'
1111
schedule:
1212
- cron: "0 0 1 * *" # run every month
1313
workflow_dispatch:
1414
permissions:
1515
contents: read
1616
jobs:
1717
run:
18-
name: Run 'spring-native-graal'
18+
name: Run 'native-image/containerize'
1919
runs-on: ubuntu-latest
2020
timeout-minutes: 20
2121
strategy:
2222
matrix:
23-
java-version: ['21', 'dev']
23+
java-version: ['21', '24-ea']
2424
steps:
2525
- uses: actions/checkout@v4
2626
- uses: graalvm/setup-graalvm@v1
@@ -30,9 +30,9 @@ jobs:
3030
github-token: ${{ secrets.GITHUB_TOKEN }}
3131
cache: 'maven'
3232
native-image-job-reports: 'true'
33-
- name: Run 'spring-native-image'
33+
- name: Run 'native-image/containerize'
3434
run: |
35-
cd spring-native-image
35+
cd native-image/containerize
3636
mvn --no-transfer-progress package
3737
mvn --no-transfer-progress native:compile -Pnative
3838
./target/benchmark-jibber &

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ cd graalvm-demos
180180
</thead>
181181
<tbody>
182182
<tr>
183-
<td align="left" width="30%"><a href="/spring-native-image/">spring-native-image</a><br><a href="https://github.com/graalvm/graalvm-demos/actions/workflows/spring-native-image.yml"><img alt="spring-native-image" src="https://github.com/graalvm/graalvm-demos/actions/workflows/spring-native-image.yml/badge.svg" /></a></td>
184-
<td align="left" width="70%">Demonstrates how to compile a Spring Boot application into a native executable using the Native Build Tools Maven plugin and a Maven profile <br> <strong>Technologies: </strong>Spring Boot, Native Image, Native Build Tools Maven plugin <br><strong>Reference: </strong><a href="https://luna.oracle.com/lab/fdfd090d-e52c-4481-a8de-dccecdca7d68/steps">GraalVM Native Image, Spring and Containerisation</a>, <a href="https://docs.oracle.com/en/graalvm/jdk/21/docs/getting-started/oci/cloud-shell/">Oracle GraalVM in OCI Cloud Shell</a></td>
183+
<td align="left" width="30%"><a href="/native-image/containerize/">native-image/containerize</a><br><a href="https://github.com/graalvm/graalvm-demos/actions/workflows/native-image-containerize.yml"><img alt="native-image/containerizee" src="https://github.com/graalvm/graalvm-demos/actions/workflows/native-image-containerize.yml/badge.svg" /></a></td>
184+
<td align="left" width="70%">Demonstrates how to compile a Spring Boot 3 application into a native executable using the Native Build Tools Maven plugin and a Maven profile <br> <strong>Technologies: </strong>Spring Boot, Native Image, Native Build Tools Maven plugin <br><strong>Reference: </strong><a href="https://www.graalvm.org/latest/reference-manual/native-image/guides/containerise-native-executable-and-run-in-docker-container/">Containerize a Native Executable and Run in a Container</a>, <a href="https://docs.oracle.com/en/graalvm/jdk/21/docs/getting-started/oci/cloud-shell/">Oracle GraalVM in OCI Cloud Shell</a></td>
185185
</tr>
186186
<tr>
187187
<td align="left" width="30%"><a href="/spring-r/">spring-r</a><br><a href="https://github.com/graalvm/graalvm-demos/actions/workflows/spring-r.yml"><img alt="spring-r" src="https://github.com/graalvm/graalvm-demos/actions/workflows/spring-r.yml/badge.svg" /></a></td>

spring-native-image/.mvn/wrapper/maven-wrapper.properties renamed to native-image/containerize/.mvn/wrapper/maven-wrapper.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
# "License"); you may not use this file except in compliance
77
# with the License. You may obtain a copy of the License at
88
#
9-
# https://www.apache.org/licenses/LICENSE-2.0
9+
# http://www.apache.org/licenses/LICENSE-2.0
1010
#
1111
# Unless required by applicable law or agreed to in writing,
1212
# software distributed under the License is distributed on an
1313
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.3/apache-maven-3.9.3-bin.zip
18-
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.1/maven-wrapper-3.1.1.jar
17+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.5/apache-maven-3.8.5-bin.zip
18+
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar

native-image/containerize/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Containerize a Native Executable and Run in a Container
2+
3+
You can find the steps to run this demo on [the website](https://www.graalvm.org/latest/reference-manual/native-image/guides/containerise-native-executable-and-run-in-docker-container/).
4+
5+
## Measure the Performance of the Application and Metrics
6+
7+
The Spring Actuator dependency is added to the project, along with support for Prometheus.
8+
If you want to test the performance of either the JVM version, or the native executable version of the application, you can make use of the Prometheus support.
9+
If you are hosting the application locally, it is available on port 8080:
10+
11+
[http://localhost:8080/actuator/prometheus](http://localhost:8080/actuator/prometheus)

0 commit comments

Comments
 (0)