coder13 / coder13/LetsCube

Support an isolated beta/staging environment

Aperta
#181 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
30
Fork
9
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

## Goal

Add a beta/staging environment where changes can be tested without disrupting active production races.

## Current constraints

The production host currently has:

- 1 vCPU
- 1.9 GiB RAM with no swap
- About 738 MiB available RAM during normal operation
- About 505 MiB used by the existing Docker containers
- About 14 GiB free disk space after routine cleanup

Normal beta traffic would be negligible. The main constraints are the fixed memory cost of duplicated services and contention from building images on the single CPU. A fully duplicated stack would add roughly 500 MiB at idle, leaving too little safety margin on the current host.

## Recommended direction

Prefer a fully isolated beta stack on a separate small VPS. This keeps beta deployments, migrations, restarts, memory spikes, and broken builds from affecting production. An on-demand VPS that is stopped when unused could keep the cost low.

If beta must share the production host, first resize it to at least 4 GiB RAM, add service resource limits, and build images in CI rather than on the server.

## Likely implementation work

- Add beta.letscube.net, TLS, and a separately registered WCA OAuth callback.
- Parameterize the Compose project name and currently single-environment deployment script.
- Use separate secrets, sessions, Mongo database, PostgreSQL database, Redis namespace or instance, and migration target.
- Configure beta API, Socket.IO, CORS, and client build origins.
- Separate deployment locks, logs, image and rollback tags, health checks, and backups.
- Prefer CI-built images that each environment pulls and deploys.
- Document beta deployment, rollback, reset, and data-seeding procedures.

## Rough effort

- Minimal usable environment: 1–2 focused days.
- Polished setup with CI image builds, verified rollback, documentation, and end-to-end testing: 2–4 days.

## Alternative options

- Run beta API/socket processes against logically isolated databases on the current host: lower memory use, but it shares production failure modes.
- Run a fully isolated beta stack on demand on the current host: workable only with careful resource management and still risks production contention.
- Host only a beta client against production: very low effort, but it does not safely test backend, protocol, migration, or deployment changes.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia individuando la configurazione Compose e lo script di deployment attualmente per un singolo ambiente, quindi traccia l’API, Socket.IO, le origins della build del client, i secrets e le destinazioni del database. Il lavoro è completato quando beta dispone di risorse di deployment e dati isolate, della gestione di rollback e health-check e di procedure documentate per deployment, reset e data-seeding.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
docker, docker-compose, javascript, mongodb, node.js, postgresql, react, redis
Ambito
api, backend, ci-cd, cloud, databases, devops, documentation, infrastructure
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.