diff --git a/heatwave-genai/connect-dbs-vscode/connect-dbs-vscode.md b/heatwave-genai/connect-dbs-vscode/connect-dbs-vscode.md new file mode 100644 index 00000000..09565179 --- /dev/null +++ b/heatwave-genai/connect-dbs-vscode/connect-dbs-vscode.md @@ -0,0 +1,161 @@ +# Connect to the HeatWave Instance + +## Introduction + +In this lab you will setup MySQL Shell for Visual Studio Code, and connect to the HeatWave instance you created in Lab 1 from VS Code. + +_Estimated Time:_ 30 minutes + +### Objectives + +In this lab, you will be guided through the following tasks: + +- Setup MySQL Shell for Visual Studio Code. +- Connect to the OCI tenancy. +- Connect to the HeatWave instance. + +### Prerequisites + +- You have completed Lab 2. +- Visual Studio Code is installed. If you do not have it installed, download and install from [here](https://code.visualstudio.com/download). + +## Task 1: Setup MySQL Shell for Visual Studio Code + +1. Launch **Visual Studio Code**. + +2. Click **Extensions** and search for **MySQL Shell for VS Code**. + +3. Click **Install**. + ![Installing MySQL Shell for VS Code](./images/1-installing-mysql-shell-for-vscode.png "Installing MySQL Shell for VS Code") + +4. After MySQL Shell for VS Code is installed, you can see the following icon: + ![MySQL Shell installed](./images/2-installed-mysql-shell-for-vscode.png "MySQL Shell installed") + + + + +## Task 2: Connect to the HeatWave instance + +1. In Visual Studio Code, click the **MySQL Shell for VS Code** icon in the activity bar. + +2. Click **Create New DB Connection**. + + ![Create New DB Connection](./images/connect-database.png "Create New DB Connection") + +3. In the **Database Connection Configuration** dialog, enter/select the following: + + - **Database Type**: **MySQL** + + - **Caption**: + + ```bash + heatwave-genai-db-connection + ``` + +4. Under **Connection Details**, in the **Basic** tab, enter the following: + + - **Hostname or IP Address**: Private IP address of the DB system that you had noted in Lab 1, Task 5, Step 19. + + - **User Name**: + + ```bash + admin + ``` + + - **Tunneling Options**: Select **Connect Using SSH Tunnel**. + + ![Database Connection Configuration](./images/database-connection-details.png "Database Connection Configuration") + +5. Click **Store Passsword**, and enter the password. + + ![Enter password](./images/password.png "Enter password") + +6. Under **Connection Details**, click **SSH Tunnel**. + + ![Click SSH tunnel](./images/ssh-tunnel.png "Click SSH tunnel") + +7. Enter the following details: + + - **SSH URI**: opc@ComputeIPAddress. Replace ComputeIPAddress with the IP address of the compute that you had noted in Lab 2, Task 1, Step 13. + + - **SSH Private Key File**: Browse to the SSH folder and select the SSH key + + - **Custom Path for the SSH Configuration File**: Browse to the SSH folder and select the SSH key + + ![SSH details](./images/ssh-details.png "SSH details") + +8. Click **OK**. + +9. Under **DATABASE CONNECTIONS**, click **Open New Database Connection** icon next to your HeatWave instance to connect to it. + + ![Open New Database Connection](./images/open-connection.png "Open New Database Connection") + +10. Click **Yes** to confirm your connection request. + + ![Confirm New Database Connection](./images/confrm-connection.png "Confirm New Database Connection") + +11. Check whether you are connected to the HeatWave instance by entering the following command and clicking **Execute the selection or full block on HeatWave and create a new block**. + + ```bash + show databases; + ``` + + ![New Database Connection](./images/12-show-databases.png "New Database Connection") + +You may now **proceed to the next lab**. + +## Learn More + +- [HeatWave User Guide](https://dev.mysql.com/doc/heatwave/en/) + +- [HeatWave on OCI User Guide](https://docs.oracle.com/en-us/iaas/mysql-database/index.html) + +- [MySQL Documentation](https://dev.mysql.com/) + +## Acknowledgements + +- **Author** - Aijaz Fatima, Product Manager +- **Contributors** - Mandy Pang, Senior Principal Product Manager +- **Last Updated By/Date** - Aijaz Fatima, Product Manager, August 2024 \ No newline at end of file diff --git a/heatwave-genai/connect-dbs-vscode/images/1-cloud-account-name.png b/heatwave-genai/connect-dbs-vscode/images/1-cloud-account-name.png new file mode 100644 index 00000000..10a14eb9 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/1-cloud-account-name.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/1-installing-mysql-shell-for-vscode.png b/heatwave-genai/connect-dbs-vscode/images/1-installing-mysql-shell-for-vscode.png new file mode 100644 index 00000000..4454660e Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/1-installing-mysql-shell-for-vscode.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/10-database-connection.png b/heatwave-genai/connect-dbs-vscode/images/10-database-connection.png new file mode 100644 index 00000000..1f24ca9f Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/10-database-connection.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/11-load-llm.png b/heatwave-genai/connect-dbs-vscode/images/11-load-llm.png new file mode 100644 index 00000000..3cff76a8 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/11-load-llm.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/11-open-database-connection.png b/heatwave-genai/connect-dbs-vscode/images/11-open-database-connection.png new file mode 100644 index 00000000..c47ce29c Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/11-open-database-connection.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/12-llm-response.png b/heatwave-genai/connect-dbs-vscode/images/12-llm-response.png new file mode 100644 index 00000000..06526c59 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/12-llm-response.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/12-show-databases.png b/heatwave-genai/connect-dbs-vscode/images/12-show-databases.png new file mode 100644 index 00000000..319a5058 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/12-show-databases.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/13-summarize-query.png b/heatwave-genai/connect-dbs-vscode/images/13-summarize-query.png new file mode 100644 index 00000000..e4df6e7a Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/13-summarize-query.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/14-llm-summarize.png b/heatwave-genai/connect-dbs-vscode/images/14-llm-summarize.png new file mode 100644 index 00000000..7f1e8ecd Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/14-llm-summarize.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/15-identity-domain.png b/heatwave-genai/connect-dbs-vscode/images/15-identity-domain.png new file mode 100644 index 00000000..6ed41588 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/15-identity-domain.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/16-default-identity-domain.png b/heatwave-genai/connect-dbs-vscode/images/16-default-identity-domain.png new file mode 100644 index 00000000..a220b8d5 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/16-default-identity-domain.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/17-oci-api-key.png b/heatwave-genai/connect-dbs-vscode/images/17-oci-api-key.png new file mode 100644 index 00000000..31617862 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/17-oci-api-key.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/18-new-connection.png b/heatwave-genai/connect-dbs-vscode/images/18-new-connection.png new file mode 100644 index 00000000..25996f3e Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/18-new-connection.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/2-installed-mysql-shell-for-vscode.png b/heatwave-genai/connect-dbs-vscode/images/2-installed-mysql-shell-for-vscode.png new file mode 100644 index 00000000..883e9734 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/2-installed-mysql-shell-for-vscode.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/2-username.png b/heatwave-genai/connect-dbs-vscode/images/2-username.png new file mode 100644 index 00000000..2eaf7c99 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/2-username.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/3-profile.png b/heatwave-genai/connect-dbs-vscode/images/3-profile.png new file mode 100644 index 00000000..c708d0b3 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/3-profile.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/4-add-api-key.png b/heatwave-genai/connect-dbs-vscode/images/4-add-api-key.png new file mode 100644 index 00000000..e5d3e575 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/4-add-api-key.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/5-copy-config.png b/heatwave-genai/connect-dbs-vscode/images/5-copy-config.png new file mode 100644 index 00000000..d633fe09 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/5-copy-config.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/6-save-config.png b/heatwave-genai/connect-dbs-vscode/images/6-save-config.png new file mode 100644 index 00000000..dd9fdc56 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/6-save-config.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/7-tenancy-details.png b/heatwave-genai/connect-dbs-vscode/images/7-tenancy-details.png new file mode 100644 index 00000000..273bab79 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/7-tenancy-details.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/8-create-bastion.png b/heatwave-genai/connect-dbs-vscode/images/8-create-bastion.png new file mode 100644 index 00000000..b2fb4a2c Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/8-create-bastion.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/9-create-new-bastion.png b/heatwave-genai/connect-dbs-vscode/images/9-create-new-bastion.png new file mode 100644 index 00000000..fbb41d13 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/9-create-new-bastion.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/confrm-connection.png b/heatwave-genai/connect-dbs-vscode/images/confrm-connection.png new file mode 100644 index 00000000..6e8a5d3b Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/confrm-connection.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/connect-database.png b/heatwave-genai/connect-dbs-vscode/images/connect-database.png new file mode 100644 index 00000000..fd926889 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/connect-database.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/database-connection-details.png b/heatwave-genai/connect-dbs-vscode/images/database-connection-details.png new file mode 100644 index 00000000..146a1839 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/database-connection-details.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/open-connection.png b/heatwave-genai/connect-dbs-vscode/images/open-connection.png new file mode 100644 index 00000000..69ff8259 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/open-connection.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/password.png b/heatwave-genai/connect-dbs-vscode/images/password.png new file mode 100644 index 00000000..b76a3661 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/password.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/ssh-details.png b/heatwave-genai/connect-dbs-vscode/images/ssh-details.png new file mode 100644 index 00000000..dd7a08de Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/ssh-details.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/ssh-tunnel.png b/heatwave-genai/connect-dbs-vscode/images/ssh-tunnel.png new file mode 100644 index 00000000..0b632d55 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/ssh-tunnel.png differ diff --git a/heatwave-genai/create-compute/create-compute.md b/heatwave-genai/create-compute/create-compute.md new file mode 100644 index 00000000..0c0dfc42 --- /dev/null +++ b/heatwave-genai/create-compute/create-compute.md @@ -0,0 +1,94 @@ +# Create Linux Compute Instance + + +## Introduction + +Oracle Cloud Infrastructure Compute lets you provision and manage compute hosts, known as instances . You can create instances as needed to meet your compute and application requirements. After you create an instance, you can access it securely from your computer or cloud shell. + + +**Create Linux Compute Instance** + +In this lab, you use Oracle Cloud Infrastructure to create an Oracle Linux instance. + +_Estimated Time:_ 10 minutes + +### Objectives + +In this lab, you will be guided through the following tasks: + +- Create Compute Instance + +### Prerequisites + +- An Oracle Free Tier or Paid Cloud Account +- You have completed Lab 2. + +## Task 1: Create Compute Instance + +You need a compute instance to connect to the Heatwave instance. + +1. Click the **Navigation menu** in the upper left, navigate to **Compute**, and under **Compute**, select **Instances**. + + ![Click compute](./images/click-compute.png "Click compute") + +2. Ensure **heatwave-genai** compartment is selected, and click click **Create instance**. + + ![Create instance](./images/create-instance.png "Create instance") + +3. On **Create compute instance** page, enter the name of the compute instance. + + ```bash + heatwave-genai-compute + ``` + +4. Ensure **heatwave-genai** compartment is selected. + + ![Compute instance name](./images/compute-name.png "Compute instance name") + +5. In the **Placement** field, keep the selected **Availability Domain**. + +6. In the **Image and Shape** field, keep the selected image, **Oracle Linux 8**, and the default shape. + + ![Compute image and shape](./images/compute-image-shape.png "Compute image and shape") + +7. In **Primary VNIC information** field, ensure the following settings are selected: + + - **Primary Network**: **heatwave-genai-vcn** + + - **Subnet**: **public-subnet-heatwave-genai-vcn** + +8. In **Primary VNIC IP addresses** field, ensure the following settings are selected: + + - **Private IPv4 address**: **Automatically assign private IPv4 address** + + - **Public IPv4 address**: Selected + + ![Network settings](./images/networking.png "Network settings") + +9. In **Add SSH keys** field, click **Generate a key pair for me**. + + ![Add SSH Keys](./images/ssh-keys.png "Add SSH Keys") + +10. Save the downloaded SSH keys in your .ssh folder. and rename the key. For example: + + ```bash + ssh-key-2024 + ``` + + ![Save SSH keys](./images/ssh-key-store.png "Save SSH Keys") + +11. Click '**Create**' to create your compute instance. + +12. The compute instance will be ready to use after a few minutes. The state is shown as **Provisioning** while the instance is creating. + +13. When the compute instance is ready to use, the state is shown as **Running**. *Note* the **Public IP address** and the **Username**. + + ![Compute instance is created](./images/compute.png "Compute instance is created") + +You may now **proceed to the next lab**. + +## Acknowledgements + +- **Author** - Aijaz Fatima, Product Manager +- **Contributors** - Mandy Pang, Senior Principal Product Manager +- **Last Updated By/Date** - Aijaz Fatima, Product Manager, September 2024 diff --git a/heatwave-genai/create-compute/images/00-mds-image.png b/heatwave-genai/create-compute/images/00-mds-image.png new file mode 100644 index 00000000..58101936 Binary files /dev/null and b/heatwave-genai/create-compute/images/00-mds-image.png differ diff --git a/heatwave-genai/create-compute/images/05compute-id-rsa-paste.png b/heatwave-genai/create-compute/images/05compute-id-rsa-paste.png new file mode 100644 index 00000000..76c5b69f Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute-id-rsa-paste.png differ diff --git a/heatwave-genai/create-compute/images/05compute-shape-old.png b/heatwave-genai/create-compute/images/05compute-shape-old.png new file mode 100644 index 00000000..41efe7df Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute-shape-old.png differ diff --git a/heatwave-genai/create-compute/images/05compute-shape.png b/heatwave-genai/create-compute/images/05compute-shape.png new file mode 100644 index 00000000..7d9c3b97 Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute-shape.png differ diff --git a/heatwave-genai/create-compute/images/05compute01.png b/heatwave-genai/create-compute/images/05compute01.png new file mode 100644 index 00000000..8850f7d1 Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute01.png differ diff --git a/heatwave-genai/create-compute/images/05compute02-00.png b/heatwave-genai/create-compute/images/05compute02-00.png new file mode 100644 index 00000000..f839c597 Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute02-00.png differ diff --git a/heatwave-genai/create-compute/images/05compute02.png b/heatwave-genai/create-compute/images/05compute02.png new file mode 100644 index 00000000..239fe9f3 Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute02.png differ diff --git a/heatwave-genai/create-compute/images/05compute03-old.png b/heatwave-genai/create-compute/images/05compute03-old.png new file mode 100644 index 00000000..50baefd8 Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute03-old.png differ diff --git a/heatwave-genai/create-compute/images/05compute03.png b/heatwave-genai/create-compute/images/05compute03.png new file mode 100644 index 00000000..58129fc8 Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute03.png differ diff --git a/heatwave-genai/create-compute/images/05compute04.png b/heatwave-genai/create-compute/images/05compute04.png new file mode 100644 index 00000000..92a7822e Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute04.png differ diff --git a/heatwave-genai/create-compute/images/05compute05.png b/heatwave-genai/create-compute/images/05compute05.png new file mode 100644 index 00000000..20f1628b Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute05.png differ diff --git a/heatwave-genai/create-compute/images/05compute06.png b/heatwave-genai/create-compute/images/05compute06.png new file mode 100644 index 00000000..533f8648 Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute06.png differ diff --git a/heatwave-genai/create-compute/images/05compute07.png b/heatwave-genai/create-compute/images/05compute07.png new file mode 100644 index 00000000..ddc61c56 Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute07.png differ diff --git a/heatwave-genai/create-compute/images/05compute08-a.png b/heatwave-genai/create-compute/images/05compute08-a.png new file mode 100644 index 00000000..9ac9e1d6 Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute08-a.png differ diff --git a/heatwave-genai/create-compute/images/05compute08-b.png b/heatwave-genai/create-compute/images/05compute08-b.png new file mode 100644 index 00000000..f3caceac Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute08-b.png differ diff --git a/heatwave-genai/create-compute/images/06connect01-signin.png b/heatwave-genai/create-compute/images/06connect01-signin.png new file mode 100644 index 00000000..2e6978b2 Binary files /dev/null and b/heatwave-genai/create-compute/images/06connect01-signin.png differ diff --git a/heatwave-genai/create-compute/images/06connect02-shell.png b/heatwave-genai/create-compute/images/06connect02-shell.png new file mode 100644 index 00000000..d83fc838 Binary files /dev/null and b/heatwave-genai/create-compute/images/06connect02-shell.png differ diff --git a/heatwave-genai/create-compute/images/06connect02.png b/heatwave-genai/create-compute/images/06connect02.png new file mode 100644 index 00000000..90a4ebfc Binary files /dev/null and b/heatwave-genai/create-compute/images/06connect02.png differ diff --git a/heatwave-genai/create-compute/images/cat-in-cloudshell.png b/heatwave-genai/create-compute/images/cat-in-cloudshell.png new file mode 100644 index 00000000..65337e80 Binary files /dev/null and b/heatwave-genai/create-compute/images/cat-in-cloudshell.png differ diff --git a/heatwave-genai/create-compute/images/cat.png b/heatwave-genai/create-compute/images/cat.png new file mode 100644 index 00000000..ae5dd81d Binary files /dev/null and b/heatwave-genai/create-compute/images/cat.png differ diff --git a/heatwave-genai/create-compute/images/click-compute.png b/heatwave-genai/create-compute/images/click-compute.png new file mode 100644 index 00000000..2e95a557 Binary files /dev/null and b/heatwave-genai/create-compute/images/click-compute.png differ diff --git a/heatwave-genai/create-compute/images/cloudshell-10.png b/heatwave-genai/create-compute/images/cloudshell-10.png new file mode 100644 index 00000000..2180d63c Binary files /dev/null and b/heatwave-genai/create-compute/images/cloudshell-10.png differ diff --git a/heatwave-genai/create-compute/images/cloudshell-11.png b/heatwave-genai/create-compute/images/cloudshell-11.png new file mode 100644 index 00000000..1b1e45a3 Binary files /dev/null and b/heatwave-genai/create-compute/images/cloudshell-11.png differ diff --git a/heatwave-genai/create-compute/images/cloudshell-ssh-keygen-2.png b/heatwave-genai/create-compute/images/cloudshell-ssh-keygen-2.png new file mode 100644 index 00000000..10327d48 Binary files /dev/null and b/heatwave-genai/create-compute/images/cloudshell-ssh-keygen-2.png differ diff --git a/heatwave-genai/create-compute/images/cloudshell-ssh-keygen.png b/heatwave-genai/create-compute/images/cloudshell-ssh-keygen.png new file mode 100644 index 00000000..4917d817 Binary files /dev/null and b/heatwave-genai/create-compute/images/cloudshell-ssh-keygen.png differ diff --git a/heatwave-genai/create-compute/images/cloudshell-ssh.png b/heatwave-genai/create-compute/images/cloudshell-ssh.png new file mode 100644 index 00000000..56b5de96 Binary files /dev/null and b/heatwave-genai/create-compute/images/cloudshell-ssh.png differ diff --git a/heatwave-genai/create-compute/images/cloudshell.png b/heatwave-genai/create-compute/images/cloudshell.png new file mode 100644 index 00000000..916c2c37 Binary files /dev/null and b/heatwave-genai/create-compute/images/cloudshell.png differ diff --git a/heatwave-genai/create-compute/images/cloudshell01.png b/heatwave-genai/create-compute/images/cloudshell01.png new file mode 100644 index 00000000..14133ebf Binary files /dev/null and b/heatwave-genai/create-compute/images/cloudshell01.png differ diff --git a/heatwave-genai/create-compute/images/cloudshellopen.png b/heatwave-genai/create-compute/images/cloudshellopen.png new file mode 100644 index 00000000..b6d8cc18 Binary files /dev/null and b/heatwave-genai/create-compute/images/cloudshellopen.png differ diff --git a/heatwave-genai/create-compute/images/cloudshellsetup.png b/heatwave-genai/create-compute/images/cloudshellsetup.png new file mode 100644 index 00000000..00645e88 Binary files /dev/null and b/heatwave-genai/create-compute/images/cloudshellsetup.png differ diff --git a/heatwave-genai/create-compute/images/compute-image-shape.png b/heatwave-genai/create-compute/images/compute-image-shape.png new file mode 100644 index 00000000..5254673b Binary files /dev/null and b/heatwave-genai/create-compute/images/compute-image-shape.png differ diff --git a/heatwave-genai/create-compute/images/compute-name.png b/heatwave-genai/create-compute/images/compute-name.png new file mode 100644 index 00000000..a430e5ca Binary files /dev/null and b/heatwave-genai/create-compute/images/compute-name.png differ diff --git a/heatwave-genai/create-compute/images/compute.png b/heatwave-genai/create-compute/images/compute.png new file mode 100644 index 00000000..90310909 Binary files /dev/null and b/heatwave-genai/create-compute/images/compute.png differ diff --git a/heatwave-genai/create-compute/images/copy-cat.png b/heatwave-genai/create-compute/images/copy-cat.png new file mode 100644 index 00000000..e0e16156 Binary files /dev/null and b/heatwave-genai/create-compute/images/copy-cat.png differ diff --git a/heatwave-genai/create-compute/images/copy-publickey-cloudshell.png b/heatwave-genai/create-compute/images/copy-publickey-cloudshell.png new file mode 100644 index 00000000..5fe304f7 Binary files /dev/null and b/heatwave-genai/create-compute/images/copy-publickey-cloudshell.png differ diff --git a/heatwave-genai/create-compute/images/create-instance.png b/heatwave-genai/create-compute/images/create-instance.png new file mode 100644 index 00000000..41923880 Binary files /dev/null and b/heatwave-genai/create-compute/images/create-instance.png differ diff --git a/heatwave-genai/create-compute/images/db-active.png b/heatwave-genai/create-compute/images/db-active.png new file mode 100644 index 00000000..8e28c0d9 Binary files /dev/null and b/heatwave-genai/create-compute/images/db-active.png differ diff --git a/heatwave-genai/create-compute/images/db-list.png b/heatwave-genai/create-compute/images/db-list.png new file mode 100644 index 00000000..07704614 Binary files /dev/null and b/heatwave-genai/create-compute/images/db-list.png differ diff --git a/heatwave-genai/create-compute/images/examine-cloudshell-keys.png b/heatwave-genai/create-compute/images/examine-cloudshell-keys.png new file mode 100644 index 00000000..bdd77722 Binary files /dev/null and b/heatwave-genai/create-compute/images/examine-cloudshell-keys.png differ diff --git a/heatwave-genai/create-compute/images/green-compute-vcn.png b/heatwave-genai/create-compute/images/green-compute-vcn.png new file mode 100644 index 00000000..54a78ba1 Binary files /dev/null and b/heatwave-genai/create-compute/images/green-compute-vcn.png differ diff --git a/heatwave-genai/create-compute/images/green-configure-vcn.png b/heatwave-genai/create-compute/images/green-configure-vcn.png new file mode 100644 index 00000000..f27ee079 Binary files /dev/null and b/heatwave-genai/create-compute/images/green-configure-vcn.png differ diff --git a/heatwave-genai/create-compute/images/heatwave-load-01-shell.png b/heatwave-genai/create-compute/images/heatwave-load-01-shell.png new file mode 100644 index 00000000..b73b6bc7 Binary files /dev/null and b/heatwave-genai/create-compute/images/heatwave-load-01-shell.png differ diff --git a/heatwave-genai/create-compute/images/ls.png b/heatwave-genai/create-compute/images/ls.png new file mode 100644 index 00000000..772f545f Binary files /dev/null and b/heatwave-genai/create-compute/images/ls.png differ diff --git a/heatwave-genai/create-compute/images/mkdir.png b/heatwave-genai/create-compute/images/mkdir.png new file mode 100644 index 00000000..58c38962 Binary files /dev/null and b/heatwave-genai/create-compute/images/mkdir.png differ diff --git a/heatwave-genai/create-compute/images/networking.png b/heatwave-genai/create-compute/images/networking.png new file mode 100644 index 00000000..201db8d0 Binary files /dev/null and b/heatwave-genai/create-compute/images/networking.png differ diff --git a/heatwave-genai/create-compute/images/notepad-rsa-key-1.png b/heatwave-genai/create-compute/images/notepad-rsa-key-1.png new file mode 100644 index 00000000..f7949c0d Binary files /dev/null and b/heatwave-genai/create-compute/images/notepad-rsa-key-1.png differ diff --git a/heatwave-genai/create-compute/images/notepad-rsa-key-compute-mds-1.png b/heatwave-genai/create-compute/images/notepad-rsa-key-compute-mds-1.png new file mode 100644 index 00000000..f9ba98e3 Binary files /dev/null and b/heatwave-genai/create-compute/images/notepad-rsa-key-compute-mds-1.png differ diff --git a/heatwave-genai/create-compute/images/notepad1.png b/heatwave-genai/create-compute/images/notepad1.png new file mode 100644 index 00000000..027e349a Binary files /dev/null and b/heatwave-genai/create-compute/images/notepad1.png differ diff --git a/heatwave-genai/create-compute/images/notepad2-old.png b/heatwave-genai/create-compute/images/notepad2-old.png new file mode 100644 index 00000000..e1787204 Binary files /dev/null and b/heatwave-genai/create-compute/images/notepad2-old.png differ diff --git a/heatwave-genai/create-compute/images/notepad2.png b/heatwave-genai/create-compute/images/notepad2.png new file mode 100644 index 00000000..4cdd8d7a Binary files /dev/null and b/heatwave-genai/create-compute/images/notepad2.png differ diff --git a/heatwave-genai/create-compute/images/see-IP-address.png b/heatwave-genai/create-compute/images/see-IP-address.png new file mode 100644 index 00000000..f4875176 Binary files /dev/null and b/heatwave-genai/create-compute/images/see-IP-address.png differ diff --git a/heatwave-genai/create-compute/images/ssh-details.png b/heatwave-genai/create-compute/images/ssh-details.png new file mode 100644 index 00000000..f8c18f31 Binary files /dev/null and b/heatwave-genai/create-compute/images/ssh-details.png differ diff --git a/heatwave-genai/create-compute/images/ssh-key-store.png b/heatwave-genai/create-compute/images/ssh-key-store.png new file mode 100644 index 00000000..2ea9cd8e Binary files /dev/null and b/heatwave-genai/create-compute/images/ssh-key-store.png differ diff --git a/heatwave-genai/create-compute/images/ssh-key01.png b/heatwave-genai/create-compute/images/ssh-key01.png new file mode 100644 index 00000000..72287931 Binary files /dev/null and b/heatwave-genai/create-compute/images/ssh-key01.png differ diff --git a/heatwave-genai/create-compute/images/ssh-keys.png b/heatwave-genai/create-compute/images/ssh-keys.png new file mode 100644 index 00000000..18182c1f Binary files /dev/null and b/heatwave-genai/create-compute/images/ssh-keys.png differ diff --git a/heatwave-genai/create-compute/images/ssh-ls-01.png b/heatwave-genai/create-compute/images/ssh-ls-01.png new file mode 100644 index 00000000..d88ff20e Binary files /dev/null and b/heatwave-genai/create-compute/images/ssh-ls-01.png differ diff --git a/heatwave-genai/create-compute/images/sshkeygen.png b/heatwave-genai/create-compute/images/sshkeygen.png new file mode 100644 index 00000000..248ca839 Binary files /dev/null and b/heatwave-genai/create-compute/images/sshkeygen.png differ diff --git a/heatwave-genai/create-heatwave/create-heatwave.md b/heatwave-genai/create-heatwave/create-heatwave.md new file mode 100644 index 00000000..da4f18d3 --- /dev/null +++ b/heatwave-genai/create-heatwave/create-heatwave.md @@ -0,0 +1,255 @@ +# Create a HeatWave instance + +## Introduction + +In this lab, you will create a create a compartment, a Virtual Cloud Network, and a Heatwave instance. + +_Estimated Time:_ 30 minutes + +### Objectives + +In this lab, you will be guided through the following tasks: + +- Create compartment. +- Create Virtual Cloud Network. +- Configure security list to allow incoming connections. +- Configure security list to allow HTTP incoming connections. +- Create a HeatWave instance. + +### Prerequisites + +- An Oracle trial or paid cloud account. +- Some experience with MySQL Shell. +- You have logged into the OCI Console using the default identity domain. + +## Task 1: Create Compartment + +1. Click the **Navigation menu** in the upper left, navigate to **Identity & Security**, and under **Identity**, select **Compartments**. + + ![Select compartment](./images/1-select-compartment.png "Select compartment") + +2. On the Compartments page, click **Create Compartment**. + +3. In the **Create Compartment** dialog box, enter the following: + + **Name**: + + ```bash + heatwave-genai + ``` + + **Description**: + + ```bash + Compartment for HeatWave GenAI + ``` + +5. Click **Create Compartment**. + + ![Create a compartment](./images/2-create-compartment.png "Create a compartment") + +## Task 2: Create Virtual Cloud Network + +1. Click the **Navigation menu** in the upper left, navigate to **Networking**, and select **Virtual cloud networks**. + + ![Select VCN](./images/3-select-vcn.png "Select VCN") + +2. Under **Compartment**, select **heatwave-genai**, and Click **Start VCN Wizard**. + + ![Start VCN Wizard](./images/4-start-vcn-wizard.png "Start VCN Wizard ") + +3. In the **Start VCN Wizard** dialog box, select **Create VCN with Internet Connectivity**, and click **Start VCN Wizard**. + + ![Start VCN Wizard](./images/5-start-vcn-wizard-dialog-box.png "Start VCN Wizard ") + +4. Under **Basic information**, provide a **VCN name**: + + ```bash + heatwave-genai-vcn + ``` + + 5. Ensure that **heatwave-genai** compartment is selected, and click **Next**. + + ![VCN configuration](./images/6-create-vcn-internet-connectivity.png "VCN configuration") + +6. Review Oracle Virtual Cloud Network (VCN), Subnets, and Gateways, and click **Create**. + + ![Create VCN](./images/7-create-vcn.png "Create VCN") + +7. When the Virtual Cloud Network is created, click **View VCN** to display the created VCN. + + ![View VCN](./images/8-view-vcn.png "View VCN") + +## Task 3: Configure security list to allow incoming connections + +1. On the **heatwave-genai-vcn** page, under **Subnets**, click **private subnet-heatwave-genai-vcn**. + + ![Show subnet details](./images/9-heatwave-genai-vcn-subnets.png "Show subnet details") + +2. On **private subnet-heatwave-genai-vcn** page, under **Security Lists**, click **security List for private subnet-heatwave-vcn**. + + ![Select security lists](./images/10-select-security-list.png "Select security lists") + +3. On the **security list for private subnet-heatwave-genai-vcn** page, under **Ingress Rules**, click **Add Ingress Rules**. + + ![Add ingress rules](./images/11-add-ingress-rules.png "Add ingress rules") + +4. On **Add Ingress Rules** panel, enter the following, and click **Add Ingress Rules**: + + **Source CIDR**: + + ```bash + 0.0.0.0/0 + ``` + + **Destination Port Range**: + + ```bash + 3306,33060 + ``` + + ![Ingress rules](./images/12-enter-ingress-rules.png "Ingress rules") + +5. On **security list for private subnet-heatwave-genai-vcn** page, the new ingress rules are shown under **Ingress Rules**. + + ![New ingress rules](./images/13-new-ingress-rules.png "New ingress rules") + +## Task 4: Configure security list to allow HTTP incoming connections + +1. Click the **Navigation menu** in the upper left, navigate to **Networking**, and select **Virtual cloud networks**. + + ![Select VCN](./images/3-select-vcn.png "Select VCN") + +2. Under **Compartment**, ensure **heatwave-genai** is selected, and click the VCN you created, **heatwave-genai-vcn**. + + ![Select VCN](./images/14-select-vcn.png "Select VCN") + +3. On the **heatwave-genai-vcn** page, under **Subnets**, click **public subnet-heatwave-genai-vcn**. + + ![Select public subnet](./images/15-public-subnet.png "Select public subnet") + +4. Click **Default Security List for heatwave-genai-vcn**. + + ![Default security list](./images/16-default-security-list.png "Default security list") + +5. On **Default Security List for heatwave-genai-vcn** page, under **Ingress Rules**, click **Add Ingress Rules**. + + ![Add ingress rules in default security list](./images/17-add-ingress-rules-default-security-list.png "Add ingress rules in default security list") + +6. On **Add Ingress Rules** panel, enter the following, and click **Add Ingress Rules**: + + **Source CIDR**: + + ```bash + 0.0.0.0/0 + ``` + + **Destination Port Range**: + + ```bash + 80,443 + ``` + + ![Ingress rules](./images/18-enter-ingess-rules-default-security-list.png "Ingress rules") + +7. On **Default Security List for heatwave-genai-vcn** page, the new ingress rules are shown under **Ingress Rules**. + + ![New ingress rules](./images/19-new-ingress-rules-default-security-list.png "New ingress rules") + +## Task 5: Create a HeatWave instance + +1. Click the **Navigation menu** in the upper left, navigate to **Databases**, and under **HeatWave**, select **DB Systems**. + + ![Select HeatWave DB System](./images/20-select-heatwave-db-system.png "Select HeatWave DB System") + +2. Ensure that **heatwave-genai** compartment is selected, and click **Create DB system**. + + ![Create DB system](./images/21-create-dbs.png "Create DB system") + +3. In the **Create DB system** panel, select **Development or Testing**. + +4. Under **Create in compartment**, ensure **heatwave-genai** is selected, and enter a name for the DB system. + + **Name**: + + ```bash + heatwave-genai-dbs + ``` + +5. Enter the administrator credentials. *Note* the administrator credentials as you will need them to connect to the DB system. + + ![HeatWave DB system details](./images/22-create-dbs-admin.png "HeatWave DB system details") + +6. Select **Standalone** instance, and select the VCN, **heatwave-genai-vcn**, and private subnet, **private subnet-heatwave-genai-vcn**, which you created earlier. + + ![Configure networking](./images/23-configure-networking.png "Configure networking") + +7. Let the **Configure placement** settings remain as is. + +8. Under **Configure hardware**, select **Enable HeatWave cluster**, and click **Change shape**. + + ![Change shape](./images/24-change-shape.png "Change shape") + +9. In the **Browse all shapes** page, ensure the compute model is **ECPU**, select **MySQL.32** shape, and click **Select a shape**. The ECPU Shape of the DB system must be MySQL.32. + + ![Select MySQL.32 shape](./images/25-select-mysql-32.png "Select MySQL.32 shape") + +10. Click **Configure HeatWave cluster**. + + ![Configure HeatWave cluster](./images/26-configure-heatwave-cluster.png "Configure HeatWave cluster") + +11. In **Configure HeatWave cluster** page, click **Change shape**. + + ![Change HeatWave shape](./images/27-change-heatwave-shape.png "Change Heatwave shape") + +12. In the **Browse all shapes** page, select **HeatWave.512** shape, and click **Select a shape**. The HeatWave Shape must be HeatWave.512. + + ![Change HeatWave shape](./images/28-select-heatwave-512.png "Change Heatwave shape") + +13. Select **HeatWave Lakehouse**, and click **Save changes**. HeatWave Lakehouse must be enabled on the DB system. + + ![Enable Lakehouse](./images/29-enable-lakehouse.png "Enable Lakehouse") + +14. Click **Show advanced options**. + +15. Go to the **Configuration** tab, and under **Database version**, select version **9.0.0 - Innovation** or higher version. + + ![Select database innovation version](./images/31-innovation-version.png "Select database innovation version") + +16. Go to the **Connections** tab, enter the **Hostname**, which is same as DB system name, and click **Create**: + + **Hostname**: + + ```bash + heatwave-genai-dbs + ``` + + ![HeatWave hostname](./images/32-heatwave-hostname.png "HeatWave hostname") + +17. While the DB system is created, the state is shown as **CREATING**. + + ![Show creating state](./images/33-dbs-creating.png "Show creating state") + +18. The new DB system will be ready to use after a few minutes. The state **ACTIVE** indicates that the DB system is ready for use. + + ![Show active state](./images/34-dbs-active.png "Show active state") + +19. In the **Connections** tab, note the **Private IP address** of the DB system, which is the HeatWave endpoint. + + ![Heatwave endpoint](./images/35-heatwave-endpoint.png "Heatwave endpoint") + +You may now **proceed to the next lab**. + +## Learn More + +- [HeatWave User Guide](https://dev.mysql.com/doc/heatwave/en/) + +- [HeatWave on OCI User Guide](https://docs.oracle.com/en-us/iaas/mysql-database/index.html) + +- [MySQL Documentation](https://dev.mysql.com/) + +## Acknowledgements + +- **Author** - Aijaz Fatima, Product Manager +- **Contributors** - Mandy Pang, Senior Principal Product Manager +- **Last Updated By/Date** - Aijaz Fatima, Product Manager, August 2024 diff --git a/heatwave-genai/create-heatwave/images/1-select-compartment.png b/heatwave-genai/create-heatwave/images/1-select-compartment.png new file mode 100644 index 00000000..10f68c5d Binary files /dev/null and b/heatwave-genai/create-heatwave/images/1-select-compartment.png differ diff --git a/heatwave-genai/create-heatwave/images/10-select-security-list.png b/heatwave-genai/create-heatwave/images/10-select-security-list.png new file mode 100644 index 00000000..2481faca Binary files /dev/null and b/heatwave-genai/create-heatwave/images/10-select-security-list.png differ diff --git a/heatwave-genai/create-heatwave/images/11-add-ingress-rules.png b/heatwave-genai/create-heatwave/images/11-add-ingress-rules.png new file mode 100644 index 00000000..92a30976 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/11-add-ingress-rules.png differ diff --git a/heatwave-genai/create-heatwave/images/12-enter-ingress-rules.png b/heatwave-genai/create-heatwave/images/12-enter-ingress-rules.png new file mode 100644 index 00000000..ffd60636 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/12-enter-ingress-rules.png differ diff --git a/heatwave-genai/create-heatwave/images/13-new-ingress-rules.png b/heatwave-genai/create-heatwave/images/13-new-ingress-rules.png new file mode 100644 index 00000000..60c77e62 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/13-new-ingress-rules.png differ diff --git a/heatwave-genai/create-heatwave/images/14-select-vcn.png b/heatwave-genai/create-heatwave/images/14-select-vcn.png new file mode 100644 index 00000000..5924ad2a Binary files /dev/null and b/heatwave-genai/create-heatwave/images/14-select-vcn.png differ diff --git a/heatwave-genai/create-heatwave/images/15-public-subnet.png b/heatwave-genai/create-heatwave/images/15-public-subnet.png new file mode 100644 index 00000000..f4827103 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/15-public-subnet.png differ diff --git a/heatwave-genai/create-heatwave/images/16-default-security-list.png b/heatwave-genai/create-heatwave/images/16-default-security-list.png new file mode 100644 index 00000000..0307c6e7 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/16-default-security-list.png differ diff --git a/heatwave-genai/create-heatwave/images/17-add-ingress-rules-default-security-list.png b/heatwave-genai/create-heatwave/images/17-add-ingress-rules-default-security-list.png new file mode 100644 index 00000000..5bb0a7c0 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/17-add-ingress-rules-default-security-list.png differ diff --git a/heatwave-genai/create-heatwave/images/18-enter-ingess-rules-default-security-list.png b/heatwave-genai/create-heatwave/images/18-enter-ingess-rules-default-security-list.png new file mode 100644 index 00000000..3807c561 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/18-enter-ingess-rules-default-security-list.png differ diff --git a/heatwave-genai/create-heatwave/images/19-new-ingress-rules-default-security-list.png b/heatwave-genai/create-heatwave/images/19-new-ingress-rules-default-security-list.png new file mode 100644 index 00000000..c0d158e8 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/19-new-ingress-rules-default-security-list.png differ diff --git a/heatwave-genai/create-heatwave/images/2-create-compartment.png b/heatwave-genai/create-heatwave/images/2-create-compartment.png new file mode 100644 index 00000000..02644cbb Binary files /dev/null and b/heatwave-genai/create-heatwave/images/2-create-compartment.png differ diff --git a/heatwave-genai/create-heatwave/images/20-select-heatwave-db-system.png b/heatwave-genai/create-heatwave/images/20-select-heatwave-db-system.png new file mode 100644 index 00000000..d35a137a Binary files /dev/null and b/heatwave-genai/create-heatwave/images/20-select-heatwave-db-system.png differ diff --git a/heatwave-genai/create-heatwave/images/21-create-dbs.png b/heatwave-genai/create-heatwave/images/21-create-dbs.png new file mode 100644 index 00000000..1b4d4771 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/21-create-dbs.png differ diff --git a/heatwave-genai/create-heatwave/images/22-create-dbs-admin.png b/heatwave-genai/create-heatwave/images/22-create-dbs-admin.png new file mode 100644 index 00000000..1d720d38 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/22-create-dbs-admin.png differ diff --git a/heatwave-genai/create-heatwave/images/23-configure-networking.png b/heatwave-genai/create-heatwave/images/23-configure-networking.png new file mode 100644 index 00000000..690beae4 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/23-configure-networking.png differ diff --git a/heatwave-genai/create-heatwave/images/24-change-shape.png b/heatwave-genai/create-heatwave/images/24-change-shape.png new file mode 100644 index 00000000..1e1644f4 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/24-change-shape.png differ diff --git a/heatwave-genai/create-heatwave/images/25-select-mysql-32.png b/heatwave-genai/create-heatwave/images/25-select-mysql-32.png new file mode 100644 index 00000000..88373313 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/25-select-mysql-32.png differ diff --git a/heatwave-genai/create-heatwave/images/26-configure-heatwave-cluster.png b/heatwave-genai/create-heatwave/images/26-configure-heatwave-cluster.png new file mode 100644 index 00000000..992292e8 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/26-configure-heatwave-cluster.png differ diff --git a/heatwave-genai/create-heatwave/images/27-change-heatwave-shape.png b/heatwave-genai/create-heatwave/images/27-change-heatwave-shape.png new file mode 100644 index 00000000..e884a1e3 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/27-change-heatwave-shape.png differ diff --git a/heatwave-genai/create-heatwave/images/28-select-heatwave-512.png b/heatwave-genai/create-heatwave/images/28-select-heatwave-512.png new file mode 100644 index 00000000..81838fa6 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/28-select-heatwave-512.png differ diff --git a/heatwave-genai/create-heatwave/images/29-enable-lakehouse.png b/heatwave-genai/create-heatwave/images/29-enable-lakehouse.png new file mode 100644 index 00000000..d6b21887 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/29-enable-lakehouse.png differ diff --git a/heatwave-genai/create-heatwave/images/3-select-vcn.png b/heatwave-genai/create-heatwave/images/3-select-vcn.png new file mode 100644 index 00000000..9844352d Binary files /dev/null and b/heatwave-genai/create-heatwave/images/3-select-vcn.png differ diff --git a/heatwave-genai/create-heatwave/images/30-database-version.png b/heatwave-genai/create-heatwave/images/30-database-version.png new file mode 100644 index 00000000..c9d7ed89 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/30-database-version.png differ diff --git a/heatwave-genai/create-heatwave/images/31-innovation-version.png b/heatwave-genai/create-heatwave/images/31-innovation-version.png new file mode 100644 index 00000000..809227a3 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/31-innovation-version.png differ diff --git a/heatwave-genai/create-heatwave/images/32-heatwave-hostname.png b/heatwave-genai/create-heatwave/images/32-heatwave-hostname.png new file mode 100644 index 00000000..ef91e9f8 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/32-heatwave-hostname.png differ diff --git a/heatwave-genai/create-heatwave/images/33-dbs-creating.png b/heatwave-genai/create-heatwave/images/33-dbs-creating.png new file mode 100644 index 00000000..c6e8f3c6 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/33-dbs-creating.png differ diff --git a/heatwave-genai/create-heatwave/images/34-dbs-active.png b/heatwave-genai/create-heatwave/images/34-dbs-active.png new file mode 100644 index 00000000..2f008051 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/34-dbs-active.png differ diff --git a/heatwave-genai/create-heatwave/images/35-heatwave-endpoint.png b/heatwave-genai/create-heatwave/images/35-heatwave-endpoint.png new file mode 100644 index 00000000..33195c53 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/35-heatwave-endpoint.png differ diff --git a/heatwave-genai/create-heatwave/images/36-private-ip-address.png b/heatwave-genai/create-heatwave/images/36-private-ip-address.png new file mode 100644 index 00000000..49284c8a Binary files /dev/null and b/heatwave-genai/create-heatwave/images/36-private-ip-address.png differ diff --git a/heatwave-genai/create-heatwave/images/4-start-vcn-wizard.png b/heatwave-genai/create-heatwave/images/4-start-vcn-wizard.png new file mode 100644 index 00000000..390f3cab Binary files /dev/null and b/heatwave-genai/create-heatwave/images/4-start-vcn-wizard.png differ diff --git a/heatwave-genai/create-heatwave/images/5-start-vcn-wizard-dialog-box.png b/heatwave-genai/create-heatwave/images/5-start-vcn-wizard-dialog-box.png new file mode 100644 index 00000000..56c74b6a Binary files /dev/null and b/heatwave-genai/create-heatwave/images/5-start-vcn-wizard-dialog-box.png differ diff --git a/heatwave-genai/create-heatwave/images/6-create-vcn-internet-connectivity.png b/heatwave-genai/create-heatwave/images/6-create-vcn-internet-connectivity.png new file mode 100644 index 00000000..41a25f25 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/6-create-vcn-internet-connectivity.png differ diff --git a/heatwave-genai/create-heatwave/images/7-create-vcn.png b/heatwave-genai/create-heatwave/images/7-create-vcn.png new file mode 100644 index 00000000..41c22904 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/7-create-vcn.png differ diff --git a/heatwave-genai/create-heatwave/images/8-view-vcn.png b/heatwave-genai/create-heatwave/images/8-view-vcn.png new file mode 100644 index 00000000..26a6661b Binary files /dev/null and b/heatwave-genai/create-heatwave/images/8-view-vcn.png differ diff --git a/heatwave-genai/create-heatwave/images/9-heatwave-genai-vcn-subnets.png b/heatwave-genai/create-heatwave/images/9-heatwave-genai-vcn-subnets.png new file mode 100644 index 00000000..cc53fb04 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/9-heatwave-genai-vcn-subnets.png differ diff --git a/heatwave-genai/develop-app/develop-app.md b/heatwave-genai/develop-app/develop-app.md new file mode 100644 index 00000000..657a10ae --- /dev/null +++ b/heatwave-genai/develop-app/develop-app.md @@ -0,0 +1,424 @@ +# Build HeatWave RAG Chat Application + +## Introduction + +HeatWave seamlessly integrates with existing Oracle services, such as Oracle Analytics Cloud, making it ideal for development tasks. Additionally, you can use HeatWave to create new applications using the LAMP stack (Linux, Apache, MySQL, PHP) or other software stacks. + +In this lab you will build a LAMP stack and deploy a prebuilt HeatWave RAG Chat Application. The application is designed to make interacting with HeatWave GenAI Retrieval-Augmented Generation (RAG) capabilities straightforward and user-friendly. + +### Objectives + +In this lab, you will be guided through the following tasks: + +- Connect to compute instance using VS Code and SSH +- Install Apache Server. +- Install PHP. +- Create HeatWave/PHP connect test app. +- Deploy HeatWave RAG chat application. +- Test HeatWave RAG chat application. + +### Prerequisites + +- Completed Lab 5. + +### About the HeatWave RAG Chat Application + +This application provides a user-friendly web interface for interacting with HeatWave GenAI Retrieval-Augmented Generation (RAG) capabilities. It enables you to ask questions and receive AI-generated responses based on the information stored in HeatWave. + +#### HeatWave RAG Chat Application Architecture Diagram + +The following diagram provides details of how the different components of the HeatWave RAG chat application are structured and how they interact with each other. The arrows indicate the flow of data and interactions between the components. For example: + +- The web browser interacts with the web server. +- The PHP Runtime manages the chat interface and HeatWave RAG class. +- The HeatWave RAG class interacts with the HeatWave instance. +- The chat interface interacts with the PHP session for storing chat history. + + ![Chat application architecture](./images/chat-app-flow.png "Chat application architecture") + +#### Key Features + +- Simple Web Interface: Easy-to-use chat interface for asking questions and viewing responses. +- RAG Integration: Utilizes MySQL HeatWave's RAG functionality to generate informed responses. +- Chat History: Maintains a session-based chat history for continuous conversations. +- Citation Display: Shows relevant citations for the AI's responses, enhancing transparency and trustworthiness. +- Clear History Option: Allows users to reset the chat history as needed. + +#### Overview + +- Backend: Linux, Apache, PHP, and HeatWave integration +- Frontend: HTML and CSS for a responsive design +- Data Storage: HeatWave Lakehouse and HeatWave for vector embeddings and RAG processing + +This solution bridges the gap between complex database operations and user-friendly interaction, making it easy for users to leverage the power of HeatWave GenAI capabilities through a simple chat interface. + +_Note:_ This application code is intended for educational purposes only. It is designed to help developers learn and practice application development skills with HeatWave on OCI. The code is not designed to be used in a production environment. + +_Estimated Time:_ 20 minutes + +## Task 1: Connect to Compute instance using VS Code and SSH + +1. In Visual Studio Code, in the menu bar, click **Terminal**, and then **New Terminal**. + + ![New terminal](./images/new-terminal.png "New terminal") + +2. Click **Maximize Panel Size** to set the terminal to full screen. + + ![Maximize panel size](./images/maximize-panel.png "Maximize panel") + +3. Connect to the compute instance from the terminal using SSH. + + ```bash + ssh -i ~/.ssh/ opc@ + ``` + - You had stored the ssh keys in Lab 2, Task 1, Step 10. + - You had noted the public IP address o the compute instance in Lab 2, Task 1, Step 13. + + For example: + + ```bash + ssh -i ~/.ssh/ssh-key-2024.key opc@129.153.218.143 + ``` + ![SSH compute](./images/ssh-compute.png "SSH compute") + +## Task 2: Install Apache App Server + +1. Using Visual Studio Code, install Apache app server. + + ```bash + sudo yum install httpd -y + ``` + ![Install Apache](./images/install-apache.png "Install Apache") + +2. Enable Apache. + + ```bash + sudo systemctl enable httpd + ``` + +3. Start Apache. + + ```bash + sudo systemctl restart httpd + ``` + +4. Setup firewall. + + ```bash + sudo firewall-cmd --permanent --add-port=80/tcp + ``` + +5. Reload firewall. + + ```bash + sudo firewall-cmd --reload + ``` + + ![Start Apache](./images/start-apache.png "Start Apache") + +6. From a web browser, test apache from your local machine using the public IP address of your compute instance. You had noted the public IP address of the compute instance in Lab 2, Task 1, Step 13. + + ```bash + http:// + ``` + For example: + + http://129.153.218.143 + + ![Test Apache](./images/test-apache.png "Test Apache") + +## Task 3: Install PHP + +1. Using Visual Studio Code, install PHP 7.4. + + ```bash + sudo dnf module install php:7.4 -y + ``` + + ![Install PHP](./images/install-php.png "Install PHP") + +2. Install associated PHP libraries. + + ```bash + sudo yum install php-cli php-mysqlnd php-zip php-gd php-mbstring php-xml php-json -y + ``` + + ![Install PHP libraries](./images/install-php-libraries.png "Install PHP libraries") + +3. View PHP/MySQL libraries. + + ```bash + php -m |grep mysql + ``` + +4. View PHP version. + + ```bash + php -v + ``` + +5. Restart Apache application server. + + ```bash + sudo systemctl restart httpd + ``` + + ![View PHP libraries](./images/view-php-libraries.png "View PHP libraries") + +6. Create the test PHP file, info.php. + + ```bash + sudo nano /var/www/html/info.php + ``` + ![Edit info.php](./images/edit-info-php.png "Edit info.php") + +7. Paste the following code in the info.php file. + + ```bash + + ``` + + ![Paste code](./images/paste-info-php.png "Paste code") + +8. Click ctrl+O, followed by **Enter** to save the file. + +9. Click ctrl+X to exit the editor. + +10. From a web browser, test the info.php file. + + ```bash + http:///info.php + ``` + For example: + + http://129.153.218.143/info.php + + ![Info.php page output](./images/output-info-php.png "Info.php page output") + +## Task 4: Create HeatWave/PHP Connect Test App + +1. Using Visual Studio Code, allow Apache application server to connect to the HeatWave instance. + + ```bash + sudo setsebool -P httpd_can_network_connect 1 + ``` + ![Allow Apache application](./images/allow-apache.png "Allow Apache application") + +2. Create config.php file. + + ```bash + sudo nano /var/www/html/config.php + ``` + +3. Paste the following code in the config.php file. + + ```bash + + + ``` + + ![Paste config.php](./images/paste-config-php.png "Paste config.php") + +5. Update the following: + + - DB_SERVER: Specify the IP address of the HeatWave instance. + - DB_USERNAME: Specify administrator username, **admin**, which you had provided in Lab 1, Task 5, Step 5. + - DB_PASSWORD: Specify the password, which you had provided in Lab 1, Task 5, Step 5. + - DB_NAME: Specify the schema, **genai-db**, which you had provided in Lab 5, Task 6, Step 2. + + ![config.php](./images/config-php.png "config.php") + +6. Click ctrl+O, followed by **Enter** to save the file. + +7. Click ctrl+X to exit the editor. + +8. From a web browser, test the config.php file. You should be able to connect to the HeatWave instance. + + ```bash + http:///config.php + ``` + For example: + + http://129.153.218.143/config.php + + ![config.php page output](./images/output-config-php.png "config.php page output") + +9. Create the dbtest.php file. + + ```bash + sudo nano /var/www/html/dbtest.php + ``` + ![dbtest.php](./images/dbtest.png "dbtest.php") + +10. Paste the following code in the dbtest.php file. + + ```bash + + prepare($query)) { + $stmt->execute(); + $stmt->bind_result($user); + echo ""; + echo ""; + echo ""; + echo ""; + + while ($stmt->fetch()) { + echo ""; + echo ""; + echo ""; + } + + $stmt->close(); + } + ?> + + ``` + + ![Update dbtest.php](./images/paste-dbtest-php.png "Update dbtest.php") + +11. Click ctrl+O, followed by **Enter** to save the file. + +12. Click ctrl+X to exit the editor. + +13. From a web browser, test the dbtest.php file. You should be able to see the MySQL users in the instance. + + ```bash + http:///dbtest.php + ``` + For example: + + http://129.153.218.143/dbtest.php + + ![dbtest.php page output](./images/output-dbtest-php.png "dbtest.php page output") + +## Task 5: Deploy HeatWave RAG Chat Application + +1. Go to the development folder. + + ```bash + cd /var/www/html + ``` + +2. Download the application code. + + ```bash + sudo wget https://objectstorage.us-ashburn-1.oraclecloud.com/p/r73t2H8D425uNocg2E22-B_2vfPXG86Opsfdb6CGglaiw6Zy7IRyFdfBbOe93qXF/n/mysqlpm/b/mysql_gen_ai/o/php-rag-chat-app/app.zip + ``` + ![Download application code](./images/application-code.png "Download application code") + +3. Unzip the application code. + + ```bash + sudo unzip app.zip + ``` +4. Go to the app folder. + + ```bash + cd app + ``` + +5. View the files in the application folder. + + ```bash + ls -l + ``` + + You should see the following two files: + + - chat_interface.php + - HeatWaveRAG.php + +6. Open the chat_interface.php file. + + ```bash + sudo nano chat_interface.php + ``` + + ![Chat interface](./images/chat-interface-php.png "Chat interface") + +7. Locate the following line in the chat_interface.php file: + + ```bash + "$rag = new HeatWaveRAG('your_mysql_host', 'your_username', 'your_password', 'genai_db');" + ``` + ![Provide your administrator details](./images/rag-replace.png "Provide your administrator details") + +8. Replace the following: + + - **your\_mysql\_host**: Specify the IP address of the HeatWave instance, **heatwave-genai-db**. For example, 10.0.0.123. + - **your\_username**: Specify the username you had used for the Heatwave instance. If you arefollowing the lab instructions, specify **admin**. + - **your\_password**: Specify the pasword you used when creating the HeatWave instance. + + Note to not change **genai\_db** as it is the schema name that we had specified for the vector store. + + ![Updated chat interace](./images/updated-chat-interface.png "Updated chat interace") + +## Task 6: Test HeatWave RAG Chat Application + +1. From your web browser, access the chat_interface.php. + + ```bash + http:///app/chat_interface.php) + ``` + + For example: + + http://129.153.218.143/app/chat_interface.php + +2. You'll see a chat interface with a text input field. + + ![Input field](./images/input-field.png "Input field") + +3. Type your question into the input field and click **Send** or **Enter**. + + For example: + + - What is HeatWave AutoML? + - What is MySQL? + - Is HeatWave available on AWS? + + The application will send your query to the HeatWave RAG system and display the response along with any relevant citations. Your chat history will be maintained across page reloads using PHP sessions. + + ![Enter your questions](./images/queries.png "Enter your questions") + +5. To clear the chat history, click **Clear Chat History**. + +You may now **proceed to the next lab**. + +## Learn More + +- [HeatWave User Guide](https://dev.mysql.com/doc/heatwave/en/) + +- [HeatWave on OCI User Guide](https://docs.oracle.com/en-us/iaas/mysql-database/index.html) + +- [MySQL Documentation](https://dev.mysql.com/) + +You may now **proceed to the next lab**. + +## Acknowledgements + +- **Author** - Aijaz Fatima, Product Manager +- **Contributors** - Perside Foster, MySQL Principal Solution Engineer +- **Last Updated By/Date** - Aijaz Fatima, Product Manager, September 2024 \ No newline at end of file diff --git a/heatwave-genai/develop-app/images/allow-apache.png b/heatwave-genai/develop-app/images/allow-apache.png new file mode 100644 index 00000000..405d3b66 Binary files /dev/null and b/heatwave-genai/develop-app/images/allow-apache.png differ diff --git a/heatwave-genai/develop-app/images/application-code.png b/heatwave-genai/develop-app/images/application-code.png new file mode 100644 index 00000000..5cce0a6e Binary files /dev/null and b/heatwave-genai/develop-app/images/application-code.png differ diff --git a/heatwave-genai/develop-app/images/chat-app-flow.png b/heatwave-genai/develop-app/images/chat-app-flow.png new file mode 100644 index 00000000..b25a4e8d Binary files /dev/null and b/heatwave-genai/develop-app/images/chat-app-flow.png differ diff --git a/heatwave-genai/develop-app/images/chat-interface-php.png b/heatwave-genai/develop-app/images/chat-interface-php.png new file mode 100644 index 00000000..45197332 Binary files /dev/null and b/heatwave-genai/develop-app/images/chat-interface-php.png differ diff --git a/heatwave-genai/develop-app/images/config-connect.png b/heatwave-genai/develop-app/images/config-connect.png new file mode 100644 index 00000000..9bc918a6 Binary files /dev/null and b/heatwave-genai/develop-app/images/config-connect.png differ diff --git a/heatwave-genai/develop-app/images/config-php.png b/heatwave-genai/develop-app/images/config-php.png new file mode 100644 index 00000000..fae19f74 Binary files /dev/null and b/heatwave-genai/develop-app/images/config-php.png differ diff --git a/heatwave-genai/develop-app/images/create-config-php.png b/heatwave-genai/develop-app/images/create-config-php.png new file mode 100644 index 00000000..3a4c845f Binary files /dev/null and b/heatwave-genai/develop-app/images/create-config-php.png differ diff --git a/heatwave-genai/develop-app/images/dbtest.png b/heatwave-genai/develop-app/images/dbtest.png new file mode 100644 index 00000000..2fbfb585 Binary files /dev/null and b/heatwave-genai/develop-app/images/dbtest.png differ diff --git a/heatwave-genai/develop-app/images/edit-info-php.png b/heatwave-genai/develop-app/images/edit-info-php.png new file mode 100644 index 00000000..5b06311c Binary files /dev/null and b/heatwave-genai/develop-app/images/edit-info-php.png differ diff --git a/heatwave-genai/develop-app/images/input-field.png b/heatwave-genai/develop-app/images/input-field.png new file mode 100644 index 00000000..73a47207 Binary files /dev/null and b/heatwave-genai/develop-app/images/input-field.png differ diff --git a/heatwave-genai/develop-app/images/install-apache.png b/heatwave-genai/develop-app/images/install-apache.png new file mode 100644 index 00000000..e8799c0d Binary files /dev/null and b/heatwave-genai/develop-app/images/install-apache.png differ diff --git a/heatwave-genai/develop-app/images/install-php-libraries.png b/heatwave-genai/develop-app/images/install-php-libraries.png new file mode 100644 index 00000000..080874ac Binary files /dev/null and b/heatwave-genai/develop-app/images/install-php-libraries.png differ diff --git a/heatwave-genai/develop-app/images/install-php.png b/heatwave-genai/develop-app/images/install-php.png new file mode 100644 index 00000000..0ab8fc30 Binary files /dev/null and b/heatwave-genai/develop-app/images/install-php.png differ diff --git a/heatwave-genai/develop-app/images/maximize-panel.png b/heatwave-genai/develop-app/images/maximize-panel.png new file mode 100644 index 00000000..af0d103f Binary files /dev/null and b/heatwave-genai/develop-app/images/maximize-panel.png differ diff --git a/heatwave-genai/develop-app/images/new-terminal.png b/heatwave-genai/develop-app/images/new-terminal.png new file mode 100644 index 00000000..c8de9e53 Binary files /dev/null and b/heatwave-genai/develop-app/images/new-terminal.png differ diff --git a/heatwave-genai/develop-app/images/output-config-php.png b/heatwave-genai/develop-app/images/output-config-php.png new file mode 100644 index 00000000..16ae4aa1 Binary files /dev/null and b/heatwave-genai/develop-app/images/output-config-php.png differ diff --git a/heatwave-genai/develop-app/images/output-dbtest-php.png b/heatwave-genai/develop-app/images/output-dbtest-php.png new file mode 100644 index 00000000..bc1cc9e5 Binary files /dev/null and b/heatwave-genai/develop-app/images/output-dbtest-php.png differ diff --git a/heatwave-genai/develop-app/images/output-info-php.png b/heatwave-genai/develop-app/images/output-info-php.png new file mode 100644 index 00000000..16f0ee18 Binary files /dev/null and b/heatwave-genai/develop-app/images/output-info-php.png differ diff --git a/heatwave-genai/develop-app/images/paste-config-php.png b/heatwave-genai/develop-app/images/paste-config-php.png new file mode 100644 index 00000000..51e008e0 Binary files /dev/null and b/heatwave-genai/develop-app/images/paste-config-php.png differ diff --git a/heatwave-genai/develop-app/images/paste-dbtest-php.png b/heatwave-genai/develop-app/images/paste-dbtest-php.png new file mode 100644 index 00000000..3daaa2f3 Binary files /dev/null and b/heatwave-genai/develop-app/images/paste-dbtest-php.png differ diff --git a/heatwave-genai/develop-app/images/paste-info-php.png b/heatwave-genai/develop-app/images/paste-info-php.png new file mode 100644 index 00000000..5924ba55 Binary files /dev/null and b/heatwave-genai/develop-app/images/paste-info-php.png differ diff --git a/heatwave-genai/develop-app/images/queries.png b/heatwave-genai/develop-app/images/queries.png new file mode 100644 index 00000000..f89205a5 Binary files /dev/null and b/heatwave-genai/develop-app/images/queries.png differ diff --git a/heatwave-genai/develop-app/images/rag-app-list.png b/heatwave-genai/develop-app/images/rag-app-list.png new file mode 100644 index 00000000..000fc878 Binary files /dev/null and b/heatwave-genai/develop-app/images/rag-app-list.png differ diff --git a/heatwave-genai/develop-app/images/rag-app.png b/heatwave-genai/develop-app/images/rag-app.png new file mode 100644 index 00000000..48dc0e68 Binary files /dev/null and b/heatwave-genai/develop-app/images/rag-app.png differ diff --git a/heatwave-genai/develop-app/images/rag-replace.png b/heatwave-genai/develop-app/images/rag-replace.png new file mode 100644 index 00000000..33217876 Binary files /dev/null and b/heatwave-genai/develop-app/images/rag-replace.png differ diff --git a/heatwave-genai/develop-app/images/ssh-compute.png b/heatwave-genai/develop-app/images/ssh-compute.png new file mode 100644 index 00000000..b2f1f4bb Binary files /dev/null and b/heatwave-genai/develop-app/images/ssh-compute.png differ diff --git a/heatwave-genai/develop-app/images/start-apache.png b/heatwave-genai/develop-app/images/start-apache.png new file mode 100644 index 00000000..1e643120 Binary files /dev/null and b/heatwave-genai/develop-app/images/start-apache.png differ diff --git a/heatwave-genai/develop-app/images/test-apache.png b/heatwave-genai/develop-app/images/test-apache.png new file mode 100644 index 00000000..557517b6 Binary files /dev/null and b/heatwave-genai/develop-app/images/test-apache.png differ diff --git a/heatwave-genai/develop-app/images/updated-chat-interface.png b/heatwave-genai/develop-app/images/updated-chat-interface.png new file mode 100644 index 00000000..55f0dbd0 Binary files /dev/null and b/heatwave-genai/develop-app/images/updated-chat-interface.png differ diff --git a/heatwave-genai/develop-app/images/view-php-libraries.png b/heatwave-genai/develop-app/images/view-php-libraries.png new file mode 100644 index 00000000..d9044e0f Binary files /dev/null and b/heatwave-genai/develop-app/images/view-php-libraries.png differ diff --git a/heatwave-genai/generate-content/generate-content.md b/heatwave-genai/generate-content/generate-content.md new file mode 100644 index 00000000..926b8f9c --- /dev/null +++ b/heatwave-genai/generate-content/generate-content.md @@ -0,0 +1,100 @@ +# Use HeatWave in-database LLM to Generate and Summarize Content + +## Introduction + +HeatWave GenAI supports two in-database large language models (LLM): mistral-7b-instruct-v1 and llama2-7b-v1. You can use any of these models to generate response or summarize. + +_Estimated Time:_ 10 minutes + +### Objectives + +In this lab, you will be guided through the following task: + +- Generate response using in-database LLMs. +- Summarize text using in-database LLMs. + +### Prerequisites + +- Must complete Lab 3. + + +## Task 1: Generate response using in-database LLMs + +1. Load the LLM in HeatWave, and click **Execute the selection or full block on HeatWave and create a new block**: + + - To load mistral-7b-instruct-v1 model: + + ```bash + call sys.ML_MODEL_LOAD('mistral-7b-instruct-v1', NULL); + ``` + + ![Load LLMs](./images/1-load-llm.png "Load LLMs") + +2. Set the @query session variable with your query in natural language, and click **Enter**. + + ```bash + set @query=""; + ``` + + For example: + + ```bash + set @query="What is the use of generative AI in 200 words"; + ``` +3. Generate the response from LLM by entering the following command and click **Execute the selection or full block on HeatWave and create a new block**: + + ```bash + select sys.ML_GENERATE(@query, JSON_OBJECT("task", "generation", "model_id", "mistral-7b-instruct-v1")); + ``` + + ![Generate response](./images/2-generate-response.png "Generate response") + +4. HeatWave GenAI generates a response using the in-database LLMs. + + ![HeatWave GenAI output](./images/3-llm-ouput.png "HeatWave GenAI output") + +## Task 2: Summarize text using in-database LLMs + +1. Define the text that you want to summarize, and click **Enter**: + + ```bash + set @text=""; + ``` + + For example: + ```bash + set @text="Artificial Intelligence (AI) is an ever-expanding field that holds immense potential to transform our societal and professional landscapes. AI pertains to the creation of computer systems capable of simulating human intelligence to carry out tasks such as visual perception, speech recognition, decision-making, and language translation. A significant stride in AI development is the ascension of machine learning, a segment of AI that empowers computers to glean insights from data without explicit programming. By analyzing copious amounts of data and recognizing patterns, machine learning algorithms are becoming increasingly proficient at forecasting outcomes and making decisions. The integration of AI is already underway across diverse industries, ranging from healthcare and finance to transportation. In the healthcare sector, AI is playing a pivotal role in crafting personalized treatment plans for patients based on their unique medical history and genetic composition. In finance, AI is instrumental in detecting fraudulent activities and offering investment advice. Furthermore, in transportation, AI is driving advancements in self-driving vehicle technology and optimizing traffic management systems. Despite the manifold advantages associated with AI, there exist apprehensions regarding its potential societal impact. Some express concern about the possibility of AI leading to job displacement, as machines become more adept at performing tasks traditionally undertaken by humans. Additionally, there are worries about the potential malicious applications of AI technology."; + ``` + + ![Define text to summarize](./images/4-define-text-to-summarize.png "Define text to summarize") + +2. Generate the summarized text by entering the following command and click **Execute the selection or full block on HeatWave and create a new block**: + + ```bash + select sys.ML_GENERATE(@text, JSON_OBJECT("task", "summarization","model_id", "mistral-7b-instruct-v1")); + ``` + + ![Summarize text](./images/5-summarize-text.png "Summarize text") + + 3. LLM generates a summary of your text: + + ![Summarized text](./images/6-summarized-text.png "Summarized text") + + +You may now **proceed to the next lab**. + +## Learn More + +- [HeatWave User Guide](https://dev.mysql.com/doc/heatwave/en/) + +- [HeatWave on OCI User Guide](https://docs.oracle.com/en-us/iaas/mysql-database/index.html) + +- [MySQL Documentation](https://dev.mysql.com/) + + +## Acknowledgements + +- **Author** - Aijaz Fatima, Product Manager +- **Contributors** - Mandy Pang, Senior Principal Product Manager, Aijaz Fatima, Product Manager +- **Last Updated By/Date** - Aijaz Fatima, Product Manager, August 2024 + diff --git a/heatwave-genai/generate-content/images/1-load-llm.png b/heatwave-genai/generate-content/images/1-load-llm.png new file mode 100644 index 00000000..b159908a Binary files /dev/null and b/heatwave-genai/generate-content/images/1-load-llm.png differ diff --git a/heatwave-genai/generate-content/images/2-generate-response.png b/heatwave-genai/generate-content/images/2-generate-response.png new file mode 100644 index 00000000..8b18e316 Binary files /dev/null and b/heatwave-genai/generate-content/images/2-generate-response.png differ diff --git a/heatwave-genai/generate-content/images/3-llm-ouput.png b/heatwave-genai/generate-content/images/3-llm-ouput.png new file mode 100644 index 00000000..3428b5d3 Binary files /dev/null and b/heatwave-genai/generate-content/images/3-llm-ouput.png differ diff --git a/heatwave-genai/generate-content/images/4-define-text-to-summarize.png b/heatwave-genai/generate-content/images/4-define-text-to-summarize.png new file mode 100644 index 00000000..be0eac21 Binary files /dev/null and b/heatwave-genai/generate-content/images/4-define-text-to-summarize.png differ diff --git a/heatwave-genai/generate-content/images/5-summarize-text.png b/heatwave-genai/generate-content/images/5-summarize-text.png new file mode 100644 index 00000000..7229b764 Binary files /dev/null and b/heatwave-genai/generate-content/images/5-summarize-text.png differ diff --git a/heatwave-genai/generate-content/images/6-summarized-text.png b/heatwave-genai/generate-content/images/6-summarized-text.png new file mode 100644 index 00000000..674836fa Binary files /dev/null and b/heatwave-genai/generate-content/images/6-summarized-text.png differ diff --git a/heatwave-genai/get-started/get-started.md b/heatwave-genai/get-started/get-started.md new file mode 100644 index 00000000..9cc16911 --- /dev/null +++ b/heatwave-genai/get-started/get-started.md @@ -0,0 +1,57 @@ +# Get Started + +## Introduction + +Oracle Cloud is the industry's broadest and most integrated cloud provider, with deployment options ranging from the public cloud to your data center. Oracle Cloud offers best-in-class services across Software as a Service (SaaS), Platform as a Service (PaaS), and Infrastructure as a Service (IaaS). + +_Estimated Time:_ 15 minutes + +We offer two types of Cloud Accounts: + +- _Free Tier Accounts_: After you sign up for the free [Oracle Cloud promotion](https://signup.cloud.oracle.com/?sourceType=:ow:lp:cpo::::RC_WWMK211125P00013:llid=3306) or sign up for a paid account, you’ll get a welcome email. The email provides you with your cloud account details and sign in credentials. + +- _Oracle Cloud Paid Accounts_: When your tenancy is provisioned, Oracle sends an email to the default administrator at your company with the sign-in credentials and URL. This administrator can then create a user for each person who needs access to the Oracle Cloud. Check your email or contact your administrator for your credentials and account name. + +### Objectives + +In this lab, you will be guided through the following tasks: + +- Learn how to log in to your Oracle Cloud Account. + +### Prerequisites + +- Cloud Account Name - The name of your tenancy (supplied by the administrator or in your Oracle Cloud welcome email) +- Username +- Password + +## Task 1: Log in to Oracle Cloud + +1. Go to cloud.oracle.com and enter your **Cloud Account Name** and click **Next**. This is the name you chose while creating your account in the previous section. It's NOT your email address. If you've forgotten the name, see the confirmation email. + +2. Click **Continue** to reveal the login input fields. + + ![Enable Lakehouse](./images/1-enable-lakehouse.png "Enable Lakehouse") + +3. Enter your Cloud Account credentials and click **Sign In**. Your username is your email address. The password is what you chose when you signed up for an account. + + ![Enable Lakehouse dialog](./images/2-enable-lakehouse-dialog.png "Enable Lakehouse dialog") + +4. Based on the Multi-factor authentication setup for your account, provide authentication to sign into the account. For example, click **Allow** on the app or enter your **authentication code** and click **Verify** based on the authentication setup. For more details, refer the [Managing Multifactor Authentication documentation](https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/usingmfa.htm) + + ![Lakehouse enabled](./images/3-lakehouse-enabled.png "Lakehouse enabled") + +You may now **proceed to the next lab**. + +## Learn More + +- [HeatWave User Guide](https://dev.mysql.com/doc/heatwave/en/) + +- [HeatWave on OCI User Guide](https://docs.oracle.com/en-us/iaas/mysql-database/index.html) + +- [MySQL Documentation](https://dev.mysql.com/) + +## Acknowledgements + +- **Author** - Aijaz Fatima, Product Manager +- **Contributors** - Mandy Pang, Senior Principal Product Manager +- **Last Updated By/Date** - Aijaz Fatima, Product Manager, August 2024 \ No newline at end of file diff --git a/heatwave-genai/introduction/images/1-heatwave-genai.png b/heatwave-genai/introduction/images/1-heatwave-genai.png new file mode 100644 index 00000000..f5bc1e54 Binary files /dev/null and b/heatwave-genai/introduction/images/1-heatwave-genai.png differ diff --git a/heatwave-genai/introduction/images/2-heatwave-components.png b/heatwave-genai/introduction/images/2-heatwave-components.png new file mode 100644 index 00000000..7d235edc Binary files /dev/null and b/heatwave-genai/introduction/images/2-heatwave-components.png differ diff --git a/heatwave-genai/introduction/images/heatwave-aws-architect.png b/heatwave-genai/introduction/images/heatwave-aws-architect.png new file mode 100644 index 00000000..243bff98 Binary files /dev/null and b/heatwave-genai/introduction/images/heatwave-aws-architect.png differ diff --git a/heatwave-genai/introduction/images/hwonaws.png b/heatwave-genai/introduction/images/hwonaws.png new file mode 100644 index 00000000..b63cace0 Binary files /dev/null and b/heatwave-genai/introduction/images/hwonaws.png differ diff --git a/heatwave-genai/introduction/images/hwonaws_lakehouse.png b/heatwave-genai/introduction/images/hwonaws_lakehouse.png new file mode 100644 index 00000000..f65b4986 Binary files /dev/null and b/heatwave-genai/introduction/images/hwonaws_lakehouse.png differ diff --git a/heatwave-genai/introduction/images/mhds-hw-oci-integration.png b/heatwave-genai/introduction/images/mhds-hw-oci-integration.png new file mode 100644 index 00000000..254c3fb7 Binary files /dev/null and b/heatwave-genai/introduction/images/mhds-hw-oci-integration.png differ diff --git a/heatwave-genai/introduction/introduction.md b/heatwave-genai/introduction/introduction.md new file mode 100644 index 00000000..4b728b4e --- /dev/null +++ b/heatwave-genai/introduction/introduction.md @@ -0,0 +1,51 @@ +# Introduction + +HeatWave GenAI lets organizations easily process and analyze vast amounts of proprietary unstructured documents in Object Storage. They can develop turnkey AI-powered applications with enhanced performance and enterprise-grade data security. HeatWave genAI supports in-database large language models (LLMs), an automated, in-database vector store, scale-out vector processing, and has the ability to have contextual conversations in natural language. + +HeatWave GenAI is unique because it seamlessly integrates large language models (LLMs) and embedding generation within the database, eliminating the need for external services. This integration enhances performance and security, simplifies application complexity, and reduces costs as it runs on CPUs. HeatWave GenAI integrates seamlessly with other in-database HeatWave capabilities such as machine learning, analytics, and Lakehouse, opening up a new class of applications and providing higher-quality responses. With HeatWave GenAI, you can effortlessly generate new and realistic content, speed up manual or repetitive tasks like summarizing large documents, and engage in natural language interactions. + +![HeatWave GenAI](./images/1-heatwave-genai.png "HeatWave GenAI") + + +## About this Workshop + +In this LiveLab, you will first setup Visual Studio Code. You will then create a HeatWave instance, and connect to it from Visual Studio Code. Subsequently, you will use HeatWave GenAI to generate content in natural language, summarize text, and perform vector search on your enterprise data. + +_Estimated Time:_ 1.5 hours + +## About Product/Technology + +HeatWave is a fully managed cloud service that enables organizations to efficiently run analytics, transaction processing, machine learning, and generative AI using a single service without the need for ETL. Its scale-out architecture is designed to process data stored in Object Storage and MySQL databases, delivering industry-leading performance and price-performance. HeatWave can process structured, semi-structured, and unstructured data in Object Storage. It provides the capability to create a vector store from Object Storage files and enables enterprises to utilize LLMs and generative AI on their internal content. This opens the door to a new class of applications built with HeatWave, including the ability to interact with HeatWave using natural language. HeatWave is available on OCI, AWS, and Azure. + +The following diagram illustrates HeatWave components at a glance. + +![HeatWave components](./images/2-heatwave-components.png "HeatWave components") + +## Objectives + +In this lab, you will be guided through the following steps: + +1. Setup MySQL Shell for Visual Studio Code +2. Create a HeatWave instance +3. Connect to the HeatWave instance from Visual Studio Code +4. Generate content +5. Perform a vector search +6. Build HeatWave RAG Chat Application + +## Prerequisites + +Please make sure you can sign in to your HeatWave OCI Cloud Account. + +## Learn More + +- [HeatWave User Guide](https://dev.mysql.com/doc/heatwave/en/) + +- [HeatWave on OCI User Guide](https://docs.oracle.com/en-us/iaas/mysql-database/index.html) + +- [MySQL Documentation](https://dev.mysql.com/) + +## Acknowledgements + +- **Author** - Aijaz Fatima, Product Manager +- **Contributors** - Mandy Pang, Senior Principal Product Manager +- **Last Updated By/Date** - Aijaz Fatima, Product Manager, August 2024 diff --git a/heatwave-genai/stop-services/images/1-stop-dbs.png b/heatwave-genai/stop-services/images/1-stop-dbs.png new file mode 100644 index 00000000..697612bc Binary files /dev/null and b/heatwave-genai/stop-services/images/1-stop-dbs.png differ diff --git a/heatwave-genai/stop-services/images/2-stop-dialog.png b/heatwave-genai/stop-services/images/2-stop-dialog.png new file mode 100644 index 00000000..4b3653cf Binary files /dev/null and b/heatwave-genai/stop-services/images/2-stop-dialog.png differ diff --git a/heatwave-genai/stop-services/images/3-delete-bucket.png b/heatwave-genai/stop-services/images/3-delete-bucket.png new file mode 100644 index 00000000..96a02a01 Binary files /dev/null and b/heatwave-genai/stop-services/images/3-delete-bucket.png differ diff --git a/heatwave-genai/stop-services/images/4-confirm-deletion.png b/heatwave-genai/stop-services/images/4-confirm-deletion.png new file mode 100644 index 00000000..b5db8201 Binary files /dev/null and b/heatwave-genai/stop-services/images/4-confirm-deletion.png differ diff --git a/heatwave-genai/stop-services/stop-services.md b/heatwave-genai/stop-services/stop-services.md new file mode 100644 index 00000000..9a968272 --- /dev/null +++ b/heatwave-genai/stop-services/stop-services.md @@ -0,0 +1,62 @@ +# Stop Services + +## Introduction + +In this lab you will use the Console to stop all of the Services you created in this workshop. + +_Estimated Time:_ 5 min + +### Objectives + +In this lab, you will be guided through the following task: + +- Stop the HeatWave instance. +- Delete the bucket. + +### Prerequisites + +- An Oracle Trial or Paid Cloud Account +- Some Experience with MySQL Shell +- Completed Lab1-5 + +## Task 1: Stop the HeatWave instance + +1. Click the **Navigation Menu** in the upper left, navigate to **Databases**, and under HeatWave select **DB Systems**. + +2. In the **heatwave-geni** Compartment, select the **heatwave-genai-dbs**, under **Actions**, click **Stop**. + + ![Stop DB system](./images/1-stop-dbs.png "Stop DB system") + +3. In the **Stop DB systems** dialog box, click **Stop DB Systems**. + + ![Stop DB system](./images/2-stop-dialog.png "Stop DB system") + +## Task 2: Delete the bucket + +1. Open the **Navigation menu** and click **Storage**. Under **Object Storage & Archive Storage**, click **Buckets**. + +2. Select the compartment from the list under List Scope. + +3. Click the **More Actions** menu besides your bucket, **bucket-vector-search**, and click **Delete**. + + ![Delete bucket](./images/3-delete-bucket.png "Delete bucket") + +4. In the **Delete Bucket** panel, confirm the bucket name, **bucket-vector-search**, and click **Delete**. + + ![Confirm deletion](./images/4-confirm-deletion.png "Confirm deletion") + +**Congratulations! You have successfully finished the Workshop.** + +## Learn More + +- [HeatWave User Guide](https://dev.mysql.com/doc/heatwave/en/) + +- [HeatWave on OCI User Guide](https://docs.oracle.com/en-us/iaas/mysql-database/index.html) + +- [MySQL Documentation](https://dev.mysql.com/) + +## Acknowledgements + +- **Author** - Aijaz Fatima, Product Manager +- **Contributors** - Mandy Pang, Senior Principal Product Manager +- **Last Updated By/Date** - Aijaz Fatima, Product Manager, August 2024 diff --git a/heatwave-genai/vector-search/images/1-click-bucket.png b/heatwave-genai/vector-search/images/1-click-bucket.png new file mode 100644 index 00000000..82f60d05 Binary files /dev/null and b/heatwave-genai/vector-search/images/1-click-bucket.png differ diff --git a/heatwave-genai/vector-search/images/10-copy-par.png b/heatwave-genai/vector-search/images/10-copy-par.png new file mode 100644 index 00000000..06ec8bd1 Binary files /dev/null and b/heatwave-genai/vector-search/images/10-copy-par.png differ diff --git a/heatwave-genai/vector-search/images/11-create-database.png b/heatwave-genai/vector-search/images/11-create-database.png new file mode 100644 index 00000000..4714d04c Binary files /dev/null and b/heatwave-genai/vector-search/images/11-create-database.png differ diff --git a/heatwave-genai/vector-search/images/12-call-procedure.png b/heatwave-genai/vector-search/images/12-call-procedure.png new file mode 100644 index 00000000..440baa6b Binary files /dev/null and b/heatwave-genai/vector-search/images/12-call-procedure.png differ diff --git a/heatwave-genai/vector-search/images/13-reload-database-information.png b/heatwave-genai/vector-search/images/13-reload-database-information.png new file mode 100644 index 00000000..be50e341 Binary files /dev/null and b/heatwave-genai/vector-search/images/13-reload-database-information.png differ diff --git a/heatwave-genai/vector-search/images/14-ingest-files.png b/heatwave-genai/vector-search/images/14-ingest-files.png new file mode 100644 index 00000000..c6ea2b63 Binary files /dev/null and b/heatwave-genai/vector-search/images/14-ingest-files.png differ diff --git a/heatwave-genai/vector-search/images/15-check-count.png b/heatwave-genai/vector-search/images/15-check-count.png new file mode 100644 index 00000000..83e35b83 Binary files /dev/null and b/heatwave-genai/vector-search/images/15-check-count.png differ diff --git a/heatwave-genai/vector-search/images/16-load-llm.png b/heatwave-genai/vector-search/images/16-load-llm.png new file mode 100644 index 00000000..b2dc477e Binary files /dev/null and b/heatwave-genai/vector-search/images/16-load-llm.png differ diff --git a/heatwave-genai/vector-search/images/17-set-options.png b/heatwave-genai/vector-search/images/17-set-options.png new file mode 100644 index 00000000..07fa2e53 Binary files /dev/null and b/heatwave-genai/vector-search/images/17-set-options.png differ diff --git a/heatwave-genai/vector-search/images/18-vector-search-output.png b/heatwave-genai/vector-search/images/18-vector-search-output.png new file mode 100644 index 00000000..0e9318f9 Binary files /dev/null and b/heatwave-genai/vector-search/images/18-vector-search-output.png differ diff --git a/heatwave-genai/vector-search/images/19-click-domain.png b/heatwave-genai/vector-search/images/19-click-domain.png new file mode 100644 index 00000000..e49b210b Binary files /dev/null and b/heatwave-genai/vector-search/images/19-click-domain.png differ diff --git a/heatwave-genai/vector-search/images/2-create-bucket.png b/heatwave-genai/vector-search/images/2-create-bucket.png new file mode 100644 index 00000000..c55060c1 Binary files /dev/null and b/heatwave-genai/vector-search/images/2-create-bucket.png differ diff --git a/heatwave-genai/vector-search/images/20-current-domain.png b/heatwave-genai/vector-search/images/20-current-domain.png new file mode 100644 index 00000000..afa1c525 Binary files /dev/null and b/heatwave-genai/vector-search/images/20-current-domain.png differ diff --git a/heatwave-genai/vector-search/images/21-click-dynamic-group.png b/heatwave-genai/vector-search/images/21-click-dynamic-group.png new file mode 100644 index 00000000..729cc14e Binary files /dev/null and b/heatwave-genai/vector-search/images/21-click-dynamic-group.png differ diff --git a/heatwave-genai/vector-search/images/22-create-dynamic-group.png b/heatwave-genai/vector-search/images/22-create-dynamic-group.png new file mode 100644 index 00000000..3a249412 Binary files /dev/null and b/heatwave-genai/vector-search/images/22-create-dynamic-group.png differ diff --git a/heatwave-genai/vector-search/images/23-click-compartment.png b/heatwave-genai/vector-search/images/23-click-compartment.png new file mode 100644 index 00000000..1b380661 Binary files /dev/null and b/heatwave-genai/vector-search/images/23-click-compartment.png differ diff --git a/heatwave-genai/vector-search/images/24-copy-comparment-ocid.png b/heatwave-genai/vector-search/images/24-copy-comparment-ocid.png new file mode 100644 index 00000000..b737f184 Binary files /dev/null and b/heatwave-genai/vector-search/images/24-copy-comparment-ocid.png differ diff --git a/heatwave-genai/vector-search/images/25-enter-dynamic-group-details.png b/heatwave-genai/vector-search/images/25-enter-dynamic-group-details.png new file mode 100644 index 00000000..97a4368f Binary files /dev/null and b/heatwave-genai/vector-search/images/25-enter-dynamic-group-details.png differ diff --git a/heatwave-genai/vector-search/images/26-enter-ocid.png b/heatwave-genai/vector-search/images/26-enter-ocid.png new file mode 100644 index 00000000..3ab01e56 Binary files /dev/null and b/heatwave-genai/vector-search/images/26-enter-ocid.png differ diff --git a/heatwave-genai/vector-search/images/27-click-create-dynamic-group.png b/heatwave-genai/vector-search/images/27-click-create-dynamic-group.png new file mode 100644 index 00000000..18d74d08 Binary files /dev/null and b/heatwave-genai/vector-search/images/27-click-create-dynamic-group.png differ diff --git a/heatwave-genai/vector-search/images/28-click-policies.png b/heatwave-genai/vector-search/images/28-click-policies.png new file mode 100644 index 00000000..c8dd7fbe Binary files /dev/null and b/heatwave-genai/vector-search/images/28-click-policies.png differ diff --git a/heatwave-genai/vector-search/images/29-create-policies.png b/heatwave-genai/vector-search/images/29-create-policies.png new file mode 100644 index 00000000..92496f46 Binary files /dev/null and b/heatwave-genai/vector-search/images/29-create-policies.png differ diff --git a/heatwave-genai/vector-search/images/3-enter-bucket-details.png b/heatwave-genai/vector-search/images/3-enter-bucket-details.png new file mode 100644 index 00000000..48c22cff Binary files /dev/null and b/heatwave-genai/vector-search/images/3-enter-bucket-details.png differ diff --git a/heatwave-genai/vector-search/images/30-enter-policy-details.png b/heatwave-genai/vector-search/images/30-enter-policy-details.png new file mode 100644 index 00000000..7134fd79 Binary files /dev/null and b/heatwave-genai/vector-search/images/30-enter-policy-details.png differ diff --git a/heatwave-genai/vector-search/images/31-create-new-folder.png b/heatwave-genai/vector-search/images/31-create-new-folder.png new file mode 100644 index 00000000..4e62d1a5 Binary files /dev/null and b/heatwave-genai/vector-search/images/31-create-new-folder.png differ diff --git a/heatwave-genai/vector-search/images/32-enter-folder-details.png b/heatwave-genai/vector-search/images/32-enter-folder-details.png new file mode 100644 index 00000000..44de9a07 Binary files /dev/null and b/heatwave-genai/vector-search/images/32-enter-folder-details.png differ diff --git a/heatwave-genai/vector-search/images/33-click-bucket-folder.png b/heatwave-genai/vector-search/images/33-click-bucket-folder.png new file mode 100644 index 00000000..732bd65a Binary files /dev/null and b/heatwave-genai/vector-search/images/33-click-bucket-folder.png differ diff --git a/heatwave-genai/vector-search/images/34-click-upload.png b/heatwave-genai/vector-search/images/34-click-upload.png new file mode 100644 index 00000000..73b5b023 Binary files /dev/null and b/heatwave-genai/vector-search/images/34-click-upload.png differ diff --git a/heatwave-genai/vector-search/images/35-bucket-namespace.png b/heatwave-genai/vector-search/images/35-bucket-namespace.png new file mode 100644 index 00000000..2c53fe12 Binary files /dev/null and b/heatwave-genai/vector-search/images/35-bucket-namespace.png differ diff --git a/heatwave-genai/vector-search/images/36-create-domain.png b/heatwave-genai/vector-search/images/36-create-domain.png new file mode 100644 index 00000000..7b282f66 Binary files /dev/null and b/heatwave-genai/vector-search/images/36-create-domain.png differ diff --git a/heatwave-genai/vector-search/images/37-dynamic-group-rule.png b/heatwave-genai/vector-search/images/37-dynamic-group-rule.png new file mode 100644 index 00000000..4651355e Binary files /dev/null and b/heatwave-genai/vector-search/images/37-dynamic-group-rule.png differ diff --git a/heatwave-genai/vector-search/images/38-create-dynamic-group.png b/heatwave-genai/vector-search/images/38-create-dynamic-group.png new file mode 100644 index 00000000..0eb37158 Binary files /dev/null and b/heatwave-genai/vector-search/images/38-create-dynamic-group.png differ diff --git a/heatwave-genai/vector-search/images/39-default-domain.png b/heatwave-genai/vector-search/images/39-default-domain.png new file mode 100644 index 00000000..fb02d0f4 Binary files /dev/null and b/heatwave-genai/vector-search/images/39-default-domain.png differ diff --git a/heatwave-genai/vector-search/images/4-created-bucket.png b/heatwave-genai/vector-search/images/4-created-bucket.png new file mode 100644 index 00000000..10507268 Binary files /dev/null and b/heatwave-genai/vector-search/images/4-created-bucket.png differ diff --git a/heatwave-genai/vector-search/images/5-view-bucket-details.png b/heatwave-genai/vector-search/images/5-view-bucket-details.png new file mode 100644 index 00000000..d5d2428b Binary files /dev/null and b/heatwave-genai/vector-search/images/5-view-bucket-details.png differ diff --git a/heatwave-genai/vector-search/images/6-upload-files.png b/heatwave-genai/vector-search/images/6-upload-files.png new file mode 100644 index 00000000..c77a23fd Binary files /dev/null and b/heatwave-genai/vector-search/images/6-upload-files.png differ diff --git a/heatwave-genai/vector-search/images/7-upload-files-finished.png b/heatwave-genai/vector-search/images/7-upload-files-finished.png new file mode 100644 index 00000000..1673bcce Binary files /dev/null and b/heatwave-genai/vector-search/images/7-upload-files-finished.png differ diff --git a/heatwave-genai/vector-search/images/8-create-par.png b/heatwave-genai/vector-search/images/8-create-par.png new file mode 100644 index 00000000..a5207bcf Binary files /dev/null and b/heatwave-genai/vector-search/images/8-create-par.png differ diff --git a/heatwave-genai/vector-search/images/9-par-details.png b/heatwave-genai/vector-search/images/9-par-details.png new file mode 100644 index 00000000..bd71d836 Binary files /dev/null and b/heatwave-genai/vector-search/images/9-par-details.png differ diff --git a/heatwave-genai/vector-search/images/vector-search-folder.png b/heatwave-genai/vector-search/images/vector-search-folder.png new file mode 100644 index 00000000..88ab6ce4 Binary files /dev/null and b/heatwave-genai/vector-search/images/vector-search-folder.png differ diff --git a/heatwave-genai/vector-search/images/vscode-connection.png b/heatwave-genai/vector-search/images/vscode-connection.png new file mode 100644 index 00000000..dc74a6fe Binary files /dev/null and b/heatwave-genai/vector-search/images/vscode-connection.png differ diff --git a/heatwave-genai/vector-search/vector-search.md b/heatwave-genai/vector-search/vector-search.md new file mode 100644 index 00000000..8e413c2f --- /dev/null +++ b/heatwave-genai/vector-search/vector-search.md @@ -0,0 +1,356 @@ +# Perform Retrieval Augmented Generation + +## Introduction + +Using the in-database vector store and retrieval-augmented generation (RAG), you can load and query unstructured documents stored in Object Storage using natural language within the HeatWave ecosystem. + +_Estimated Time:_ 30 minutes + +### Objectives + +In this lab, you will be guided through the following task: + +- Download HeatWave files. +- Create a bucket and a folder. +- Upload files to the bucket folder. +- Create a dynamic group. +- Write policies for the dynamic group. +- Set up a vector store. +- Perform a vector search. + +### Prerequisites + +- Must complete Lab 4. + +## Task 1: Download HeatWave files + +Download HeatWave files on which we will perform a vector search. + +1. Download the following files and save it in your local computer. + + - https://www.oracle.com/a/ocom/docs/mysql-heatwave-technical-brief.pdf + - https://www.oracle.com/a/ocom/docs/mysql/mysql-heatwave-on-aws-brief.pdf + - https://www.oracle.com/a/ocom/docs/mysql/mysql-heatwave-ml-technical-brief.pdf + - https://www.oracle.com/a/ocom/docs/mysql/mysql-heatwave-lakehouse-technical-brief.pdf + + ![Download files](./images/vector-search-folder.png "Download files") + +## Task 2: Create a bucket and a folder + +The Object Storage service provides reliable, secure, and scalable object storage. Object Storage uses buckets to organize your files. + +1. Open the **Navigation menu** and click **Storage**. Under **Object Storage & Archive Storage**, click **Buckets**. + + ![Click bucket](./images/1-click-bucket.png "Click bucket") + +2. In the **heatwave-genai** compartment, click **Create Bucket**. + + ![Create bucket](./images/2-create-bucket.png "Create bucket") + +3. Enter the **Bucket Name**, and accept the defaults for the rest of the fields. + + ```bash + bucket-vector-search + ``` + +4. Click **Create**. + + ![Enter bucket details](./images/3-enter-bucket-details.png "Enter bucket details") + +5. Once the bucket is created, click the name of the bucket to open the **Bucket Details** page. + + ![Created bucket](./images/4-created-bucket.png "Created bucket") + +6. Copy the bucket name and **Namespace**, and paste the it somewhere for future reference. + + ![Bucket namespace](./images/35-bucket-namespace.png "Bucket namespace") + +7. Under **Objects**, click **More Actions**, and then click **Create New Folder**. + + ![Create new folder](./images/31-create-new-folder.png "Create new folder") + +8. In the **Create New Folder** page, enter a **Name** of the folder, and note it for future reference. + + ```bash + bucket-folder-heatwave + ``` + + ![Enter new folder details](./images/32-enter-folder-details.png "Enter new folder details") + +9. Click **Create**. + +## Task 3: Upload files to the bucket folder + +1. In the **Bucket Details** page, under **Objects**, click the bucket folder name. + + ![Click bucket folder](./images/33-click-bucket-folder.png "Click bucket folder") + +2. Click **Upload**. + + ![Click upload](./images/34-click-upload.png "Click upload") + +3. Click **select files** to display a file selection dialog box. + +4. Select the files you had downloaded earlier in Task 1, and click **Upload**. + + ![Upload files](./images/6-upload-files.png "Upload files") + +5. When the file status shows **Finished**, click **Close** to return to the bucket. + + ![Upload files finished](./images/7-upload-files-finished.png "Upload files finished") + + +## Task 4: Create a dynamic group + +Dynamic groups allow you to group Oracle Cloud Infrastructure resources as principal. You can then create policies to permit the dynamic groups to access Oracle Cloud Infrastructure services. + +1. Open the **Navigation menu**, click **Identity & Security**, and under **Identity**, click **Compartments**. + + ![Click Domain](./images/23-click-compartment.png "Click Domain") + +2. In the **Compartments** page, hover over the OCID of your compartment, click **Copy**, and paste the OCID somewhere for future reference. + + ![Copy compartment OCID](./images/24-copy-comparment-ocid.png "Copy compartment OCID") + +3. Open the **Navigation menu**, click **Identity & Security**, and under **Identity**, click **Domains**. + + ![Click Domain](./images/19-click-domain.png "Click Domain") + +4. Click the domain, **Default**. Note that you had logged into OCI Console using the default identity domain. + + ![Click default domain](./images/39-default-domain.png "Click default domain") + +5. Under **Identity domain**, click **Dynamic groups**. + + ![Click dynamic group](./images/21-click-dynamic-group.png "Click group") + +6. Click **Create dynamic group**. + +7. In the **Create dynamic group** page, enter a **Name** and a **Description** for the dynamic group. *Note* the name of the dynamic group. + + **Name**: + + ```bash + heatwave-genai-dynamic-group + ``` + **Description**: + + ```bash + Dynamic group for HeatWave GenAI + ``` + + ![Create dynamic group](./images/38-create-dynamic-group.png "Create dynamic group") + +8. Enter the followng rule: + + ```bash + ALL{resource.type='mysqldbsystem', resource.compartment.id = ''} + ``` + Replace OCIDComparment with the OCID of the compartment you had copied in Task 3. + + For example: + + ```bash + ALL{resource.type='mysqldbsystem', resource.compartment.id = 'ocid1.compartment.oc1..aaaaaaaad2mplktxh7unkxodwcqpvtj32ierpvvixvu7qedzsfonq'} + ``` + + ![Enter rule](./images/37-dynamic-group-rule.png "Enter rule") + +9. Click **Create**. + + +## Task 5: Write policies for the dynamic group to access Object Storage bucket + +To access Object Storage from HeatWave, you must define a policy that enables the dynamic group to access to buckets and its folders. + + 1. Open the **Navigation menu**, click **Identity & Security**, and under **Identity**, click **Policies**. + + ![Click policy](./images/28-click-policies.png "Click policy") + + 2. Click **Create Policy**. + + ![Create dynamic group](./images/29-create-policies.png "Create dynamic group") + +3. In **Create policy** page, enter the **Name**, and **Description** of the policy. + + **Name**: + + ```bash + heatwave-genai-policy + ``` + **Description**: + ```bash + Policy for HeatWave GenAI + ``` + +4. Ensure that the Compartment is **heatwave-genai**. + +5. Toggle the **Show manual editor** button, and paste the following policy. *Note* that you can use the following command only when you have logged into OCI Console using the default domain. + + ```bash + Allow dynamic-group to read buckets in compartment + Allow dynamic-group to read objects in compartment + ``` + Replace DynamicGroupName with the name of the dynamic group, and CompartmentName with the name of the compartment. + + For example: + + ```bash + Allow dynamic-group heatwave-genai-dynamic-group to read buckets in compartment heatwave-genai + Allow dynamic-group heatwave-genai-dynamic-group to read objects in compartment heatwave-genai + ``` + + 6. Click **Create**. + + ![Enter policy details](./images/30-enter-policy-details.png "Enter policy details") + + + + + +## Task 6: Set up a vector store + +1. Go to Visual Studio Code, and under **DATABASE CONNECTIONS**, click **Open New Database Connection** icon next to your HeatWave instance to connect to it. + + ![Connect database](./images/vscode-connection.png "Connect database") + +2. Create a new schema and select it. + + ```bash + create database genai_db; + use genai_db; + ``` + + ![Create database](./images/11-create-database.png "Create database") + +2. Call the following procedure to create a schema that is used for task management. + + ```bash + select mysql_task_management_ensure_schema(); + ``` + + ![Call procedure](./images/12-call-procedure.png "Call procedure") + +3. Click **Reload Database Information** to view the mysql\_task\_management schema. + + ![Reload Database Information](./images/13-reload-database-information.png "Reload Database Information") + +4. Ingest the file from the Object Storage, create vector embeddings, and load the vector embeddings into HeatWave: + + ```bash + call sys.VECTOR_STORE_LOAD('oci://BucketName@Namespace/Path/', '{"table_name": "VectorStoreTableName"}'); + ``` + Replace the following: + + - BucketName: The OCI Object Storage bucket name that you created in Task 2. + - Namespace: The name of the Object Storage bucket namespace that you copied in Task 2, Step 6. + - Path: Path to the folder that contains the source file that you created in Task 2, Step 7. + - VectorStoreTableName: The name you want for the vector store table + + For example: + + ```bash + call sys.VECTOR_STORE_LOAD('oci://bucket-vector-search@axqzijr6ae84/bucket-folder-heatwave/', '{"table_name": "livelab_embedding"}'); + ``` + + ![Ingest files from Object Storage](./images/14-ingest-files.png "Ingest files from Object Storage") + +5. Wait for a few minutes, and verify that embeddings are loaded in the vector embeddings table. + + ```bash + select count(*) from ; + ``` + For example: + ```bash + select count(*) from livelab_embedding_pdf; + ``` + It takes a couple of minutes to create vector embeddings. You should see a numerical value in the output, which means your embeddings are successfully loaded in the table. + + ![Vector embeddings](./images/15-check-count.png "Vector embeddings") + +## Task 7: Perform retrieval augmented generation + +HeatWave retrieves content from the vector store and provide that as context to the LLM. This process is called as retrieval-augmented generation or RAG. This helps the LLM to produce more relevant and accurate results for your queries. + +1. Set the @options session variable to specify the table for retrieving the vector embeddings, and click **Enter**. + + ```bash + set @options = JSON_OBJECT("vector_store", JSON_ARRAY(".")); + ``` + + For example: + + ```bash + set @options = JSON_OBJECT("vector_store", JSON_ARRAY("genai_db.livelab_embedding_pdf")); + ``` + +2. Set the session @query variable to define your natural language query, and click **Enter**. + + ```bash + set @query=""; + ``` + + Replace AddYourQuery with your natural language query. + + For example: + + ```bash + set @query="What is HeatWave AutoML?"; + ``` + +3. Retrieve the augmented prompt, using the ML_RAG routine, and click **Execute the selection or full block on HeatWave and create a new block**. + + ```bash + call sys.ML_RAG(@query,@output,@options); + ``` + + ![Set options](./images/17-set-options.png "Set options") + +4. Print the output: + + ```bash + select JSON_PRETTY(@output); + ``` + + Text-based content that is generated by the LLM in response to your query is printed as output. The output generated by RAG is comprised of two parts: + + - The text section contains the text-based content generated by the LLM as a response for your query. + + - The citations section shows the segments and documents it referred to as context. + + ![Vector search results](./images/18-vector-search-output.png "Vector search results") + +## Learn More + +- [HeatWave User Guide](https://dev.mysql.com/doc/heatwave/en/) + +- [HeatWave on OCI User Guide](https://docs.oracle.com/en-us/iaas/mysql-database/index.html) + +- [MySQL Documentation](https://dev.mysql.com/) + + +## Acknowledgements + +- **Author** - Aijaz Fatima, Product Manager +- **Contributors** - Mandy Pang, Senior Principal Product Manager, Aijaz Fatima, Product Manager +- **Last Updated By/Date** - Aijaz Fatima, Product Manager, August 2024 \ No newline at end of file diff --git a/heatwave-genai/workshops/freetier/index.html b/heatwave-genai/workshops/freetier/index.html new file mode 100644 index 00000000..63410186 --- /dev/null +++ b/heatwave-genai/workshops/freetier/index.html @@ -0,0 +1,61 @@ + + + + + + + + + Oracle LiveLabs + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + diff --git a/heatwave-genai/workshops/freetier/manifest.json b/heatwave-genai/workshops/freetier/manifest.json new file mode 100644 index 00000000..225a9195 --- /dev/null +++ b/heatwave-genai/workshops/freetier/manifest.json @@ -0,0 +1,57 @@ +{ + "workshoptitle": "Get started with HeatWave GenAI", + "help": "livelabs-help-oci_us@oracle.com", + "tutorials": [ + { + "title": "Introduction", + "description": "The Introduction is always second. The title and contents menu title match for the Introduction.", + "filename": "../../introduction/introduction.md" + }, + + { + "title": "Get Started", + "description": "Prerequisites for LiveLabs (Oracle-owned tenancies). The title of the lab and the Contents Menu title (the title above) match for Prerequisite lab. This lab is always first.", + "filename": "https://oracle-livelabs.github.io/common/labs/cloud-login/cloud-login.md" + }, + + { + "title": "Lab 1: Create a HeatWave instance ", + "filename": "../../create-heatwave/create-heatwave.md" + }, + + { + "title": "Lab 2: Create a Compute instance ", + "filename": "../../create-compute/create-compute.md" + }, + + { + "title": "Lab 3: Connect to the HeatWave Instance from Visual Studio Code", + "filename": "../../connect-dbs-vscode/connect-dbs-vscode.md" + }, + + { + "title": "Lab 4: Use HeatWave In-database LLM to Generate and Summarize Content", + "filename": "../../generate-content/generate-content.md" + }, + + { + "title": "Lab 5: Perform Retrieval Augmented Generation", + "filename": "../../vector-search/vector-search.md" + }, + + { + "title": "Lab 6: Build HeatWave RAG Chat Application", + "filename": "../../develop-app/develop-app.md" + }, + + { + "title": "Stop Services", + "filename": "../../stop-services/stop-services.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-freetier.md" } + ] +}
User
" . $user ."