Skip to content

Commit e5fefd4

Browse files
Merge pull request #390 from Ratio1/develop
Develop
2 parents 4120379 + f389597 commit e5fefd4

108 files changed

Lines changed: 28920 additions & 11340 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@ ratio1
33
decentra-vision
44
python-telegram-bot[rate-limiter]
55
protobuf==5.28.3
6-
vectordb
76
ngrok
87
paramiko

.github/workflows/build_gpu.yml

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
name: Build GPU images
2+
3+
on:
4+
push:
5+
branches:
6+
- "develop"
7+
- "main"
8+
workflow_dispatch:
9+
10+
jobs:
11+
build-gpu-devnet:
12+
if: github.ref == 'refs/heads/develop' || github.event_name == 'workflow_dispatch'
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Retrieve edge node version
19+
run: |
20+
VERSION=$(cat ver.py | grep -o "'.*'" | tr -d "'")
21+
echo "VERSION=$VERSION" >> $GITHUB_ENV
22+
echo "GPU devnet build — edge node version: $VERSION"
23+
24+
- name: Log in to Docker Hub
25+
uses: docker/login-action@v3
26+
with:
27+
username: ${{ secrets.DOCKERHUB_USERNAME }}
28+
password: ${{ secrets.DOCKERHUB_TOKEN }}
29+
30+
- name: Set up Docker Buildx
31+
id: buildx
32+
uses: docker/setup-buildx-action@v3
33+
with:
34+
version: "lab:latest"
35+
driver: cloud
36+
endpoint: "naeural/naeural-builder"
37+
38+
- name: Cleanup space
39+
run: |
40+
docker buildx prune -f --verbose --builder "${{ steps.buildx.outputs.name }}"
41+
42+
- name: Build and push GPU devnet image
43+
uses: docker/build-push-action@v6
44+
with:
45+
builder: ${{ steps.buildx.outputs.name }}
46+
context: .
47+
file: ./Dockerfile_devnet
48+
build-args: |
49+
BASE_IMAGE=ratio1/base_edge_node_amd64_gpu:latest
50+
push: true
51+
tags: "ratio1/edge_node_gpu:devnet"
52+
53+
build-gpu-testnet:
54+
if: github.ref == 'refs/heads/develop' || github.event_name == 'workflow_dispatch'
55+
runs-on: ubuntu-latest
56+
steps:
57+
- name: Checkout
58+
uses: actions/checkout@v4
59+
60+
- name: Retrieve edge node version
61+
run: |
62+
VERSION=$(cat ver.py | grep -o "'.*'" | tr -d "'")
63+
echo "VERSION=$VERSION" >> $GITHUB_ENV
64+
echo "GPU testnet build — edge node version: $VERSION"
65+
66+
- name: Log in to Docker Hub
67+
uses: docker/login-action@v3
68+
with:
69+
username: ${{ secrets.DOCKERHUB_USERNAME }}
70+
password: ${{ secrets.DOCKERHUB_TOKEN }}
71+
72+
- name: Set up Docker Buildx
73+
id: buildx
74+
uses: docker/setup-buildx-action@v3
75+
with:
76+
version: "lab:latest"
77+
driver: cloud
78+
endpoint: "naeural/naeural-builder"
79+
80+
- name: Cleanup space
81+
run: |
82+
docker buildx prune -f --verbose --builder "${{ steps.buildx.outputs.name }}"
83+
84+
- name: Build and push GPU testnet image
85+
uses: docker/build-push-action@v6
86+
with:
87+
builder: ${{ steps.buildx.outputs.name }}
88+
context: .
89+
file: ./Dockerfile_testnet
90+
build-args: |
91+
BASE_IMAGE=ratio1/base_edge_node_amd64_gpu:latest
92+
push: true
93+
tags: "ratio1/edge_node_gpu:testnet"
94+
95+
build-gpu-mainnet:
96+
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
97+
runs-on: ubuntu-latest
98+
steps:
99+
- name: Checkout
100+
uses: actions/checkout@v4
101+
102+
- name: Retrieve edge node version
103+
run: |
104+
VERSION=$(cat ver.py | grep -o "'.*'" | tr -d "'")
105+
echo "VERSION=$VERSION" >> $GITHUB_ENV
106+
echo "GPU mainnet build — edge node version: $VERSION"
107+
108+
- name: Log in to Docker Hub
109+
uses: docker/login-action@v3
110+
with:
111+
username: ${{ secrets.DOCKERHUB_USERNAME }}
112+
password: ${{ secrets.DOCKERHUB_TOKEN }}
113+
114+
- name: Set up Docker Buildx
115+
id: buildx
116+
uses: docker/setup-buildx-action@v3
117+
with:
118+
version: "lab:latest"
119+
driver: cloud
120+
endpoint: "naeural/naeural-builder"
121+
122+
- name: Cleanup space
123+
run: |
124+
docker buildx prune -f --verbose --builder "${{ steps.buildx.outputs.name }}"
125+
126+
- name: Build and push GPU mainnet image
127+
uses: docker/build-push-action@v6
128+
with:
129+
builder: ${{ steps.buildx.outputs.name }}
130+
context: .
131+
file: ./Dockerfile_mainnet
132+
build-args: |
133+
BASE_IMAGE=ratio1/base_edge_node_amd64_gpu:latest
134+
push: true
135+
tags: |
136+
ratio1/edge_node_gpu:mainnet
137+
ratio1/edge_node_gpu:latest

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,6 @@ config_startup*.yaml
158158
config_startup*.yml
159159
inference/model_testing/_local_cache/_logs/MPTF.txt
160160
inference/model_testing/_local_cache/_logs/20211224_102325_MPTF_001_log.txt
161-
vectordb
162-
_vector_db_cache
163-
_vector_db_cache_HNSWVectorDB
164161
db_cache
165162

