Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
build
cfg/active.yaml
cfg/build.yaml
cfg/cli-compose.yaml
cfg/cli-compose.yaml
cfg/lab-compose.yaml
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 3 additions & 2 deletions cfg/drm/drm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
3 changes: 3 additions & 0 deletions cfg/drm/scenarios/drm-debug.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
scenario_name: "debug"
overrides:
debug: true
3 changes: 0 additions & 3 deletions cfg/drm/scenarios/drm-flight.yaml

This file was deleted.

1 change: 1 addition & 0 deletions cfg/drm/scenarios/drm-nominal.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
scenario_name: "nominal"
overrides:
debug: false
16 changes: 9 additions & 7 deletions cfg/lab-compose.yaml → cfg/lab-compose.j2
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -12,7 +8,7 @@ services:
- tryspace-net
attach: false
ports:
- "8090:8090" # YAMCS Web Interface
- "8090:8090"
volumes:
- gsw-data:/app/yamcs-data
healthcheck:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion cfg/tryspace-comp-mold.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
19 changes: 18 additions & 1 deletion cfg/tryspace-orchestrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@ 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}")

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)
Expand Down Expand Up @@ -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"
Expand All @@ -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()
2 changes: 1 addition & 1 deletion comp/demo
2 changes: 1 addition & 1 deletion comp/eps
1 change: 1 addition & 0 deletions comp/radio
Submodule radio added at c4ed81
2 changes: 1 addition & 1 deletion gsw