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
27 changes: 15 additions & 12 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-C debuginfo=0"
LANG: C.UTF-8
LC_ALL: C.UTF-8


jobs:
check:
Expand All @@ -36,16 +39,16 @@ jobs:
- name: Run clippy
if: success() || failure()
run: cargo clippy -- -D warnings
#- name: Install Redis binary
#run: |
#sudo apt-get update
#sudo apt-get install -y redis-server
## Ensure redis-server binary is installed but don't start the service
#sudo systemctl stop redis || true
#sudo systemctl disable redis || true
- name: Install Redis binary
run: |
sudo apt-get update
sudo apt-get install -y redis-server
# Ensure redis-server binary is installed but don't start the service
sudo systemctl stop redis || true
sudo systemctl disable redis || true

#- name: Run tests
#if: success() || failure()
#run: |
#redis-server --version
#cargo test -- --nocapture
- name: Run tests
if: success() || failure()
run: |
redis-server --version
cargo test -- --nocapture
78 changes: 21 additions & 57 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,32 @@
# Contributing Guidelines

We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's:
We welcome contributions via GitHub Pull Requests.

- Reporting a bug
- Discussing the current state of the code
- Submitting a fix
- Proposing new features
- Becoming a maintainer
## Branching & Workflow

## We Develop with Github
We use GitHub to host code, to track issues and feature requests, as well as accept pull requests.
* **`main`:** Stable releases ONLY. Merged from `release/*`. **NEVER commit directly.**
* **`develop`:** Integration branch for the next release. Source for features/releases.

## Branch Strategy
We use a two-branch strategy for development:
**1. Features (`feature/*`)**
* Branch from `develop`.
* PR targets `develop`.
* Use **Squash and Merge** when merging the PR.

1. `develop` - This is our main development branch where all feature branches are merged for nightly builds and testing
2. `main` - This is our stable production branch that contains reviewed and tested code
**2. Releases (`release/vX.Y.Z`)**
* Branch from `develop`. Add only version bumps & critical final fixes.
* **PR 1:** `release/*` -> `main`. Use **Merge Commit (NO Squash)**.
* **PR 2:** `release/*` -> `develop`. Use **Merge Commit (NO Squash)**.

### Development Process
**Rule:** **NEVER** merge `main` back into `develop`.

1. Create a new feature branch from `develop`
2. Make your changes and commit them
3. Submit a pull request to merge into `develop`
4. After review and testing in `develop`, changes will be merged into `main` for production releases
## Pull Requests (Features to `develop`)

## Pull Request Process
* Base your feature branch on the latest `develop`.
* Include tests and documentation updates.
* Ensure tests and linting pass.
* Submit PR targeting `develop`; address feedback.

1. Fork the repo and create your feature branch from `develop`
2. If you've added code that should be tested, add tests
3. If you've changed APIs, update the documentation
4. Ensure the test suite passes
5. Make sure your code lints
6. Submit a pull request to merge into `develop`
## Issues & Commits

## Report bugs using Github's issue tracker
We use GitHub issues to track public bugs. Report a bug by opening a new issue; it's that easy!

## Write bug reports with detail, background, and sample code

**Great Bug Reports** tend to have:

- A quick summary and/or background
- Steps to reproduce
- Be specific!
- Give sample code if you can.
- What you expected would happen
- What actually happens
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)

## Development Process

1. Create a new branch from `develop` for your work
2. Make your changes
3. Write or update tests as needed
4. Update documentation as needed
5. Submit a pull request to `develop`
6. Address any review feedback

### Commit Messages

- Use the present tense ("Add feature" not "Added feature")
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit the first line to 72 characters or less
- Reference issues and pull requests liberally after the first line

