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
21 changes: 21 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Summary

Provide a brief description of the changes in this pull request.

## How to Test

* ...

## Checklist

- [ ] My code follows the project's coding standards
- [ ] I have performed a self-review of my own code
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my feature works

## Related

List any related issues or submodule PRs that need to be completed:
* ...

Closes #123.
15 changes: 0 additions & 15 deletions .github/PULL_REQUEST_TEMPLATE/issue.md

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.vscode
build
cfg/active.yaml
cfg/build.yaml
cfg/build.yaml
cfg/cli-compose.yaml
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@
path = atlas
url = https://github.com/TrySpaceOrg/TrySpaceOrg.github.io.git
branch = main
[submodule "comp/eps"]
path = comp/eps
url = https://github.com/TrySpaceOrg/tryspace-comp-eps.git
branch = main
43 changes: 30 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Makefile for TrySpace Lab development
.PHONY: build clean clean-cli clean-fsw clean-gsw clean-sim cfg cli container debug fsw gsw help sim start stop uninstall
.PHONY: build clean clean-cache clean-cli clean-fsw clean-gsw clean-sim cfg cli container debug fsw gsw help mold sim start stop uninstall

# Build image name
export BUILD_IMAGE ?= tryspaceorg/tryspace-lab:0.0.0
Expand All @@ -18,17 +18,19 @@ cfg: container

clean:
$(MAKE) stop
@if docker image inspect $(BUILD_IMAGE):latest >/dev/null 2>&1; then \
@if docker image inspect $(BUILD_IMAGE) >/dev/null 2>&1; then \
$(MAKE) clean-cli; \
$(MAKE) clean-fsw; \
$(MAKE) clean-gsw; \
$(MAKE) clean-sim; \
docker volume ls -q --filter "name=gsw-data" | xargs -r docker volume rm \
docker volume ls -q --filter "name=simulith_ipc" | xargs -r docker volume rm \
docker volume ls -q --filter "name=gsw-data" | xargs -r docker volume rm; \
docker volume ls -q --filter "name=simulith_ipc" | xargs -r docker volume rm; \
else \
echo "Docker image $(BUILD_IMAGE) does not exist. Skipping clean subcommands."; \
fi
rm -f $(CFG_DIR)/active.yaml $(CFG_DIR)/build.yaml

clean-cache:
docker builder prune -f

clean-cli:
@for dir in $(CURDIR)/comp/*/cli ; do \
Expand All @@ -44,7 +46,7 @@ clean-gsw:
cd gsw && $(MAKE) clean

clean-sim:
@for dir in $(CURDIR)/comp/* ; do \
@for dir in $(CURDIR)/comp/*/sim ; do \
if [ -d "$$dir" ] && [ -f "$$dir/Makefile" ]; then \
$(MAKE) -C "$$dir" clean; \
fi; \
Expand All @@ -53,13 +55,13 @@ clean-sim:

