Skip to content

Commit 7a8afec

Browse files
Merge pull request #118 from eclipsevortex/release/3.1.0
Feature metagraph (#117)
2 parents 1e21295 + 1b32d04 commit 7a8afec

342 files changed

Lines changed: 19465 additions & 7543 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.

.github/scripts/generate_metadata.sh

Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
set -e
44

5-
echo "🔄 Updating metadata.json with correct versions"
5+
echo "🔄 Updating metadata.json and manifest.json with correct versions"
66

77
# Define components and their services
88
COMPONENTS=("miner" "validator")
99
declare -A SERVICES
10-
SERVICES["miner"]="neuron"
11-
SERVICES["validator"]="neuron redis"
10+
SERVICES["miner"]="neuron metagraph redis"
11+
SERVICES["validator"]="neuron metagraph redis"
1212

1313
# Function to extract version from a directory
1414
get_version() {
@@ -38,6 +38,33 @@ if [[ "$ROOT_VERSION" == "VERSION_NOT_FOUND" ]]; then
3838
exit 1
3939
fi
4040

41+
# Helper to update a given JSON file (metadata.json or manifest.json)
42+
update_json_file() {
43+
local file_path="$1"
44+
local component="$2"
45+
local service="$3"
46+
local root_version="$4"
47+
local component_version="$5"
48+
local service_version="$6"
49+
50+
tmpfile=$(mktemp)
51+
if [ -f "$file_path" ]; then
52+
jq --arg root_version "$root_version" \
53+
--arg comp_version "$component_version" \
54+
--arg svc_version "$service_version" \
55+
'.version = $root_version
56+
| ."'"$component"'.version" = $comp_version
57+
| ."'"$component"'.'"$service"'.version" = $svc_version' \
58+
"$file_path" > "$tmpfile" && mv "$tmpfile" "$file_path"
59+
else
60+
echo "{
61+
\"version\": \"$root_version\",
62+
\"$component.version\": \"$component_version\",
63+
\"$component.$service.version\": \"$service_version\"
64+
}" > "$file_path"
65+
fi
66+
}
67+
4168
# Iterate over all components
4269
for COMPONENT in "${COMPONENTS[@]}"; do
4370
echo "📦 Processing component: $COMPONENT"
@@ -66,31 +93,14 @@ for COMPONENT in "${COMPONENTS[@]}"; do
6693
continue
6794
fi
6895

69-
# Metadata file
70-
metadata_path="$SERVICE_PATH/metadata.json"
71-
tmpfile=$(mktemp)
72-
73-
# Build/update JSON
74-
if [ -f "$metadata_path" ]; then
75-
jq --arg root_version "$ROOT_VERSION" \
76-
--arg comp_version "$COMPONENT_VERSION" \
77-
--arg svc_version "$SERVICE_VERSION" \
78-
'.version = $root_version
79-
| ."'"$COMPONENT"'.version" = $comp_version
80-
| ."'"$COMPONENT"'.'"$SERVICE"'.version" = $svc_version' \
81-
"$metadata_path" > "$tmpfile" && mv "$tmpfile" "$metadata_path"
82-
else
83-
echo "{
84-
\"version\": \"$ROOT_VERSION\",
85-
\"$COMPONENT.version\": \"$COMPONENT_VERSION\",
86-
\"$COMPONENT.$SERVICE.version\": \"$SERVICE_VERSION\"
87-
}" > "$metadata_path"
88-
fi
89-
90-
echo "🏷️ Updated $metadata_path with:"
91-
echo " ➡️ version=$ROOT_VERSION"
92-
echo " ➡️ $COMPONENT.version=$COMPONENT_VERSION"
93-
echo " ➡️ $COMPONENT.$SERVICE.version=$SERVICE_VERSION"
96+
for FILE in metadata.json manifest.json; do
97+
FILE_PATH="$SERVICE_PATH/$FILE"
98+
update_json_file "$FILE_PATH" "$COMPONENT" "$SERVICE" "$ROOT_VERSION" "$COMPONENT_VERSION" "$SERVICE_VERSION"
99+
echo "📁 Updated $FILE_PATH:"
100+
echo " ➡️ version=$ROOT_VERSION"
101+
echo " ➡️ $COMPONENT.version=$COMPONENT_VERSION"
102+
echo " ➡️ $COMPONENT.$SERVICE.version=$SERVICE_VERSION"
103+
done
94104
done
95105
done
96106

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ firewall-events.json
174174
DS_Store
175175
*secrets
176176
*.txt
177+
!requirements*.txt
177178
ga-*.json
178179
.build
179180
redis.conf
180-
pyproject.toml
181+
/pyproject.toml

Makefile

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ ACTIONS_miner := bump-major bump-minor bump-patch bump-alpha bump-rc
1212
ACTIONS_validator := bump-major bump-minor bump-patch bump-alpha bump-rc
1313

1414
# Services per component
15-
SERVICES_miner := neuron
16-
SERVICES_validator := neuron redis
15+
SERVICES_miner := neuron metagraph redis
16+
SERVICES_validator := neuron metagraph redis
1717

