From 605368b85a83261ee7faf9e2695f127d49947abd Mon Sep 17 00:00:00 2001 From: vitalii Date: Sun, 3 May 2026 00:23:12 +0300 Subject: [PATCH 1/4] ci: serialize image builds into per-branch workflows to cut concurrent build cost Collapse the three previous workflows (build_testnet, build_mainnet, build_gpu) into one workflow per branch: - build_develop.yml: devnet CPU -> testnet CPU -> devnet GPU -> testnet GPU - build_main.yml: mainnet CPU -> mainnet GPU (with version git tag) Steps run sequentially in a single job (one runner, one buildx-cloud session, one Docker login), and a shared concurrency group prevents a develop build and a main build from overlapping. Build steps use `if: !cancelled()` so a failure in one image does not block subsequent images, since the images are independent. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/build_develop.yml | 110 ++++++++++++++++++++++ .github/workflows/build_gpu.yml | 137 ---------------------------- .github/workflows/build_main.yml | 97 ++++++++++++++++++++ .github/workflows/build_mainnet.yml | 110 ---------------------- .github/workflows/build_testnet.yml | 104 --------------------- 5 files changed, 207 insertions(+), 351 deletions(-) create mode 100644 .github/workflows/build_develop.yml delete mode 100644 .github/workflows/build_gpu.yml create mode 100644 .github/workflows/build_main.yml delete mode 100644 .github/workflows/build_mainnet.yml delete mode 100644 .github/workflows/build_testnet.yml diff --git a/.github/workflows/build_develop.yml b/.github/workflows/build_develop.yml new file mode 100644 index 000000000..925d50e62 --- /dev/null +++ b/.github/workflows/build_develop.yml @@ -0,0 +1,110 @@ +name: Build develop images (CPU + GPU) + +on: + push: + branches: + - "develop" + workflow_dispatch: + +concurrency: + group: edge-node-build + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Configure Git + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + + - name: Retrieve edge node version + run: | + VERSION=$(cat ver.py | grep -o "'.*'" | tr -d "'") + echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "Edge node version: $VERSION" + + - name: Check latest naeural_core version + run: | + LATEST_VERSION=$(curl -s https://pypi.org/pypi/naeural-core/json | jq -r '.info.version') + echo "LATEST_NAEURAL_CORE_VERSION=$LATEST_VERSION" >> $GITHUB_ENV + echo "Latest naeural_core version on PyPI: $LATEST_VERSION" + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + with: + version: "lab:latest" + driver: cloud + endpoint: "naeural/naeural-builder" + + - name: Cleanup builder cache + run: | + echo "=========== buildx du (before) ===========" + docker buildx du --builder "${{ steps.buildx.outputs.name }}" + echo "=========== buildx prune ===========" + docker buildx prune -f --verbose --builder "${{ steps.buildx.outputs.name }}" + echo "=========== buildx du (after) ===========" + docker buildx du --builder "${{ steps.buildx.outputs.name }}" + + # 1. devnet CPU + - name: Build and push DEVNET CPU image + if: ${{ !cancelled() }} + uses: docker/build-push-action@v6 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./Dockerfile_devnet + push: true + tags: | + ratio1/edge_node:devnet + + # 2. testnet CPU + - name: Build and push TESTNET CPU image + if: ${{ !cancelled() }} + uses: docker/build-push-action@v6 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./Dockerfile_testnet + push: true + tags: | + ratio1/edge_node:testnet + + # 3. devnet GPU + - name: Build and push DEVNET GPU image + if: ${{ !cancelled() }} + uses: docker/build-push-action@v6 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./Dockerfile_devnet + build-args: | + BASE_IMAGE=ratio1/base_edge_node_amd64_gpu:latest + push: true + tags: | + ratio1/edge_node_gpu:devnet + + # 4. testnet GPU + - name: Build and push TESTNET GPU image + if: ${{ !cancelled() }} + uses: docker/build-push-action@v6 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./Dockerfile_testnet + build-args: | + BASE_IMAGE=ratio1/base_edge_node_amd64_gpu:latest + push: true + tags: | + ratio1/edge_node_gpu:testnet diff --git a/.github/workflows/build_gpu.yml b/.github/workflows/build_gpu.yml deleted file mode 100644 index 44e25d1c2..000000000 --- a/.github/workflows/build_gpu.yml +++ /dev/null @@ -1,137 +0,0 @@ -name: Build GPU images - -on: - push: - branches: - - "develop" - - "main" - workflow_dispatch: - -jobs: - build-gpu-devnet: - if: github.ref == 'refs/heads/develop' || github.event_name == 'workflow_dispatch' - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Retrieve edge node version - run: | - VERSION=$(cat ver.py | grep -o "'.*'" | tr -d "'") - echo "VERSION=$VERSION" >> $GITHUB_ENV - echo "GPU devnet build — edge node version: $VERSION" - - - name: Log in to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - with: - version: "lab:latest" - driver: cloud - endpoint: "naeural/naeural-builder" - - - name: Cleanup space - run: | - docker buildx prune -f --verbose --builder "${{ steps.buildx.outputs.name }}" - - - name: Build and push GPU devnet image - uses: docker/build-push-action@v6 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./Dockerfile_devnet - build-args: | - BASE_IMAGE=ratio1/base_edge_node_amd64_gpu:latest - push: true - tags: "ratio1/edge_node_gpu:devnet" - - build-gpu-testnet: - if: github.ref == 'refs/heads/develop' || github.event_name == 'workflow_dispatch' - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Retrieve edge node version - run: | - VERSION=$(cat ver.py | grep -o "'.*'" | tr -d "'") - echo "VERSION=$VERSION" >> $GITHUB_ENV - echo "GPU testnet build — edge node version: $VERSION" - - - name: Log in to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - with: - version: "lab:latest" - driver: cloud - endpoint: "naeural/naeural-builder" - - - name: Cleanup space - run: | - docker buildx prune -f --verbose --builder "${{ steps.buildx.outputs.name }}" - - - name: Build and push GPU testnet image - uses: docker/build-push-action@v6 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./Dockerfile_testnet - build-args: | - BASE_IMAGE=ratio1/base_edge_node_amd64_gpu:latest - push: true - tags: "ratio1/edge_node_gpu:testnet" - - build-gpu-mainnet: - if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Retrieve edge node version - run: | - VERSION=$(cat ver.py | grep -o "'.*'" | tr -d "'") - echo "VERSION=$VERSION" >> $GITHUB_ENV - echo "GPU mainnet build — edge node version: $VERSION" - - - name: Log in to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - with: - version: "lab:latest" - driver: cloud - endpoint: "naeural/naeural-builder" - - - name: Cleanup space - run: | - docker buildx prune -f --verbose --builder "${{ steps.buildx.outputs.name }}" - - - name: Build and push GPU mainnet image - uses: docker/build-push-action@v6 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./Dockerfile_mainnet - build-args: | - BASE_IMAGE=ratio1/base_edge_node_amd64_gpu:latest - push: true - tags: | - ratio1/edge_node_gpu:mainnet - ratio1/edge_node_gpu:latest diff --git a/.github/workflows/build_main.yml b/.github/workflows/build_main.yml new file mode 100644 index 000000000..d7ef67918 --- /dev/null +++ b/.github/workflows/build_main.yml @@ -0,0 +1,97 @@ +name: Build mainnet images (CPU + GPU) and tag commit + +on: + push: + branches: + - "main" + workflow_dispatch: + +concurrency: + group: edge-node-build + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Configure Git + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + + - name: Retrieve edge node version + run: | + VERSION=$(cat ver.py | grep -o "'.*'" | tr -d "'") + echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "Edge node version: $VERSION" + + - name: Check latest naeural_core version + run: | + LATEST_VERSION=$(curl -s https://pypi.org/pypi/naeural-core/json | jq -r '.info.version') + echo "LATEST_NAEURAL_CORE_VERSION=$LATEST_VERSION" >> $GITHUB_ENV + echo "Latest naeural_core version on PyPI: $LATEST_VERSION" + + - name: Compute image tags + run: | + echo "IMAGE_TAG=ratio1/edge_node:${VERSION}" >> $GITHUB_ENV + echo "Tagging image as: ratio1/edge_node:${VERSION}" + + - name: Tag main commit with version + run: | + git tag -a "$VERSION" -m "Version $VERSION" + git push origin "$VERSION" + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + with: + version: "lab:latest" + driver: cloud + endpoint: "naeural/naeural-builder" + + - name: Cleanup builder cache + run: | + echo "=========== buildx du (before) ===========" + docker buildx du --builder "${{ steps.buildx.outputs.name }}" + echo "=========== buildx prune ===========" + docker buildx prune -f --verbose --builder "${{ steps.buildx.outputs.name }}" + echo "=========== buildx du (after) ===========" + docker buildx du --builder "${{ steps.buildx.outputs.name }}" + + # 1. mainnet CPU + - name: Build and push MAINNET CPU image + if: ${{ !cancelled() }} + uses: docker/build-push-action@v6 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./Dockerfile_mainnet + push: true + tags: | + ${{ env.IMAGE_TAG }} + ratio1/edge_node:latest + ratio1/edge_node:mainnet + + # 2. mainnet GPU + - name: Build and push MAINNET GPU image + if: ${{ !cancelled() }} + uses: docker/build-push-action@v6 + with: + builder: ${{ steps.buildx.outputs.name }} + context: . + file: ./Dockerfile_mainnet + build-args: | + BASE_IMAGE=ratio1/base_edge_node_amd64_gpu:latest + push: true + tags: | + ratio1/edge_node_gpu:mainnet + ratio1/edge_node_gpu:latest diff --git a/.github/workflows/build_mainnet.yml b/.github/workflows/build_mainnet.yml deleted file mode 100644 index 3948df07d..000000000 --- a/.github/workflows/build_mainnet.yml +++ /dev/null @@ -1,110 +0,0 @@ -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go - -name: Build main branchimage and tag commit/image with version number - -on: - push: - branches: - - "main" - workflow_dispatch: - -jobs: - tag-and-build-push-mainnet: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - # - name: Checkout code - # uses: actions/checkout@v3 - - - name: Configure Git - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - - - ## version getting and debugging - - - name: Retrieve edge node version - id: retrieve_version - run: | - echo "VERSION=$(cat ver.py | grep -o "'.*'")" >> $GITHUB_ENV - - - name: Check latest naeural_core version - id: check_core_latest_version - run: | - LATEST_VERSION=$(curl -s https://pypi.org/pypi/naeural-core/json | jq -r '.info.version') - echo "LATEST_NAEURAL_CORE_VERSION=$LATEST_VERSION" >> $GITHUB_ENV - - - name: Debug version - run: | - VERSION=${VERSION//\'/} - echo "Develop version to build: '$VERSION'" - echo "Latest naeural_core version on PyPI: '$LATEST_NAEURAL_CORE_VERSION'" - env: - VERSION: ${{ env.VERSION }} - LATEST_NAEURAL_CORE_VERSION: ${{ env.LATEST_NAEURAL_CORE_VERSION }} - - ## End of version getting and debugging - - - name: Create image tag - id: create_image_tag - run: | - VERSION=${VERSION//\'/} - echo "IMAGE_TAG=ratio1/edge_node:$VERSION" >> $GITHUB_ENV - env: - VERSION: ${{ env.VERSION }} - - - name: Debug version - run: | - VERSION=${VERSION//\'/} - echo "Version to tag: '$VERSION'" - echo "Image tag: '$IMAGE_TAG'" - env: - VERSION: ${{ env.VERSION }} - IMAGE_TAG: ${{ env.IMAGE_TAG }} - - - name: Tag main commit - run: | - VERSION=${VERSION//\'/} - git tag -a $VERSION -m "Version $VERSION" - git push origin $VERSION - env: - VERSION: ${{ env.VERSION }} - - - - name: Log in to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - with: - version: "lab:latest" - driver: cloud - endpoint: "naeural/naeural-builder" - - - name: Cleanup space - run: | - echo "===========docker buildx du ===================" - docker buildx du - echo "===========docker buildx prune -f. Add -af if any other space issues. ============" - docker buildx prune -f - echo "===========docker buildx du =================" - docker buildx du - echo "========================================" - - - - name: Build and push the Amd64 Mainnet image - uses: docker/build-push-action@v6 - with: - context: . - file: ./Dockerfile_mainnet - push: true - tags: | - ${{ env.IMAGE_TAG }} - ratio1/edge_node:latest - ratio1/edge_node:mainnet diff --git a/.github/workflows/build_testnet.yml b/.github/workflows/build_testnet.yml deleted file mode 100644 index dea114519..000000000 --- a/.github/workflows/build_testnet.yml +++ /dev/null @@ -1,104 +0,0 @@ -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go - -name: Build develop image - -on: - push: - branches: - - "develop" - workflow_dispatch: - -jobs: - build-and-push-testnet: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - # - name: Checkout code - # uses: actions/checkout@v3 - - - name: Configure Git - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - - ## version getting and debugging - - - name: Retrieve edge node version - id: retrieve_version - run: | - echo "VERSION=$(cat ver.py | grep -o "'.*'")" >> $GITHUB_ENV - - - name: Check latest naeural_core version - id: check_core_latest_version - run: | - LATEST_VERSION=$(curl -s https://pypi.org/pypi/naeural-core/json | jq -r '.info.version') - echo "LATEST_NAEURAL_CORE_VERSION=$LATEST_VERSION" >> $GITHUB_ENV - - - name: Debug version - run: | - VERSION=${VERSION//\'/} - echo "Develop version to build: '$VERSION'" - echo "Latest naeural_core version on PyPI: '$LATEST_NAEURAL_CORE_VERSION'" - env: - VERSION: ${{ env.VERSION }} - LATEST_NAEURAL_CORE_VERSION: ${{ env.LATEST_NAEURAL_CORE_VERSION }} - - ## End of version getting and debugging - - - name: Log in to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - with: - version: "lab:latest" - driver: cloud - endpoint: "naeural/naeural-builder" - - - name: Debug Buildx - run: | - docker --version - docker buildx version - echo "=== buildx ls ===" - docker buildx ls - echo "=== buildx inspect --bootstrap ===" - docker buildx inspect --bootstrap - - - name: Cleanup space - run: | - echo "===========docker buildx du --builder "${{ steps.buildx.outputs.name }}"(before) ===================" - docker buildx du --builder "${{ steps.buildx.outputs.name }}" - echo "===========docker buildx prune -f --verbose --builder "${{ steps.buildx.outputs.name }}". Add -af if any other space issues. ============" - docker buildx prune -f --verbose --builder "${{ steps.buildx.outputs.name }}" - echo "===========docker buildx du --builder "${{ steps.buildx.outputs.name }}"(after) =================" - docker buildx du --builder "${{ steps.buildx.outputs.name }}" - echo "========================================" - - - - name: Build and push Amd64 TESTNET image - uses: docker/build-push-action@v5 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./Dockerfile_testnet - push: true - # tags: "naeural/edge_node:develop" - tags: | - ratio1/edge_node:develop - ratio1/edge_node:testnet - - - name: Build and push Amd64 DEVNET image - uses: docker/build-push-action@v6 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./Dockerfile_devnet - push: true - tags: | - ratio1/edge_node:devnet From 302924836cb6b8d4cc6ed2b78772e49a64c5accc Mon Sep 17 00:00:00 2001 From: vitalii Date: Sun, 3 May 2026 00:47:32 +0300 Subject: [PATCH 2/4] ci: prune buildx-cloud cache between CPU and GPU build pairs The cloud builder's gcPolicy caps cache at 25GiB. After 2 CPU builds the cache fills with non-GPU layers, then the GPU base (libtorch + CUDA) cannot be extracted and the GPU build fails with "no space left on device" inside /buildkit/data/runc-overlayfs/snapshots/. Prune the builder cache right before the GPU pair so the CPU layers (which the GPU builds cannot reuse anyway) are evicted. The two GPU builds still share the freshly cached GPU base, so we keep within-pair cache reuse. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/build_develop.yml | 10 ++++++++++ .github/workflows/build_main.yml | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/.github/workflows/build_develop.yml b/.github/workflows/build_develop.yml index 925d50e62..44ce3024d 100644 --- a/.github/workflows/build_develop.yml +++ b/.github/workflows/build_develop.yml @@ -81,6 +81,16 @@ jobs: tags: | ratio1/edge_node:testnet + # Free buildx-cloud cache before GPU pair (CPU layers won't be reused). + - name: Prune buildx cache before GPU builds + if: ${{ !cancelled() }} + run: | + echo "=========== buildx du (before GPU prune) ===========" + docker buildx du --builder "${{ steps.buildx.outputs.name }}" + docker buildx prune -af --verbose --builder "${{ steps.buildx.outputs.name }}" + echo "=========== buildx du (after GPU prune) ===========" + docker buildx du --builder "${{ steps.buildx.outputs.name }}" + # 3. devnet GPU - name: Build and push DEVNET GPU image if: ${{ !cancelled() }} diff --git a/.github/workflows/build_main.yml b/.github/workflows/build_main.yml index d7ef67918..5f330a5af 100644 --- a/.github/workflows/build_main.yml +++ b/.github/workflows/build_main.yml @@ -81,6 +81,16 @@ jobs: ratio1/edge_node:latest ratio1/edge_node:mainnet + # Free buildx-cloud cache before GPU build (CPU layers won't be reused). + - name: Prune buildx cache before GPU build + if: ${{ !cancelled() }} + run: | + echo "=========== buildx du (before GPU prune) ===========" + docker buildx du --builder "${{ steps.buildx.outputs.name }}" + docker buildx prune -af --verbose --builder "${{ steps.buildx.outputs.name }}" + echo "=========== buildx du (after GPU prune) ===========" + docker buildx du --builder "${{ steps.buildx.outputs.name }}" + # 2. mainnet GPU - name: Build and push MAINNET GPU image if: ${{ !cancelled() }} From 5ba8ef5e43c394fbc25688248e248b02d9518b12 Mon Sep 17 00:00:00 2001 From: vitalii Date: Sun, 3 May 2026 00:57:55 +0300 Subject: [PATCH 3/4] ci: split each image build into its own job for clearer run-graph view Each image (devnet/testnet CPU+GPU on develop, mainnet CPU+GPU on main) is now its own job, chained via `needs:` to keep them sequential. The run-summary view shows one box per image instead of a single job with nested steps, and individual builds can be re-run on their own. Buildx-cloud cache stays shared across jobs because it lives on the cloud builder (server-side), so layer reuse between adjacent builds is preserved. The CPU-to-GPU prune still runs at the start of the first GPU job to free the CPU layers from the cache cap. Failure semantics unchanged: `if: !cancelled()` on downstream jobs lets each build run independently of the previous one's outcome. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/build_develop.yml | 102 ++++++++++++++++++++-------- .github/workflows/build_main.yml | 51 +++++++------- 2 files changed, 102 insertions(+), 51 deletions(-) diff --git a/.github/workflows/build_develop.yml b/.github/workflows/build_develop.yml index 44ce3024d..9e64dedf6 100644 --- a/.github/workflows/build_develop.yml +++ b/.github/workflows/build_develop.yml @@ -11,16 +11,12 @@ concurrency: cancel-in-progress: false jobs: - build: + # 1. devnet CPU + devnet-cpu: + name: Build devnet CPU runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Configure Git - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" + - uses: actions/checkout@v4 - name: Retrieve edge node version run: | @@ -28,12 +24,6 @@ jobs: echo "VERSION=$VERSION" >> $GITHUB_ENV echo "Edge node version: $VERSION" - - name: Check latest naeural_core version - run: | - LATEST_VERSION=$(curl -s https://pypi.org/pypi/naeural-core/json | jq -r '.info.version') - echo "LATEST_NAEURAL_CORE_VERSION=$LATEST_VERSION" >> $GITHUB_ENV - echo "Latest naeural_core version on PyPI: $LATEST_VERSION" - - name: Log in to Docker Hub uses: docker/login-action@v3 with: @@ -50,16 +40,11 @@ jobs: - name: Cleanup builder cache run: | - echo "=========== buildx du (before) ===========" docker buildx du --builder "${{ steps.buildx.outputs.name }}" - echo "=========== buildx prune ===========" docker buildx prune -f --verbose --builder "${{ steps.buildx.outputs.name }}" - echo "=========== buildx du (after) ===========" docker buildx du --builder "${{ steps.buildx.outputs.name }}" - # 1. devnet CPU - name: Build and push DEVNET CPU image - if: ${{ !cancelled() }} uses: docker/build-push-action@v6 with: builder: ${{ steps.buildx.outputs.name }} @@ -69,9 +54,30 @@ jobs: tags: | ratio1/edge_node:devnet - # 2. testnet CPU + # 2. testnet CPU + testnet-cpu: + name: Build testnet CPU + needs: devnet-cpu + if: ${{ !cancelled() }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + with: + version: "lab:latest" + driver: cloud + endpoint: "naeural/naeural-builder" + - name: Build and push TESTNET CPU image - if: ${{ !cancelled() }} uses: docker/build-push-action@v6 with: builder: ${{ steps.buildx.outputs.name }} @@ -81,9 +87,30 @@ jobs: tags: | ratio1/edge_node:testnet - # Free buildx-cloud cache before GPU pair (CPU layers won't be reused). - - name: Prune buildx cache before GPU builds - if: ${{ !cancelled() }} + # 3. devnet GPU (prunes the buildx-cloud cache first to free CPU layers) + devnet-gpu: + name: Build devnet GPU + needs: testnet-cpu + if: ${{ !cancelled() }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + with: + version: "lab:latest" + driver: cloud + endpoint: "naeural/naeural-builder" + + - name: Prune buildx cache before GPU pair run: | echo "=========== buildx du (before GPU prune) ===========" docker buildx du --builder "${{ steps.buildx.outputs.name }}" @@ -91,9 +118,7 @@ jobs: echo "=========== buildx du (after GPU prune) ===========" docker buildx du --builder "${{ steps.buildx.outputs.name }}" - # 3. devnet GPU - name: Build and push DEVNET GPU image - if: ${{ !cancelled() }} uses: docker/build-push-action@v6 with: builder: ${{ steps.buildx.outputs.name }} @@ -105,9 +130,30 @@ jobs: tags: | ratio1/edge_node_gpu:devnet - # 4. testnet GPU + # 4. testnet GPU + testnet-gpu: + name: Build testnet GPU + needs: devnet-gpu + if: ${{ !cancelled() }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + with: + version: "lab:latest" + driver: cloud + endpoint: "naeural/naeural-builder" + - name: Build and push TESTNET GPU image - if: ${{ !cancelled() }} uses: docker/build-push-action@v6 with: builder: ${{ steps.buildx.outputs.name }} diff --git a/.github/workflows/build_main.yml b/.github/workflows/build_main.yml index 5f330a5af..82bacd6eb 100644 --- a/.github/workflows/build_main.yml +++ b/.github/workflows/build_main.yml @@ -11,11 +11,12 @@ concurrency: cancel-in-progress: false jobs: - build: + # 1. mainnet CPU (also tags the commit with the edge node version) + mainnet-cpu: + name: Build mainnet CPU runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - name: Configure Git run: | @@ -26,18 +27,8 @@ jobs: run: | VERSION=$(cat ver.py | grep -o "'.*'" | tr -d "'") echo "VERSION=$VERSION" >> $GITHUB_ENV - echo "Edge node version: $VERSION" - - - name: Check latest naeural_core version - run: | - LATEST_VERSION=$(curl -s https://pypi.org/pypi/naeural-core/json | jq -r '.info.version') - echo "LATEST_NAEURAL_CORE_VERSION=$LATEST_VERSION" >> $GITHUB_ENV - echo "Latest naeural_core version on PyPI: $LATEST_VERSION" - - - name: Compute image tags - run: | echo "IMAGE_TAG=ratio1/edge_node:${VERSION}" >> $GITHUB_ENV - echo "Tagging image as: ratio1/edge_node:${VERSION}" + echo "Edge node version: $VERSION" - name: Tag main commit with version run: | @@ -60,16 +51,11 @@ jobs: - name: Cleanup builder cache run: | - echo "=========== buildx du (before) ===========" docker buildx du --builder "${{ steps.buildx.outputs.name }}" - echo "=========== buildx prune ===========" docker buildx prune -f --verbose --builder "${{ steps.buildx.outputs.name }}" - echo "=========== buildx du (after) ===========" docker buildx du --builder "${{ steps.buildx.outputs.name }}" - # 1. mainnet CPU - name: Build and push MAINNET CPU image - if: ${{ !cancelled() }} uses: docker/build-push-action@v6 with: builder: ${{ steps.buildx.outputs.name }} @@ -81,9 +67,30 @@ jobs: ratio1/edge_node:latest ratio1/edge_node:mainnet - # Free buildx-cloud cache before GPU build (CPU layers won't be reused). + # 2. mainnet GPU (prunes the buildx-cloud cache first to free CPU layers) + mainnet-gpu: + name: Build mainnet GPU + needs: mainnet-cpu + if: ${{ !cancelled() }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + with: + version: "lab:latest" + driver: cloud + endpoint: "naeural/naeural-builder" + - name: Prune buildx cache before GPU build - if: ${{ !cancelled() }} run: | echo "=========== buildx du (before GPU prune) ===========" docker buildx du --builder "${{ steps.buildx.outputs.name }}" @@ -91,9 +98,7 @@ jobs: echo "=========== buildx du (after GPU prune) ===========" docker buildx du --builder "${{ steps.buildx.outputs.name }}" - # 2. mainnet GPU - name: Build and push MAINNET GPU image - if: ${{ !cancelled() }} uses: docker/build-push-action@v6 with: builder: ${{ steps.buildx.outputs.name }} From e49122c263bef790a6555adfa8f7dc7edc7ec251 Mon Sep 17 00:00:00 2001 From: Cristi Bleotiu <164478159+cristibleotiu@users.noreply.github.com> Date: Wed, 6 May 2026 18:19:33 +0300 Subject: [PATCH 4/4] chore: inc ver --- ver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ver.py b/ver.py index 971f654ba..4ebf09156 100644 --- a/ver.py +++ b/ver.py @@ -1 +1 @@ -__VER__ = '2.10.200' +__VER__ = '2.10.210'