cli: cfg
$(MAKE) container
$(MAKE) sim
@for dir in $(CURDIR)/comp/*/cli ; do \
if [ -f "$$dir/Makefile" ]; then \
$(MAKE) -C "$$dir" runtime; \
fi; \
done
cd $(CURDIR)/simulith && $(MAKE) director && $(MAKE) server
docker compose -f ./cfg/cli-compose.yml up
docker compose -f ./cfg/cli-compose.yaml up

container: cfg/Dockerfile.base
@command -v docker >/dev/null 2>&1 || { echo "Error: docker is not installed or not in PATH."; exit 1; }
Expand All @@ -74,13 +76,23 @@ fsw: cfg
gsw: cfg
cd $(CURDIR)/gsw && $(MAKE) runtime

mold:
@if [ "$(COMP)" = "" ]; then \
echo "Error: COMP parameter is required"; \
echo "Usage: make mold COMP=<name>"; \
echo "Example: make mold COMP=my_sensor"; \
exit 1; \
fi
python3 $(CFG_DIR)/tryspace-comp-mold.py "$(COMP)"

help:
@echo "Usage: make <target>"
@echo "Targets:"
@echo " build - Build the full runtime environment"
@echo " cfg - Run orchestrator to configure environment"
@echo " cli - Build CLI and start CLI services"
@echo " clean - Remove build artifacts and stop services"
@echo " clean-cache - Clean Docker build cache (frees significant disk space)"
@echo " clean-cli - Clean CLI components"
@echo " clean-fsw - Clean FSW components"
@echo " clean-gsw - Clean GSW components"
Expand All @@ -89,6 +101,7 @@ help:
@echo " debug - Start a debug shell in the container"
@echo " fsw - Build FSW"
@echo " gsw - Build GSW"
@echo " mold - Create new component from demo template (Usage: make mold COMP=<name>)"
@echo " sim - Build Simulith and component simulators"
@echo " start - Start lab services"
@echo " stop - Stop lab and CLI services, clean up Docker images"
Expand All @@ -98,20 +111,24 @@ sim: cfg
@for dir in $(CURDIR)/comp/*/sim ; do \
if [ -d "$$dir" ] && [ -f "$$dir/Makefile" ]; then \
echo "Building component in $$dir"; \
$(MAKE) -C "$$dir" runtime; \
$(MAKE) -C "$$dir" build; \
fi; \
done
cd $(CURDIR)/simulith && $(MAKE) director && $(MAKE) server

start: cfg
docker compose -f ./cfg/lab-compose.yml up
docker compose -f ./cfg/lab-compose.yaml up

stop:
docker compose -f ./cfg/cli-compose.yml down
docker compose -f ./cfg/lab-compose.yml down
docker compose -f ./cfg/cli-compose.yaml down --remove-orphans
docker compose -f ./cfg/lab-compose.yaml down --remove-orphans
docker images -f "dangling=true" -q | xargs -r docker rmi
@echo ""
@echo "To cleanup Docker build cache, run: make clean-cache"
@echo "To cleanup everything Docker, run: docker system prune -a"

uninstall: clean
uninstall: clean clean-cache
rm -f $(CFG_DIR)/active.yaml $(CFG_DIR)/build.yaml
docker ps -a --filter "name=tryspace-" -q | xargs -r docker rm -f
docker images "tryspace-*" -q | xargs -r docker rmi
docker volume ls -q --filter "name=gsw-data" | xargs -r docker volume rm
Expand Down
2 changes: 1 addition & 1 deletion atlas
14 changes: 5 additions & 9 deletions cfg/cli-compose.yml → cfg/cli-compose.j2
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Start
# docker compose -f cli-compose.yml up
# View specific containers
# docker attach tryspace-comp-demo-cli
# docker attach tryspace-sim
# docker attach tryspace-director
# Jinja2 template for dynamic CLI Compose file
# Usage: Render with orchestrator using active CLI component
services:
tryspace-sim:
image: tryspace-server:latest
Expand Down Expand Up @@ -40,9 +36,9 @@ services:
tmpfs:
- /dev/shm:noexec,nosuid,size=100m

tryspace-comp-demo-cli:
image: tryspace-comp-demo-cli:latest
container_name: tryspace-comp-demo-cli
tryspace-comp-{{ cli_component }}-cli:
image: tryspace-comp-{{ cli_component }}-cli:latest
container_name: tryspace-comp-{{ cli_component }}-cli
networks:
- tryspace-net
stdin_open: true
Expand Down
1 change: 1 addition & 0 deletions cfg/drm/drm.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
mission_name: "drm"
components:
- name: "demo"
- name: "eps"
scenarios:
- name: "nominal"
config_file: "drm/scenarios/drm-nominal.yaml"
Expand Down
2 changes: 1 addition & 1 deletion cfg/lab-compose.yml → cfg/lab-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Start
# docker compose -f lab-compose.yml up
# docker compose -f lab-compose.yaml up
# View specific containers
# docker attach tryspace-fsw
# docker attach tryspace-director
Expand Down
Loading