Background
The Simulation interface in simulations/simulation.go was designed from the start as a deployment boundary, each implementation was intended to run as an independently deployable service. A team change introduced the current monolith, wiring all handlers into a single binary without respecting that boundary. This proposal restores the original design intent.
Problem 1: Repository structure
The folder naming has drifted and no longer reflects the contents or the intended architecture.
| Current |
Problem |
webservice.docker/ |
Dot in directory name; not idiomatic |
webservice.docker/servicehub/ |
Vague name for the Calliope/PyPSA runner |
techs/ |
Vague; contains tech service dockerfiles |
webservice.docker/webservice/convertion/ |
Misspelled (conversion) |
docker-compose.photovoltaik.yaml |
German mixed into an English codebase |
.gitlab-ci-.yml |
Broken filename |
servicehub/data/ + servicehub/data_new/ |
Duplicate data directories |
temp_c2p_pkg/, tmp/webservice |
Build artifacts committed to git |
c2p.py, export.py, generate_slp_profiles.py |
Loose scripts at repo root |
Proposed rename (no logic changes, standalone PR):
simulation-engine/
├── engine/ # was webservice.docker/ as Go simulation gateway
│ ├── webservice/ # Go source (unchanged)
│ ├── calliope-runner/ # was servicehub/ as Calliope/PyPSA Python runner
│ └── *.dockerfile
├── services/ # was techs/ as per-tech service dockerfiles
└── docker-compose/ # unchanged
Problem 2: Restoring namespace separation
The original design intent: each Simulation implementation is a separately deployable service, grouped by concern into its own Docker network.
| Namespace |
Services |
building-model |
ignis-sim-api, ignis, buem-sim-api, buem |
renewables |
pv-sim-api, pv, wind-sim-api, wind, biomass-sim-api, biomass, geothermal-sim-api, geothermal |
optimiser |
calliope-sim-api, calliope |
grid-simulator |
pypsa-sim-api, pypsa |
grid-generator |
pylovo-sim-api, pylovo |
All namespaces share a single shared_sim_data Docker volume for simulation outputs.
Implementation: restoring the original intent
The Simulation interface is already the correct abstraction:
type Simulation interface {
Path() string
Configure() http.HandlerFunc
Generate() http.HandlerFunc
Start() http.HandlerFunc
Show() http.HandlerFunc
Log() http.HandlerFunc
Finish() http.HandlerFunc
}
Every handler already implements it. The required change is small: add an ENABLED_SIMS env var that filters which implementations are registered at startup.
// routes.go
all := []Simulation{NewCalliope(), NewPyPSA(), NewBUEM(), NewIgnis(), ...}
enabled := filterByEnv(all, os.Getenv("ENABLED_SIMS"))
for _, sim := range enabled { ... }
Deploy the same binary with different env configs per namespace:
# building-model namespace
environment:
- ENABLED_SIMS=ignis,buem
# optimiser namespace
environment:
- ENABLED_SIMS=calliope
No code split. No new repos. No new images. One binary, multiple deployment profiles, which is what the interface was designed to enable.
Splitting into separate binaries per namespace is explicitly out of scope. It multiplies CI pipelines and images for no benefit over the env-var approach.
Decision needed
Background
The
Simulationinterface insimulations/simulation.gowas designed from the start as a deployment boundary, each implementation was intended to run as an independently deployable service. A team change introduced the current monolith, wiring all handlers into a single binary without respecting that boundary. This proposal restores the original design intent.Problem 1: Repository structure
The folder naming has drifted and no longer reflects the contents or the intended architecture.
webservice.docker/webservice.docker/servicehub/techs/webservice.docker/webservice/convertion/conversion)docker-compose.photovoltaik.yaml.gitlab-ci-.ymlservicehub/data/+servicehub/data_new/temp_c2p_pkg/,tmp/webservicec2p.py,export.py,generate_slp_profiles.pyProposed rename (no logic changes, standalone PR):
Problem 2: Restoring namespace separation
The original design intent: each
Simulationimplementation is a separately deployable service, grouped by concern into its own Docker network.building-modelignis-sim-api,ignis,buem-sim-api,buemrenewablespv-sim-api,pv,wind-sim-api,wind,biomass-sim-api,biomass,geothermal-sim-api,geothermaloptimisercalliope-sim-api,calliopegrid-simulatorpypsa-sim-api,pypsagrid-generatorpylovo-sim-api,pylovoAll namespaces share a single
shared_sim_dataDocker volume for simulation outputs.Implementation: restoring the original intent
The
Simulationinterface is already the correct abstraction:Every handler already implements it. The required change is small: add an
ENABLED_SIMSenv var that filters which implementations are registered at startup.Deploy the same binary with different env configs per namespace:
No code split. No new repos. No new images. One binary, multiple deployment profiles, which is what the interface was designed to enable.
Splitting into separate binaries per namespace is explicitly out of scope. It multiplies CI pipelines and images for no benefit over the env-var approach.
Decision needed
ENABLED_SIMSenv var name and format