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 benchpress/config/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ django_workload:
- ./benchmarks/django_workload/proxygen_binding/proxygen_binding*.so
- ./benchmarks/django_workload/django-workload/django-workload/django_workload/thrift/build/gen-py3/mock_services/MockAdsService-remote
- ./benchmarks/django_workload/django-workload/django-workload/django_workload/feed_timeline.py
- ./benchmarks/django_workload/django-workload/django-workload/cinder/cinder-build/bin/python3.10
- ./benchmarks/django_workload/django-workload/django-workload/Python-3.10.2/python-build/bin/python3.10
- ./benchmarks/django_workload/django-workload/django-workload/cinder/cinder-build/bin/python3.14
- ./benchmarks/django_workload/django-workload/django-workload/Python-3.14.2/python-build/bin/python3.14
- ./benchmarks/django_workload/wrk/wrk
- ./benchmarks/django_workload/apache-cassandra/bin/cassandra
path: ./benchmarks/django_workload/bin/run.sh
Expand Down
187 changes: 153 additions & 34 deletions packages/django_workload/install_django_workload_aarch64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dnf groupinstall "Development Tools" -y --exclude="texlive*"
dnf install -y memcached libmemcached-awesome-devel zlib-devel screen \
openssl-devel bzip2-devel libffi-devel wget make xz-devel haproxy \
xxhash-devel perl-FindBin perl-JSON perl-core liburing-devel \
ninja-build
ninja-build clang libev libev-devel

echo "System dependencies installed successfully"

Expand Down Expand Up @@ -70,29 +70,21 @@ else
alias wget='wget --no-clobber'
fi
pushd "${DJANGO_WORKLOAD_DEPS}"
# cassandra_driver-3.29.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
wget "https://files.pythonhosted.org/packages/cc/60/f8de88175937481be98da88eb88b4fd704093e284e5907775293c496df32/cassandra_driver-3.29.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl"
# Removed Cython download as it's not needed
# Django-5.2.tar.gz
wget "https://files.pythonhosted.org/packages/1b/11/7aff961db37e1ea501a2bb663d27a8ce97f3683b9e5b83d3bfead8b86fa4/django-5.2.3-py3-none-any.whl"
# django-cassandra-engine-1.6.2.tar.gz
wget "https://files.pythonhosted.org/packages/1f/5e/438eb7f2d8b8e240701b721a43cb5a20cf970c8e9da8b3770df1de6d7c5b/django-cassandra-engine-1.6.2.tar.gz"
# Note: django-cassandra-engine is installed directly from PyPI (not pre-downloaded) to avoid poetry build issues
# django_statsd_mozilla-0.4.0-py3-none-any.whl
wget "https://files.pythonhosted.org/packages/ac/54/5fa99753dab7ced46129a4c95c777596a2e4094a8b0f65c8764d60d5cff4/django_statsd_mozilla-0.4.0-py3-none-any.whl"
# numpy-1.26.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
wget "https://files.pythonhosted.org/packages/fc/a5/4beee6488160798683eed5bdb7eead455892c3b4e1f78d79d8d3f3b084ac/numpy-1.26.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl"
# psutil-5.8.0.tar.gz
wget "https://files.pythonhosted.org/packages/e1/b0/7276de53321c12981717490516b7e612364f2cb372ee8901bd4a66a000d7/psutil-5.8.0.tar.gz"
# pylibmc-1.6.1-cp36-cp36m-manylinux1_x86_64.whl
wget "https://files.pythonhosted.org/packages/a7/0c/f7a3af34b05c167a69ed1fc330b06b658dac4ab25b8632c52d1022dd5337/pylibmc-1.6.1.tar.gz"
# pylibmc - installed from GitHub source for Python 3.14 compatibility (see Step 6.3)
# pytz-2021.1-py2.py3-none-any.whl
wget "https://files.pythonhosted.org/packages/70/94/784178ca5dd892a98f113cdd923372024dc04b8d40abe77ca76b5fb90ca6/pytz-2021.1-py2.py3-none-any.whl"
# six-1.16.0-py2.py3-none-any.whl
wget "https://files.pythonhosted.org/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl"
# statsd
wget "https://files.pythonhosted.org/packages/47/33/c824f799128dfcfce2142f18d9bc6c55c46a939f6e4250639134222d99eb/statsd-3.3.0-py2.py3-none-any.whl"
# uwsgi-2.0.22.tar.gz
wget "https://files.pythonhosted.org/packages/a7/4e/c4d5559b3504bb65175a759392b03cac04b8771e9a9b14811adf1151f02f/uwsgi-2.0.22.tar.gz"
# Note: uwsgi is installed directly from PyPI (not pre-downloaded) to ensure proper linking
# geomet-0.2.1.post1-py3-none-any.whl
wget "https://files.pythonhosted.org/packages/c9/81/156ca48f950f833ddc392f8e3677ca50a18cb9d5db38ccb4ecea55a9303f/geomet-0.2.1.post1-py3-none-any.whl"
# click-7.1.2.tar.gz
Expand Down Expand Up @@ -219,45 +211,48 @@ popd
echo "JDK and Cassandra installed successfully"

