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
137 changes: 137 additions & 0 deletions .github/workflows/build_gpu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
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
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
64 changes: 25 additions & 39 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
curl -fsSLo kubo.tar.gz https://dist.ipfs.tech/kubo/${KUBO_VERSION}/kubo_${KUBO_VERSION}_linux-amd64.tar.gz; \
tar -xzf kubo.tar.gz; \
cd kubo && bash install.sh; \
cd / && rm -rf kubo kubo.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 All @@ -53,6 +38,8 @@ RUN rm -rf /edge_node/cmds
ENV AINODE_DOCKER=Yes
# set a generic env variable
ENV AINODE_DOCKER_SOURCE=develop
# enable Docker-in-Docker in the optional base-image entrypoint
ENV EE_DD=1
# set default Execution Engine id
ENV EE_ID=E2dkr
# Temporary fix:
Expand Down Expand Up @@ -84,10 +71,9 @@ 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
RUN uv pip install --system --no-cache -r requirements.txt
RUN uv pip install --system --no-cache --no-deps naeural-core
#RUN pip install --no-cache-dir -r requirements.txt
#RUN pip install --no-cache-dir --no-deps naeural-core

CMD ["python3","device.py"]
65 changes: 27 additions & 38 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
curl -fsSLo kubo.tar.gz https://dist.ipfs.tech/kubo/${KUBO_VERSION}/kubo_${KUBO_VERSION}_linux-amd64.tar.gz; \
tar -xzf kubo.tar.gz; \
cd kubo && bash install.sh; \
cd / && rm -rf kubo kubo.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 All @@ -54,6 +39,8 @@ RUN rm -rf /edge_node/cmds
ENV AINODE_DOCKER=Yes
# set a generic env variable
ENV AINODE_DOCKER_SOURCE=main
# enable Docker-in-Docker in the optional base-image entrypoint
ENV EE_DD=1
# set default Execution Engine id
ENV EE_ID=E2dkr
# Temporary fix:
Expand Down Expand Up @@ -85,7 +72,9 @@ ENV EE_DEBUG_R1FS=false
# althouh this is not recommended as it should be in .env file
# ENV EE_DEVICE cuda:0

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

CMD ["python3","device.py"]
Loading
Loading