Skip to content
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
142 changes: 46 additions & 96 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,131 +2,81 @@ name: CI

on:
push:
branches: [main, master, develop, "feat/*"]
branches: [main, master, "feat/*"]
pull_request:
branches: [main, master, develop]
branches: [main, master]

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
fmt:
name: Format Check
# 1. Separate linting to fail fast
static-analysis:
name: Lint & Format
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: Install protobuf compiler
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Install Protoc
uses: arduino/setup-protoc@v3

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'

- name: Install Python dependencies
run: pip install -e .[dev]
- uses: dtolnay/rust-toolchain@stable

- name: Install Linting Tools
run: |
pip install black ruff mypy

- name: Check formatting
- name: Rust Fmt
run: make fmt-check

lint:
name: Clippy Lint
- name: Rust Clippy
run: make lint

build-and-test:
name: Build & Test
runs-on: ubuntu-latest
needs: static-analysis
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: actions/checkout@v4

- name: Install protobuf compiler
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- name: Install Protoc
uses: arduino/setup-protoc@v3

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'

- name: Install Python dependencies
run: pip install -e .[dev]

- name: Cache dependencies
uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0-rust"
shared-key: "stable"

- name: Run clippy
run: make lint

test:
name: Rust Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install protobuf compiler
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler

- name: Install Rust toolchain
- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- name: Cache dependencies
# The heavy lifter: caches target/ and cargo registry
- name: Cache Rust
uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0-rust"
shared-key: "stable"

- name: Run tests
run: make test

build:
name: Build Check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install protobuf compiler
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install Build & Test Dependencies
run: |
python -m pip install --upgrade pip
# patchelf is required for maturin to repair manylinux wheels
pip install maturin patchelf

- name: Cache dependencies
uses: Swatinem/rust-cache@v2
with:
prefix-key: "v0-rust"
shared-key: "stable"
- name: Install Project (Editable)
# --no-build-isolation is the key to speed: it uses the cached
# Rust toolchain and dependencies instead of creating a fresh env.
run: pip install -e .[dev] --no-build-isolation

- name: Build project
run: make build
- name: Run Tests
# Ensure 'make test' points to your pytest / python test suite
run: make test

# Summary job that depends on all checks
ci-success:
name: CI Success
runs-on: ubuntu-latest
needs: [fmt, lint, test, build]
if: always()
steps:
- name: Check all jobs passed
run: |
if [[ "${{ needs.fmt.result }}" != "success" ]] || \
[[ "${{ needs.lint.result }}" != "success" ]] || \
[[ "${{ needs.test.result }}" != "success" ]] || \
[[ "${{ needs.build.result }}" != "success" ]]; then
echo "One or more jobs failed"
exit 1
fi
echo "All CI checks passed!"
- name: Build Wheel (Optional check)
# This confirms the project can package correctly for distribution
run: maturin build --out dist
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Grism

