-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #336 from graalvm/move-tiny-containers-demo
[GR-60094] Move tiny containers demo under native-image/containerize category.
- Loading branch information
Showing
45 changed files
with
127 additions
and
25 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
17 changes: 10 additions & 7 deletions
17
.github/workflows/tiny-java-containers.yml → ...ows/containerize-tiny-java-containers.yml
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
native-image/containerize/README.md → ...spring-boot-microservice-jibber/README.md
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
32 changes: 32 additions & 0 deletions
32
...boot-microservice-jibber/src/main/java/com/example/benchmarks/jibber/DemoApplication.java
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,32 @@ | ||
/* | ||
* Copyright © 2023, Oracle and/or its affiliates. | ||
* Released under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl/. | ||
*/ | ||
|
||
package com.example.benchmarks.jibber; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestMethod; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
|
||
@SpringBootApplication | ||
@RestController | ||
public class DemoApplication { | ||
|
||
@Autowired | ||
Jabberwocky j; | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(DemoApplication.class, args); | ||
} | ||
|
||
@RequestMapping(method = RequestMethod.GET, path = "/jibber") | ||
ResponseEntity<String> jibber() { | ||
return ResponseEntity.ok(j.generate()); | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
...ing-boot-microservice-jibber/src/main/java/com/example/benchmarks/jibber/Jabberwocky.java
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,68 @@ | ||
/* | ||
* Copyright © 2023, Oracle and/or its affiliates. | ||
* Released under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl/. | ||
*/ | ||
|
||
package com.example.benchmarks.jibber; | ||
|
||
import org.springframework.context.annotation.Scope; | ||
import org.springframework.stereotype.Service; | ||
|
||
import rita.RiMarkov; | ||
|
||
@Service | ||
@Scope("singleton") | ||
public class Jabberwocky { | ||
// | ||
private RiMarkov r; | ||
|
||
public Jabberwocky() { | ||
loadModel(); | ||
} | ||
|
||
private void loadModel() { | ||
// | ||
String text = "’Twas brillig, and the slithy toves " + | ||
"Did gyre and gimble in the wabe: " + | ||
"All mimsy were the borogoves, " + | ||
"And the mome raths outgrabe. " + | ||
"Beware the Jabberwock, my son! " + | ||
"The jaws that bite, the claws that catch! " + | ||
"Beware the Jubjub bird, and shun " + | ||
"The frumious Bandersnatch! " + | ||
"He took his vorpal sword in hand; " + | ||
"Long time the manxome foe he sought— " + | ||
"So rested he by the Tumtum tree " + | ||
"And stood awhile in thought. " + | ||
"And, as in uffish thought he stood, " + | ||
"The Jabberwock, with eyes of flame, " + | ||
"Came whiffling through the tulgey wood, " + | ||
"And burbled as it came! " + | ||
"One, two! One, two! And through and through " + | ||
"The vorpal blade went snicker-snack! " + | ||
"He left it dead, and with its head " + | ||
"He went galumphing back. " + | ||
"And hast thou slain the Jabberwock? " + | ||
"Come to my arms, my beamish boy! " + | ||
"O frabjous day! Callooh! Callay! " + | ||
"He chortled in his joy. " + | ||
"’Twas brillig, and the slithy toves " + | ||
"Did gyre and gimble in the wabe: " + | ||
"All mimsy were the borogoves, " + | ||
"And the mome raths outgrabe."; | ||
this.r = new RiMarkov(3); | ||
this.r.addText(text); | ||
} | ||
public String generate() { | ||
String[] lines = this.r.generate(10); | ||
StringBuilder b = new StringBuilder(); | ||
// | ||
for (String line : lines ) { | ||
b.append(line); | ||
b.append("<br/>\n"); | ||
} | ||
// | ||
return b.toString(); | ||
} | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
...ge/containerize/spring-boot-microservice-jibber/src/main/resources/application.properties
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 @@ | ||
management.endpoints.web.exposure.include=metrics,health,info,prometheus |
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.