# =====================================================================
# Step 4: Build CPython 3.10
# Step 4: Build CPython 3.14
# =====================================================================
echo ""
echo "====================================================================="
echo "Step 4: Building CPython 3.10"
echo "Step 4: Building CPython 3.14"
echo "====================================================================="

pushd "${DJANGO_SERVER_ROOT}"

# Install python3.10
if ! [ -d Python-3.10.2 ]; then
wget https://www.python.org/ftp/python/3.10.2/Python-3.10.2.tgz
tar -xzf Python-3.10.2.tgz
cd Python-3.10.2
# Install python3.14
if ! [ -d Python-3.14.2 ]; then
wget https://www.python.org/ftp/python/3.14.2/Python-3.14.2.tgz
tar -xzf Python-3.14.2.tgz
cd Python-3.14.2
./configure --enable-optimizations --prefix="$(pwd)/python-build" --enable-shared LN="ln -s"
make -j"${NUM_BUILD_JOBS}"
make install
cd ../
fi

CPYTHON_INSTALL_PREFIX="${DJANGO_SERVER_ROOT}/Python-3.10.2/python-build"
CPYTHON_INSTALL_PREFIX="${DJANGO_SERVER_ROOT}/Python-3.14.2/python-build"
export LD_LIBRARY_PATH="${CPYTHON_INSTALL_PREFIX}/lib"

echo "CPython 3.10 built successfully"
echo "CPython 3.14 built successfully"

# =====================================================================
# Step 5: Build Cinder 3.10
# Step 5: Build Cinder 3.14
# =====================================================================
echo ""
echo "====================================================================="
echo "Step 5: Building Cinder 3.10"
echo "Step 5: Building Cinder 3.14"
echo "====================================================================="

# Download and build Cinder
# Using meta/3.14 branch at a known good commit for reproducibility
CINDER_COMMIT="04f91c3659d8d2dfe4331a47548316289d2fa3f0"
if ! [ -d "cinder" ]; then
git clone -b cinder/3.10 https://github.com/facebookincubator/cinder.git
git clone https://github.com/facebookincubator/cinder.git
pushd cinder
git checkout "${CINDER_COMMIT}"
mkdir -p cinder-build
./configure --prefix="$(pwd)/cinder-build" --enable-optimizations --enable-shared LN="ln -s"
./configure --prefix="$(pwd)/cinder-build" --enable-profiling --enable-optimizations --enable-shared LN="ln -s"
make -j"${NUM_BUILD_JOBS}"
make install
popd
Expand All @@ -266,7 +261,7 @@ fi
CINDER_INSTALL_PREFIX="${DJANGO_SERVER_ROOT}/cinder/cinder-build"
export LD_LIBRARY_PATH="${CINDER_INSTALL_PREFIX}/lib"

