From 4a710ff294c85fc31e19af9c8164dfe83a029da7 Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Sat, 9 May 2026 20:50:01 -0500 Subject: [PATCH] Move soul-demo build after JS compile to prevent Docker memory pressure on elc --- .gitea/workflows/stage.yaml | 44 ++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.gitea/workflows/stage.yaml b/.gitea/workflows/stage.yaml index 48fc8ef..435fb17 100644 --- a/.gitea/workflows/stage.yaml +++ b/.gitea/workflows/stage.yaml @@ -111,28 +111,6 @@ jobs: # in the build context for Dockerfile COPY to succeed. run: touch src/index.html src/about.html src/terms.html src/enterprise-terms.html - - name: Build soul-demo image tar - # Dockerfile.stage COPYs dist/soul-demo-image.tar so k3s can import - # soul-demo:local at runtime. We compile soul-demo from source on the - # host runner (ci-base has gcc), build a minimal OCI image, and save it. - # Runs before the main Docker build so the COPY succeeds. - if: steps.changetype.outputs.asset_only != 'true' - run: | - set -euo pipefail - # Compile el_runtime.o and soul-demo on the host runner - cc -O2 -DHAVE_CURL -c runtime/el_runtime.c -I runtime/ -o /tmp/el_runtime.o - cc -O2 -rdynamic -DEL_SOUL_DEMO_BUILD \ - -I runtime/ \ - -o dist/soul-demo \ - dist/soul-demo.c dist/vessel_stubs.c /tmp/el_runtime.o \ - -lcurl -lpthread -ldl -lm -lssl -lcrypto - echo "soul-demo compiled: $(ls -lh dist/soul-demo)" - # Package as minimal OCI image for k3s import - docker build -f dist/Dockerfile.soul-demo -t soul-demo:local dist/ - docker save soul-demo:local -o dist/soul-demo-image.tar - echo "soul-demo-image.tar: $(du -sh dist/soul-demo-image.tar | cut -f1)" - docker rmi soul-demo:local 2>/dev/null || true - # ── El SDK setup ────────────────────────────────────────────────────── - name: Extract El SDK from ci-base @@ -184,6 +162,28 @@ jobs: # ── Docker build + push ─────────────────────────────────────────────── + - name: Build soul-demo image tar + # Dockerfile.stage COPYs dist/soul-demo-image.tar so k3s can import + # soul-demo:local at runtime. We compile soul-demo from source on the + # host runner (ci-base has gcc), build a minimal OCI image, and save it. + # Moved AFTER JS compilation to avoid Docker memory pressure killing elc. + if: steps.changetype.outputs.asset_only != 'true' + run: | + set -euo pipefail + # Compile el_runtime.o and soul-demo on the host runner + cc -O2 -DHAVE_CURL -c runtime/el_runtime.c -I runtime/ -o /tmp/el_runtime.o + cc -O2 -rdynamic -DEL_SOUL_DEMO_BUILD \ + -I runtime/ \ + -o dist/soul-demo \ + dist/soul-demo.c dist/vessel_stubs.c /tmp/el_runtime.o \ + -lcurl -lpthread -ldl -lm -lssl -lcrypto + echo "soul-demo compiled: $(ls -lh dist/soul-demo)" + # Package as minimal OCI image for k3s import + docker build -f dist/Dockerfile.soul-demo -t soul-demo:local dist/ + docker save soul-demo:local -o dist/soul-demo-image.tar + echo "soul-demo-image.tar: $(du -sh dist/soul-demo-image.tar | cut -f1)" + docker rmi soul-demo:local 2>/dev/null || true + - name: Build and tag image if: steps.changetype.outputs.asset_only != 'true' run: |