OpenG2P Developer Setup
Shared setup for all local stacks. Module pages only document what differs (ports, DBs, commands).
Repository: https://github.com/OpenG2P/openg2p-developer
Quick start
git clone https://github.com/OpenG2P/openg2p-developer.git
cd openg2p-developer
cp .env.example .env
make setup && make infra-upThen open a module page (e.g. Farmer: make farmer-setup && make farmer-registry-run).
Docker Farmer (includes this common stack):
sed -i 's/^USE_EXTERNAL_REDIS=.*/USE_EXTERNAL_REDIS=false/' .env
docker login (Docker Hub)
make sync-images && make docker-farmer-upDefault login: staff / staff.
Prerequisites
Checklist
Docker Engine + Compose v2, Git, Make
Python 3.10+ (3.11+ for AWE/SPAR)
Node.js 18+ (native staff UI)
~20 GB disk; 16 GB+ RAM with Odoo
GitHub + PyPI + npm access;
docker login (Docker Hub)for AWE/Master Data images
Hardware / OS
CPU
4 cores
8+
RAM
8 GB
16 GB+
Disk
15 GB free
30 GB+
macOS
Yes (linux/amd64 for Keycloak / ID Generator on Apple Silicon)
Linux
Yes
Windows
WSL2 + Docker Desktop
Optional macOS: brew install libpq openssl.
Port check
Shared infrastructure (make infra-up)
Service
Port (.env.example)
Credentials
Postgres
5433
postgres / postgres
Redis
6379
none (USE_EXTERNAL_REDIS=true by default; set false for Docker Redis)
MinIO
9000 / console 9001
admin / adminsecret
Keycloak
8080
admin / admin
ID Generator
8040
none
Also used by most app stacks:
Staff Portal hub
3000
App launcher (Docker Farmer/NSR)
IAM Staff Portal API
8020
SSO broker
AWE API / Admin UI
8030 / 8031
Approvals / policies
IAM + AWE come with make *-setup / make pbms-setup, or: make install-iam && make iam-init, make install-awe && make awe-init.
Full port map (module-specific ports belong on module pages): see .env.example.
Users (Keycloak staff realm)
staff
staff
Staff UI / Registry / AWE admin
alex.carter
pass
AWE Stage 1
nina.patel
pass
AWE Stage 2
admin
admin
Keycloak console
Auth flow
Do not refresh /auth/callback. IAM + Redis required (OAuth state ~5 min).
Keycloak
make infra-up / make keycloak-init creates realm staff, users above, and OIDC clients (iam-staff-portal, farmer/NSR portal clients, AWE, Bridge, SPAR, PBMS). IAM secret default: dev-iam-staff-secret.
Workspace
Registry Gen2 (shared)
Celery: beat producers + worker; env under generated/<variant>/celery-*.env (queues must match). Functional IDs need ID Generator + config/id-generator/default.yaml.
Common make targets
Docker Farmer/NSR always start this common stack; variant UI/API ports are on the Farmer / NSR pages (make docker-farmer-up / make docker-nsr-up).
Updating versions
Pins live in two places. Do not hand-edit the # BEGIN IMAGE PINS … # END IMAGE PINS block in .env - that block is overwritten by make sync-images.
1. Docker images (Compose / docker-*-up)
Source of truth: versions.yaml → images:.
Update flow:
Edit the tag(s) under
images:inversions.yaml.Sync into
.env/.env.example:Recreate the stack so Compose pulls the new tags:
For GitLab images (AWE, Master Data), run docker login (Docker Hub) first.
2. Git repo refs (native clone / make setup)
Defaults are in versions.yaml → repos.*.ref. Override per machine in .env without editing versions.yaml:
.env variable
Controls
REGISTRY_REF
registry-platform
IAM_REF
iam-service
FARMER_REGISTRY_REF
farmer-registry
NSR_REF
national-social-registry
AWE_REF
awe
PBMS_REF
pbms
G2P_BRIDGE_REF
g2p-bridge
SPAR_REF
spar
ODOO_REF
odoo17 (usually 17.0)
Update flow:
Set the ref in
.env(branch, tag, or commit), e.g.FARMER_REGISTRY_REF=1.2.0ordevelop.Re-clone or pull that profile:
Reinstall / regenerate as needed:
make clone uses the *_REF values from .env when present; otherwise it uses versions.yaml.
3. Keep images and git refs aligned
Docker-only (make docker-farmer-up)
versions.yaml images: + make sync-images
Native (make farmer-registry-run)
*_REF in .env (and matching extension install)
Both
Update both so UI/API/Celery tags match the git code you expect
After changing pins, prefer recreating app containers rather than only restarting, so Docker actually pulls new digests.
Hybrid cluster
Port-forward shared cluster services instead of local infra:
Then fix hosts/ports in .env and make generate.
Multi-module smoke test
Troubleshooting
Postgres bind conflict
Set POSTGRES_PORT in .env, make generate
Keycloak on Apple Silicon
Compose uses platform: linux/amd64; update Docker Desktop
UI /api/login 500
Use make *-registry-run (copies UI env)
Login Provider Id not received
Restart login from UI; don’t refresh callback
AWE-ERR-008 on task stats
Expected with REGISTRY_AUTH_ENABLED=false
Dashboard login loop
make generate then make *-registry-run
keycloak-init JSON parse error
Current keycloak-init.sh (attributes as JSON); make keycloak-init
Functional IDs PENDING
Beat + worker + matching queues + ID type in default.yaml
Celery beat not ready
make install-registry-extension VARIANT=…
psycopg2-binary on Python 3.14
Use ≥2.9.12 or OPENG2P_PYTHON=python3.13
PBMS search empty
Wait for beneficiary_list_worker
Bridge mapper fails
make seed-spar-farmer-links; check spardb.id_fa_mappings
Bridge/SPAR ports busy
bash scripts/free-bridge-spar-ports.sh
Last updated
Was this helpful?