diff --git a/microservices-with-converged-db/helidon/helidon.md b/microservices-with-converged-db/helidon/helidon.md index 1b0c8ae..9ac29f4 100644 --- a/microservices-with-converged-db/helidon/helidon.md +++ b/microservices-with-converged-db/helidon/helidon.md @@ -22,15 +22,31 @@ This lab assumes you have: - Provisioned environment with Git and Maven (Cloud Shell). -## Task 1: Clone the repos +## Task 1: Install GraalVM 22 and dd to project dir -1. Clone the following repos: +1. Open Cloud Shell and make sure you're using X86_64 as your target architecture as was done during the setup lab + +2. Cd to the following directory of the repos you cloned during setup. For example, if you cloned to your user's $HOME directory: ``` - git clone https://github.com/paulparkinson/microservices-datadriven-devrel.git + sdk list java + sdk install java 22.0.2-graal + sdk use java 22.0.2-graal + sdk current + csruntimectl java list + csruntimectl java set graalvmjdk-17 + ``` + + +3. Cd to the following directory of the repos you cloned during setup. For example, if you cloned to your user's $HOME directory: + ``` + + cd $HOME/microservices-datadriven/graalvm-nativeimage/helidon + + ``` ## Task 2: Build and run @@ -42,7 +58,7 @@ This lab assumes you have: ```properties javax.sql.DataSource.example.connectionFactoryClassName=oracle.jdbc.pool.OracleDataSource - javax.sql.DataSource.example.URL=jdbc:oracle:thin:@?TNS_ADMIN=/path/to/wallet + javax.sql.DataSource.example.URL=jdbc:oracle:thin:@_high?TNS_ADMIN=/home//myatpwallet javax.sql.DataSource.example.user=ADMIN javax.sql.DataSource.example.password= ``` diff --git a/microservices-with-converged-db/micronaut/micronaut.md b/microservices-with-converged-db/micronaut/micronaut.md index ba75dd1..a05af19 100644 --- a/microservices-with-converged-db/micronaut/micronaut.md +++ b/microservices-with-converged-db/micronaut/micronaut.md @@ -28,7 +28,11 @@ This lab assumes you have: ## Task 1: Download and install the Micronaut CLI -1. To install the Micronaut CLI on Linux, you can use SDKMAN!. Open a terminal and run: +1. Open Cloud Shell and make sure you're using X86_64 as your target architecture as was done during the setup lab + + ![Cloud Shell Architecture](../setup/images/cloud-shell-architecture.png "cloud shell architecture") + +2. To install the Micronaut CLI on Linux, you can use SDKMAN!. Open a terminal and run: ``` @@ -52,15 +56,13 @@ This lab assumes you have: You should see `Micronaut Version: 4.6.2` as the installed Micronaut CLI version. -## Task 2: Clone and build the project +## Task 2: Cd to project dir and build the project -1. Create a new directory of your choice, then clone the workshop code into it. As an example, the new directory below will be created at the root of your user's $HOME directory: +1. Cd to the following directory of the repos you cloned during setup. For example, if you cloned to your user's $HOME directory: ``` - mkdir micronaut-graalvm-oracledb - cd micronaut-graalvm-oracledb - git clone https://github.com/juarezjuniorgithub/micronaut-guide.git + cd $HOME/microservices-datadriven/graalvm-nativeimage/micronaut ``` @@ -103,7 +105,7 @@ This lab assumes you have: sdk use java 22.0.2-graal ``` - You have to end your current Cloud Shell session, and start a new session to have it reflected after running the commands above. Then, run the commands below to confirm Java 22 as your current version. + **Note: You must end your current Cloud Shell session, and start a new session to have it reflected after running the commands above. You can do this by selecting `Actions` in the upper left of the Cloud Shell and `Restart`. Then, run the commands below to confirm Java 22 as your current version. ``` @@ -131,6 +133,7 @@ This lab assumes you have: ![project build success](images/project-build-success.png) + ## Task 3: Configure Micronaut Data with your Oracle ADB instance details 1. We’ll use an application properties file. Below is an example with the relevant details you must provide. Navigate to your `application.properties` file under `$HOME//micronaut-graalvm-oracledb/micronaut-guide/src/main/resources`: @@ -178,9 +181,9 @@ 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 =50%x*) + ![sql script flyway](images/sql-script-flyway.png) -## Task 4: A first run with VS Code only and the JIT (C2) compiler +## Task 4: A first run with Java 1. The Micronaut application is now finished and ready to be executed. So, you can compile, build, and run it with Maven from the command-line. diff --git a/microservices-with-converged-db/quarkus/quarkus.md b/microservices-with-converged-db/quarkus/quarkus.md index 0647ada..5614a26 100644 --- a/microservices-with-converged-db/quarkus/quarkus.md +++ b/microservices-with-converged-db/quarkus/quarkus.md @@ -18,20 +18,17 @@ This lab assumes you have: ## Task 1: Clone the repos -1. Clone the following repos: +## Task 1: Cd to project dir and build the project - ``` - - git clone https://github.com/juarezjuniorgithub/jdbc-driver-graalvm-nativeimage.git - - ``` +1. Open Cloud Shell and make sure you're using X86_64 as your target architecture as was done during the setup lab + +2. Cd to the following directory of the repos you cloned during setup. For example, if you cloned to your user's $HOME directory: - And cd into the directory... ``` - cd jdbc-driver-graalvm-nativeimage + cd $HOME/microservices-datadriven/graalvm-nativeimage/quarkus - ``` + ``` ## Task 2: Build and run diff --git a/microservices-with-converged-db/setup/images/cloud-shell-architecture.png b/microservices-with-converged-db/setup/images/cloud-shell-architecture.png new file mode 100644 index 0000000..b44d871 Binary files /dev/null and b/microservices-with-converged-db/setup/images/cloud-shell-architecture.png differ diff --git a/microservices-with-converged-db/setup/images/cloud-shell-confirmation.png b/microservices-with-converged-db/setup/images/cloud-shell-confirmation.png new file mode 100644 index 0000000..5fa1920 Binary files /dev/null and b/microservices-with-converged-db/setup/images/cloud-shell-confirmation.png differ diff --git a/microservices-with-converged-db/setup/images/open-cloud-shell.png b/microservices-with-converged-db/setup/images/open-cloud-shell.png index 20abc27..0f6f1aa 100644 Binary files a/microservices-with-converged-db/setup/images/open-cloud-shell.png and b/microservices-with-converged-db/setup/images/open-cloud-shell.png differ diff --git a/microservices-with-converged-db/setup/images/oracledatabase-ociconsole.png b/microservices-with-converged-db/setup/images/oracledatabase-ociconsole.png new file mode 100644 index 0000000..dd3799e Binary files /dev/null and b/microservices-with-converged-db/setup/images/oracledatabase-ociconsole.png differ diff --git a/microservices-with-converged-db/setup/setup-graalvm-workshop.md b/microservices-with-converged-db/setup/setup-graalvm-workshop.md index b5021e9..5e1a07e 100644 --- a/microservices-with-converged-db/setup/setup-graalvm-workshop.md +++ b/microservices-with-converged-db/setup/setup-graalvm-workshop.md @@ -21,9 +21,9 @@ Your own Oracle Cloud Infrastructure compartment for running this workshop has b ![Copy Comp Name](images/copy-comp-name.png " ") -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. +2. Select the navigation menu from the top left corner of the Oracle Cloud Console and navigate to "Oracle Database" and then, on the right, click "Autonomous Transaction Processing" (ATP) . - ![Select component instances](images/select-compute-instances.png " ") + ![Select component instances](images/oracledatabase-ociconsole.png " ") 3. Search for compartment using the compartment name from step#1 in the "Compartment" field under "List Scope". @@ -35,7 +35,7 @@ Your own Oracle Cloud Infrastructure compartment for running this workshop has b ![Enter correct component name](images/correct-comp-name.png " ") -5. Select your database from the list and explore! +5. Select your pre-provisioned database from the list and explore! @@ -43,26 +43,62 @@ Your own Oracle Cloud Infrastructure compartment for running this workshop has b 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. - 1. Click the Cloud Shell icon in the top-right corner of the Console. + 1. Verify you are in the correct compartment (this was done as part of Task 1). + + 2. Click the Cloud Shell icon in the top-right corner of the Console. ![Open Cloud Shell](images/open-cloud-shell.png =50%x*) + 3. Make sure you're using X86_64 as your target architecture. Click Actions, then click Architecture. + + ![Cloud Shell Architecture](../setup/images/cloud-shell-architecture.png "cloud shell architecture") + + 4. Select the *X86_64* radio button, then click the *Confirm* button if it was not already selected as the default architecture. + + ![Cloud Shell Confirmation](../setup/images/cloud-shell-confirmation.png "cloud shell confirmation") + >**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 -## Task 3: Download the wallet of your pre-provisioned ATP instance +## Task 3: Download the wallet of your pre-provisioned ATP instance (used to make connections in the Java/GraalVM app) + + 1. Create a directory to hold the wallet files... - 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. + ``` + + mkdir ~/myatpwallet + + ``` - oci db autonomous-database list --compartment-id --display-name "" - 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. + 2. Copy the database ocid from the workshop reservation page described in the "Get Started" lab and issue the following command in the Cloud Shell. Use the ocid as the `autonomous-database-id` and arbitrary values for the `file` and (wallet) `password`. - oci db autonomous-database generate-wallet --autonomous-database-id --file ~/myatpwallet.zip --password + ``` + + oci db autonomous-database generate-wallet --autonomous-database-id --file ~/myatpwallet/myatpwallet.zip --password + + ``` - 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) + 3. Finally, unzip it the wallet file to a directory such as... + + ``` + + cd ~/myatpwallet ; unzip myatpwallet.zip ; cd ~ + + ``` > **Note:** Cloud Shell sessions have a maximum length of 24 hours, and time out after 20 minutes of inactivity. +## Task 4: Clone the GitHub source code repos + +1. Clone the src... + + ``` + + git clone https://github.com/oracle-devrel/microservices-datadriven.git + + ``` + + You may now proceed to the next lab. diff --git a/microservices-with-converged-db/springboot/springboot.md b/microservices-with-converged-db/springboot/springboot.md index 5fefbc9..b2abf85 100644 --- a/microservices-with-converged-db/springboot/springboot.md +++ b/microservices-with-converged-db/springboot/springboot.md @@ -16,44 +16,38 @@ This lab assumes you have: - Provisioned environment with Git and Maven (Cloud Shell). -## Task 1: Clone the repos +## Task 1: Cd to project dir and build the project -1. Clone the following repos: +1. Open Cloud Shell and make sure you're using X86_64 as your target architecture as was done during the setup lab - ``` - - git clone https://github.com/juarezjuniorgithub/jdbc-driver-graalvm-nativeimage.git - - ``` +2. Cd to the following directory of the repos you cloned during setup. For example, if you cloned to your user's $HOME directory: - And cd into the directory... ``` - cd jdbc-driver-graalvm-nativeimage + cd $HOME/microservices-datadriven/graalvm-nativeimage/springboot - ``` + ``` ## 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`: +1. Edit src/main/java/com/oracle/jdbc/graalvm/GraalVMNativeImageJDBCDriver.java to include appropriate values for URL, user, and password such as the following. + Replace values with those found in the workshop `Reservation Information` page and the explicit home directory path as appropriate... + - ```properties - javax.sql.DataSource.example.connectionFactoryClassName=oracle.jdbc.pool.OracleDataSource - javax.sql.DataSource.example.URL=jdbc:oracle:thin:@?TNS_ADMIN=/path/to/wallet - javax.sql.DataSource.example.user=ADMIN - javax.sql.DataSource.example.password= + ```java + //notice the servicename suffix appended, which can be _high, _low, ... + ods.setURL("jdbc:oracle:thin:@${ATP Name}_high?TNS_ADMIN=/home/${MY_HOME_DIR}/myatpwallet"); + ods.setUser("ADMIN"); + ods.setPassword("[ATP Admin Password]"); ``` - *Note that the values of the password and path to wallet are those that were collected during setup. + *Again note that the values of the password and path to wallet are those that were collected during setup. -2. Build and run +2. Build and run the following and notice the `Hello World!` output after startup, indicating a connection has been made to the ATP instance ``` - mvn clean package exec:java -Dexec.mainClass="com.oracle.jdbc.graalvm.App" + mvn clean package exec:java -Dexec.mainClass="com.oracle.jdbc.graalvm.GraalVMNativeImageJDBCDriver" ``` @@ -62,10 +56,10 @@ This lab assumes you have: ``` - mvn -Pnative packagemvn -Pnative package + mvn -Pnative package ``` - + This will take a bit of time to complete. On the order of 10 or 15 minutes. When complete, run the native image generated... ```