echo "Cinder 3.10 built successfully"
echo "Cinder 3.14 built successfully"

# =====================================================================
# Step 6: Install Python dependencies in virtual environments
Expand All @@ -278,11 +273,57 @@ echo "====================================================================="

# Create virtual environments for both CPython and Cinder
export LD_LIBRARY_PATH="${CPYTHON_INSTALL_PREFIX}/lib"
[ ! -d venv_cpython ] && "${CPYTHON_INSTALL_PREFIX}/bin/python3.10" -m venv venv_cpython
[ ! -d venv_cpython ] && "${CPYTHON_INSTALL_PREFIX}/bin/python3.14" -m venv venv_cpython

export LD_LIBRARY_PATH="${CINDER_INSTALL_PREFIX}/lib"
[ ! -d venv_cinder ] && "${CINDER_INSTALL_PREFIX}/bin/python3" -m venv venv_cinder

# =====================================================================
# Step 6.3: Clone pylibmc from GitHub (Python 3.14 compatible)
# =====================================================================
echo ""
echo "====================================================================="
echo "Step 6.3: Cloning pylibmc from GitHub source"
echo "====================================================================="

# Clone pylibmc 1.6.1 from GitHub and patch for Python 3.14 compatibility
# pylibmc trunk has bugs in the refactored _fetch_multi function that cause
# memcached connection failures after ~2300 requests. Using stable 1.6.1
# with a minimal setup.py patch (distutils→setuptools, remove "U" mode) instead.
PYLIBMC_DIR="${DJANGO_SERVER_ROOT}/pylibmc"
if ! [ -d "${PYLIBMC_DIR}" ]; then
cd "${DJANGO_SERVER_ROOT}"
git clone https://github.com/lericson/pylibmc.git
cd "${PYLIBMC_DIR}"
git checkout 1.6.1
# Apply Python 3.14 compatibility patch (setup.py: distutils removed in 3.12)
patch -p1 < "${BENCHPRESS_ROOT}/packages/django_workload/srcs/patches/pylibmc-1.6.1-py314-compat.patch"
echo "Applied pylibmc 1.6.1 Python 3.14 compatibility patch"
fi

# =====================================================================
# Step 6.4: Clone cassandra-python-driver from GitHub (setuptools v82 compatible)
# =====================================================================
echo ""
echo "====================================================================="
echo "Step 6.4: Cloning cassandra-python-driver from GitHub source"
echo "====================================================================="

# Clone cassandra-python-driver from GitHub
# PyPI version uses deprecated ez_setup which is incompatible with setuptools v82+
# Latest trunk removed ez_setup for compatibility
CASSANDRA_DRIVER_COMMIT="7d8015e3c1cff543a5f64c70cff3e14216e58037"
CASSANDRA_DRIVER_DIR="${DJANGO_SERVER_ROOT}/cassandra-python-driver"
if ! [ -d "${CASSANDRA_DRIVER_DIR}" ]; then
cd "${DJANGO_SERVER_ROOT}"
git clone https://github.com/apache/cassandra-python-driver.git
cd cassandra-python-driver
git checkout "${CASSANDRA_DRIVER_COMMIT}"
fi

# Return to DJANGO_SERVER_ROOT before activating virtual environments
cd "${DJANGO_SERVER_ROOT}"

# Install packages in CPython environment
set +u
# shellcheck disable=SC1091
Expand All @@ -291,12 +332,35 @@ set -u

