diff --git a/.gitignore b/.gitignore index 8ba3c9e..373794f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ build cfg/active.yaml cfg/build.yaml -cfg/cli-compose.yaml \ No newline at end of file +cfg/cli-compose.yaml +cfg/lab-compose.yaml \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index ee48375..f869daf 100644 --- a/.gitmodules +++ b/.gitmodules @@ -22,3 +22,7 @@ path = comp/eps url = https://github.com/TrySpaceOrg/tryspace-comp-eps.git branch = main +[submodule "comp/radio"] + path = comp/radio + url = https://github.com/TrySpaceOrg/tryspace-comp-radio.git + branch = main diff --git a/cfg/drm/drm.yaml b/cfg/drm/drm.yaml index 0ca2482..5067847 100644 --- a/cfg/drm/drm.yaml +++ b/cfg/drm/drm.yaml @@ -2,8 +2,9 @@ mission_name: "drm" components: - name: "demo" - name: "eps" + - name: "radio" scenarios: - name: "nominal" config_file: "drm/scenarios/drm-nominal.yaml" - - name: "flight" - config_file: "drm/scenarios/drm-flight.yaml" + - name: "debug" + config_file: "drm/scenarios/drm-debug.yaml" diff --git a/cfg/drm/scenarios/drm-debug.yaml b/cfg/drm/scenarios/drm-debug.yaml new file mode 100644 index 0000000..0abfa22 --- /dev/null +++ b/cfg/drm/scenarios/drm-debug.yaml @@ -0,0 +1,3 @@ +scenario_name: "debug" +overrides: + debug: true diff --git a/cfg/drm/scenarios/drm-flight.yaml b/cfg/drm/scenarios/drm-flight.yaml deleted file mode 100644 index 6b7eb17..0000000 --- a/cfg/drm/scenarios/drm-flight.yaml +++ /dev/null @@ -1,3 +0,0 @@ -scenario_name: "flight" -overrides: - debug: false diff --git a/cfg/drm/scenarios/drm-nominal.yaml b/cfg/drm/scenarios/drm-nominal.yaml index bcdd9bb..8f6d597 100644 --- a/cfg/drm/scenarios/drm-nominal.yaml +++ b/cfg/drm/scenarios/drm-nominal.yaml @@ -1,2 +1,3 @@ scenario_name: "nominal" overrides: + debug: false diff --git a/cfg/lab-compose.yaml b/cfg/lab-compose.j2 similarity index 85% rename from cfg/lab-compose.yaml rename to cfg/lab-compose.j2 index 917c325..a235aff 100644 --- a/cfg/lab-compose.yaml +++ b/cfg/lab-compose.j2 @@ -1,9 +1,5 @@ -# Start -# docker compose -f lab-compose.yaml up -# View specific containers -# docker attach tryspace-fsw -# docker attach tryspace-director -# docker attach tryspace-server +# lab-compose.j2 +# Jinja2 template for lab-compose.yaml with SIMULITH_LOG_MODE services: tryspace-gsw: image: tryspace-gsw:latest @@ -12,7 +8,7 @@ services: - tryspace-net attach: false ports: - - "8090:8090" # YAMCS Web Interface + - "8090:8090" volumes: - gsw-data:/app/yamcs-data healthcheck: @@ -33,6 +29,7 @@ services: tty: true environment: - NUM_CLIENTS=${NUM_CLIENTS:-2} + - SIMULITH_LOG_MODE=stdout command: ["/bin/sh", "-c", "/app/simulith_server_standalone $${NUM_CLIENTS}"] cpus: "4.0" mem_limit: 2g @@ -50,7 +47,10 @@ services: stdin_open: true tty: true depends_on: + - tryspace-gsw - tryspace-server + environment: + - SIMULITH_LOG_MODE={{ log_mode | default('stdout') }} command: ["/app/simulith_director_standalone"] cpus: "1.0" mem_limit: 512m @@ -69,6 +69,8 @@ services: depends_on: - tryspace-server - tryspace-director + environment: + - SIMULITH_LOG_MODE={{ log_mode | default('stdout') }} sysctls: - fs.mqueue.msg_max=10000 ulimits: diff --git a/cfg/tryspace-comp-mold.py b/cfg/tryspace-comp-mold.py index 621f45d..f768877 100644 --- a/cfg/tryspace-comp-mold.py +++ b/cfg/tryspace-comp-mold.py @@ -199,7 +199,7 @@ def main(): print(f" ./fsw/tryspace_defs/tables/to_lab_sub.c") print(f" ./fsw/tryspace_defs/targets.cmake") print(f" 4. Add the component to the GSW definitions:") - print(f" ./gsw/src/main/yamcs/etc/etc/yamcs.nos3.yaml") + print(f" ./gsw/src/main/yamcs/etc/yamcs.tryspace.yaml") print(f" 5. Build like you would normally and confirm new component runs") print(f" 6. Customize the component for your specific needs") print() diff --git a/cfg/tryspace-orchestrator.py b/cfg/tryspace-orchestrator.py index 7cb014f..312f1d6 100644 --- a/cfg/tryspace-orchestrator.py +++ b/cfg/tryspace-orchestrator.py @@ -40,7 +40,7 @@ def main(): mission_cfg = load_yaml(mission_cfg_path) scenarios = mission_cfg.get("scenarios", []) scenario = scenarios[0]["name"] if scenarios else "nominal" - active = {"mission": mission, "scenario": scenario, "cli": "demo"} + active = {"mission": mission, "scenario": scenario, "cli": "demo", "log_mode": "none"} with open(ACTIVE_PATH, "w") as f: yaml.safe_dump(active, f) print(f"[orchestrator] Created {ACTIVE_PATH} with defaults: mission={mission}, scenario={scenario}") @@ -48,6 +48,7 @@ def main(): mission = active.get("mission") scenario = active.get("scenario", "nominal") cli_component = active.get("cli", "demo") + log_mode = active.get("log", "stdout") # Find mission config file mission_entry = next((m for m in global_cfg["build"]["missions"] if m["name"] == mission), None) @@ -126,6 +127,7 @@ def main(): else: print(f"[orchestrator] No config or template found for component '{comp_name}', skipping.") + # Render cli-compose.yaml from Jinja2 template using cli_component cli_template_path = os.path.abspath(os.path.join(CFG_DIR)) cli_template_file = "cli-compose.j2" @@ -141,5 +143,20 @@ def main(): else: print(f"[orchestrator] cli-compose.j2 template not found, skipping cli-compose.yaml generation.") + # Render lab-compose.yaml from Jinja2 template using log_mode + lab_template_path = os.path.abspath(os.path.join(CFG_DIR)) + lab_template_file = "lab-compose.j2" + lab_template_full_path = os.path.join(lab_template_path, lab_template_file) + lab_compose_output_path = os.path.join(CFG_DIR, "lab-compose.yaml") + if os.path.exists(lab_template_full_path): + env = Environment(loader=FileSystemLoader(lab_template_path)) + template = env.get_template(lab_template_file) + output = template.render(log_mode=log_mode) + with open(lab_compose_output_path, "w") as f: + f.write(output) + print(f"[orchestrator] lab-compose.yaml written to {lab_compose_output_path} (log_mode={log_mode})") + else: + print(f"[orchestrator] lab-compose.j2 template not found, skipping lab-compose.yaml generation.") + if __name__ == "__main__": main() diff --git a/comp/demo b/comp/demo index 57d5ea1..2c0f06f 160000 --- a/comp/demo +++ b/comp/demo @@ -1 +1 @@ -Subproject commit 57d5ea1aeb665bfb1c37a2818e1a6d29e283f4f1 +Subproject commit 2c0f06fa5ccb0a84a95d3e508da0e8d41680c74e diff --git a/comp/eps b/comp/eps index 2e8f87b..0d5a9dd 160000 --- a/comp/eps +++ b/comp/eps @@ -1 +1 @@ -Subproject commit 2e8f87b3e4332174e2ab2c5635b75e8e508cdb62 +Subproject commit 0d5a9dd217dcc07716757614f6047de0cd3d3359 diff --git a/comp/radio b/comp/radio new file mode 160000 index 0000000..c4ed812 --- /dev/null +++ b/comp/radio @@ -0,0 +1 @@ +Subproject commit c4ed812803b177ddf1157a114b8e267643b04058 diff --git a/fsw b/fsw index dd35df9..a3617ef 160000 --- a/fsw +++ b/fsw @@ -1 +1 @@ -Subproject commit dd35df945eb69769e1a7324f765203993260dee2 +Subproject commit a3617efa0a221a56e3a3f287f93c6600e3989296 diff --git a/gsw b/gsw index b304b47..80e590d 160000 --- a/gsw +++ b/gsw @@ -1 +1 @@ -Subproject commit b304b47ef13ad554efd95b7e0bf310c191998e40 +Subproject commit 80e590da3763db63e9bb6b24813d35c7d44a83e5 diff --git a/simulith b/simulith index a62a722..554c81a 160000 --- a/simulith +++ b/simulith @@ -1 +1 @@ -Subproject commit a62a722010e49a88b24377de1725f1fe0fbc7a48 +Subproject commit 554c81aecbbe2629cf484074bf9e46e96fa5e4f5