Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .devcontainer/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ ratio1
decentra-vision
python-telegram-bot[rate-limiter]
protobuf==5.28.3
vectordb
ngrok
paramiko
99 changes: 99 additions & 0 deletions .github/workflows/build_gpu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Build GPU images

on:
push:
branches:
- "develop"
- "main"
workflow_dispatch:
inputs:
networks:
description: "Networks to build (comma-separated: devnet,testnet,mainnet)"
required: false
default: "devnet,testnet"

jobs:
build-and-push-gpu:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- network: devnet
dockerfile: Dockerfile_devnet
branch: develop
- network: testnet
dockerfile: Dockerfile_testnet
branch: develop
- network: mainnet
dockerfile: Dockerfile_mainnet
branch: main

# Only build if the branch matches, or if manually dispatched
if: >-
github.event_name == 'workflow_dispatch' ||
(matrix.branch == 'develop' && github.ref == 'refs/heads/develop') ||
(matrix.branch == 'main' && github.ref == 'refs/heads/main')

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
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 "GPU build for ${{ matrix.network }}"
echo "Edge node version: '$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 }}

- 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: |
echo "===========docker buildx du (before) ==================="
docker buildx du --builder "${{ steps.buildx.outputs.name }}"
echo "===========docker buildx prune -f ============"
docker buildx prune -f --verbose --builder "${{ steps.buildx.outputs.name }}"
echo "===========docker buildx du (after) ================="
docker buildx du --builder "${{ steps.buildx.outputs.name }}"

- name: Build and push GPU ${{ matrix.network }} image
uses: docker/build-push-action@v6
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./${{ matrix.dockerfile }}
build-args: |
BASE_IMAGE=ratio1/base_edge_node_amd64_gpu:latest
push: true
tags: "ratio1/edge_node_gpu:${{ matrix.network }}"
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,6 @@ config_startup*.yaml
config_startup*.yml
inference/model_testing/_local_cache/_logs/MPTF.txt
inference/model_testing/_local_cache/_logs/20211224_102325_MPTF_001_log.txt
vectordb
_vector_db_cache
_vector_db_cache_HNSWVectorDB
db_cache

plugins/libs/_cache/
Expand Down
56 changes: 19 additions & 37 deletions Dockerfile_devnet
Original file line number Diff line number Diff line change
@@ -1,45 +1,30 @@
# -d for dind
FROM ratio1/base_edge_node:x86_64-py3.10.12-th2.3.1.cu121-tr4.43.3-dnctk
#FROM aidamian/base_edge_node:x86_64-py3.10.12-th2.3.1.cu121-tr4.43.3-d
# Base image: CPU by default, override with --build-arg BASE_IMAGE=ratio1/base_edge_node_amd64_gpu:latest for GPU
# The base image provides: Python 3.13, PyTorch, FFmpeg, Docker Engine (DIND), Node.js, uv, and ML/data stack
ARG BASE_IMAGE=ratio1/base_edge_node_amd64_cpu:latest
FROM ${BASE_IMAGE}

