this demo RAG on HeatWave GenAI
- Prerequisites:
- OCI Account (Click here to SignUp) / (Click Here to Login)
- VCN (Click here to learn how)
- Compute Instance (Click here learn how)
- Heatwave DB Instance (Click here learn how)
- Object storage bucket with PAR. (Click here learn how)
-
Make sure your ssh key is secured (Windows users)
chmod 700 <your_ssh_key_path>.key
-
Connect to the compute instance you've created earlier today by running the following command on your shell:
sudo ssh -i <your_ssh_key_path>.key opc@<instance_ip>
-
After you connected to your machine, install git by running the following command:
sudo dnf install git -y
-
Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
-
Disconnect from the server and connect again
exit ssh -a ...
-
Install node lTS
nvm install --lts
-
Make sure Node is installed
node -v result --> v20.15.1
-
Install yarn and pm2
npm install -g pm2 yarn
-
Clone this project
git clone https://github.com/OCI-IL/HeatwaveGenAIDemo.git
-
Change to directory
cd HeatwaveGenAIDemo
-
Run yarn to install all deps.
yarn
-
Change dir to src
cd src
-
Run the create_env scripts, the scripts will ask you for the params of the DB and the PARs for the DB and the frontend and will create .env files
./create_env.sh
-
Return to root folder $ cd ..
-
Run the app using pm2
pm2 start ecosystem.config.js
-
Save the config of pm2
pm2 save
-
Set pm2 to run on startup
pm2 startup systemd
-
The pm2 startup systemd command will generate a command that you need to run with sudo. It usually looks like this:
sudo env PATH=$PATH:/home/opc/.nvm/versions/node/v20.15.1/bin /home/opc/.nvm/versions/node/v20.15.1/lib/node_modules/pm2/bin/pm2 startup systemd -u opc --hp /home/opc
-
Run the output cmd by copy-paste
-
try to access the server locally
curl http://localhost:3003/createDb ->> you should see good result curl http://localhost:3001/ ->> you should see html
-
open the local Oracle linux firewall:
sudo firewall-cmd --zone=public --permanent --add-port=3003/tcp sudo firewall-cmd --zone=public --permanent --add-port=3001/tcp
-
commit the rules
sudo firewall-cmd --reload
If your using Ubuntu please follow this cheat sheet:https://bit.ly/OCI_OS_FW
-
Go back to Chrome and navigate to: http://{public_instance_ip}:3001
-
Upload a PDF file, run embed and enjoy exploring.
-
With the trail account this setup can run for 30 days, until credits are expired. Please turn of the resources if you are not using it.