wiki/b-reference/platform/infrastructure.md

112 lines
4.2 KiB
Markdown

<!-- status: canonical -->
<!-- lastReviewed: 2026-05-24 -->
# Deployment-Infrastruktur
## Hosting-Provider
Infomaniak Public Cloud (OpenStack) unter dem Dach-Account **PowerOnUniverse** (ID 17397).
Horizon Dashboard: `https://api.pub1.infomaniak.cloud/horizon`
## Projektstruktur
Jeder Service-Bereich ist ein eigenes OpenStack-Projekt mit eigenem Netzwerk, eigenen Security Groups, eigenen Floating IPs. Die Kommunikation zwischen Projekten laeuft ueber oeffentliche Floating IPs.
| Projekt | OpenStack-ID | Zweck |
|---|---|---|
| **Porta** | PCP-OUJTOXY | Plattform-Kern (Frontend, Backend, DB) |
| **Service-LLM** | PCP-MPXPVCR | Private LLM (Ollama + Flask, GPU) |
| **Service-Teamsbot** | PCP-KO2UYXT | Teams-Browser-Bot |
## Naming Convention
### Schema
```
{bereich}-{env}-{komponente}
```
- **bereich:** `porta` (Plattform-Kern) oder `service` (eigenstaendiger Service)
- **env:** `main` (Produktion) oder `int` (Integration)
- **komponente:** Forgejo-Repo-Name oder `db`
### Regeln
1. Alles fuer PORTA laeuft im Projekt **Porta** mit:
- `porta-main-<repo|db>` fuer alle Produktions-Komponenten
- `porta-int-<repo|db>` fuer alle Integrations-Komponenten
2. Alle eigenstaendigen Services laufen je als **separates Projekt** mit:
- `service-main-<repo>` fuer Produktion
- `service-int-<repo>` fuer Integration (falls vorhanden)
### Instanzen
#### Projekt: Porta (PCP-OUJTOXY)
| Instanzname | Env | Komponente | Flavor | Intern IP | Floating IP | DNS |
|---|---|---|---|---|---|---|
| `porta-main-ui-nyla` | main | Frontend (React/Vite) | a2-ram4-disk20-perf1 | 10.20.0.92 | 37.156.43.5 | `porta.poweron.swiss` |
| `porta-main-platform-core` | main | Backend (FastAPI) | a2-ram4-disk50-perf1 | 10.20.0.197 | 83.228.234.207 | `api.poweron.swiss` |
| `porta-main-db` | main | PostgreSQL + pgvector | a2-ram4-disk80-perf1 | 10.20.0.21 | 37.156.40.141 | -- |
| `porta-int-ui-nyla` | int | Frontend (React/Vite) | a2-ram4-disk20-perf1 | 10.20.0.182 | 37.156.41.74 | `porta-int.poweron.swiss` |
| `porta-int-platform-core` | int | Backend (FastAPI) | a2-ram4-disk50-perf1 | 10.20.0.74 | 37.156.43.14 | `api-int.poweron.swiss` |
| `porta-int-db` | int | PostgreSQL + pgvector | a2-ram4-disk80-perf1 | 10.20.0.175 | 37.156.42.67 | -- |
Key Pair: `ida-laptop` (alle Instanzen)
#### Projekt: Service-LLM (PCP-MPXPVCR)
| Instanzname | Env | Komponente | Flavor | DNS / IP |
|---|---|---|---|---|
| `service-main-llm-private` | main | Ollama + Flask (Vision-LLM) | GPU L4 (24 GB VRAM), 8 vCPU, 16 GB RAM, 150 GB | `83.228.200.109` |
#### Projekt: Service-Teamsbot (PCP-KO2UYXT)
| Instanzname | Env | Komponente | Flavor | Floating IP | DNS |
|---|---|---|---|---|---|
| `service-main-teams-browser-bot` | main | Docker + Playwright/Chrome | a2-ram4-disk20 | 179.237.73.4 | `teamsbot.poweron.swiss` |
Key Pair: `teamsbot-deploy-key`
## Deployment-Patterns
### Porta (git pull + systemd restart)
Deploy-Workflow: `.forgejo/workflows/main_porta-main-platform-core.yml` in `platform-core`
1. Forgejo Actions Runner verbindet per SSH auf die VM
2. `git fetch origin main && git reset --hard origin/main`
3. `pip install -r requirements.txt`
4. `sudo systemctl restart gateway`
### Private LLM (rsync + systemd restart)
Deploy-Workflow: `.github/workflows/deploy.yml` in `service-llm-private`
1. GitHub Actions (noch nicht migriert auf Forgejo) verbindet per SSH
2. `rsync` des Codes nach `/opt/ollama-webapp/app/`
3. `pip install -r requirements.txt`
4. `sudo systemctl restart ollama-webapp`
### Teams-Bot (rsync + docker compose, geplant)
Deploy-Workflow: `.forgejo/workflows/deploy.yml` in `service-teams-browser-bot`
1. Forgejo Actions Runner verbindet per SSH auf die VM
2. `rsync` des Codes nach `/opt/teamsbot/`
3. `docker compose build && docker compose up -d`
4. Health-Check auf Port 4100
## Zugriff
| Ressource | URL / Pfad |
|---|---|
| Infomaniak Cloud Console | `https://www.infomaniak.com/cloud-computing` |
| OpenStack Horizon | `https://api.pub1.infomaniak.cloud/horizon` |
| Forgejo (Git + CI/CD) | `https://git.poweron.swiss` |
| SSH Key (LLM) | `ollama-deploy-key.pem` |
| SSH Key (Teamsbot) | `teamsbot-deploy-key.pem` (geplant) |
Credentials: siehe lokale Datei `local/notes/key.txt` (nicht im Repo).