## References
This document was adapted from the open-source contribution guidelines for [Facebook's Draft](https://github.com/facebook/draft-js/blob/a9316a723f9e918afde44dea68b5f9f39b7d9b00/CONTRIBUTING.md).
* Report bugs via GitHub Issues with details.
* Use clear, present-tense commit messages (e.g., "Fix login bug #123").
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.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ members = ["discovery", "worker", "validator", "shared", "orchestrator", "dev-ut
resolver = "2"

[workspace.package]
version = "0.2.3"
version = "0.2.4"
edition = "2021"

[workspace.features]
Expand Down
1 change: 1 addition & 0 deletions discovery/src/api/routes/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ mod tests {
count: Some(4),
model: Some("A100".to_string()),
memory_mb: Some(40000),
indices: Some(vec![0, 1, 2, 3]),
}),
cpu: Some(CpuSpecs {
cores: Some(16),
Expand Down
22 changes: 20 additions & 2 deletions orchestrator/src/api/routes/nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,31 @@ use serde_json::json;
use shared::security::request_signer::sign_request;
use std::str::FromStr;
use std::time::Duration;

// Timeout for node operations in seconds
const NODE_REQUEST_TIMEOUT: u64 = 30;

async fn get_nodes(app_state: Data<AppState>) -> HttpResponse {
let nodes = app_state.store_context.node_store.get_nodes();
HttpResponse::Ok().json(json!({"success": true, "nodes": nodes}))

let mut status_counts = json!({});
for node in &nodes {
let status_str = format!("{:?}", node.status);
if let Some(count) = status_counts.get(&status_str) {
if let Some(count_value) = count.as_u64() {
status_counts[status_str] = json!(count_value + 1);
} else {
status_counts[status_str] = json!(1);
}
} else {
status_counts[status_str] = json!(1);
}
}

HttpResponse::Ok().json(json!({
"success": true,
"nodes": nodes,
"counts": status_counts
}))
}

async fn restart_node_task(node_id: web::Path<String>, app_state: Data<AppState>) -> HttpResponse {
Expand Down
3 changes: 3 additions & 0 deletions shared/src/models/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ pub struct GpuSpecs {
pub count: Option<u32>,
pub model: Option<String>,
pub memory_mb: Option<u32>,
pub indices: Option<Vec<u32>>,
}

impl fmt::Display for GpuSpecs {
Expand Down Expand Up @@ -445,6 +446,7 @@ mod tests {
count: gpu_count,
model: gpu_model.map(String::from),
memory_mb: gpu_mem,
indices: None,
})
} else {
None
Expand Down Expand Up @@ -744,6 +746,7 @@ mod tests {
count: Some(4),
model: Some("A100".to_string()),
memory_mb: None,
indices: None,
}),
cpu: Some(CpuSpecs {
cores: Some(16),
Expand Down
15 changes: 12 additions & 3 deletions validator/src/validators/synthetic_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,6 @@ mod tests {
use shared::web3::contracts::core::builder::ContractBuilder;
use shared::web3::wallet::Wallet;
use url::Url;

fn test_store() -> RedisStore {
let store = RedisStore::new_test();
let mut con = store
Expand Down Expand Up @@ -639,6 +638,16 @@ mod tests {
.build()
.map_err(|e| Error::msg(format!("Failed to build contracts: {}", e)))?;

// Get S3 credentials from environment variables if they exist
let s3_credentials = std::env::var("S3_CREDENTIALS").ok();
let bucket_name = std::env::var("S3_BUCKET_NAME").ok();

// If either credential is missing, we'll proceed with None values
if s3_credentials.is_none() || bucket_name.is_none() {
println!("S3 credentials or bucket name not found in environment, proceeding with test using None values");
return Ok(());
}

let validator = SyntheticDataValidator::new(
"0".to_string(),
contracts.synthetic_data_validator.clone().unwrap(),
Expand All @@ -651,8 +660,8 @@ mod tests {
unknown_status_expiry_seconds: 120,
},
U256::from(1000),
None,
None,
s3_credentials,
bucket_name,
store,
CancellationToken::new(),
);
Expand Down
Loading