166163
plugins/libs/_cache/

Dockerfile_devnet

Lines changed: 25 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,30 @@
1-
# -d for dind
2-
FROM ratio1/base_edge_node:x86_64-py3.10.12-th2.3.1.cu121-tr4.43.3-dnctk
3-
#FROM aidamian/base_edge_node:x86_64-py3.10.12-th2.3.1.cu121-tr4.43.3-d
1+
# Base image: CPU by default, override with --build-arg BASE_IMAGE=ratio1/base_edge_node_amd64_gpu:latest for GPU
2+
# The base image provides: Python 3.13, PyTorch, FFmpeg, Docker Engine (DIND), Node.js, uv, and ML/data stack
3+
ARG BASE_IMAGE=ratio1/base_edge_node_amd64_cpu:latest
4+
FROM ${BASE_IMAGE}
45

5-
# Install IPFS
6-
# The line below was creating issues due to flaky external repos
7-
# RUN apt-get update && apt-get install -y wget && apt-get install -y tar
8-
# Install tools needed for the next steps without hitting flaky external repos
6+
# Install IPFS (Kubo) — needed for R1FS decentralized file system
7+
ARG KUBO_VERSION=v0.35.0
98
RUN set -eux; \
10-
# disable NodeSource (if present) so apt won't read it
11-
rm -f /etc/apt/sources.list.d/nodesource*.list /etc/apt/sources.list.d/nodesource*.sources || true; \
12-
apt-get update -o Acquire::Retries=3; \
13-
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
14-
wget tar ca-certificates \
15-
ninja-build; \
16-
rm -rf /var/lib/apt/lists/*
17-
18-
RUN wget https://dist.ipfs.tech/kubo/v0.35.0/kubo_v0.35.0_linux-amd64.tar.gz && \
19-
tar -xvzf kubo_v0.35.0_linux-amd64.tar.gz && \
20-
cd kubo && \
21-
bash install.sh
22-
# End Install IPFS
9+
curl -fsSLo kubo.tar.gz https://dist.ipfs.tech/kubo/${KUBO_VERSION}/kubo_${KUBO_VERSION}_linux-amd64.tar.gz; \
10+
tar -xzf kubo.tar.gz; \
11+
cd kubo && bash install.sh; \
12+
cd / && rm -rf kubo kubo.tar.gz
2313

24-
# Install Cloudflared
14+
# Install Cloudflared — tunnel engine for exposing webapp endpoints
2515
ARG CLOUDFLARED_VERSION=2025.7.0
26-
2716
RUN set -eux; \
28-
# --- map architecture names to Cloudflare’s file names -------
29-
arch="$(uname -m)"; \
30-
case "$arch" in \
31-
x86_64) arch=amd64 ;; \
32-
aarch64 | arm64) arch=arm64 ;; \
33-
armv7l) arch=armv7 ;; \
17+
arch="$(uname -m)"; \
18+
case "$arch" in \
19+
x86_64) arch=amd64 ;; \
20+
aarch64 | arm64) arch=arm64 ;; \
21+
armv7l) arch=armv7 ;; \
3422
*) echo "Unsupported arch: $arch" >&2; exit 1 ;; \
35-
esac; \
36-
# --- download the pinned release --------------------------------
23+
esac; \
3724
curl -L "https://github.com/cloudflare/cloudflared/releases/download/${CLOUDFLARED_VERSION}/cloudflared-linux-${arch}" \
38-
-o /usr/local/bin/cloudflared; \
39-
chmod +x /usr/local/bin/cloudflared; \
40-
# --- (optional) show version so it appears in build logs --------
25+
-o /usr/local/bin/cloudflared; \
26+
chmod +x /usr/local/bin/cloudflared; \
4127
cloudflared --version
42-
# End Install Cloudflared
4328

4429
COPY ./cmds /usr/local/bin/
4530
RUN chmod +x /usr/local/bin/*
@@ -53,6 +38,8 @@ RUN rm -rf /edge_node/cmds
5338
ENV AINODE_DOCKER=Yes
5439
# set a generic env variable
5540
ENV AINODE_DOCKER_SOURCE=develop
41+
# enable Docker-in-Docker in the optional base-image entrypoint
42+
ENV EE_DD=1
5643
# set default Execution Engine id
5744
ENV EE_ID=E2dkr
5845
# Temporary fix:
@@ -84,10 +71,9 @@ ENV EE_DEBUG_R1FS=true
8471
# althouh this is not recommended as it should be in .env file
8572
# ENV EE_DEVICE=cuda:0
8673

87-
# to avoid issues with hnswlib and building from source
88-
ENV HNSWLIB_NO_NATIVE=1
89-
90-
RUN pip install --no-cache-dir -r requirements.txt
91-
RUN pip install --no-cache-dir --no-deps naeural-core
74+
RUN uv pip install --system --no-cache -r requirements.txt
75+
RUN uv pip install --system --no-cache --no-deps naeural-core
76+
#RUN pip install --no-cache-dir -r requirements.txt
77+
#RUN pip install --no-cache-dir --no-deps naeural-core
9278

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

Dockerfile_mainnet

Lines changed: 27 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,30 @@
1-
# -d for dind
2-
#FROM aidamian/base_edge_node:x86_64-py3.10.12-th2.3.1.cu121-tr4.43.3-d
3-
FROM ratio1/base_edge_node:x86_64-py3.10.12-th2.3.1.cu121-tr4.43.3-dnctk
4-
5-
# Install IPFS
6-
# The line below was creating issues due to flaky external repos
7-
# RUN apt-get update && apt-get install -y wget && apt-get install -y tar
8-
# Install tools needed for the next steps without hitting flaky external repos
1+
# Base image: CPU by default, override with --build-arg BASE_IMAGE=ratio1/base_edge_node_amd64_gpu:latest for GPU
2+
# The base image provides: Python 3.13, PyTorch, FFmpeg, Docker Engine (DIND), Node.js, uv, and ML/data stack
3+
ARG BASE_IMAGE=ratio1/base_edge_node_amd64_cpu:latest
4+
FROM ${BASE_IMAGE}
5+
6+
# Install IPFS (Kubo) — needed for R1FS decentralized file system
7+
ARG KUBO_VERSION=v0.35.0
98
RUN set -eux; \
10-
# disable NodeSource (if present) so apt won't read it
11-
rm -f /etc/apt/sources.list.d/nodesource*.list /etc/apt/sources.list.d/nodesource*.sources || true; \
12-
apt-get update -o Acquire::Retries=3; \
13-
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
14-
wget tar ca-certificates \
15-
ninja-build; \
16-
rm -rf /var/lib/apt/lists/*
17-
18-
RUN wget https://dist.ipfs.tech/kubo/v0.35.0/kubo_v0.35.0_linux-amd64.tar.gz && \
19-
tar -xvzf kubo_v0.35.0_linux-amd64.tar.gz && \
20-
cd kubo && \
21-
bash install.sh
22-
# End Install IPFS
23-
24-
# Install Cloudflared
25-
ARG CLOUDFLARED_VERSION=2025.7.0
9+
curl -fsSLo kubo.tar.gz https://dist.ipfs.tech/kubo/${KUBO_VERSION}/kubo_${KUBO_VERSION}_linux-amd64.tar.gz; \
10+
tar -xzf kubo.tar.gz; \
11+
cd kubo && bash install.sh; \
12+
cd / && rm -rf kubo kubo.tar.gz
2613

14+
# Install Cloudflared — tunnel engine for exposing webapp endpoints
15+
ARG CLOUDFLARED_VERSION=2025.7.0
2716
RUN set -eux; \
28-
# --- map architecture names to Cloudflare’s file names -------
29-
arch="$(uname -m)"; \
30-
case "$arch" in \
31-
x86_64) arch=amd64 ;; \
32-
aarch64 | arm64) arch=arm64 ;; \
33-
armv7l) arch=armv7 ;; \
17+
arch="$(uname -m)"; \
18+
case "$arch" in \
19+
x86_64) arch=amd64 ;; \
20+
aarch64 | arm64) arch=arm64 ;; \
21+
armv7l) arch=armv7 ;; \
3422
*) echo "Unsupported arch: $arch" >&2; exit 1 ;; \
35-
esac; \
36-
# --- download the pinned release --------------------------------
23+
esac; \
3724
curl -L "https://github.com/cloudflare/cloudflared/releases/download/${CLOUDFLARED_VERSION}/cloudflared-linux-${arch}" \
38-
-o /usr/local/bin/cloudflared; \
39-
chmod +x /usr/local/bin/cloudflared; \
40-
# --- (optional) show version so it appears in build logs --------
25+
-o /usr/local/bin/cloudflared; \
26+
chmod +x /usr/local/bin/cloudflared; \
4127
cloudflared --version
42-
# End Install Cloudflared
4328

4429

4530
COPY ./cmds /usr/local/bin/
@@ -54,6 +39,8 @@ RUN rm -rf /edge_node/cmds
5439
ENV AINODE_DOCKER=Yes
5540
# set a generic env variable
5641
ENV AINODE_DOCKER_SOURCE=main
42+
# enable Docker-in-Docker in the optional base-image entrypoint
43+
ENV EE_DD=1
5744
# set default Execution Engine id
5845
ENV EE_ID=E2dkr
5946
# Temporary fix:
@@ -85,7 +72,9 @@ ENV EE_DEBUG_R1FS=false
8572
# althouh this is not recommended as it should be in .env file
8673
# ENV EE_DEVICE cuda:0
8774

88-
RUN pip install --no-cache-dir -r requirements.txt
89-
RUN pip install --no-cache-dir --no-deps naeural-core
75+
RUN uv pip install --system --no-cache -r requirements.txt
76+
RUN uv pip install --system --no-cache --no-deps naeural-core
77+
#RUN pip install --no-cache-dir -r requirements.txt
78+
#RUN pip install --no-cache-dir --no-deps naeural-core
9079

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

0 commit comments

Comments
 (0)