From 1c962408ba87897a3d968d2d104e6a2bcf1b1202 Mon Sep 17 00:00:00 2001 From: "Lucas, John P." Date: Sat, 16 Aug 2025 22:24:00 -0400 Subject: [PATCH 1/2] [tryspaceorg/tryspace-lab#47] Change to versioned container; --- .github/workflows/ci.yml | 4 ++-- Makefile | 2 +- test/Dockerfile.director | 2 +- test/Dockerfile.server | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 66763b7..3de20d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: build-sim: runs-on: ubuntu-latest container: - image: tryspaceorg/tryspace-lab + image: tryspaceorg/tryspace-lab:0.0.0 steps: - name: Checkout repository uses: actions/checkout@v4 @@ -26,7 +26,7 @@ jobs: build-test: runs-on: ubuntu-latest container: - image: tryspaceorg/tryspace-lab + image: tryspaceorg/tryspace-lab:0.0.0 steps: - name: Checkout repository uses: actions/checkout@v4 diff --git a/Makefile b/Makefile index 187cbcf..4269ad5 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ export BUILDDIR ?= $(CURDIR)/build export TOPDIR ?= $(CURDIR)/.. -export BUILD_IMAGE ?= tryspaceorg/tryspace-lab +export BUILD_IMAGE ?= tryspaceorg/tryspace-lab:0.0.0 export CONTAINER_NAME ?= tryspace-lab export RUNTIME_DIRECTOR_NAME ?= tryspace-director export RUNTIME_SERVER_NAME ?= tryspace-server diff --git a/test/Dockerfile.director b/test/Dockerfile.director index 0e2f8f0..ec9eb2e 100644 --- a/test/Dockerfile.director +++ b/test/Dockerfile.director @@ -1,4 +1,4 @@ -FROM tryspaceorg/tryspace-lab:latest +FROM tryspaceorg/tryspace-lab:0.0.0 # Copy built simulith director and components COPY ./build/simulith_director_standalone /app/simulith_director_standalone diff --git a/test/Dockerfile.server b/test/Dockerfile.server index 92b40fc..ccf512c 100644 --- a/test/Dockerfile.server +++ b/test/Dockerfile.server @@ -1,4 +1,4 @@ -FROM tryspaceorg/tryspace-lab:latest +FROM tryspaceorg/tryspace-lab:0.0.0 # Copy built FSW files into the image COPY build /app From 1bff3989f0115c589b5622acb6f9db2683d4c9e7 Mon Sep 17 00:00:00 2001 From: "Lucas, John P." Date: Sun, 17 Aug 2025 22:36:31 -0400 Subject: [PATCH 2/2] [tryspaceorg/tryspace-lab#47] Limited number of parallel jobs; --- Makefile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4269ad5..a0bc777 100644 --- a/Makefile +++ b/Makefile @@ -9,9 +9,14 @@ export CONTAINER_NAME ?= tryspace-lab export RUNTIME_DIRECTOR_NAME ?= tryspace-director export RUNTIME_SERVER_NAME ?= tryspace-server +# Determine number of parallel jobs to avoid maxing out low-power systems (Raspberry Pi etc.). +# Use `nproc - 1` but ensure at least 1 job. +NPROC := $(shell nproc 2>/dev/null || echo 1) +JOBS := $(shell if [ $(NPROC) -le 1 ]; then echo 1; else expr $(NPROC) - 1; fi) + # Commands build: - docker run --rm -v $(TOPDIR):$(TOPDIR) --user $(shell id -u):$(shell id -g) --name $(CONTAINER_NAME) -w $(CURDIR) $(BUILD_IMAGE) make -j build-sim + docker run --rm -v $(TOPDIR):$(TOPDIR) --user $(shell id -u):$(shell id -g) --name $(CONTAINER_NAME) -w $(CURDIR) $(BUILD_IMAGE) make -j$(JOBS) build-sim build-director: mkdir -p $(BUILDDIR) @@ -58,4 +63,4 @@ stop: docker ps --filter name=tryspace-* | xargs docker stop test: - docker run --rm -v $(TOPDIR):$(TOPDIR) --user $(shell id -u):$(shell id -g) --name $(CONTAINER_NAME) -w $(CURDIR) $(BUILD_IMAGE) make -j build-test + docker run --rm -v $(TOPDIR):$(TOPDIR) --user $(shell id -u):$(shell id -g) --name $(CONTAINER_NAME) -w $(CURDIR) $(BUILD_IMAGE) make -j$(JOBS) build-test