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
34 changes: 11 additions & 23 deletions Cargo.lock

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

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace.package]
authors = ["Jeremy Harris <[email protected]>"]
version = "0.8.0-alpha"
version = "0.9.0-alpha"
edition = "2024"
repository = "https://github.com/jzombie/rust-simd-r-drive"
license = "Apache-2.0"
Expand All @@ -22,9 +22,9 @@ publish.workspace = true # Inherit from workspace

[workspace.dependencies]
# Intra-workspace crates
simd-r-drive = { path = ".", version = "0.8.0-alpha" }
simd-r-drive-ws-client = { path = "./experiments/simd-r-drive-ws-client", version = "0.8.0-alpha" }
simd-r-drive-muxio-service-definition = { path = "./experiments/simd-r-drive-muxio-service-definition", version = "0.8.0-alpha" }
simd-r-drive = { path = ".", version = "0.9.0-alpha" }
simd-r-drive-ws-client = { path = "./experiments/simd-r-drive-ws-client", version = "0.9.0-alpha" }
simd-r-drive-muxio-service-definition = { path = "./experiments/simd-r-drive-muxio-service-definition", version = "0.9.0-alpha" }

[dependencies]
async-trait = "0.1.88"
Expand Down
16 changes: 8 additions & 8 deletions experiments/bindings/python-ws-client/Cargo.lock

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

8 changes: 5 additions & 3 deletions experiments/bindings/python-ws-client/integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ EXPERIMENTS_DIR_REL_PATH="../../"
# Server and test settings
SERVER_PACKAGE_NAME="simd-r-drive-ws-server"
STORAGE_FILE="/tmp/simd-r-drive-pytest-storage.bin"
SERVER_ADDR="127.0.0.1:34129"
SERVER_HOST="127.0.0.1"
SERVER_PORT=34129
SERVER_PID=""

# --- Cleanup Function ---
Expand Down Expand Up @@ -49,7 +50,7 @@ echo "--> Starting server in background mode..."
set -m
# Use 'cargo run' to start the server, which is more reliable than a direct path.
# The '--' separates cargo's arguments from the application's arguments.
cargo run --package "$SERVER_PACKAGE_NAME" -- "$STORAGE_FILE" --listen "$SERVER_ADDR" &
cargo run --package "$SERVER_PACKAGE_NAME" -- "$STORAGE_FILE" --host "$SERVER_HOST" --port "$SERVER_PORT" &
SERVER_PID=$!
set +m
echo "Server process started with PID: $SERVER_PID."
Expand Down Expand Up @@ -79,7 +80,8 @@ pwd

echo "--> Running pytest..."
# Export the server address so the Python test script can use it
export TEST_SERVER_ADDR=$SERVER_ADDR
export TEST_SERVER_HOST=$SERVER_HOST
export TEST_SERVER_PORT=$SERVER_PORT
# Run pytest using the virtual environment's executable
uv run pytest -v -s

Expand Down
2 changes: 1 addition & 1 deletion experiments/bindings/python-ws-client/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "simd-r-drive-ws-client"
version = "0.8.0-alpha"
version = "0.9.0-alpha"
description = "SIMD-optimized append-only schema-less storage engine. Key-based binary storage in a single-file storage container."
repository = "https://github.com/jzombie/rust-simd-r-drive"
license = "Apache-2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ class DataStoreWsClient:
key/value pairs, streaming writes, and zero-copy reads.
"""

def __init__(self, ws_addr: str) -> None:
def __init__(self, host: str, port: int) -> None:
"""
Connects to a SIMD R Drive server.

