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..a0bc777 100644 --- a/Makefile +++ b/Makefile @@ -4,14 +4,19 @@ 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 +# 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 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