Skip to content

Commit

Permalink
442 for MLH hackathon p4 (#115)
Browse files Browse the repository at this point in the history
* init for graalvm workshops

* init for graalvm workshops

* init for graalvm workshops

* init for graalvm workshops

* init for graalvm workshops

* init for graalvm workshops

* init for graalvm workshops

* init for graalvm workshops

* init for graalvm workshops
  • Loading branch information
paulparkinson authored Oct 1, 2024
1 parent cf55356 commit 745d709
Show file tree
Hide file tree
Showing 10 changed files with 206 additions and 27 deletions.
2 changes: 1 addition & 1 deletion microservices-with-converged-db/micronaut/micronaut.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ This lab assumes you have:
Nevertheless, the related SQL script can be found under the `$HOME//micronaut-graalvm-oracledb/micronaut-guide/src/main/resources/db/migration` directory, as shown below.
![sql script flyway](images/sql-script-flyway.png)
![sql script flyway](images/sql-script-flyway.png =50%x*)
## Task 4: A first run with VS Code only and the JIT (C2) compiler
Expand Down
81 changes: 81 additions & 0 deletions microservices-with-converged-db/quarkus/quarkus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Develop with Oracle Database 23ai and GraalVM using Quarkus

## Introduction

This lab walks you through the steps to develop with Oracle Database 23ai and GraalVM using Quarkus
Estimated Time: 30 minutes

### Objectives

In this lab, you will:
- Develop with Oracle Database 23ai and GraalVM using Quarkus

### Prerequisites

This lab assumes you have:
- Provisioned environment with Git and Maven (Cloud Shell).


## Task 1: Clone the repos

1. Clone the following repos:

```
<copy>
git clone https://github.com/juarezjuniorgithub/jdbc-driver-graalvm-nativeimage.git
</copy>
```
And cd into the directory...
```
<copy>
cd jdbc-driver-graalvm-nativeimage
</copy>
```
## Task 2: Build and run
1. To ensure that the sample application is configured to talk to the
Oracle ATP database running in OCI, verify that the
following lines (among others) are set to correct values in
`src/main/resources/META-INF/microprofile-config.properties`:
```properties
javax.sql.DataSource.example.connectionFactoryClassName=oracle.jdbc.pool.OracleDataSource
javax.sql.DataSource.example.URL=jdbc:oracle:thin:@<tnsServiceName>?TNS_ADMIN=/path/to/wallet
javax.sql.DataSource.example.user=ADMIN
javax.sql.DataSource.example.password=<password>
```

*Note that the values of the password and path to wallet are those that were collected during setup.

2. Build and run

```
<copy>
mvn clean package exec:java -Dexec.mainClass="com.oracle.jdbc.graalvm.App"
</copy>
```
3. Now build and run the native image. This will take some time (up to 10 minutes)
```
<copy>
mvn -Pnative packagemvn -Pnative package
</copy>
```
```
<copy>
target/jdbc-driver-graalvm-nativeimage
</copy>
```
## Acknowledgements
* **Author** - Paul Parkinson, Architect and Developer Advocate; Juarez Barbosa, Sr. Principal Java Developer Evangelist, Java Database Access
* **Last Updated By/Date** - Paul Parkinson, 2024
Binary file modified microservices-with-converged-db/setup/images/copy-comp-name.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified microservices-with-converged-db/setup/images/enter-comp-name.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 28 additions & 26 deletions microservices-with-converged-db/setup/setup-graalvm-workshop.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,58 +8,60 @@ Estimates Time: 20 minutes

### Objectives

* Clone the setup and microservices code
* Execute setup
* Select the correct compartment and view Oracle Autonomous Database (ATP) screen
* Start Cloud Shell
* Download wallet for ATP instance


## Task 1: Launch the Cloud Shell
## Task 1: Select the correct compartment and view Oracle Autonomous Database (ATP) screen in OCI console

Cloud Shell is a small virtual machine running a "bash" shell which you access through the Oracle Cloud Console. Cloud Shell comes with a pre-authenticated command line interface connected to the tenancy. It also provides up-to-date tools and utilities.
Your own Oracle Cloud Infrastructure compartment for running this workshop has been assigned to you. The name of the compartment appears on the Launch page.

1. Click the Cloud Shell icon in the top-right corner of the Console.
1. Copy the compartment name (not OCID) from the workshop reservation page.

![Open Cloud Shell](images/open-cloud-shell.png " ")
![Copy Comp Name](images/copy-comp-name.png " ")

>**Note**: Cloud Shell uses websockets to communicate between your browser and the service. If your browser has websockets disabled or uses a corporate proxy that has websockets disabled you will see an error message ("An unexpected error occurred") when attempting to start Cloud Shell from the console. You also can change the browser cookies settings for a specific site to allow the traffic from *.oracle.com
2. Select the navigation menu from the top left corner of the Oracle Cloud Console and navigate to the ATP page in the Oracle Database section.

## Task 2: Download the wallet of your pre-provisioned ATP instance
![Select component instances](images/select-compute-instances.png " ")

1. Copy the compartment-id and database name from the workshop reservation page described in the "Get Started" lab and issue the following command in the Cloud Shell using those values.
3. Search for compartment using the compartment name from step#1 in the "Compartment" field under "List Scope".

oci db autonomous-database list --compartment-id <your-compartment-ocid> --display-name "<ATP_NAME>"
![Enter component name](images/enter-comp-name.png " ")

2. This command should return the ocid of the database which you can use, along with an arbitrary `wallet-password` to run the following command to download the database wallet to the file location provided.
4. Select your compartment name from the drop down list.

oci db autonomous-database generate-wallet --autonomous-database-id <ATP_OCID> --file ~/myatpwallet.zip --password <wallet-password>
![Enter component name](images/select-comp-name.png " ")

2. Finally, unzip it the wallet file to a directory such as ~/myatpwallet (this wallet/directory will be used to make connections in the Java/GraalVM app)
![Enter correct component name](images/correct-comp-name.png " ")

> **Note:** Cloud Shell sessions have a maximum length of 24 hours, and time out after 20 minutes of inactivity.
5. Select your database from the list and explore!


## Task 3: Exploore the ATP instance in OCI Console (Optional)

Your own Oracle Cloud Infrastructure compartment for running this workshop has been assigned to you. The name of the compartment appears on the Launch page.
## Task 2: Launch the Cloud Shell

1. Copy the compartment name (not OCID) from the workshop reservation page.
Cloud Shell is a small virtual machine running a "bash" shell which you access through the Oracle Cloud Console. Cloud Shell comes with a pre-authenticated command line interface connected to the tenancy. It also provides up-to-date tools and utilities.

![Copy Comp Name](images/copy-comp-name.png " ")
1. Click the Cloud Shell icon in the top-right corner of the Console.

2. Select the navigation menu from the top left corner of the Oracle Cloud Console and navigate to the ATP page in the Oracle Database section.
![Open Cloud Shell](images/open-cloud-shell.png =50%x*)

![Select component instances](images/select-compute-instances.png " ")
>**Note**: Cloud Shell uses websockets to communicate between your browser and the service. If your browser has websockets disabled or uses a corporate proxy that has websockets disabled you will see an error message ("An unexpected error occurred") when attempting to start Cloud Shell from the console. You also can change the browser cookies settings for a specific site to allow the traffic from *.oracle.com
3. Search for compartment using the compartment name from step#1 in the "Compartment" field under "List Scope".
## Task 3: Download the wallet of your pre-provisioned ATP instance

![Enter component name](images/enter-comp-name.png " ")
1. Copy the compartment-id and database name from the workshop reservation page described in the "Get Started" lab and issue the following command in the Cloud Shell using those values.

4. Select your compartment name from the drop down list.
oci db autonomous-database list --compartment-id <your-compartment-ocid> --display-name "<ATP_NAME>"

![Enter component name](images/select-comp-name.png " ")
2. This command should return the ocid of the database which you can use, along with an arbitrary `wallet-password` to run the following command to download the database wallet to the file location provided.

![Enter correct component name](images/correct-comp-name.png " ")
oci db autonomous-database generate-wallet --autonomous-database-id <ATP_OCID> --file ~/myatpwallet.zip --password <wallet-password>

5. Select your database from the list and explore!
2. Finally, unzip it the wallet file to a directory such as ~/myatpwallet (this wallet/directory will be used to make connections in the Java/GraalVM app)

> **Note:** Cloud Shell sessions have a maximum length of 24 hours, and time out after 20 minutes of inactivity.

You may now proceed to the next lab.
Expand Down
6 changes: 6 additions & 0 deletions microservices-with-converged-db/springboot/springboot.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ This lab assumes you have:
</copy>
```
And cd into the directory...
```
<copy>
cd jdbc-driver-graalvm-nativeimage
</copy>
```
## Task 2: Build and run
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Oracle LiveLabs gives you access to Oracle's products to run a wide variety of labs and workshops; allowing you to experience our best technology, live!">
<title>Oracle LiveLabs</title>

<script src="https://oracle-livelabs.github.io/common/redwood-hol/js/jquery-1.11.0.min.js"></script>
<script src="https://oracle-livelabs.github.io/common/redwood-hol/js/jquery-ui-1.10.4.custom.js"></script>
<script src="https://oracle-livelabs.github.io/common/redwood-hol/js/main.min.js"></script>

<link rel="stylesheet" href="https://oracle-livelabs.github.io/common/redwood-hol/css/style.min.css" />
<link rel="shortcut icon" href="https://oracle-livelabs.github.io/common/redwood-hol/img/favicon.ico" />
</head>

<body>
<header class="hol-Header" role="banner">
<div class="hol-Header-wrap">
<div class="hol-Header-logo"><span>Oracle LiveLabs</span></div>
<a href="https://livelabs.oracle.com" target="_blank" id="livelabs" title="Oracle LiveLabs"></a>
<div class="hol-Header-actions">
<button id="openNav" class="hol-Header-button hol-Header-button--menu rightNav" aria-label="Open Menu"
title="Open Menu">
<span class="hol-Header-toggleIcon"></span>
</button>
</div>
</div>
</header>

<div id="container">
<div id="leftNav">
<div id="toc"></div>
</div>
<div id="contentBox">
<main class="hol-Content" id="module-content"></main>
</div>
</div>

<footer class="hol-Footer">
<a class="hol-Footer-topLink" href="#top">Return to Top</a>
<div id="footer-banner"><div class="footer-row">
<div class="footer-content"><ul class="footer-links">
<li><a href="https://docs.oracle.com/pls/topic/lookup?ctx=en/legal&id=cpyr" target="_blank" aria-label="Open a new window to Oracle legal notices" data-lbl="copyright">© Oracle</a></li>
<li><a href="https://www.oracle.com/corporate/index.html" target="_blank" aria-label="Open a new window to learn more about oracle" data-lbl="about-oracle">About Oracle</a></li>
<li><a href="https://www.oracle.com/corporate/contact/" target="_blank" aria-label="Open a new window to contact oracle" data-lbl="contact-us">Contact Us</a></li>
<li class="footer-links-break"></li>
<li><a href="https://docs.oracle.com/en/browseall.html" target="_blank" aria-label="Open a new window to products a-z" data-lbl="products-a-z">Products A-Z</a></li>
<li><a href="https://www.oracle.com/legal/privacy/" target="_blank" aria-label="Open a new window to read more about Oracle terms of use and privacy" data-lbl="terms-of-use-and-privacy">Terms of Use & Privacy</a></li>
<li><a href="https://www.oracle.com/legal/privacy/privacy-policy.html#11" target="_blank" aria-label="Open a new window to read more about managing Oracle cookie preferences" data-lbl="cookie-preferences">Cookie Preferences</a></li>
<li><a href="https://www.oracle.com/legal/privacy/marketing-cloud-data-cloud-privacy-policy.html#adchoices" target="_blank" aria-label="Open a new window to ad choices" data-lbl="ad-choices">Ad Choices</a></li>
<li class="footer-links-break"></li><li class="last"><a href="https://docs.oracle.com/pls/topic/lookup?ctx=en/legal&id=cpyr" target="_blank" aria-label="Open a new window to Oracle legal notices" data-lbl="copyright">© Oracle</a></li>
</ul>
</div>
</div>
</div>
</footer>
</body>

</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"workshoptitle": "Develop with Oracle Database 23ai and GraalVM using Quarkus",
"help": "[email protected]",
"tutorials": [
{
"title": "Introduction",
"filename": "../../intro-graalvm/intro-graalvm.md"
},
{
"title": "Get Started",
"description": "Login to Oracle Cloud",
"filename": "https://oracle-livelabs.github.io/common/labs/cloud-login/cloud-login-livelabs2.md"
},
{
"title": "Lab 1: Setup",
"filename": "../../setup/setup-graalvm-workshop.md"
},
{
"title": "Lab 2: Configure, build and run an application that uses Oracle Database 23ai and GraalVM using Quarkus",
"filename": "../../quarkus/quarkus.md"
},
{
"title": "Need Help?",
"description": "Solutions to Common Problems and Directions for Receiving Live Help",
"filename":"https://oracle-livelabs.github.io/common/labs/need-help/need-help-livelabs.md"
}
]
}

0 comments on commit 745d709

Please sign in to comment.