1818
# All components
1919
COMPONENTS := miner validator
@@ -272,8 +272,8 @@ unprerelease:
272272
[ -d "$$comp" ] || continue; \
273273
comp_name=$$(basename "$$comp"); \
274274
case $$comp_name in \
275-
miner) services="neuron" ;; \
276-
validator) services="neuron redis" ;; \
275+
miner) services="$(SERVICES_miner)" ;; \
276+
validator) services="$(SERVICES_validator)" ;; \
277277
*) services="$$comp_name" ;; \
278278
esac; \
279279
for service in $$services; do \
@@ -318,8 +318,8 @@ unrelease:
318318
[ -d "$$comp" ] || continue; \
319319
comp_name=$$(basename "$$comp"); \
320320
case $$comp_name in \
321-
miner) services="neuron" ;; \
322-
validator) services="neuron redis" ;; \
321+
miner) services="$(SERVICES_miner)" ;; \
322+
validator) services="$(SERVICES_validator)" ;; \
323323
*) services="$$comp_name" ;; \
324324
esac; \
325325
for service in $$services; do \
@@ -344,6 +344,44 @@ release:
344344
$(DIST_DIR)/*.tar.gz \
345345
$(DIST_DIR)/*.whl || true
346346

347+
# =========
348+
# 🧪 Tests
349+
# =========
350+
TARGETS += test
351+
352+
test:
353+
@echo "🧪 Running tests in all components/services..."
354+
@PYTHONPATH=. ; \
355+
for comp in $(COMPONENTS); do \
356+
case "$$comp" in \
357+
miner) SERVICES="$(SERVICES_miner)";; \
358+
validator) SERVICES="$(SERVICES_validator)";; \
359+
*) echo "Unknown component: $$comp"; exit 1;; \
360+
esac; \
361+
for svc in $$SERVICES; do \
362+
svc_path=subvortex/$$comp/$$svc; \
363+
if [ -d "$$svc_path" ]; then \
364+
echo "🔍 Testing $$svc_path..."; \
365+
PYTHONPATH=. pytest "$$svc_path"|| test $$? -eq 5 || exit $$?; \
366+
else \
367+
echo "⚠️ Warning: Path $$svc_path not found, skipping..."; \
368+
fi \
369+
done \
370+
done; \
371+
if [ -d "subvortex/core" ]; then \
372+
echo "🔍 Testing subvortex/core..."; \
373+
PYTHONPATH=. pytest subvortex/core || test $$? -eq 5 || exit $$?; \
374+
else \
375+
echo "⚠️ Warning: subvortex/core not found, skipping..."; \
376+
fi
377+
378+
379+
# ==========
380+
# 📜 Scripts
381+
# ==========
382+
generate:
383+
python3 tools/generate_scripts/src/main.py
384+
347385
# =====================
348386
# Add the last target
349387
# =====================
@@ -385,6 +423,7 @@ help:
385423
@echo ""
386424
@echo " build – Build all components"
387425
@echo " clean – Clean all components"
426+
@echo " test – Run pytest in all service folders"
388427
@echo ""
389428
@echo "🏷️ Tag/Untag:"
390429
@echo ""

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0.1
1+
3.1.0

min_compute.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ compute_spec:
1414
miner:
1515

1616
cpu:
17-
min_cores: 4 # Minimum number of CPU cores
17+
min_cores: 8 # Minimum number of CPU cores
1818
min_speed: 2.5 # Minimum speed per core (GHz)
1919
recommended_cores: 8 # Recommended number of CPU cores
2020
recommended_speed: 3.5 # Recommended speed per core (GHz)
@@ -43,7 +43,7 @@ compute_spec:
4343
validator:
4444

4545
cpu:
46-
min_cores: 4 # Minimum number of CPU cores
46+
min_cores: 8 # Minimum number of CPU cores
4747
min_speed: 2.5 # Minimum speed per core (GHz)
4848
recommended_cores: 8 # Recommended number of CPU cores
4949
recommended_speed: 3.5 # Recommended speed per core (GHz)

pyproject-miner.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@ include-package-data = true
3838
[tool.setuptools.packages.find]
3939
where = ["."]
4040
include = [
41+
"scripts",
4142
"subvortex",
4243
"subvortex.core",
4344
"subvortex.miner",
4445
"subvortex.scripts",
4546
]
4647

4748
[tool.setuptools.package-data]
49+
"scripts" = ["**/utils/*.sh"]
4850
"subvortex" = ["pyproject.toml"]
4951
"subvortex.miner" = [
5052
"**/*.py",
@@ -56,6 +58,7 @@ include = [
5658
"**/env.template",
5759
"**/docker-compose.yml",
5860
"**/metadata.json",
61+
"**/manifest.json",
5962
]
6063
"subvortex.core" = ["**/*.py"]
6164
"subvortex.scripts" = ["**/*.sh", "wss/**/*"]

pyproject-validator.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ include = [
5858
"**/env.template",
5959
"**/docker-compose.yml",
6060
"**/metadata.json",
61+
"**/manifest.json",
6162
]
6263
"subvortex.core" = ["**/*.py"]
6364
"subvortex.scripts" = ["**/*.sh"]

subvortex/core/Makefile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# =========
2+
# 🧪 Tests
3+
# =========
4+
TARGETS += test
5+
6+
test:
7+
PYTHONPATH=../.. pytest . $(ARGS)
8+
9+
# =====================
10+
# Add the last target
11+
# =====================
12+
.PHONY: $(TARGETS) help
13+
14+
# =====================
15+
# Optional: help target
16+
# =====================
17+
help:
18+
@echo "📦 CI/CD Targets:"
19+
@echo ""
20+
@echo " test – Run pytest in all service folders"
21+
22+
targets:
23+
@echo "📋 Available Dynamic Targets:"
24+
@echo ""
25+
@printf " %s\n" $(sort $(TARGETS))

subvortex/core/core_bittensor/axon.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import uvicorn
2020
import bittensor.core.config as btcc
2121
import bittensor.core.axon as btca
22-
import bittensor.core.settings as btcs
2322
import bittensor.core.threadpool as btct
2423
import bittensor.utils.networking as btun
2524
import bittensor.utils.btlogging as btul

0 commit comments

Comments
 (0)