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
9 changes: 0 additions & 9 deletions Dockerfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,6 @@ RUN rm -rf /tmp/flatbuffers
# Install boost
RUN dnf install -y boost boost-devel

# Install pybind11 for different versions of built-in python3 by almalinux
RUN /opt/python/cp310-cp310/bin/pip3 install pybind11
RUN /opt/python/cp311-cp311/bin/pip3 install pybind11

# In almalinux, setuptools for python3.12 is not installed
# so install it
RUN /opt/python/cp312-cp312/bin/pip3 install setuptools
RUN /opt/python/cp312-cp312/bin/pip3 install pybind11

# The above get the build environment ready!
WORKDIR /app
RUN git config --global --add safe.directory /app
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Most users just need to deploy and run InfiniStore, and they don't need to under
pip install infinistore
```

## Install from Source Code
## Development Installation

For users who need to understand how InfiniStore code works or make code contributions to InfiniStore, it's recommended to install from source code:

Expand All @@ -43,7 +43,7 @@ apt install libflatbuffers-dev
apt install libspdlog-dev libfmt-dev
apt install ibverbs-utils libibverbs-dev
apt install libboost-dev libboost-stacktrace-dev
pip install -e .
pip install --no-build-isolation -e .
pip install pre-commit
pre-commit install
```
Expand Down
28 changes: 13 additions & 15 deletions build_manylinux_wheels.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
PYTHON_VERSIONS=(
"/opt/python/cp310-cp310/bin/python3.10"
"/opt/python/cp311-cp311/bin/python3.11"
"/opt/python/cp312-cp312/bin/python3.12"
"/opt/python/cp310-cp310/bin/python3.10"
"/opt/python/cp311-cp311/bin/python3.11"
"/opt/python/cp312-cp312/bin/python3.12"
)
rm -rf build/ dist/ wheelhouse/

#clean up inplace build
rm infinistore/*.so

rm -rf dist/ wheelhouse/
OLDPATH=$PATH
for PYTHON in "${PYTHON_VERSIONS[@]}"; do
make -C src clean
rm -rf infinistore/*.so
make -C src manylinux PYTHON=${PYTHON} -j8
if [ $? -ne 0 ]; then
exit 1
fi
unset LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/lib
#ldd check, auditwheel will also check LD_LIBRARY_PATH
ldd src/*.so
${PYTHON} setup.py bdist_wheel
BINDIR="$(dirname $PYTHON)"
export PATH="$BINDIR:$OLDPATH"

pip wheel -v . --no-deps -w dist/
#runtime will install ibverbs, so exclude it
WHEEL_FILE=$(ls dist/*.whl)
echo "WHEEL_FILE: ${WHEEL_FILE}"
Expand Down
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[build-system]
requires = [
"setuptools>=42",
"wheel",
"meson",
"ninja",
"pybind11",
]
build-backend = "setuptools.build_meta"
34 changes: 24 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,44 @@ def get_version():
# invoke the make command to build the shared library
class CustomBuildExt(build_ext):
def run(self):
import glob
import shutil
import os

subprocess.check_call(["meson", "setup", "build", "--wipe"], cwd="src")
subprocess.check_call(["ninja"], cwd="src/build")

so_files = glob.glob("src/build/_infinistore*.so")
if self.inplace:
# developer mode
print("developer mode: building shared library")
subprocess.check_call(["make", "clean"], cwd="src")
subprocess.check_call(["make"], cwd="src")
super().run()
for so_file in so_files:
dest = os.path.join("infinistore", os.path.basename(so_file))
print(f"Copying {so_file} to {dest}")
shutil.copy(so_file, dest)
else:
# package mode, return. build.sh script will build the shared library
return
build_dir = os.path.join(self.build_lib, "infinistore")
for so_file in so_files:
build_dest = os.path.join(build_dir, os.path.basename(so_file))
print(f"Copying {so_file} to build directory: {build_dest}")
shutil.copy(so_file, build_dest)


cpp_extension = Extension(name="infinistore._infinistore", sources=[])
ext_modules = [cpp_extension]


setup(
name="infinistore",
version=get_version(),
packages=find_packages(),
cmdclass={"build_ext": CustomBuildExt},
package_data={
"infinistore": ["*.so"],
"infinistore": ["_infinistore*.so"],
},
install_requires=["torch", "uvloop", "fastapi", "pybind11", "uvicorn", "numpy"],
install_requires=[
"uvloop",
"fastapi",
"uvicorn",
"numpy",
],
description="A kvcache memory pool",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
Expand Down
44 changes: 0 additions & 44 deletions src/Makefile

This file was deleted.

110 changes: 0 additions & 110 deletions src/allocate_response_generated.h

This file was deleted.

84 changes: 0 additions & 84 deletions src/delete_keys_generated.h

This file was deleted.

Loading