You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: oci-build-examples/oci_devops_graalee_micronaut/README.md
+21-20Lines changed: 21 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Using GraalVM Enterprise in OCI DevOps to build a Micronaut REST App
2
2
3
-
This sample shows how to use `Oracle GraalVM Enterprise Edition` in `OCI DevOps build pipelines`build pipelines to build a simple Micronaut hello world REST application. You can use this approach to build any high-performance Java application with Micronaut, GraalVM Enterprise and OCI DevOps.
3
+
This sample shows how to use `Oracle GraalVM Enterprise Edition` in `OCI DevOps build pipelines` to build a simple Micronaut hello world REST application. You can use this approach to build any high-performance Java application with Micronaut, GraalVM Enterprise and OCI DevOps.
4
4
5
5
## What is GraalVM?
6
6
@@ -12,7 +12,7 @@ This sample shows how to use `Oracle GraalVM Enterprise Edition` in `OCI DevOps
12
12
13
13
## What is Micronaut
14
14
15
-
- Micronaut is a modern, JVM-based framework to build modular, easily testable microservice and serverless applications. By avoiding runtime reflection in favour of annotation processing, Micronaut improves the Java-based development experience by detecting errors at compile time instead of runtime and improves Java-based application start time and memory footprint. Micronaut includes a persistence framework called Micronaut Data that precomputes your SQL queries at compilation time making it a great fit for working with databases like MySQL, Oracle Autonomous Database, etc.
15
+
- Micronaut is a modern, JVM-based framework to build modular, easily testable microservice and serverless applications. By avoiding runtime reflection in favour of annotation processing, Micronaut improves the Java-based development experience by detecting errors at compile time instead of runtime and improves Java-based application start time and memory footprint. Micronaut includes a persistence framework called Micronaut Data that precomputes your SQL queries at compilation time making it a great fit for working with databases like Oracle Autonomous Database, MySQL, etc.
16
16
17
17
- Micronaut uses GraalVM Native Image to build lightweight Java applications that use less memory and CPUs, and are smaller and faster because of an advanced ahead-of-time compilation technology.
18
18
@@ -32,8 +32,8 @@ This sample shows how to use `Oracle GraalVM Enterprise Edition` in `OCI DevOps
32
32
## Objectives
33
33
34
34
- Create an OCI build pipeline.
35
-
- Make a build using Oracle GraalVM Enterprise edition.
36
-
- Here the focus will be on Build instructions and OCI build pipeline
35
+
- Make a build using Oracle GraalVM Enterprise Edition.
36
+
- Here the focus will be on the build specification and DevOps build pipeline
37
37
38
38
39
39
## Procedure to use this illustration.
@@ -61,8 +61,6 @@ ALL {resource.type = 'devopsrepository', resource.compartment.id = 'COMPARMENT O
61
61
```markdown
62
62
Allow dynamic-group "NAME OF THE DynamicGroup" to manage repos in compartment "COMPARTMENT NAME"
63
63
Allow dynamic-group "NAME OF THE DynamicGroup" to use ons-topics in compartment "COMPARTMENT NAME"
64
-
65
-
Allow dynamic-group "NAME OF THE DynamicGroup" to manage repos in compartment "COMPARTMENT NAME"
66
64
```
67
65
68
66
- Switch back to OCI DevOps Project and create an OCI Code repo - https://docs.oracle.com/en-us/iaas/Content/devops/using/create_repo.htm#create_repo
@@ -73,7 +71,7 @@ Allow dynamic-group "NAME OF THE DynamicGroup" to manage repos in compartment "C
73
71
74
72

75
73
76
-
- You may use other support version control repos as well (like Github.com,Bitbucket.com, Bitbucket Cloud etc). You may also need to adjust the policies according to connection and setup external connections accordingly - https://docs.oracle.com/en-us/iaas/Content/devops/using/create_connection.htm
74
+
- You may use other supported version control repos as well (like Github.com,Bitbucket.com, Bitbucket Cloud, etc). You may also need to adjust the policies according to the connection and setup external connections accordingly - https://docs.oracle.com/en-us/iaas/Content/devops/using/create_connection.htm
77
75
78
76
- Create a new build pipeline. - https://docs.oracle.com/en-us/iaas/Content/devops/using/create_buildpipeline.htm
79
77
@@ -98,14 +96,14 @@ Allow dynamic-group "NAME OF THE DynamicGroup" to manage repos in compartment "C
98
96
99
97
## Take a closer look at the build instructions below
100
98
101
-
To install and use GraalVM Enterprise with Micronaut REST in the DevOps build pipeline, the build specification file is as follows:
99
+
To install and use GraalVM Enterprise with Micronaut REST in the DevOps build pipeline, the build specification file is as follows:
102
100
103
101
1. Add the following command to install one or more required GraalVM Enterprise components. For example, this command installs Native Image along with the Java Development Kit (JDK) and other necessary dependencies.
104
102
105
103
```shell
106
104
steps:
107
105
- type: Command
108
-
name: "Install GraalVM 22.x Native Image for Java17"
106
+
name: "Install GraalVM Enterprise 22.x Native Image for Java17"
109
107
command: |
110
108
yum -y install graalvm22-ee-17-native-image
111
109
```
@@ -179,20 +177,22 @@ Here's the complete [build specification](build_spec.yaml) file.
179
177
180
178
The following instructions will help you to export the `executable app file` to OCI Artifactory and which can then be used in the further stage including deployment pipelines.
181
179
182
-
Or You can create an OCI Container registry and push the build container image which can be used to deploy to the supported container-based platform (Example OKE).
180
+
OR
181
+
182
+
You can create an OCI Container registry and push the build container image which can be used to deploy to the supported container-based platform (Example OKE).
183
183
184
184
- Create an OCI artifact registry. https://docs.oracle.com/en-us/iaas/Content/artifacts/home.htm
185
185
186
186

187
187
188
-
- Create a public OCI Container registry repo - https://docs.oracle.com/en-us/iaas/Content/Registry/home.htm
188
+
- Create a public OCI Container registry repo - https://docs.oracle.com/en-us/iaas/Content/Registry/home.htm
189
189
190
190

191
191
192
192
193
-
- Switch back to `DevOps Project` and create Two `Artifacts`- https://docs.oracle.com/en-us/iaas/Content/devops/using/artifacts.htm
193
+
- Switch back to `DevOps Project` and create two `Artifacts`- https://docs.oracle.com/en-us/iaas/Content/devops/using/artifacts.htm
194
194
195
-
- For the first one select the type as `General artifact`
195
+
- For the first one, select the type as `General artifact`
196
196
197
197

198
198
@@ -203,7 +203,7 @@ Or You can create an OCI Container registry and push the build container image w
203
203
204
204
- Use option `Set Custom Location` as Artifact location.
205
205
- Provide a path and version as `${BUILDRUN_HASH}`, this is to maintain immutable artifacts.
206
-
- The variable `BUILDRUN_HASH` is derived during managed build stage and exported as an exportedVariables.You may use any other name ,but ensure to update the file [build_spec.yaml](build_spec.yaml).
206
+
- The variable `BUILDRUN_HASH` is derived during managed build stage and exported as an exportedVariables.You may use any other name, but ensure to update the file [build_spec.yaml](build_spec.yaml).
207
207
- Select `Yes, substitute placeholders` as an option and click `Add`.
208
208
209
209

@@ -228,7 +228,7 @@ Or You can create an OCI Container registry and push the build container image w
228
228
229
229
- Use name `app_native_executable` result artifact name for artifact reference for `General artifacts` for executable artifact.
230
230
- Use name `runtime_image` result artifact name for artifact reference for `Docker image` for container image artifact.
231
-
- The name `app_native_executable` and `runtime_image` are a references to the `outputArtifacts` defined under the file [build_spec.yaml](build_spec.yaml).
231
+
- The name `app_native_executable` and `runtime_image` are references to the `outputArtifacts` defined under the file [build_spec.yaml](build_spec.yaml).
232
232
- Click `Add` and add the stage.
233
233
234
234
- The build pipeline with two stages would look like the one below.
@@ -249,7 +249,7 @@ Or You can create an OCI Container registry and push the build container image w
249
249

250
250
251
251
- Validate the outcome - `executable artifact` or `container image`.
252
-
- Switch to `OCI Container registry repo` and you should see a container image, which can be used to deploy onto any supported platform (Example: OKE) or can refer to the OCI Deployment pipeline too.
252
+
- Switch to `OCI Container registry repo` and you should see a container image, which can be used to deploy onto any supported platform (Example: OKE) or can refer to the OCI Deployment pipeline too.
253
253
254
254

255
255
@@ -261,17 +261,17 @@ Or You can create an OCI Container registry and push the build container image w
261
261
262
262
- An additional build instruction file as [build_spec_verbose.yaml](build_spec_verbose.yaml)
263
263
can be used for more verbose output with the managed build.
264
-
- To do so, switch to `OCI DevOps project`>`OCI Build pipeline`> Click `3 dots` on the `Managed Build` stage and click on `View details` and then`Edit Stage`.
264
+
- To do so, switch to `OCI DevOps project`>`OCI Build pipeline`> Click `3 dots` on the `Managed Build` stage and click on `View details` and then`Edit Stage`.
265
265
266
266

267
267
268
-
- Change `Build spec file path` as `build_spec_verbose.yaml` and `Save changes`
268
+
- Change `Build spec file path` as `build_spec_verbose.yaml` and `Save changes`
269
269
270
270

271
271
272
272
- Do another manal run for the build pipeline and you will see more verbose build logs.
273
273
274
-
## Sample Build Logs (Non-verbose mode)
274
+
## Sample Build Logs
275
275
276
276
1. The `yum install` build log statements should be similar to:
277
277
@@ -338,7 +338,8 @@ Or You can create an OCI Container registry and push the build container image w
0 commit comments