Skip to content

Commit 9ebbd1d

Browse files
author
BESS Solutions
committed
docs(adopters): friction reduction — setup targets, contributing guide, README fixes
- Makefile: add 'make setup' (interactive config/.env) and 'make onboard' targets - Makefile: add setup/onboard to .PHONY - docs/CONTRIBUTING_ADOPTERS.md: first-PR guide (hardware profile, bug report, docs) - README.md: Quick Start overhauled — setup.sh as step 0, fix admin/bessai, fix .env paths - docs/tutorials/connecting_real_hardware.md: fix broken bounty_program.md link - mkdocs.yml: add CONTRIBUTING_ADOPTERS.md to Para Adopters nav section
1 parent 2d48b0c commit 9ebbd1d

5 files changed

Lines changed: 197 additions & 14 deletions

File tree

Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# BESSAI Edge Gateway — Developer Makefile
22
# Usage: make <target> → make help for full list
33

4-
.PHONY: help dev install test test-cov test-compliance test-fast lint lint-fix type-check security audit \
4+
.PHONY: help dev install setup onboard test test-cov test-compliance test-fast lint lint-fix type-check security audit \
55
all-checks simulate health up up-sim down logs build \
66
gen-onnx export-cmg fetch-cmg evolve train-drl train-ppo \
77
cert pilot compliance-report fleet \
@@ -33,6 +33,16 @@ dev: ## Install all dev dependencies + pre-commit hooks + security hooks
3333
install: ## Install runtime dependencies only
3434
pip install -e "."
3535

36+
setup: ## Interactive setup — generate config/.env for your site (5 questions)
37+
@bash scripts/setup.sh
38+
39+
onboard: setup ## Full onboarding: generate config/.env + activate PI hooks + verify Docker
40+
@bash scripts/install_hooks.sh
41+
@echo ""
42+
@echo "✅ config/.env generated and PI hooks active."
43+
@echo "📖 Next step: make up-sim → demo local con simulador"
44+
@echo "📖 Full guide: docs/ONBOARDING_7DAYS.md"
45+
3646
# ── Testing ────────────────────────────────────────────────────────────────────
3747

3848
test: ## Run full test suite (compliance + edge)

README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,28 +170,33 @@ graph LR
170170

171171
## ⚡ Quick Start
172172

173-
### 1. Local (Python)
173+
### 0. Setup interactivo (recomendado)
174174

175175
```bash
176176
git clone https://github.com/bess-solutions/open-bess-edge.git
177177
cd open-bess-edge
178-
make dev # install all deps + pre-commit hooks
179-
cp .env.example .env # edit with your BESS IP + credentials
180-
make simulate # run with built-in hardware simulator
181-
make health # verify all subsystems are up
178+
bash scripts/setup.sh # 5 preguntas → genera config/.env listo
179+
```
180+
181+
### 1. Local (Python)
182+
183+
```bash
184+
make dev # instala dependencias + pre-commit hooks
185+
bash scripts/setup.sh # genera config/.env
186+
make simulate # arranca con simulador integrado
187+
make health # verifica que todo está activo
182188
```
183189

184190
### 2. Docker Compose (recommended)
185191

186192
```bash
187193
git clone https://github.com/bess-solutions/open-bess-edge.git
188194
cd open-bess-edge
189-
cp .env.example .env
190-
docker compose up -d # core gateway
191-
docker compose --profile monitoring up -d # + Prometheus + Grafana
195+
bash scripts/setup.sh # genera config/.env con parámetros de tu sitio
196+
docker compose -f infrastructure/docker/docker-compose.yml --profile simulator --profile monitoring up -d
192197
```
193198

194-
Grafana → http://localhost:3000 (admin / bessai)
199+
Grafana → http://localhost:3000 (credenciales: ver `GF_SECURITY_ADMIN_PASSWORD` en `config/.env`)
195200
Metrics → http://localhost:8000/metrics
196201
Health → http://localhost:8000/health
197202