# Install IPFS
# The line below was creating issues due to flaky external repos
# RUN apt-get update && apt-get install -y wget && apt-get install -y tar
# Install tools needed for the next steps without hitting flaky external repos
# Install IPFS (Kubo) — needed for R1FS decentralized file system
ARG KUBO_VERSION=v0.35.0
RUN set -eux; \
# disable NodeSource (if present) so apt won't read it
rm -f /etc/apt/sources.list.d/nodesource*.list /etc/apt/sources.list.d/nodesource*.sources || true; \
apt-get update -o Acquire::Retries=3; \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
wget tar ca-certificates \
ninja-build; \
rm -rf /var/lib/apt/lists/*

RUN wget https://dist.ipfs.tech/kubo/v0.35.0/kubo_v0.35.0_linux-amd64.tar.gz && \
tar -xvzf kubo_v0.35.0_linux-amd64.tar.gz && \
cd kubo && \
bash install.sh
# End Install IPFS
wget -q https://dist.ipfs.tech/kubo/${KUBO_VERSION}/kubo_${KUBO_VERSION}_linux-amd64.tar.gz; \
tar -xzf kubo_${KUBO_VERSION}_linux-amd64.tar.gz; \
cd kubo && bash install.sh; \
cd / && rm -rf kubo kubo_${KUBO_VERSION}_linux-amd64.tar.gz

# Install Cloudflared
# Install Cloudflared — tunnel engine for exposing webapp endpoints
ARG CLOUDFLARED_VERSION=2025.7.0

RUN set -eux; \
# --- map architecture names to Cloudflare’s file names -------
arch="$(uname -m)"; \
case "$arch" in \
x86_64) arch=amd64 ;; \
aarch64 | arm64) arch=arm64 ;; \
armv7l) arch=armv7 ;; \
arch="$(uname -m)"; \
case "$arch" in \
x86_64) arch=amd64 ;; \
aarch64 | arm64) arch=arm64 ;; \
armv7l) arch=armv7 ;; \
*) echo "Unsupported arch: $arch" >&2; exit 1 ;; \
esac; \
# --- download the pinned release --------------------------------
esac; \
curl -L "https://github.com/cloudflare/cloudflared/releases/download/${CLOUDFLARED_VERSION}/cloudflared-linux-${arch}" \
-o /usr/local/bin/cloudflared; \
chmod +x /usr/local/bin/cloudflared; \
# --- (optional) show version so it appears in build logs --------
-o /usr/local/bin/cloudflared; \
chmod +x /usr/local/bin/cloudflared; \
cloudflared --version
# End Install Cloudflared

COPY ./cmds /usr/local/bin/
RUN chmod +x /usr/local/bin/*
Expand Down Expand Up @@ -84,9 +69,6 @@ ENV EE_DEBUG_R1FS=true
# althouh this is not recommended as it should be in .env file
# ENV EE_DEVICE=cuda:0

# to avoid issues with hnswlib and building from source
ENV HNSWLIB_NO_NATIVE=1

RUN pip install --no-cache-dir -r requirements.txt
RUN pip install --no-cache-dir --no-deps naeural-core

Expand Down
57 changes: 21 additions & 36 deletions Dockerfile_mainnet
Original file line number Diff line number Diff line change
@@ -1,45 +1,30 @@
# -d for dind
#FROM aidamian/base_edge_node:x86_64-py3.10.12-th2.3.1.cu121-tr4.43.3-d
FROM ratio1/base_edge_node:x86_64-py3.10.12-th2.3.1.cu121-tr4.43.3-dnctk

# Install IPFS
# The line below was creating issues due to flaky external repos
# RUN apt-get update && apt-get install -y wget && apt-get install -y tar
# Install tools needed for the next steps without hitting flaky external repos
# Base image: CPU by default, override with --build-arg BASE_IMAGE=ratio1/base_edge_node_amd64_gpu:latest for GPU
# The base image provides: Python 3.13, PyTorch, FFmpeg, Docker Engine (DIND), Node.js, uv, and ML/data stack
ARG BASE_IMAGE=ratio1/base_edge_node_amd64_cpu:latest
FROM ${BASE_IMAGE}

# Install IPFS (Kubo) — needed for R1FS decentralized file system
ARG KUBO_VERSION=v0.35.0
RUN set -eux; \
# disable NodeSource (if present) so apt won't read it
rm -f /etc/apt/sources.list.d/nodesource*.list /etc/apt/sources.list.d/nodesource*.sources || true; \
apt-get update -o Acquire::Retries=3; \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
wget tar ca-certificates \
ninja-build; \
rm -rf /var/lib/apt/lists/*

RUN wget https://dist.ipfs.tech/kubo/v0.35.0/kubo_v0.35.0_linux-amd64.tar.gz && \
tar -xvzf kubo_v0.35.0_linux-amd64.tar.gz && \
cd kubo && \
bash install.sh
# End Install IPFS

# Install Cloudflared
ARG CLOUDFLARED_VERSION=2025.7.0
wget -q https://dist.ipfs.tech/kubo/${KUBO_VERSION}/kubo_${KUBO_VERSION}_linux-amd64.tar.gz; \
tar -xzf kubo_${KUBO_VERSION}_linux-amd64.tar.gz; \
cd kubo && bash install.sh; \
cd / && rm -rf kubo kubo_${KUBO_VERSION}_linux-amd64.tar.gz

# Install Cloudflared — tunnel engine for exposing webapp endpoints
ARG CLOUDFLARED_VERSION=2025.7.0
RUN set -eux; \
# --- map architecture names to Cloudflare’s file names -------
arch="$(uname -m)"; \
case "$arch" in \
x86_64) arch=amd64 ;; \
aarch64 | arm64) arch=arm64 ;; \
armv7l) arch=armv7 ;; \
arch="$(uname -m)"; \
case "$arch" in \
x86_64) arch=amd64 ;; \
aarch64 | arm64) arch=arm64 ;; \
armv7l) arch=armv7 ;; \
*) echo "Unsupported arch: $arch" >&2; exit 1 ;; \
esac; \
# --- download the pinned release --------------------------------
esac; \
curl -L "https://github.com/cloudflare/cloudflared/releases/download/${CLOUDFLARED_VERSION}/cloudflared-linux-${arch}" \
-o /usr/local/bin/cloudflared; \
chmod +x /usr/local/bin/cloudflared; \
# --- (optional) show version so it appears in build logs --------
-o /usr/local/bin/cloudflared; \
chmod +x /usr/local/bin/cloudflared; \
cloudflared --version
# End Install Cloudflared


COPY ./cmds /usr/local/bin/
Expand Down
56 changes: 19 additions & 37 deletions Dockerfile_testnet
Original file line number Diff line number Diff line change
@@ -1,45 +1,30 @@
# -d for dind
#FROM aidamian/base_edge_node:x86_64-py3.10.12-th2.3.1.cu121-tr4.43.3-d
FROM ratio1/base_edge_node:x86_64-py3.10.12-th2.3.1.cu121-tr4.43.3-dnctk
# Base image: CPU by default, override with --build-arg BASE_IMAGE=ratio1/base_edge_node_amd64_gpu:latest for GPU
# The base image provides: Python 3.13, PyTorch, FFmpeg, Docker Engine (DIND), Node.js, uv, and ML/data stack
ARG BASE_IMAGE=ratio1/base_edge_node_amd64_cpu:latest
FROM ${BASE_IMAGE}

# Install IPFS
# The line below was creating issues due to flaky external repos
# RUN apt-get update && apt-get install -y wget && apt-get install -y tar
# Install tools needed for the next steps without hitting flaky external repos
# Install IPFS (Kubo) — needed for R1FS decentralized file system
ARG KUBO_VERSION=v0.35.0
RUN set -eux; \
# disable NodeSource (if present) so apt won't read it
rm -f /etc/apt/sources.list.d/nodesource*.list /etc/apt/sources.list.d/nodesource*.sources || true; \
apt-get update -o Acquire::Retries=3; \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
wget tar ca-certificates \
ninja-build; \
rm -rf /var/lib/apt/lists/*

RUN wget https://dist.ipfs.tech/kubo/v0.35.0/kubo_v0.35.0_linux-amd64.tar.gz && \
tar -xvzf kubo_v0.35.0_linux-amd64.tar.gz && \
cd kubo && \
bash install.sh
# End Install IPFS
wget -q https://dist.ipfs.tech/kubo/${KUBO_VERSION}/kubo_${KUBO_VERSION}_linux-amd64.tar.gz; \
tar -xzf kubo_${KUBO_VERSION}_linux-amd64.tar.gz; \
cd kubo && bash install.sh; \
cd / && rm -rf kubo kubo_${KUBO_VERSION}_linux-amd64.tar.gz

# Install Cloudflared
# Install Cloudflared — tunnel engine for exposing webapp endpoints
ARG CLOUDFLARED_VERSION=2025.7.0

RUN set -eux; \
# --- map architecture names to Cloudflare’s file names -------
arch="$(uname -m)"; \
case "$arch" in \
x86_64) arch=amd64 ;; \
aarch64 | arm64) arch=arm64 ;; \
armv7l) arch=armv7 ;; \
arch="$(uname -m)"; \
case "$arch" in \
x86_64) arch=amd64 ;; \
aarch64 | arm64) arch=arm64 ;; \
armv7l) arch=armv7 ;; \
*) echo "Unsupported arch: $arch" >&2; exit 1 ;; \
esac; \
# --- download the pinned release --------------------------------
esac; \
curl -L "https://github.com/cloudflare/cloudflared/releases/download/${CLOUDFLARED_VERSION}/cloudflared-linux-${arch}" \
-o /usr/local/bin/cloudflared; \
chmod +x /usr/local/bin/cloudflared; \
# --- (optional) show version so it appears in build logs --------
-o /usr/local/bin/cloudflared; \
chmod +x /usr/local/bin/cloudflared; \
cloudflared --version
# End Install Cloudflared

COPY ./cmds /usr/local/bin/
RUN chmod +x /usr/local/bin/*
Expand Down Expand Up @@ -84,9 +69,6 @@ ENV EE_DEBUG_R1FS=true
# althouh this is not recommended as it should be in .env file
# ENV EE_DEVICE=cuda:0

# to avoid issues with hnswlib and building from source
ENV HNSWLIB_NO_NATIVE=1

RUN pip install --no-cache-dir -r requirements.txt
RUN pip install --no-cache-dir --no-deps naeural-core

Expand Down
Loading