Skip to content
This repository was archived by the owner on Jan 27, 2026. It is now read-only.
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
6 changes: 3 additions & 3 deletions .github/workflows/dev-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
file: ./discovery/Dockerfile
file: ./crates/discovery/Dockerfile
push: true
tags: |
ghcr.io/${{ steps.meta.outputs.repo_lower }}/discovery:dev
Expand All @@ -171,7 +171,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
file: ./validator/Dockerfile
file: ./crates/validator/Dockerfile
push: true
tags: |
ghcr.io/${{ steps.meta.outputs.repo_lower }}/validator:dev
Expand All @@ -183,7 +183,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
file: ./orchestrator/Dockerfile
file: ./crates/orchestrator/Dockerfile
push: true
tags: |
ghcr.io/${{ steps.meta.outputs.repo_lower }}/orchestrator:dev
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/prod-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
file: ./discovery/Dockerfile
file: ./crates/discovery/Dockerfile
push: true
tags: |
ghcr.io/${{ steps.meta.outputs.repo_lower }}/discovery:latest
Expand All @@ -170,7 +170,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
file: ./validator/Dockerfile
file: ./crates/validator/Dockerfile
push: true
tags: |
ghcr.io/${{ steps.meta.outputs.repo_lower }}/validator:latest
Expand All @@ -183,7 +183,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: .
file: ./orchestrator/Dockerfile
file: ./crates/orchestrator/Dockerfile
push: true
tags: |
ghcr.io/${{ steps.meta.outputs.repo_lower }}/orchestrator:latest
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
[workspace]
members = [
"discovery",
"worker",
"validator",
"shared",
"orchestrator",
"dev-utils",
"crates/discovery",
"crates/worker",
"crates/validator",
"crates/shared",
"crates/orchestrator",
"crates/dev-utils",
]
resolver = "2"

[workspace.dependencies]
shared = { path = "shared" }
shared = { path = "crates/shared" }
actix-web = "4.9.0"
clap = { version = "4.5.27", features = ["derive"] }
serde = { version = "1.0.219", features = ["derive"] }
Expand All @@ -35,7 +35,7 @@ redis = "0.28.1"
redis-test = "0.8.0"

[workspace.package]
version = "0.2.5"
version = "0.2.6"
edition = "2021"

[workspace.features]
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,22 @@ whitelist-provider:

watch-discovery:
set -a; source .env; set +a; \
cargo watch -w discovery/src -x "run --bin discovery -- --rpc-url $${RPC_URL}"
cargo watch -w crates/discovery/src -x "run --bin discovery -- --rpc-url $${RPC_URL}"

watch-worker:
set -a; source ${ENV_FILE}; set +a; \
cargo watch -w worker/src -x "run --bin worker -- run --port 8091 --external-ip $${WORKER_EXTERNAL_IP:-localhost} --compute-pool-id $$WORKER_COMPUTE_POOL_ID --skip-system-checks $${LOKI_URL:+--loki-url $${LOKI_URL}} --log-level $${LOG_LEVEL:-info}"
cargo watch -w crates/worker/src -x "run --bin worker -- run --port 8091 --external-ip $${WORKER_EXTERNAL_IP:-localhost} --compute-pool-id $$WORKER_COMPUTE_POOL_ID --skip-system-checks $${LOKI_URL:+--loki-url $${LOKI_URL}} --log-level $${LOG_LEVEL:-info}"

watch-check:
cargo watch -w worker/src -x "run --bin worker -- check"
cargo watch -w crates/worker/src -x "run --bin worker -- check"

watch-validator:
set -a; source ${ENV_FILE}; set +a; \
cargo watch -w validator/src -x "run --bin validator -- --validator-key $${PRIVATE_KEY_VALIDATOR} --rpc-url $${RPC_URL} --pool-id $${WORKER_COMPUTE_POOL_ID} --toploc-server-url $${TOPLOC_SERVER_URL} --toploc-auth-token $${TOPLOC_AUTH_TOKEN} --s3-credentials $${S3_CREDENTIALS} --bucket-name $${BUCKET_NAME} -l $${LOG_LEVEL:-info} --toploc-grace-interval $${TOPLOC_GRACE_INTERVAL:-30}"
cargo watch -w crates/validator/src -x "run --bin validator -- --validator-key $${PRIVATE_KEY_VALIDATOR} --rpc-url $${RPC_URL} --pool-id $${WORKER_COMPUTE_POOL_ID} --toploc-server-url $${TOPLOC_SERVER_URL} --toploc-auth-token $${TOPLOC_AUTH_TOKEN} --s3-credentials $${S3_CREDENTIALS} --bucket-name $${BUCKET_NAME} -l $${LOG_LEVEL:-info} --toploc-grace-interval $${TOPLOC_GRACE_INTERVAL:-30}"