[![CI](https://github.com/mirasoth/Grism/actions/workflows/ci.yml/badge.svg)](https://github.com/mirasoth/Grism/actions/workflows/ci.yml)

**AI-native, neurosymbolic hypergraph database**

Grism is a hypergraph-first database designed for knowledge representation, semantic reasoning, and multi-modal data processing. It combines the expressiveness of n-ary relations with low-latency graph traversal and scalable computation.
Expand Down Expand Up @@ -54,5 +56,4 @@ cargo test

## License

See [LICENSE](LICENSE) for details.

See [LICENSE](LICENSE) for details.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Issues = "https://github.com/mirasoth/Grism/issues"

[tool.maturin]
# Build with Python feature enabled
features = ["python"]
features = ["python","pyo3/extension-module"]
# Python source directory (root contains the grism/ package)
python-source = "."
# Module name - the native extension lives at grism._grism
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.92.0" # Pin to specific version - update periodically
channel = "stable"
components = ["rustfmt", "clippy"]
profile = "minimal"
4 changes: 2 additions & 2 deletions specs/rfc-0012.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ For the local execution engine, the following backends are supported:

| Backend | Persistence | Description |
| ----------------- | ----------- | ---------------------------------- |
| `InMemoryStorage` | None | Ephemeral, testing and prototyping |
| `MemoryStorage` | None | Ephemeral, testing and prototyping |
| `LanceStorage` | Local FS | Persistent, Lance-based datasets |

Both conform strictly to the `Storage` trait.
Expand All @@ -255,7 +255,7 @@ For Ray-based distributed execution, storage is backed by cloud object stores:
* S3
* GCS
* Azure Blob
* Other Daft-supported backends
* Other cloud object stores

Key requirements:

Expand Down
2 changes: 1 addition & 1 deletion specs/rfc-0102.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ The local runtime supports multiple storage backends:

| Backend | Description | Use Case |
|---------|-------------|----------|
| `InMemoryStorage` | Hash-map based storage | Testing, small datasets |
| `MemoryStorage` | Hash-map based storage | Testing, small datasets |
| `LanceStorage` | Lance format file storage | Production, large datasets |

Storage is accessed through the `Storage` trait defined in `grism-storage`.
Expand Down
2 changes: 1 addition & 1 deletion src/common/error/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl GrismError {
Self::InternalError(msg.into())
}

/// Create an out-of-spec error (following Daft's parquet2 pattern).
/// Create an out-of-spec error.
#[must_use]
pub fn oos<S: Into<String>>(msg: S) -> Self {
Self::OutOfSpec(msg.into())
Expand Down
3 changes: 1 addition & 2 deletions src/common/error/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Error types and result aliases for Grism.
//!
//! This module provides the core error handling infrastructure following
//! the pattern from Daft's error module.
//! This module provides the core error handling infrastructure

mod error;
#[cfg(feature = "python")]
Expand Down
4 changes: 1 addition & 3 deletions src/grism-core/src/types/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
//! Type system for Grism values.
//!
//! This module defines the `Value` enum for runtime values and
//! `DataType` for type information, following the pattern from
//! Daft's parquet2 spec.rs for invariant checking.

//! `DataType` for type information.
mod data_type;
mod spec;
mod value;
Expand Down
2 changes: 1 addition & 1 deletion src/grism-core/src/types/spec.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Type invariant checking (following Daft's parquet2/spec.rs pattern).
//! Type invariant checking.

use common_error::{GrismError, GrismResult};

Expand Down
10 changes: 4 additions & 6 deletions src/grism-engine/src/python/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Python bindings for executors.
//!
//! This module provides `PyO3` bindings for the Grism execution engine,
//! following the Daft pattern of individual python modules per crate.
//! This module provides `PyO3` bindings for the Grism execution engine.

#![allow(unsafe_op_in_unsafe_fn)]

Expand Down Expand Up @@ -88,14 +87,13 @@ impl PyRayExecutor {
}
}

// ========== Module Registration (Daft Pattern) ==========
// ========== Module Registration ==========

/// Register all Python bindings from this crate with the parent module.
///
/// Following the Daft pattern, each crate exports a `register_modules` function
/// that registers its Python classes and functions with the parent module.
/// Each crate exports a `register_modules` function that registers its Python
/// classes and functions with the parent module.
pub fn register_modules(parent: &Bound<'_, PyModule>) -> PyResult<()> {
// ========== Executor Classes ==========
parent.add_class::<PyExecutor>()?;
parent.add_class::<PyLocalExecutor>()?;
parent.add_class::<PyRayExecutor>()?;
Expand Down
9 changes: 4 additions & 5 deletions src/grism-logical/src/python/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
//! Python bindings for the Grism expression system.
//!
//! This module provides `PyO3` bindings for expressions, following the Daft pattern
//! of individual python modules per crate. Implements expression lowering to Rust
//! `LogicalExpr` per RFC-0003.
//! This module provides `PyO3` bindings for expressions. Implements expression
//! lowering to Rust `LogicalExpr` per RFC-0003.

#![allow(unused_unsafe)]
#![allow(unsafe_op_in_unsafe_fn)]
Expand Down Expand Up @@ -1278,11 +1277,11 @@ impl PyPattern {
}
}

// ========== Module Registration (Daft Pattern) ==========
// ========== Module Registration ==========

/// Register all Python bindings from this crate with the parent module.
///
/// Following the Daft pattern, each crate exports a `register_modules` function
/// Each crate exports a `register_modules` function
/// that registers its Python classes and functions with the parent module.
pub fn register_modules(parent: &Bound<'_, PyModule>) -> PyResult<()> {
// ========== Expression Classes ==========
Expand Down
7 changes: 3 additions & 4 deletions src/python/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Python bindings for Grism.
//!
//! This module provides PyO3 bindings for the Grism Python API,
//! following the Daft pattern of individual python modules per crate.
//! This module provides PyO3 bindings for the Grism Python API.
//!
//! The Python API implements the specification in RFC-0101 (Python API Contract),
//! with expression lowering to Rust LogicalPlan per RFC-0002, RFC-0003, and RFC-0006.
Expand All @@ -22,11 +21,11 @@ pub use hypergraph::{

/// Register all Python bindings with the module.
///
/// Following the Daft pattern, this function orchestrates registration
/// This function orchestrates registration
/// by calling each sub-crate's `register_modules` function and then
/// registering types specific to the main crate.
pub fn register_module(m: &Bound<'_, PyModule>) -> PyResult<()> {
// ========== Register Sub-crate Modules (Daft Pattern) ==========
// ========== Register Sub-crate Modules ==========
// Each crate manages its own Python bindings
grism_logical::python::register_modules(m)?;
grism_engine::python::register_modules(m)?;
Expand Down
Loading