export LD_LIBRARY_PATH="${CPYTHON_INSTALL_PREFIX}/lib"
export CMAKE_LIBRARY_PATH="${CPYTHON_INSTALL_PREFIX}/lib"
export CPATH="${DJANGO_SERVER_ROOT}/Python-3.10.2/python-build/include:${DJANGO_SERVER_ROOT}/Python-3.10.2/Include"
export CPATH="${DJANGO_SERVER_ROOT}/Python-3.14.2/python-build/include:${DJANGO_SERVER_ROOT}/Python-3.14.2/Include"
# Set LIBRARY_PATH and LDFLAGS to ensure packages link against CPython's libpython
export LIBRARY_PATH="${CPYTHON_INSTALL_PREFIX}/lib"
export LDFLAGS="-L${CPYTHON_INSTALL_PREFIX}/lib -Wl,-rpath,${CPYTHON_INSTALL_PREFIX}/lib"

# Install pylibmc first (required by django-workload)
cd "${PYLIBMC_DIR}"
pip3.14 install -e .
echo "pylibmc installed in CPython venv"

# Install uwsgi directly from PyPI to ensure proper linking with CPython's libpython
# Use --no-cache-dir to prevent reusing a wheel built for a different Python environment
pip3.14 install --no-cache-dir uwsgi
echo "uwsgi installed in CPython venv"

# Install django-cassandra-engine directly from PyPI to avoid poetry build issues
pip3.14 install django-cassandra-engine
echo "django-cassandra-engine installed in CPython venv"

# Install dependencies using third_party pip dependencies
pip3.10 install "django-statsd-mozilla" --no-index --find-links file://"${DJANGO_WORKLOAD_DEPS}"
pip3.10 install "numpy>=1.19" --no-index --find-links file://"${DJANGO_WORKLOAD_DEPS}"
pip3.10 install -e . --no-index --find-links file://"${DJANGO_WORKLOAD_DEPS}"
cd "${DJANGO_SERVER_ROOT}"
pip3.14 install "django-statsd-mozilla" --no-index --find-links file://"${DJANGO_WORKLOAD_DEPS}"
# Install cassandra-driver from GitHub source (setuptools v82+ compatible)
# Disable Cython extension to avoid build issues
cd "${CASSANDRA_DRIVER_DIR}"
CASS_DRIVER_NO_CYTHON=1 pip3.14 install -e .
echo "cassandra-driver installed in CPython venv"
cd "${DJANGO_SERVER_ROOT}"
pip3.14 install -e . --no-index --find-links file://"${DJANGO_WORKLOAD_DEPS}"

echo "Dependencies installed in CPython venv"

Expand All @@ -311,16 +375,67 @@ pushd "${DJANGO_SERVER_ROOT}"
export CPATH="${DJANGO_SERVER_ROOT}/cinder/cinder-build/include:${DJANGO_SERVER_ROOT}/cinder/Include"
export LD_LIBRARY_PATH="${CINDER_INSTALL_PREFIX}/lib"
export CMAKE_LIBRARY_PATH="${CINDER_INSTALL_PREFIX}/lib"
# Critical: Set LIBRARY_PATH and LDFLAGS to ensure uwsgi links against Cinder's libpython
# Without these, the linker may find CPython's libpython3.14.so instead
export LIBRARY_PATH="${CINDER_INSTALL_PREFIX}/lib"
export LDFLAGS="-L${CINDER_INSTALL_PREFIX}/lib -Wl,-rpath,${CINDER_INSTALL_PREFIX}/lib"
source ./venv_cinder/bin/activate
set -u

# Install pylibmc first (required by django-workload)
cd "${PYLIBMC_DIR}"
pip3.14 install -e .
echo "pylibmc installed in Cinder venv"

# Install uwsgi directly from PyPI to ensure proper linking with Cinder's libpython
# Use --no-cache-dir to prevent reusing a wheel built for a different Python environment
pip3.14 install --no-cache-dir uwsgi
echo "uwsgi installed in Cinder venv"

# Install django-cassandra-engine directly from PyPI to avoid poetry build issues
pip3.14 install django-cassandra-engine
echo "django-cassandra-engine installed in Cinder venv"