watch-orchestrator:
set -a; source ${ENV_FILE}; set +a; \
cargo watch -w orchestrator/src -x "run --bin orchestrator -- -r $$RPC_URL -k $$POOL_OWNER_PRIVATE_KEY -d 0 -p 8090 -i 10 -u http://localhost:8090 --s3-credentials $$S3_CREDENTIALS --compute-pool-id $$WORKER_COMPUTE_POOL_ID --bucket-name $$BUCKET_NAME -l $${LOG_LEVEL:-info} --hourly-s3-upload-limit $${HOURLY_S3_LIMIT:-3}"
cargo watch -w crates/orchestrator/src -x "run --bin orchestrator -- -r $$RPC_URL -k $$POOL_OWNER_PRIVATE_KEY -d 0 -p 8090 -i 10 -u http://localhost:8090 --s3-credentials $$S3_CREDENTIALS --compute-pool-id $$WORKER_COMPUTE_POOL_ID --bucket-name $$BUCKET_NAME -l $${LOG_LEVEL:-info} --hourly-s3-upload-limit $${HOURLY_S3_LIMIT:-3}"

build-worker:
cargo build --release --bin worker
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,33 @@ pub async fn register_node(
return HttpResponse::Ok()
.json(ApiResponse::new(true, "Node registered successfully"));
}
// Temp. adjustment: The gpu object has changed and includes a vec of indices now.
// This now causes the discovery svc to reject nodes that have just updated their software.
// This is a temporary fix to ensure the node is accepted even though the indices are different.
let mut existing_clone = existing_node.node.clone();
match &update_node.compute_specs {
Some(compute_specs) => {
if let Some(ref mut existing_compute_specs) = existing_clone.compute_specs {
match &compute_specs.gpu {
Some(gpu_specs) => {
existing_compute_specs.gpu = Some(gpu_specs.clone());
}
None => {
existing_compute_specs.gpu = None;
}
}
}
}
None => {
existing_clone.compute_specs = None;
}
}

if existing_clone == update_node {
log::info!("Node {} is already active in a pool", update_node.id);
return HttpResponse::Ok()
.json(ApiResponse::new(true, "Node registered successfully"));
}

warn!(
"Node {} tried to change discovery but is already active in a pool",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
19 changes: 19 additions & 0 deletions orchestrator/src/main.rs → crates/orchestrator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ use crate::node::status_update::NodeStatusUpdater;
use crate::store::core::RedisStore;
use crate::store::core::StoreContext;
use crate::utils::loop_heartbeats::LoopHeartbeats;
use alloy::primitives::U256;
use anyhow::Result;
use clap::Parser;
use log::debug;
use log::error;
use log::info;
use log::LevelFilter;
use shared::web3::contracts::core::builder::ContractBuilder;
use shared::web3::contracts::structs::compute_pool::PoolStatus;
use shared::web3::wallet::Wallet;
use std::sync::Arc;
use tokio::task::JoinSet;
Expand Down Expand Up @@ -140,6 +143,22 @@ async fn main() -> Result<()> {
.unwrap(),
);

match contracts
.compute_pool
.get_pool_info(U256::from(compute_pool_id))
.await
{
Ok(pool) if pool.status == PoolStatus::ACTIVE => Arc::new(pool),
Ok(_) => {
info!("Pool is not active. Exiting.");
return Ok(());
}
Err(e) => {
error!("Failed to get pool info: {}", e);
return Ok(());
}
};

let discovery_store_context = store_context.clone();
let discovery_heartbeats = heartbeats.clone();
tasks.spawn(async move {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.