openwebui_demo
5 месяцев назад
5 месяцев назад
5 месяцев назад
5 месяцев назад
5 месяцев назад
5 месяцев назад
5 месяцев назад
5 месяцев назад
5 месяцев назад
5 месяцев назад
5 месяцев назад
5 месяцев назад
5 месяцев назад
5 месяцев назад
README.md
AI Chat Platform on Cloud.ru
A fully automated infrastructure for deploying an AI-powered chat interface using Open WebUI, backed by PostgreSQL, Redis, and S3 storage on Cloud.ru.
Setup & Deployment
Prerequisites
- Cloud.ru account with API access
- Terraform CLI installed
- Cloud.ru API credentials (Access Key, Secret Key, Project ID)
file should be created in.terraformrcdirectory for your userHOMEprovider_installation { filesystem_mirror { path = "<HOME>/.terraform.d/plugins" include = ["cloud.ru/cloudru/cloud"] } network_mirror { url = "https://terraform.cloud.ru/" include = ["registry.terraform.io/*/*"] } }
Configuration
- Edit
with your credentials:terraform.tfvars
⚠️ Security Note: Never commit
to version control. Use environment variables or a secrets manager in production.terraform.tfvars
Deployment Steps
-
Initialize Terraform:
-
Plan the infrastructure:
-
Apply the configuration:
Configure Load balancer
- Create load balancer using Cloud.ru console
- Place load balancer only in
using subnetru.AZ-1ai-chat-subnet-az1-lb - Configure ONLY
as backendai-chat-openwebui-vm-1 - Add ports: 80 -> 80, 443 -> 443
- Get the public IP address of the load balancer
Configure output inventory.ini file
After terraform deployment, the Ansible inventory () is automatically generatedinventory.ini
- Copy the public IP of Load Balancer and then run the following command in the terraform directory:
- Change
for two Redis variables - copy the password, encode it with URL encoding (e.g. with CyberChef — you need to encode all special chars)<URL_encoded_password> - Replace
and<postgresql_password>in the configuration files<postgresql_IP>
Open WebUI configuration
For ai-chat-openwebui-vm-1 configuration:
- Connect to virtual machine
via serial console and install ansible:ai-chat-openwebui-vm-1sudo apt update sudo apt install software-properties-common sudo add-apt-repository --yes --update ppa:ansible/ansible sudo apt install ansible -y - Create
andinventory.iniin home directory and copy content of corresponding files from terraform project (generatedvm1-playbook.yamlandinventory.ini)vms/vm1-playbook.yaml - Apply ansible playbook with its inventory:
For ai-chat-openwebui-vm-2 configuration:
- Now reconfigure target group of load balancer and add
as backend, tooai-chat-openwebui-vm-2 - Connect to virtual machine
and install ansible:ai-chat-openwebui-vm-2sudo apt update sudo apt install software-properties-common sudo add-apt-repository --yes --update ppa:ansible/ansible sudo apt install ansible -y - Create
andinventory.iniin home directory and copy content of corresponding files from terraform project (generatedvm2-playbook.yamlandinventory.ini)vms/vm2-playbook.yaml - Generate SSH key pair with command ssh-keygen -t ed25519 -C "your_email@example.com"
- Copy public key to
of/home/user1/.ssh/authorized_keysai-chat-openwebui-vm-1 - Copy directory
from/home/user1/letsencryptusing scp:ai-chat-openwebui-vm-1scp -i /home/user1/.ssh/id_ed25519 -r user1@<vm1_ip>:/home/user1/letsencrypt /home/user1/letsencrypt - Apply ansible playbook with its inventory:
Usage
Once deployed:
- Access Open WebUI at:
(Note: Public IP is not explicitly exposed in this configuration; use Cloud.ru Load Balancer or DNS to route traffic)http://<public-ip-of-load-balancer> - Check that models from Cloud.ru Foundation Models are available
- Check that uploaded files are stored in the configured S3 bucket