Skip to content

Commit 549ef2e

Browse files
committed
Move tiny-java-containers under native-image/containerize category
1 parent c23898d commit 549ef2e

File tree

6 files changed

+124
-5
lines changed

6 files changed

+124
-5
lines changed

.github/workflows/containerize-tiny-java-containers.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ jobs:
2424
java-version: ${{ matrix.java-version }}
2525
distribution: 'graalvm'
2626
github-token: ${{ secrets.GITHUB_TOKEN }}
27-
- name: Run 'tiny-java-containers'
27+
- name: Run 'native-image/containerize/tiny-java-containers'
2828
run: |
2929
sleep_period=5
30-
cd tiny-java-containers
30+
cd native-image/containerize/tiny-java-containers
3131
# Hello World
3232
#
3333
cd helloworld

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ cd graalvm-demos
2424
</thead>
2525
<tbody>
2626
<tr>
27-
<td align="left" width="30%"><a href="/tiny-java-containers/">tiny-java-containers</a><br><a href="https://github.com/graalvm/graalvm-demos/actions/workflows/tiny-java-containers.yml"><img alt="tiny-java-containers" src="https://github.com/graalvm/graalvm-demos/actions/workflows/tiny-java-containers.yml/badge.svg" /></a>
28-
<td align="left" width="70%">Demonstrates how to build very small Docker container images with GraalVM Native Image and various lightweight base images. <br><strong>Technologies: </strong> Native Image, musl libc<br><strong>Reference: </strong><a href="https://www.graalvm.org/22.0/reference-manual/native-image/StaticImages/">Static and Mostly Static Images</a></td>
27+
<td align="left" width="30%"><a href="/native-image/containerize/tiny-java-containers/">tiny-java-containers</a><br><a href="https://github.com/graalvm/graalvm-demos/actions/workflows/containerize-tiny-java-containers.yml.yml"><img alt="native-image/containerize/tiny-java-containers" src="https://github.com/graalvm/graalvm-demos/actions/workflows/containerize-tiny-java-containers.yml/badge.svg" /></a>
28+
<td align="left" width="70%">Demonstrates how to build very small Docker container images with GraalVM Native Image and various lightweight base images. <br><strong>Technologies: </strong> Native Image, musl libc<br><strong>Reference: </strong><a href="https://www.graalvm.org/latest/reference-manual/native-image/guides/build-static-executables/">Static and Mostly Static Images</a></td>
2929
</tr>
3030
<tr>
3131
<td align="left" width="30%"><a href="/native-image/hello-world/">native-image/hello-world</a><br><a href="https://github.com/graalvm/graalvm-demos/actions/workflows/native-image-hello-world.yml"><img alt="native-image/hello-world" src="https://github.com/graalvm/graalvm-demos/actions/workflows/native-image-hello-world.yml/badge.svg" /></a></td>
@@ -143,7 +143,7 @@ cd graalvm-demos
143143
</thead>
144144
<tbody>
145145
<tr>
146-
<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>
146+
<td align="left" width="30%"><a href="/native-image/containerize/spring-boot-microservice-jibber/">spring-boot-microservice-jibber</a><br><a href="https://github.com/graalvm/graalvm-demos/actions/workflows/containerize-spring-boot-jibber.yml"><img alt="native-image/containerize/spring-boot-microservice-jibber" src="https://github.com/graalvm/graalvm-demos/actions/workflows/containerize-spring-boot-jibber.yml/badge.svg" /></a></td>
147147
<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>
148148
</tr>
149149
</tbody>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Copyright © 2023, Oracle and/or its affiliates.
3+
* Released under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl/.
4+
*/
5+
6+
package com.example.benchmarks.jibber;
7+
8+
import org.springframework.beans.factory.annotation.Autowired;
9+
import org.springframework.boot.SpringApplication;
10+
import org.springframework.boot.autoconfigure.SpringBootApplication;
11+
import org.springframework.http.ResponseEntity;
12+
import org.springframework.web.bind.annotation.RequestMapping;
13+
import org.springframework.web.bind.annotation.RequestMethod;
14+
import org.springframework.web.bind.annotation.RestController;
15+
16+
17+
@SpringBootApplication
18+
@RestController
19+
public class DemoApplication {
20+
21+
@Autowired
22+
Jabberwocky j;
23+
24+
public static void main(String[] args) {
25+
SpringApplication.run(DemoApplication.class, args);
26+
}
27+
28+
@RequestMapping(method = RequestMethod.GET, path = "/jibber")
29+
ResponseEntity<String> jibber() {
30+
return ResponseEntity.ok(j.generate());
31+
}
32+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* Copyright © 2023, Oracle and/or its affiliates.
3+
* Released under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl/.
4+
*/
5+
6+
package com.example.benchmarks.jibber;
7+
8+
import org.springframework.context.annotation.Scope;
9+
import org.springframework.stereotype.Service;
10+
11+
import rita.RiMarkov;
12+
13+
@Service
14+
@Scope("singleton")
15+
public class Jabberwocky {
16+
//
17+
private RiMarkov r;
18+
19+
public Jabberwocky() {
20+
loadModel();
21+
}
22+
23+
private void loadModel() {
24+
//
25+
String text = "’Twas brillig, and the slithy toves " +
26+
"Did gyre and gimble in the wabe: " +
27+
"All mimsy were the borogoves, " +
28+
"And the mome raths outgrabe. " +
29+
"Beware the Jabberwock, my son! " +
30+
"The jaws that bite, the claws that catch! " +
31+
"Beware the Jubjub bird, and shun " +
32+
"The frumious Bandersnatch! " +
33+
"He took his vorpal sword in hand; " +
34+
"Long time the manxome foe he sought— " +
35+
"So rested he by the Tumtum tree " +
36+
"And stood awhile in thought. " +
37+
"And, as in uffish thought he stood, " +
38+
"The Jabberwock, with eyes of flame, " +
39+
"Came whiffling through the tulgey wood, " +
40+
"And burbled as it came! " +
41+
"One, two! One, two! And through and through " +
42+
"The vorpal blade went snicker-snack! " +
43+
"He left it dead, and with its head " +
44+
"He went galumphing back. " +
45+
"And hast thou slain the Jabberwock? " +
46+
"Come to my arms, my beamish boy! " +
47+
"O frabjous day! Callooh! Callay! " +
48+
"He chortled in his joy. " +
49+
"’Twas brillig, and the slithy toves " +
50+
"Did gyre and gimble in the wabe: " +
51+
"All mimsy were the borogoves, " +
52+
"And the mome raths outgrabe.";
53+
this.r = new RiMarkov(3);
54+
this.r.addText(text);
55+
}
56+
public String generate() {
57+
String[] lines = this.r.generate(10);
58+
StringBuilder b = new StringBuilder();
59+
//
60+
for (String line : lines ) {
61+
b.append(line);
62+
b.append("<br/>\n");
63+
}
64+
//
65+
return b.toString();
66+
}
67+
68+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
management.endpoints.web.exposure.include=metrics,health,info,prometheus

0 commit comments

Comments
 (0)