Skip to content

Commit 0582771

Browse files
authored
WMS ID 11729 - Build a Java application with the Graal Development Kit for Micronaut (GDK), Oracle Cloud Infrastructure (OCI) Autonomous Database (ADB) and Secrets in Vault (oracle-livelabs#403)
* Add gdk-oci-adb to the fork * Update configure-app.md
1 parent 8f5696b commit 0582771

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1537
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Introduction
2+
3+
## About this Workshop
4+
5+
This workshop takes you step by step through the process of building a Java application with the Graal Development Kit for Micronaut (GDK), Oracle Cloud Infrastructure (OCI) Autonomous Database (ADB) service and Secrets in OCI Vault.
6+
You'll use GraalVM Native Image to package and run the application as a native executable.
7+
8+
It is aimed at application developers and DevOps engineers with an intermediate knowledge of Java.
9+
10+
Estimated Workshop Time: 75 minutes
11+
12+
### What is Graal Development Kit for Micronaut?
13+
14+
The [Graal Development Kit for Micronaut (GDK)](https://graal.cloud/gdk) is an Oracle build of the open source Micronaut® framework. The GDK provides a curated set of Micronaut framework modules that simplify cloud application development, are designed for ahead-of-time compilation with GraalVM Native Image, and are fully supported by Oracle. The GDK also provides project creation utilities, VS Code and IntelliJ extensions to simplify application development and deployment.
15+
16+
### What is Micronaut?
17+
18+
The [Micronaut® framework](https://micronaut.io/) is a modern, JVM-based framework to build modular, easily testable microservice and serverless applications. By avoiding runtime reflection in favor of annotation processing, Micronaut improves the Java-based development experience by detecting errors at compile time instead of runtime, and improves Java-based application startup 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.
19+
20+
> Micronaut® is a registered trademark of Object Computing, Inc. Use is for referential purposes and does not imply any endorsement or affiliation with any third-party product.
21+
22+
### What is GraalVM Native Image?
23+
24+
[GraalVM Native Image](https://www.graalvm.org/) technology compiles Java applications ahead-of-time into self-contained native executables that are small in size, start almost instantaneously, provide peak performance with no warmup, and require less memory and CPU. Only the code that is required at run time by the application gets added into the executable file. Native Image is perfect for containerized workloads and microservices — which is why it has been embraced by Micronaut, Spring Boot, Helidon, and Quarkus.
25+
26+
The GDK modules are designed for ahead-of-time compilation with GraalVM Native Image to produce native executables that are ideal for microservices: they have a small memory footprint, start instantly, and provide peak performance with no warmup.
27+
28+
> Graal Development Kit for Micronaut, and Oracle GraalVM are available at no additional cost on Oracle Cloud Infrastructure (OCI).
29+
30+
### Objectives
31+
32+
In this workshop, you will:
33+
34+
* Create a new OCI Autonomous Database instance and a Vault
35+
* Use Visual Studio Code (VS Code) from a remote desktop running in an OCI Compute Instance
36+
* Review the application source code developed with the Graal Development Kit for Micronaut
37+
* Configure the Autonomous Database instance and the Vault
38+
* Configure the application to use the Autonomous Database instance and the Vault
39+
* Build a native executable for the application using GraalVM Native Image
40+
* Test the application with the Autonomous Database instance using database credentials stored as secrets in the Vault
41+
42+
### Prerequisites
43+
44+
This workshop assumes you have:
45+
46+
* Some familiarity with Oracle Cloud Infrastructure (OCI)
47+
* Understanding of the Java programming language
48+
* Oracle GraalVM for JDK 17
49+
* Visual Studio Code (VS Code)
50+
* A browser with access to the internet
51+
* An Oracle Cloud Infrastructure (OCI) account with adequate permissions
52+
53+
## Learn More
54+
55+
* [Graal Development Kit for Micronaut](https://graal.cloud/gdk/)
56+
57+
## Acknowledgements
58+
59+
* **Author** - [](var:author)
60+
* **Contributors** - [](var:contributors)
61+
* **Last Updated By/Date** - [](var:last_updated)
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Prepare Setup
2+
3+
## Introduction
4+
5+
This lab will show you how to download the Oracle Resource Manager (ORM) stack zip file needed to set up the resources needed to run this workshop.
6+
7+
*Estimated Lab Time:* 5 minutes
8+
9+
### Objectives
10+
11+
* Download ORM stack
12+
* (*Optional*) Configure an existing Virtual Cloud Network (VCN)
13+
* Select a Compartment for the workshop
14+
15+
### Prerequisites
16+
17+
This lab assumes you have:
18+
19+
* An Oracle Cloud account
20+
21+
## Task 1: Download Oracle Resource Manager (ORM) stack zip file
22+
23+
1. Click on the link below to download the Resource Manager zip file you need to build your environment:
24+
25+
* [gdk-oci-adb-ll-orm.zip](https://c4u04.objectstorage.us-ashburn-1.oci.customer-oci.com/p/EcTjWk2IuZPZeNnD_fYMcgUhdNDIDA6rt9gaFj_WZMiL7VvxPBNMY60837hu5hga/n/c4u04/b/livelabsfiles/o/oci-library/gdk-oci-adb-ll-orm.zip)
26+
27+
2. Save it in your downloads folder.
28+
29+
3. (*Recommended*) We strongly recommend using this stack to create a new self-contained/dedicated VCN along with your instance. Skip to **Task 3** to follow the recommendation.
30+
31+
4. Alternatively, if you would rather use an existing VCN then proceed to the next task to update your existing VCN with the required network security rules.
32+
33+
## Task 2: Add Network Security Rules to an Existing VCN
34+
35+
This workshop requires a certain number of ports to be available, a requirement that is automatically met by using the default ORM stack execution that creates a new dedicated VCN.
36+
37+
However, if you would rather use an existing VCN/subnet, follow these steps to add the following rules to the network security list.
38+
39+
1. From the Oracle Cloud Console navigation menu, go to **Networking >> Virtual Cloud Networks**.
40+
2. Choose your network.
41+
3. Under **Resources**, select **Security Lists**.
42+
4. Click on **Default Security Lists** under the **Create Security List** button.
43+
5. Click **Add Ingress Rules** button.
44+
6. Create a rule for each row in the *Ingress* table below:
45+
46+
| Stateless | Source Type | Source CIDR | IP Protocol | Source Port Range | Destination Port Range | Description |
47+
| :------------- | :---------: | :---------: | :---------: | :---------------: | :--------------------: | :------------------------- |
48+
| No (unchecked) | CIDR | 0.0.0.0/0 | TCP | All | 80 | Remote Desktop using noVNC |
49+
| No (unchecked) | CIDR | 0.0.0.0/0 | TCP | All | 6080 | Remote Desktop using noVNC |
50+
{: title="Network Ingress Security Rules"}
51+
52+
7. Select **Egress Rule** from the left panel.
53+
8. Click **Add Egress Rule** button
54+
9. Create a rule for each row in the *Egress* table below:
55+
56+
| Stateless | Source Type | Destination CIDR | IP Protocol | Source Port Range | Destination Port Range | Description |
57+
| :------------- | :---------: | :--------------: | :---------: | :---------------: | :--------------------: | :-------------------- |
58+
| No (unchecked) | CIDR | 0.0.0.0/0 | TCP | All | 80 | Outbound HTTP access |
59+
| No (unchecked) | CIDR | 0.0.0.0/0 | TCP | All | 443 | Outbound HTTPS access |
60+
{: title="Network Egress Security Rules"}
61+
62+
## Task 3: Select a Compartment for the Workshop
63+
64+
We recommend you use a single compartment for the workshop. We will refer to this as your workshop compartment. This is the compartment where you will provision all the resources - Oracle Resource Manager (ORM) Stack, Compute Instance, VCN/Subnet, Instance Principals, Policies, Autonomous Database, Vault - needed for the workshop.
65+
66+
1. From the Oracle Cloud Console navigation menu, go to **Identity & Security >> Identity >> Compartments**.
67+
2. Go to your workshop compartment.
68+
3. Make a note of the compartment name and OCID. You will need this information in subsequent labs.
69+
70+
## Task 4: Setup Compute
71+
72+
Using the details from the above Tasks, proceed to the **Environment Setup** lab to set up your workshop environment using Oracle Resource Manager (ORM) with one of the following options:
73+
74+
* (*Recommended*) Create Stack: **Compute + Networking**
75+
* Create Stack: **Compute only** with an existing VCN where security lists have been updated as per **Task 2** above
76+
77+
The ORM stack will provision a compute instance with 4 OCPUs, 64 GB RAM and a Remote Desktop environment.
78+
79+
You may now **proceed to the next lab**.
80+
81+
## Acknowledgements
82+
83+
* **Author** - [](var:author)
84+
* **Contributors** - [](var:contributors)
85+
* **Last Updated By/Date** - [](var:last_updated)
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Clone the Sample Application Source Code
2+
3+
## Introduction
4+
5+
This lab describes the steps to download the sample application source code used in the workshop.
6+
7+
Estimated Lab Time: 5 minutes
8+
9+
### Objectives
10+
11+
In this lab, you will:
12+
13+
* Clone the sample application source code
14+
15+
## Task 1: Clone the Sample Application Source Code
16+
17+
1. From the **Activities** menu, start a new **Terminal** window.
18+
19+
2. Clone the sample application source code.
20+
21+
``` bash
22+
<copy>
23+
git init lab
24+
cd lab
25+
git remote add origin https://github.com/sachin-pikle/gdk-oci-samples.git
26+
git config core.sparsecheckout true
27+
echo "gdk-oci-adb-mvn/*">>.git/info/sparse-checkout
28+
git pull --depth=1 origin main
29+
</copy>
30+
```
31+
32+
3. Open the sample application source code from the _gdk-oci-adb-mvn_ directory in **Visual Studio Code**.
33+
34+
``` bash
35+
<copy>
36+
code gdk-oci-adb-mvn
37+
</copy>
38+
```
39+
40+
4. VS Code may show a dialog box with the message "Do you trust the authors of the files in this folder?". Select **Trust the authors of all files in the parent folder 'oracle'** and click **Yes, I trust the authors**.
41+
42+
5. VS Code may ask you to choose a password for new keyring. Press **Cancel** twice to close the prompt.
43+
44+
6. VS Code may show a dialog box with the message "A git repository was found in the parent folders of the workspace or the open file(s). Would you like to open the repository?". Click **Never**.
45+
46+
![VS Code Question Icon](images/vs-code-question-icon.jpg#input)
47+
48+
You may now **proceed to the next lab**.
49+
50+
## Acknowledgements
51+
52+
* **Author** - [](var:author)
53+
* **Contributors** - [](var:contributors)
54+
* **Last Updated By/Date** - [](var:last_updated)
29.4 KB
Loading
1.83 MB
Loading
96.5 KB
Loading
70.6 KB
Loading
85 KB
Loading
96.6 KB
Loading
87.1 KB
Loading

0 commit comments

Comments
 (0)