Skip to content
Open
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
55 changes: 54 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
miner: ${{ steps.changes.outputs.miner }}
basilica-cli: ${{ steps.changes.outputs.basilica-cli }}
basilica-sdk-python: ${{ steps.changes.outputs.basilica-sdk-python }}
basilica-sdk-rust: ${{ steps.changes.outputs.basilica-sdk-rust }}
workspace: ${{ steps.changes.outputs.workspace }}
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -71,6 +72,12 @@ jobs:
- 'crates/basilica-common/**'
- 'Cargo.toml'
- 'Cargo.lock'
basilica-sdk-rust:
- 'crates/basilica-sdk-rust/**'
- 'crates/basilica-sdk/**'
- 'crates/basilica-common/**'
- 'Cargo.toml'
- 'Cargo.lock'
workspace:
- 'Cargo.toml'
- 'Cargo.lock'
Expand Down Expand Up @@ -143,6 +150,7 @@ jobs:
cargo clippy -p basilica-validator --all-targets --all-features -- -D warnings
cargo clippy -p basilica-cli --all-targets --all-features -- -D warnings
cargo clippy -p basilica-sdk --all-targets --all-features -- -D warnings
cargo clippy -p basilica-sdk-rust --all-targets --all-features -- -D warnings

# Build and test validator
build-validator:
Expand Down Expand Up @@ -373,6 +381,49 @@ jobs:
source .venv/bin/activate
python -c 'import basilica; print(f"SDK imported successfully. API URL: {basilica.DEFAULT_API_URL}")'

# Build and test Rust SDK
test-rust-sdk:
runs-on: blacksmith-32vcpu-ubuntu-2404
needs: changes
if: needs.changes.outputs.basilica-sdk-rust == 'true' || needs.changes.outputs.workspace == 'true'
strategy:
matrix:
rust-version: [stable]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust-version }}
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
shared-key: "shared-cache"
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Install protoc
uses: arduino/setup-protoc@v3
with:
version: "25.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache and install system dependencies
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: pkg-config libssl-dev xxd mold clang
version: 1.0
- name: Install cargo-nextest
uses: taiki-e/install-action@v2
with:
tool: nextest
- name: Check formatting
run: cargo fmt -p basilica-sdk-rust -- --check
- name: Run clippy on Rust SDK
run: cargo clippy -p basilica-sdk-rust --all-targets --all-features -- -D warnings
- name: Build Rust SDK
run: cargo build -p basilica-sdk-rust --all-features
- name: Run tests
run: cargo nextest run -p basilica-sdk-rust --all-features --no-fail-fast
- name: Run doc tests
run: cargo test -p basilica-sdk-rust --doc

# Final status check
ci-success:
runs-on: blacksmith-32vcpu-ubuntu-2404
Expand All @@ -383,6 +434,7 @@ jobs:
- build-miner
- build-cli
- test-python-sdk
- test-rust-sdk
if: always()
steps:
- name: Check if all jobs succeeded
Expand All @@ -392,7 +444,8 @@ jobs:
("${{ needs.build-validator.result }}" == "success" || "${{ needs.build-validator.result }}" == "skipped") && \
("${{ needs.build-miner.result }}" == "success" || "${{ needs.build-miner.result }}" == "skipped") && \
("${{ needs.build-cli.result }}" == "success" || "${{ needs.build-cli.result }}" == "skipped") && \
("${{ needs.test-python-sdk.result }}" == "success" || "${{ needs.test-python-sdk.result }}" == "skipped") ]]; then
("${{ needs.test-python-sdk.result }}" == "success" || "${{ needs.test-python-sdk.result }}" == "skipped") && \
("${{ needs.test-rust-sdk.result }}" == "success" || "${{ needs.test-rust-sdk.result }}" == "skipped") ]]; then
echo "All CI checks passed!"
exit 0
else
Expand Down
23 changes: 23 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ members = [
"crates/basilica-validator",
"crates/basilica-cli",
"crates/basilica-sdk",
"crates/basilica-sdk-rust",
"crates/basilica-sdk-python",
"crates/collateral-contract",
]
Expand Down
46 changes: 46 additions & 0 deletions crates/basilica-sdk-rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[package]
name = "basilica-sdk-rust"
version = "0.17.0"
edition = "2021"
authors = ["Basilica Team"]
description = "High-level Rust SDK for the Basilica GPU cloud platform"
license = "MIT OR Apache-2.0"
readme = "README.md"

[dependencies]
# Internal dependencies - reuse the low-level SDK
basilica-sdk = { path = "../basilica-sdk" }
basilica-common = { path = "../basilica-common" }

# Async runtime
tokio = { workspace = true }

# Serialization
serde = { workspace = true }
serde_json = { workspace = true }

# Error handling
thiserror = { workspace = true }

# Logging
tracing = { workspace = true }

# Utilities
regex = { workspace = true }
uuid = { workspace = true }
chrono = { workspace = true }
once_cell = { workspace = true }
shellexpand = { workspace = true }
url = { workspace = true }
base64 = { workspace = true }

# HTTP client for DNS/HTTP verification
reqwest = { workspace = true }

[dev-dependencies]
wiremock = { workspace = true }
tokio = { workspace = true, features = ["full", "test-util"] }
tempfile = { workspace = true }

[features]
default = []
Loading
Loading