@@ -56,10 +56,14 @@ elif [[ "$image" == *-noble* ]]; then
5656 UBUNTU_VERSION=24.04
5757elif [[ " $image " == * ubuntu* ]]; then
5858 extract_version_from_image_name ubuntu UBUNTU_VERSION
59+ elif [[ " $image " == * centos* ]]; then
60+ extract_version_from_image_name centos CENTOS_VERSION
5961fi
6062
6163if [ -n " ${UBUNTU_VERSION} " ]; then
6264 OS=" ubuntu"
65+ elif [ -n " ${CENTOS_VERSION} " ]; then
66+ OS=" centos"
6367else
6468 echo " Unable to derive operating system base..."
6569 exit 1
@@ -294,6 +298,7 @@ case "$tag" in
294298 ;;
295299 * )
296300 # Catch-all for builds that are not hardcoded.
301+ PROTOBUF=yes
297302 VISION=yes
298303 echo " image '$image ' did not match an existing build configuration"
299304 if [[ " $image " == * py* ]]; then
@@ -308,6 +313,7 @@ case "$tag" in
308313 TRITON=yes
309314 # To ensure that any ROCm config will build using conda cmake
310315 # and thus have LAPACK/MKL enabled
316+ CONDA_CMAKE=yes
311317 fi
312318 if [[ " $image " == * centos7* ]]; then
313319 NINJA_VERSION=1.10.2
@@ -324,6 +330,9 @@ case "$tag" in
324330 if [[ " $image " == * glibc* ]]; then
325331 extract_version_from_image_name glibc GLIBC_VERSION
326332 fi
333+ if [[ " $image " == * cmake* ]]; then
334+ extract_version_from_image_name cmake CMAKE_VERSION
335+ fi
327336 ;;
328337esac
329338
@@ -346,23 +355,27 @@ docker build \
346355 ${no_cache_flag} \
347356 ${progress_flag} \
348357 --build-arg " BUILD_ENVIRONMENT=${image} " \
358+ --build-arg " PROTOBUF=${PROTOBUF:- } " \
349359 --build-arg " LLVMDEV=${LLVMDEV:- } " \
350360 --build-arg " VISION=${VISION:- } " \
351361 --build-arg " UBUNTU_VERSION=${UBUNTU_VERSION} " \
362+ --build-arg " CENTOS_VERSION=${CENTOS_VERSION} " \
352363 --build-arg " DEVTOOLSET_VERSION=${DEVTOOLSET_VERSION} " \
353364 --build-arg " GLIBC_VERSION=${GLIBC_VERSION} " \
354365 --build-arg " CLANG_VERSION=${CLANG_VERSION} " \
355366 --build-arg " ANACONDA_PYTHON_VERSION=${ANACONDA_PYTHON_VERSION} " \
356367 --build-arg " PYTHON_VERSION=${PYTHON_VERSION} " \
357368 --build-arg " GCC_VERSION=${GCC_VERSION} " \
358369 --build-arg " CUDA_VERSION=${CUDA_VERSION} " \
370+ --build-arg " CMAKE_VERSION=${CMAKE_VERSION:- } " \
359371 --build-arg " NINJA_VERSION=${NINJA_VERSION:- } " \
360372 --build-arg " KATEX=${KATEX:- } " \
361373 --build-arg " ROCM_VERSION=${ROCM_VERSION:- } " \
362374 --build-arg " PYTORCH_ROCM_ARCH=${PYTORCH_ROCM_ARCH:- gfx90a;gfx942} " \
363375 --build-arg " IMAGE_NAME=${IMAGE_NAME} " \
364376 --build-arg " UCX_COMMIT=${UCX_COMMIT} " \
365377 --build-arg " UCC_COMMIT=${UCC_COMMIT} " \
378+ --build-arg " CONDA_CMAKE=${CONDA_CMAKE} " \
366379 --build-arg " TRITON=${TRITON} " \
367380 --build-arg " TRITON_CPU=${TRITON_CPU} " \
368381 --build-arg " ONNX=${ONNX} " \
@@ -450,11 +463,11 @@ HAS_TRITON=$(drun python -c "import triton" > /dev/null 2>&1 && echo "yes" || ec
450463if [[ -n " $TRITON " || -n " $TRITON_CPU " ]]; then
451464 if [ " $HAS_TRITON " = " no" ]; then
452465 echo " expecting triton to be installed, but it is not"
453- exit 1
466+ exit 0
454467 fi
455468elif [ " $HAS_TRITON " = " yes" ]; then
456469 echo " expecting triton to not be installed, but it is"
457- exit 1
470+ exit 0
458471fi
459472
460473# Sanity check cmake version. Executorch reinstalls cmake and I'm not sure if
@@ -463,5 +476,5 @@ CMAKE_VERSION=$(drun cmake --version)
463476if [[ " $EXECUTORCH " != * yes* && " $CMAKE_VERSION " != * 4.* ]]; then
464477 echo " CMake version is not 4.0.0:"
465478 drun cmake --version
466- exit 1
479+ exit 0
467480fi
0 commit comments