Args:
ws_addr (str): The WebSocket address of the SIMD R Drive server.
host (str): The hostname or IP address of the server to connect to.
port (int): The TCP port of the server.
"""
...

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ use std::time::Duration;
use tokio::runtime::{Builder, Runtime};
use tokio::time::timeout;

// TODO: Borrow configuration props from MySQL
// connection_timeout=10, # Timeout for the connection attempt (in seconds)
// read_timeout=30, # Timeout for waiting for response from server (in seconds)
// write_timeout=30 # Timeout for sending data to server (in seconds)

#[pyclass(subclass)]
pub struct BaseDataStoreWsClient {
ws_client: Arc<WsClient>,
Expand All @@ -21,7 +26,7 @@ pub struct BaseDataStoreWsClient {
#[pymethods]
impl BaseDataStoreWsClient {
#[new]
fn new(_py: Python<'_>, ws_address: &str) -> PyResult<Self> {
fn new(_py: Python<'_>, host: &str, port: u16) -> PyResult<Self> {
let runtime = Arc::new(
Builder::new_multi_thread()
.enable_all()
Expand All @@ -32,7 +37,7 @@ impl BaseDataStoreWsClient {
);

let ws_client = runtime
.block_on(async { WsClient::new(ws_address).await })
.block_on(async { WsClient::new(host, port).await })
.map_err(|e| PyIOError::new_err(e.to_string()))?;

let is_connected_clone = Arc::new(AtomicBool::new(true));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import secrets

# Server address, configurable via environment variable
SERVER_ADDR = os.environ.get("TEST_SERVER_ADDR", "127.0.0.1:34129")
SERVER_HOST = os.environ.get("TEST_SERVER_HOST", "127.0.0.1")
SERVER_PORT = int(os.environ.get("TEST_SERVER_PORT", 34129))


@pytest.fixture(scope="module")
Expand All @@ -17,11 +18,11 @@ def client():
# Allow some time for the server to start up.
time.sleep(2)
try:
ws_client = DataStoreWsClient(SERVER_ADDR)
ws_client = DataStoreWsClient(SERVER_HOST, SERVER_PORT)
yield ws_client
except Exception as e:
pytest.fail(
f"Failed to connect to the WebSocket server at {SERVER_ADDR}. Is it running? Error: {e}"
f"Failed to connect to the WebSocket server at {SERVER_HOST}. Is it running? Error: {e}"
)


Expand Down Expand Up @@ -123,9 +124,9 @@ def test_large_batch_write(client):
def test_batch_read_with_missing_key(client):
"""
Verifies that batch_read:
returns payloads for existing keys,
returns None for keys that are absent,
preserves order (results[i] matches keys[i]).
- returns payloads for existing keys,
- returns None for keys that are absent,
- preserves order (results[i] matches keys[i]).
"""
# --- Arrange ----------------------------------------------------------
entries = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import secrets

# Server address, configurable via environment variable
SERVER_ADDR = os.environ.get("TEST_SERVER_ADDR", "127.0.0.1:34129")
SERVER_HOST = os.environ.get("TEST_SERVER_HOST", "127.0.0.1")
SERVER_PORT = int(os.environ.get("TEST_SERVER_PORT", 34129))


@pytest.fixture(scope="module")
Expand All @@ -19,11 +20,11 @@ def client():
# Allow some time for the server to start up.
time.sleep(2)
try:
ws_client = DataStoreWsClient(SERVER_ADDR)
ws_client = DataStoreWsClient(SERVER_HOST, SERVER_PORT)
yield ws_client
except Exception as e:
pytest.fail(
f"Failed to connect to the WebSocket server at {SERVER_ADDR}. Is it running? Error: {e}"
f"Failed to connect to the WebSocket server at {SERVER_HOST}. Is it running? Error: {e}"
)

def test_concurrent_read_write_stress(client):
Expand All @@ -47,7 +48,7 @@ def worker(thread_id):
# Each worker creates its own client connection to simulate concurrent users.
local_client = None
try:
local_client = DataStoreWsClient(SERVER_ADDR)
local_client = DataStoreWsClient(SERVER_HOST, SERVER_PORT)
for i in range(OPERATIONS_PER_THREAD):
# Randomly choose between writing and reading
if (
Expand Down
2 changes: 1 addition & 1 deletion experiments/bindings/python-ws-client/uv.lock

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

2 changes: 1 addition & 1 deletion experiments/bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "simd-r-drive-py"
version = "0.8.0-alpha"
version = "0.9.0-alpha"
description = "SIMD-optimized append-only schema-less storage engine. Key-based binary storage in a single-file storage container."
repository = "https://github.com/jzombie/rust-simd-r-drive"
license = "Apache-2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ publish.workspace = true # Inherit from workspace

[dependencies]
bitcode = "0.6.6"
muxio-rpc-service = "0.8.0-alpha"
muxio-rpc-service = "0.9.0-alpha"

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// TODO: Add `api_version` route
6 changes: 3 additions & 3 deletions experiments/simd-r-drive-ws-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ publish.workspace = true # Inherit from workspace
[dependencies]
simd-r-drive = { workspace = true }
simd-r-drive-muxio-service-definition = { workspace = true }
muxio-tokio-rpc-client = "0.8.0-alpha"
muxio-rpc-service = "0.8.0-alpha"
muxio-rpc-service-caller = "0.8.0-alpha"
muxio-tokio-rpc-client = "0.9.0-alpha"
muxio-rpc-service = "0.9.0-alpha"
muxio-rpc-service-caller = "0.9.0-alpha"
tokio = "1.45.1"
tracing = "0.1.41"
async-trait = "0.1.88"
Loading