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
4 changes: 2 additions & 2 deletions Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM quay.io/pypa/manylinux_2_28_x86_64

RUN yum -y install rdma-core-devel libuv-devel
RUN yum -y install rdma-core-devel libuv-devel elfutils-devel

RUN dnf clean all
RUN dnf makecache
Expand Down Expand Up @@ -42,7 +42,7 @@ ENV PATH=/usr/local/flatbuffers/bin:$PATH
RUN rm -rf /tmp/flatbuffers

# Install boost
RUN dnf install -y boost boost-devel
RUN dnf install -y boost boost-devel elfutils-devel

# The above get the build environment ready!
WORKDIR /app
Expand Down
17 changes: 7 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ Integration with SGLang and other inference engines are in progress.

## Install from PIP

RDMA library

```
apt install ibverbs-utils libibverbs-dev
```

Most users just need to deploy and run InfiniStore, and they don't need to understand how InfiniStore works internally. For these users, PIP is the recommended way to install:

```
Expand All @@ -42,21 +48,12 @@ apt install libuv1-dev
apt install libflatbuffers-dev
apt install libspdlog-dev libfmt-dev
apt install ibverbs-utils libibverbs-dev
apt install libboost-dev libboost-stacktrace-dev
apt install libboost-dev libdw-dev
pip install --no-build-isolation -e .
pip install pre-commit
pre-commit install
```

## Verify Your Installation

After installation, either from PIP or from source code, run the following command to verify your installation is successful:

```
infinistore --manage-port 8088
curl http://127.0.0.1:8088/selftest
```

# Run InfiniStore

## Run As a Standalone Service
Expand Down
2 changes: 2 additions & 0 deletions infinistore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
InfiniStoreException,
InfiniStoreKeyNotFound,
evict_cache,
Desc,
)

__all__ = [
Expand All @@ -30,4 +31,5 @@
"InfiniStoreException",
"InfiniStoreKeyNotFound",
"evict_cache",
"Desc",
]
69 changes: 69 additions & 0 deletions infinistore/example/client_async_single2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import infinistore
import uuid
import asyncio
import ctypes
from infinistore import Desc


def generate_uuid():
return str(uuid.uuid4())


config = infinistore.ClientConfig(
host_addr="127.0.0.1",
service_port=12345,
log_level="info",
connection_type=infinistore.TYPE_RDMA,
ib_port=1,
link_type=infinistore.LINK_ETHERNET,
dev_name="mlx5_0",
)


def get_ptr(mv: memoryview):
return ctypes.addressof(ctypes.c_char.from_buffer(mv))


async def main():
rdma_conn = infinistore.InfinityConnection(config)

# FIXME: This is a blocking call, should be async
await rdma_conn.connect_async()

key = generate_uuid()

size = 128 * 1024
src = bytearray(size)
dst = memoryview(bytearray(size))

def register_mr():
rdma_conn.register_mr(get_ptr(src), len(src))
rdma_conn.register_mr(get_ptr(dst), len(dst))

await asyncio.to_thread(register_mr)

# set src
for i in range(size):
src[i] = i % 256

is_exist = await asyncio.to_thread(rdma_conn.check_exist, key)
assert not is_exist

await rdma_conn.rdma_write_cache_async2(
[Desc(key, get_ptr(src), size), Desc(key + "_1", get_ptr(src), size)]
)
ret = await rdma_conn.rdma_read_cache_async2(
[
(key, get_ptr(dst), size),
(key + "_not_exist", get_ptr(dst), size),
(key + "_not_exist1", get_ptr(dst), size),
]
)
print(f"Read result: {ret}")
assert ret == [0, -1, -1]

assert src == dst
rdma_conn.close()


asyncio.run(main())
Loading