Skip to content
8 changes: 6 additions & 2 deletions benchmark/nixlbench/contrib/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ RUN apt-get update -y && \
libtool \
libz-dev \
flex \
valgrind \
Comment thread
ovidiusm marked this conversation as resolved.
Resolved
libgtest-dev \
build-essential

Expand Down Expand Up @@ -74,6 +75,7 @@ RUN echo "INFO: Using UCX from base image (UCX=${UCX})."

# --- Stage 2b: Represents building UCX from source ---
FROM os_setup_stage AS ucx_custom_image
ARG BUILD_TYPE="release"
ARG NPROC
RUN mkdir -p /workspace/ucx
COPY --from=ucx . /workspace/ucx
Expand All @@ -90,6 +92,7 @@ RUN echo "INFO: Starting custom UCX build..." && \
./autogen.sh && \
echo "INFO: Building UCX..." && \
./contrib/configure-release --with-cuda=/usr/local/cuda \
$(if [ "$BUILD_TYPE" = "debug" ]; then echo "--enable-debug"; fi) \
--enable-mt \
--without-go && \
make -j${NPROC:-$(nproc)} && \
Expand All @@ -107,6 +110,7 @@ ARG ARCH="x86_64"
ARG DEFAULT_PYTHON_VERSION
ARG WHL_PYTHON_VERSIONS="3.12"
ARG WHL_PLATFORM="manylinux_2_39_$ARCH"
ARG BUILD_TYPE="release"
ARG NPROC

WORKDIR /workspace
Expand Down Expand Up @@ -140,7 +144,7 @@ RUN uv venv $VIRTUAL_ENV --python $DEFAULT_PYTHON_VERSION && \

RUN rm -rf build && \
mkdir build && \
uv run meson setup build/ --prefix=/usr/local/nixl && \
uv run meson setup build/ --prefix=/usr/local/nixl --buildtype=$BUILD_TYPE && \
cd build && \
ninja && \
ninja install
Expand Down Expand Up @@ -173,7 +177,7 @@ RUN ls -ll /workspace/nixlbench

RUN rm -rf build && \
mkdir build && \
uv run meson setup build -Dnixl_path=/usr/local/nixl/ -Dprefix=/usr/local/nixlbench && \
uv run meson setup build -Dnixl_path=/usr/local/nixl/ -Dprefix=/usr/local/nixlbench --buildtype=$BUILD_TYPE && \
cd build && ninja && ninja install

WORKDIR /workspace/nixl
Expand Down
12 changes: 12 additions & 0 deletions benchmark/nixlbench/contrib/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ NIXL_BENCH_BUILD_CONTEXT_ARGS="--build-context nixlbench=$BUILD_CONTEXT/"
DOCKER_FILE="${SOURCE_DIR}/Dockerfile"
UCX_SRC=""
UCX_BUILD_CONTEXT_ARGS=""
BUILD_TYPE="release"
commit_id=$(git rev-parse --short HEAD)

# Get latest TAG and add COMMIT_ID for dev
Expand Down Expand Up @@ -66,6 +67,14 @@ get_options() {
missing_requirement $1
fi
;;
--build-type)
if [ "$2" ]; then
BUILD_TYPE=$2
shift
else
missing_requirement $1
fi
;;
--nixl)
if [ "$2" ]; then
NIXL_BUILD_CONTEXT_ARGS="--build-context nixl=$2"
Expand Down Expand Up @@ -156,6 +165,7 @@ show_build_options() {
echo "Building NIXLBench Image"
echo "NIXL Source: ${NIXL_SRC}"
echo "UCX Source: ${UCX_SRC} (optional)"
echo "Build Type: ${BUILD_TYPE}"
echo "Image Tag: ${TAG}"
echo "Build Context: ${BUILD_CONTEXT}"
echo "Build Context Args: ${BUILD_CONTEXT_ARGS}"
Expand All @@ -171,6 +181,7 @@ show_help() {
echo " [--base-image-tag base image tag]"
echo " [--nixlbench path/to/nixlbench/source/dir]"
echo " [--ucx path/to/ucx/source/dir]"
echo " [--build-type [debug|release] to select build type]"
echo " [--no-cache disable docker build cache]"
echo " [--os [ubuntu24|ubuntu22] to select Ubuntu version]"
echo " [--python-versions python versions to build for, comma separated]"
Expand All @@ -194,6 +205,7 @@ BUILD_ARGS+=" --build-arg BASE_IMAGE=$BASE_IMAGE --build-arg BASE_IMAGE_TAG=$BAS
BUILD_ARGS+=" --build-arg WHL_PYTHON_VERSIONS=$WHL_PYTHON_VERSIONS"
BUILD_ARGS+=" --build-arg WHL_PLATFORM=$WHL_PLATFORM"
BUILD_ARGS+=" --build-arg ARCH=$ARCH"
BUILD_ARGS+=" --build-arg BUILD_TYPE=$BUILD_TYPE"
BUILD_ARGS+=" --build-arg NPROC=$NPROC"

show_build_options
Expand Down