docs/CONTRIBUTING_ADOPTERS.md

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
# 🤝 Cómo contribuir como Early Adopter
2+
3+
> Esta guía está dirigida a usuarios que quieren contribuir con su primera mejora al proyecto — sin necesidad de ser expertos en el código interno.
4+
5+
---
6+
7+
## Contribuciones más valoradas por la comunidad
8+
9+
| Tipo | Dificultad | Impacto |
10+
|------|-----------|---------|
11+
| ➕ Perfil JSON de nuevo hardware | ⭐ Baja | 🔴 Alto |
12+
| 🐛 Reportar bug con logs completos | ⭐ Baja | 🔴 Alto |
13+
| 📝 Mejorar documentación / traducción | ⭐ Baja | 🟡 Medio |
14+
| 🧪 Escribir test para un caso de borde | ⭐⭐ Media | 🟡 Medio |
15+
| ✨ Implementar feature de GOOD_FIRST_ISSUES | ⭐⭐ Media | 🔴 Alto |
16+
| 🏗️ Nuevo conector de mercado (CENACE, REE…) | ⭐⭐⭐ Alta | 🔴 Alto |
17+
18+
---
19+
20+
## Contribución 1 — Perfil de hardware (más común)
21+
22+
Tienes un inversor que no está en `registry/`. En 30 minutos puedes aportarlo.
23+
24+
### Paso 1 — Revisar el formato existente
25+
26+
```bash
27+
cat registry/huawei_sun2000.json | python3 -m json.tool
28+
```
29+
30+
La estructura es:
31+
```json
32+
{
33+
"profile_id": "huawei_sun2000_v1",
34+
"manufacturer": "Huawei",
35+
"model": "SUN2000",
36+
"protocol": "modbus_tcp",
37+
"default_port": 502,
38+
"default_slave_id": 0,
39+
"registers": {
40+
"soc_pct": {"address": 37760, "type": "uint16", "scale": 0.1, "unit": "%"},
41+
"power_kw": {"address": 37113, "type": "int32", "scale": 0.001, "unit": "kW"},
42+
"temp_c": {"address": 35182, "type": "int16", "scale": 0.1, "unit": "°C"}
43+
}
44+
}
45+
```
46+
47+
### Paso 2 — Crear tu perfil
48+
49+
```bash
50+
cp registry/huawei_sun2000.json registry/mi_inversor_modelo.json
51+
# Editar con los registros Modbus de tu fabricante
52+
```
53+
54+
Los tres registros **obligatorios** son `soc_pct`, `power_kw` y `temp_c`. Los demás son opcionales.
55+
56+
### Paso 3 — Validar el perfil
57+
58+
```bash
59+
make validate-registry
60+
# Debe pasar sin errores antes de abrir el PR
61+
```
62+
63+
### Paso 4 — Abrir el PR
64+
65+
```bash
66+
git checkout -b feat/hardware-profile-FABRICANTE-MODELO
67+
git add registry/mi_inversor_modelo.json
68+
git commit -m "feat(registry): add FABRICANTE MODELO profile"
69+
git push origin feat/hardware-profile-FABRICANTE-MODELO
70+
```
71+
72+
Luego ve a GitHub y abre el Pull Request. El team lo revisa en ≤ 3 días hábiles.
73+
74+
> **TIP:** Menciona en el PR qué firmware version del inversor usaste para identificar los registros.
75+
76+
---
77+
78+
## Contribución 2 — Reportar un bug
79+
80+
Usa el template de issue en GitHub:
81+
[Nuevo issue → Bug Report](https://github.com/bess-solutions/open-bess-edge/issues/new?template=bug_report.yml)
82+
83+
Los logs más útiles para el equipo:
84+
85+
```bash
86+
# Logs del gateway (últimas 50 líneas)
87+
docker logs bessai-edge 2>&1 | tail -50
88+
89+
# Estado de compliance
90+
curl http://localhost:8000/compliance/report | python3 -m json.tool
91+
92+
# Versión exacta
93+
git log --oneline -1
94+
docker inspect bessai-edge | python3 -c "import sys,json; d=json.load(sys.stdin)[0]; print(d['Config']['Image'])"
95+
```
96+
97+
---
98+
99+
## Contribución 3 — Mejorar documentación
100+
101+
La documentación está en `docs/` en formato Markdown. Para visualizarla localmente:
102+
103+
```bash
104+
pip install mkdocs-material
105+
mkdocs serve # → http://localhost:8001
106+
```
107+
108+
Para traducir partes al inglés (el repo está en español/inglés mezclado):
109+
- Abre un PR con la traducción
110+
- El team la revisa y la integra
111+
112+
---
113+
114+
## Proceso de revisión — qué esperar
115+
116+
```
117+
Tu PR abierto
118+
119+
120+
CI automático (~5 min) ← lint, type-check, tests, security scan
121+
122+
123+
Revisión del team (~3 días hábiles)
124+
125+
├── ✅ Aprobado → Merge a main
126+
└── 💬 Cambios solicitados → Iterar
127+
```
128+
129+
### Estándares de calidad obligatorios
130+
131+
- `make lint` debe pasar sin errores
132+
- `make test` debe pasar (o documentar por qué el test no aplica)
133+
- Nuevos archivos Python deben tener type hints
134+
- Commits en formato [Conventional Commits](https://www.conventionalcommits.org/): `feat:`, `fix:`, `docs:`, etc.
135+
136+
---
137+
138+
## Primeros issues recomendados para newcomers
139+
140+
Ver [GOOD_FIRST_ISSUES.md](GOOD_FIRST_ISSUES.md) para issues etiquetados con `good-first-issue`.
141+
142+
Los más accesibles actualmente:
143+
- Agregar un perfil JSON de hardware faltante
144+
- Mejorar el mensaje de error cuando `MODBUS_HOST` no es accesible
145+
- Traducir secciones del `ADOPTER_HUB.md` al inglés
146+
147+
---
148+
149+
## Stack técnico de referencia
150+
151+
| Capa | Tecnología |
152+
|------|-----------|
153+
| Runtime | Python 3.11+ / asyncio |
154+
| Protocolo industrial | pymodbus 3.x |
155+
| API REST | FastAPI + uvicorn |
156+
| Observabilidad | Prometheus + structlog + OpenTelemetry |
157+
| IA / ML | ONNX Runtime + scikit-learn |
158+
| Tests | pytest + pytest-asyncio |
159+
| Linter | ruff + mypy strict |
160+
| Contenedores | Docker multi-arch (amd64/arm64) |
161+
| CI | GitHub Actions |
162+
163+
---
164+
165+
*¿Tienes dudas? [Abre un issue](https://github.com/bess-solutions/open-bess-edge/issues/new?labels=question) o escríbenos a `ingenieria@bess-solutions.cl`.*

docs/tutorials/connecting_real_hardware.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,13 @@ Deberías ver valores reales (no el rango simulado 20-95% SOC):
154154

155155
## Paso 7 — Hardware no soportado
156156

157-
Si tu inversor no está entre los 4 perfiles:
157+
Si tu inversor no está entre los perfiles existentes:
158158

159-
1. Abre un issue con el template [`hardware_support.yml`](https://github.com/bess-solutions/open-bess-edge/issues/new?template=hardware_support.yml)
160-
2. Adjunta el Modbus register map del fabricante
161-
3. Si tienes acceso al inversor, puedes contribuir el perfil JSON y recibir un **bounty** (ver [bounty_program.md](bounty_program.md))
159+
1. Revisa si ya hay un issue abierto: [buscar en issues con etiqueta `hardware`](https://github.com/bess-solutions/open-bess-edge/issues?q=label%3Ahardware)
160+
2. Si no existe, abre uno con la etiqueta `hardware` describiendo tu inversor y adjunta el mapa de registros Modbus del fabricante
161+
3. Si tienes acceso al inversor físico, puedes contribuir el perfil JSON directamente: ver guía [hardware_profile_contribution.md](hardware_profile_contribution.md)
162+
163+
> Las contribuciones de perfiles de hardware son las más valoradas por la comunidad — se mencionan explícitamente en las release notes.
162164
163165
---
164166

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ nav:
7272
- Adopter Hub (empieza aquí): ADOPTER_HUB.md
7373
- Onboarding Día 0 → 7: ONBOARDING_7DAYS.md
7474
- FAQ Técnica: FAQ.md
75+
- Contribuir (primer PR): CONTRIBUTING_ADOPTERS.md
7576
- Programa Early Adopters: early_adopters.md
7677
- Pilot Guide (Chile/CEN): PILOT_GUIDE.md
7778
- Getting Started:

0 commit comments

Comments
 (0)