diff --git a/.github/workflows/build_gpu.yml b/.github/workflows/build_develop.yml similarity index 50% rename from .github/workflows/build_gpu.yml rename to .github/workflows/build_develop.yml index 44e25d1c2..9e64dedf6 100644 --- a/.github/workflows/build_gpu.yml +++ b/.github/workflows/build_develop.yml @@ -1,25 +1,28 @@ -name: Build GPU images +name: Build develop images (CPU + GPU) on: push: branches: - "develop" - - "main" workflow_dispatch: +concurrency: + group: edge-node-build + cancel-in-progress: false + jobs: - build-gpu-devnet: - if: github.ref == 'refs/heads/develop' || github.event_name == 'workflow_dispatch' + # 1. devnet CPU + devnet-cpu: + name: Build devnet CPU runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 + - 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" + echo "Edge node version: $VERSION" - name: Log in to Docker Hub uses: docker/login-action@v3 @@ -35,33 +38,63 @@ jobs: driver: cloud endpoint: "naeural/naeural-builder" - - name: Cleanup space + - name: Cleanup builder cache run: | + docker buildx du --builder "${{ steps.buildx.outputs.name }}" docker buildx prune -f --verbose --builder "${{ steps.buildx.outputs.name }}" + docker buildx du --builder "${{ steps.buildx.outputs.name }}" - - name: Build and push GPU devnet image + - name: Build and push DEVNET CPU 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" + tags: | + ratio1/edge_node:devnet - build-gpu-testnet: - if: github.ref == 'refs/heads/develop' || github.event_name == 'workflow_dispatch' + # 2. testnet CPU + testnet-cpu: + name: Build testnet CPU + needs: devnet-cpu + if: ${{ !cancelled() }} runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 + - 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: Build and push TESTNET CPU image + 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 (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 @@ -77,33 +110,34 @@ jobs: driver: cloud endpoint: "naeural/naeural-builder" - - name: Cleanup space + - name: Prune buildx cache before GPU pair run: | - docker buildx prune -f --verbose --builder "${{ steps.buildx.outputs.name }}" + 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 }}" - - name: Build and push GPU testnet image + - name: Build and push DEVNET GPU image uses: docker/build-push-action@v6 with: builder: ${{ steps.buildx.outputs.name }} context: . - file: ./Dockerfile_testnet + file: ./Dockerfile_devnet build-args: | BASE_IMAGE=ratio1/base_edge_node_amd64_gpu:latest push: true - tags: "ratio1/edge_node_gpu:testnet" + tags: | + ratio1/edge_node_gpu:devnet - build-gpu-mainnet: - if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' + # 4. testnet GPU + testnet-gpu: + name: Build testnet GPU + needs: devnet-gpu + if: ${{ !cancelled() }} 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" + - uses: actions/checkout@v4 - name: Log in to Docker Hub uses: docker/login-action@v3 @@ -119,19 +153,14 @@ jobs: 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 + - name: Build and push TESTNET GPU image uses: docker/build-push-action@v6 with: builder: ${{ steps.buildx.outputs.name }} context: . - file: ./Dockerfile_mainnet + file: ./Dockerfile_testnet build-args: | BASE_IMAGE=ratio1/base_edge_node_amd64_gpu:latest push: true tags: | - ratio1/edge_node_gpu:mainnet - ratio1/edge_node_gpu:latest + ratio1/edge_node_gpu:testnet diff --git a/.github/workflows/build_main.yml b/.github/workflows/build_main.yml new file mode 100644 index 000000000..82bacd6eb --- /dev/null +++ b/.github/workflows/build_main.yml @@ -0,0 +1,112 @@ +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: + # 1. mainnet CPU (also tags the commit with the edge node version) + mainnet-cpu: + name: Build mainnet CPU + runs-on: ubuntu-latest + steps: + - 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 "IMAGE_TAG=ratio1/edge_node:${VERSION}" >> $GITHUB_ENV + echo "Edge node version: $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: | + docker buildx du --builder "${{ steps.buildx.outputs.name }}" + docker buildx prune -f --verbose --builder "${{ steps.buildx.outputs.name }}" + docker buildx du --builder "${{ steps.buildx.outputs.name }}" + + - name: Build and push MAINNET CPU image + 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 (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 + 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 }}" + + - name: Build and push MAINNET GPU 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_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 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'