# Install dependencies using third_party pip dependencies
pip3.10 install "django-statsd-mozilla" --no-index --find-links file://"${DJANGO_WORKLOAD_DEPS}"
pip3.10 install "numpy>=1.19" --no-index --find-links file://"${DJANGO_WORKLOAD_DEPS}"
pip3.10 install -e . --no-index --find-links file://"${DJANGO_WORKLOAD_DEPS}"
cd "${DJANGO_SERVER_ROOT}"
pip3.14 install "django-statsd-mozilla" --no-index --find-links file://"${DJANGO_WORKLOAD_DEPS}"
# Install cassandra-driver from GitHub source (setuptools v82+ compatible)
# Disable Cython extension to avoid build issues
cd "${CASSANDRA_DRIVER_DIR}"
CASS_DRIVER_NO_CYTHON=1 pip3.14 install -e .
echo "cassandra-driver installed in Cinder venv"
cd "${DJANGO_SERVER_ROOT}"
pip3.14 install -e . --no-index --find-links file://"${DJANGO_WORKLOAD_DEPS}"

echo "Dependencies installed in Cinder venv"

# =====================================================================
# Step 6.5: Install CinderX for JIT Support
# =====================================================================
echo ""
echo "====================================================================="
echo "Step 6.5: Installing CinderX for JIT Support"
echo "====================================================================="

# Clone and install CinderX for JIT functionality
CINDERX_COMMIT="497b2b671a8084345a8288cfbd9995acfab9dfbf"
if ! [ -d "${DJANGO_SERVER_ROOT}/cinderx" ]; then
cd "${DJANGO_SERVER_ROOT}"
git clone https://github.com/facebookincubator/cinderx.git
cd cinderx
git checkout "${CINDERX_COMMIT}"
fi

# Install CinderX in Cinder virtual environment (already activated)
cd "${DJANGO_SERVER_ROOT}/cinderx"
python -m pip install -e .

# Validate CinderX installation
echo "Validating CinderX installation..."
python -c "import cinderx; cinderx.init(); assert cinderx.is_initialized(), 'CinderX failed to initialize'; print('CinderX initialized successfully')"

echo "CinderX installed and validated successfully"

deactivate
popd # ${DJANGO_SERVER_ROOT}

Expand Down Expand Up @@ -513,6 +628,7 @@ export PROXYGEN_INSTALL_DIR="${DJANGO_WORKLOAD_ROOT}/proxygen/staging"
# Build and install in venv_cpython
echo ""
echo "Installing proxygen_binding in venv_cpython..."
export LD_LIBRARY_PATH="${CPYTHON_INSTALL_PREFIX}/lib"
cd "${DJANGO_WORKLOAD_ROOT}/proxygen_binding"
"${DJANGO_SERVER_ROOT}/venv_cpython/bin/python" -m pip install pybind11
"${DJANGO_SERVER_ROOT}/venv_cpython/bin/python" -m pip install -e .
Expand All @@ -521,6 +637,7 @@ echo "proxygen_binding installed in venv_cpython"
# Build and install in venv_cinder
echo ""
echo "Installing proxygen_binding in venv_cinder..."
export LD_LIBRARY_PATH="${CINDER_INSTALL_PREFIX}/lib"
cd "${DJANGO_WORKLOAD_ROOT}/proxygen_binding"
"${DJANGO_SERVER_ROOT}/venv_cinder/bin/python" -m pip install pybind11
"${DJANGO_SERVER_ROOT}/venv_cinder/bin/python" -m pip install -e .
Expand All @@ -535,6 +652,8 @@ echo "Step 9: Generating Code Variants for FeedFlow"
echo "====================================================================="

# Install jinja2 in venv_cpython
# Set LD_LIBRARY_PATH for CPython shared library
export LD_LIBRARY_PATH="${CPYTHON_INSTALL_PREFIX}/lib"
echo "Installing jinja2 for code generation..."
"${DJANGO_SERVER_ROOT}/venv_cpython/bin/python" -m pip install jinja2

Expand Down
Loading
Loading