diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 26a3e77ec..000000000 --- a/.dockerignore +++ /dev/null @@ -1,6 +0,0 @@ -* -!docker -#cmake-build-* -#build -#install -!temp/gds diff --git a/Dockerfile-cuda110 b/Dockerfile-cuda110 deleted file mode 100644 index 725ddf2b6..000000000 --- a/Dockerfile-cuda110 +++ /dev/null @@ -1,39 +0,0 @@ -# -# Copyright (c) 2020, NVIDIA CORPORATION. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -FROM dockcross/manylinux2014-x64:20230215-2dd9a1c - -ENV DEFAULT_DOCKCROSS_IMAGE gigony/manylinux2014-x64:cuda110 -ENV PATH=/usr/local/cuda/bin/:$PATH - -ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64/:/usr/local/cuda/nvvm/lib64:${LD_LIBRARY_PATH} - -RUN curl -LO https://developer.download.nvidia.com/compute/cuda/11.0.3/local_installers/cuda_11.0.3_450.51.06_linux.run && \ - chmod +x cuda_*.run && \ - ./cuda_*.run --silent --no-opengl-libs --toolkit --override && \ - rm -f cuda_*.run; - -RUN curl -LO https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/libnvjpeg2k0-0.0.1.17-1.x86_64.rpm && \ - curl -LO https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/libnvjpeg2k-devel-0.0.1.17-1.x86_64.rpm && \ - rpm -i libnvjpeg2k*.rpm - -# TODO: Currently we don't install dependencies from libtiff here. -RUN yum install -y openslide-python openslide-devel python-devel python3-devel - -# Copy stub libcuda file -RUN cp /usr/local/cuda-11.0/targets/x86_64-linux/lib/stubs/libcuda.so /usr/lib64/libcuda.so.1 - -RUN cp -P /usr/include/nvjpeg2k* /usr/local/cuda/include/ && \ - cp -P /usr/lib64/libnvjpeg2k* /usr/local/cuda/lib64/ diff --git a/Dockerfile-cuda111 b/Dockerfile-cuda111 deleted file mode 100644 index 428c154d6..000000000 --- a/Dockerfile-cuda111 +++ /dev/null @@ -1,39 +0,0 @@ -# -# Copyright (c) 2020, NVIDIA CORPORATION. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -FROM dockcross/manylinux2014-x64:20230215-2dd9a1c - -ENV DEFAULT_DOCKCROSS_IMAGE gigony/manylinux2014-x64:cuda111 -ENV PATH=/usr/local/cuda/bin/:$PATH - -ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64/:/usr/local/cuda/nvvm/lib64:${LD_LIBRARY_PATH} - -RUN curl -LO https://developer.download.nvidia.com/compute/cuda/11.1.0/local_installers/cuda_11.1.0_455.23.05_linux.run && \ - chmod +x cuda_*.run && \ - ./cuda_*.run --silent --no-opengl-libs --toolkit --override && \ - rm -f cuda_*.run; - -RUN curl -LO https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/libnvjpeg2k0-0.0.1.17-1.x86_64.rpm && \ - curl -LO https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/libnvjpeg2k-devel-0.0.1.17-1.x86_64.rpm && \ - rpm -i libnvjpeg2k*.rpm - -# TODO: Currently we don't install dependencies from libtiff here. -RUN yum install -y openslide-python openslide-devel python-devel python3-devel - -# Copy stub libcuda file -RUN cp /usr/local/cuda-11.1/targets/x86_64-linux/lib/stubs/libcuda.so /usr/lib64/libcuda.so.1 - -RUN cp -P /usr/include/nvjpeg2k* /usr/local/cuda/include/ && \ - cp -P /usr/lib64/libnvjpeg2k* /usr/local/cuda/lib64/ diff --git a/LICENSE-3rdparty.md b/LICENSE-3rdparty.md index 4c2a045b1..984d0e952 100644 --- a/LICENSE-3rdparty.md +++ b/LICENSE-3rdparty.md @@ -287,9 +287,3 @@ PBA+ - https://github.com/orzzzjq/Parallel-Banding-Algorithm-plus/blob/master/LICENSE - Copyright: School of Computing, National University of Singapore - Usage: PBA+ is used to implement the Euclidean distance transform. - -dockcross -- License: MIT License - - https://github.com/dockcross/dockcross/blob/master/LICENSE -- Copyright: Steeve Morin, Rob Burns, Matthew McCormick, Jean-Christophe-Fillion-Robin, Bensuperpc -- Usage: Building Python wheels for Linux diff --git a/build.sh b/build.sh deleted file mode 100755 index 2f96597d6..000000000 --- a/build.sh +++ /dev/null @@ -1,245 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2020, NVIDIA CORPORATION. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -if [ "$0" != "/bin/bash" ]; then - SCRIPT_DIR=$(dirname "$(readlink -f "$0")") -fi - -################################################################################ -# Utility functions -################################################################################ - -c_str() { - local old_color=39 - local old_attr=0 - local color=39 - local attr=0 - local text="" - local no_change=0 - for i in "$@"; do - case "$i" in - r|R) - color=31 - ;; - g|G) - color=32 - ;; - y|Y) - color=33 - ;; - b|B) - color=34 - ;; - p|P) - color=35 - ;; - c|C) - color=36 - ;; - w|W) - color=37 - ;; - - z|Z) - color=0 - ;; - esac - case "$i" in - l|L|R|G|Y|B|P|C|W) - attr=1 - ;; - n|N|r|g|y|b|p|c|w) - attr=0 - ;; - z|Z) - attr=0 - ;; - *) - text="${text}$i" - esac - if [ ${old_color} -ne ${color} ] || [ ${old_attr} -ne ${attr} ]; then - text="${text}\033[${attr};${color}m" - old_color=$color - old_attr=$attr - fi - done - /bin/echo -en "$text" -} - -c_echo() { - local old_opt="$(shopt -op xtrace)" # save old xtrace option - set +x # unset xtrace - local text="$(c_str "$@")" - /bin/echo -e "$text\033[0m" - eval "${old_opt}" # restore old xtrace option -} - - -echo_err() { - >&2 echo "$@" -} - -c_echo_err() { - >&2 c_echo "$@" -} - -printf_err() { - >&2 printf "$@" -} - -get_item_ranges() { - local indexes="$1" - local list="$2" - echo -n "$(echo "${list}" | xargs | cut -d " " -f "${indexes}")" - return $? -} - -get_unused_ports() { - local num_of_ports=${1:-1} - comm -23 \ - <(seq 49152 61000 | sort) \ - <(ss -tan | awk '{print $4}' | while read line; do echo ${line##*\:}; done | grep '[0-9]\{1,5\}' | sort -u) \ - | shuf | tail -n ${num_of_ports} # use tail instead head to avoid broken pipe in VSCode terminal -} - -newline() { - echo -} - -info() { - c_echo W "$(date -u '+%Y-%m-%d %H:%M:%S') [INFO] " Z "$@" -} - -error() { - echo R "$(date -u '+%Y-%m-%d %H:%M:%S') [ERROR] " Z "$@" -} - -fatal() { - echo R "$(date -u '+%Y-%m-%d %H:%M:%S') [FATAL] " Z "$@" - echo - if [ -n "${SCRIPT_DIR}" ]; then - exit 1 - fi -} - -run_command() { - local status=0 - local cmd="$@" - - c_echo B "$(date -u '+%Y-%m-%d %H:%M:%S') \$ " G "${cmd}" - - [ "$(echo -n "$@")" = "" ] && return 1 # return 1 if there is no command available - - eval "$@" - status=$? - - if [ -n "${cmd_result}" ]; then - echo "${cmd_result}" - fi - unset IFS - - return $status -} - -retry() { - local retries=$1 - shift - - local count=0 - until run_command "$@"; do - exit=$? - wait=$((2 ** $count)) - count=$(($count + 1)) - if [ $count -lt $retries ]; then - info "Retry $count/$retries. Exit code=$exit, Retrying in $wait seconds..." - sleep $wait - else - fatal "Retry $count/$retries. Exit code=$exit, no more retries left." - return 1 - fi - done - return 0 -} - -parse_args() { - local OPTIND - while getopts 'yh' option; - do - case "${option}" in - # a) - # VALUE=${OPTARG} - # ;; - y) - ALWAYS_YES=true; - ;; - h) - print_usage - exit 1 - ;; - esac - done - shift $((OPTIND-1)) - - CMD="$1" - shift - - ARGS=("$@") -} - -print_usage() { - set +x - echo_err - echo_err "USAGE: $0 [command] [arguments]..." - echo_err "" - echo_err "Global Arguments" - echo_err - echo_err "Command List" - - echo_err - echo_err "Examples" -} - -init_script() { - TOP=$(git rev-parse --show-toplevel || pwd) -} - -main() { - parse_args "$@" - local file_type - case "$CMD" in - list|ls) - # list_testdata "${ARGS[@]}" - ;; - ''|main) - print_usage - ;; - *) - if type ${CMD} > /dev/null 2>&1; then - init_script - run_command "$CMD" "${ARGS[@]}" - else - print_usage - exit 1 - fi - ;; - esac -} - -if [ -n "${SCRIPT_DIR}" ]; then - main "$@" -fi - -# CLARA_VERSION=0.7.1-2008.4 ./serverctl get_latest_version_of recipes clara_bootstrap 2> /dev/null diff --git a/build_docker.sh b/build_docker.sh deleted file mode 100755 index f7845c594..000000000 --- a/build_docker.sh +++ /dev/null @@ -1,98 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2020, NVIDIA CORPORATION. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -set -eu - -CMAKE_CMD=cmake -CMAKE_BUILD_TYPE=Release -NUM_THREADS=$(nproc) - -SRC_ROOT=/work -BUILD_ROOT=/work/temp - -CUCIM_SDK_PATH=${BUILD_ROOT}/libcucim - -# Build libcucim -${CMAKE_CMD} -S ${SRC_ROOT} -B ${BUILD_ROOT}/libcucim \ - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \ - -DCMAKE_INSTALL_PREFIX=${CUCIM_SDK_PATH} -${CMAKE_CMD} --build ${BUILD_ROOT}/libcucim --target cucim -- -j ${NUM_THREADS} -${CMAKE_CMD} --build ${BUILD_ROOT}/libcucim --target install -- -j ${NUM_THREADS} - -# Build cuslide plugin -${CMAKE_CMD} -S ${SRC_ROOT}/cpp/plugins/cucim.kit.cuslide -B ${BUILD_ROOT}/cuslide \ - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \ - -DCMAKE_INSTALL_PREFIX=${BUILD_ROOT}/cuslide/install \ - -DCUCIM_SDK_PATH=${CUCIM_SDK_PATH} -${CMAKE_CMD} --build ${BUILD_ROOT}/cuslide --target cucim.kit.cuslide -- -j ${NUM_THREADS} -${CMAKE_CMD} --build ${BUILD_ROOT}/cuslide --target install -- -j ${NUM_THREADS} - -# Build Python bind - -for PYBIN in /opt/python/*/bin; do - ${CMAKE_CMD} -S ${SRC_ROOT}/python -B ${BUILD_ROOT}/cucim \ - -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} \ - -DCMAKE_INSTALL_PREFIX=${BUILD_ROOT}/cucim/install \ - -DCUCIM_SDK_PATH=${CUCIM_SDK_PATH} \ - -DPYTHON_EXECUTABLE=${PYBIN}/python - ${CMAKE_CMD} --build ${BUILD_ROOT}/cucim --target cucim -- -j ${NUM_THREADS} - ${CMAKE_CMD} --build ${BUILD_ROOT}/cucim --target install -- -j ${NUM_THREADS} -done - -# Copy .so files to pybind's build folder -# (it uses -P to copy symbolic links as they are) -cp -P ${BUILD_ROOT}/libcucim/install/lib/lib* ${BUILD_ROOT}/cucim/lib/cucim/ -cp -P ${BUILD_ROOT}/cuslide/install/lib/cucim* ${BUILD_ROOT}/cucim/lib/cucim/ - -# Copy .so files from pybind's build folder to cucim Python source folder -cp -P ${BUILD_ROOT}/cucim/lib/cucim/* ${SRC_ROOT}/python/cucim/src/cucim/clara/ - - - - -set -e -u -x - -function repair_wheel { - wheel="$1" - if ! auditwheel show "$wheel"; then - echo "Skipping non-platform wheel $wheel" - else - auditwheel repair --plat "$PLAT" -w wheelhouse/ "$wheel" - fi -} - -PLAT=manylinux2014_x86_64 - -cd /work/python/cucim -# Compile wheels (one python binary is enough) -for PYBIN in /opt/python/cp36-cp36m/bin; do # /opt/python/*/bin - "${PYBIN}/python" setup.py bdist_wheel -p $PLAT -done - -mkdir -p /work/python/cucim/wheelhouse - -# Bundle external shared libraries into the wheels -for whl in dist/*.whl; do - repair_wheel "$whl" -done - -# # Install packages and test -# for PYBIN in /opt/python/*/bin/; do -# "${PYBIN}/pip" install python-manylinux-demo --no-index -f /io/wheelhouse -# (cd "$HOME"; "${PYBIN}/nosetests" pymanylinuxdemo) -# done - -# python setup.py bdist_wheel -p manylinux2014-x86_64 diff --git a/dockcross-manylinux2014-x64 b/dockcross-manylinux2014-x64 deleted file mode 100755 index e6edf726e..000000000 --- a/dockcross-manylinux2014-x64 +++ /dev/null @@ -1,270 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright (c) 2020, NVIDIA CORPORATION. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -DEFAULT_DOCKCROSS_IMAGE=gigony/manylinux2014-x64:cuda110 - -#------------------------------------------------------------------------------ -# Helpers -# -err() { - echo -e >&2 ERROR: $@\\n -} - -die() { - err $@ - exit 1 -} - -has() { - # eg. has command update - local kind=$1 - local name=$2 - - type -t $kind:$name | grep -q function -} - -#------------------------------------------------------------------------------ -# Command handlers -# -command:update-image() { - docker pull $FINAL_IMAGE -} - -help:update-image() { - echo Pull the latest $FINAL_IMAGE . -} - -command:update-script() { - if cmp -s <( docker run --rm $FINAL_IMAGE ) $0; then - echo $0 is up to date - else - echo -n Updating $0 '... ' - docker run --rm $FINAL_IMAGE > $0 && echo ok - fi -} - -help:update-image() { - echo Update $0 from $FINAL_IMAGE . -} - -command:update() { - command:update-image - command:update-script -} - -help:update() { - echo Pull the latest $FINAL_IMAGE, and then update $0 from that. -} - -command:help() { - if [[ $# != 0 ]]; then - if ! has command $1; then - err \"$1\" is not an dockcross command - command:help - elif ! has help $1; then - err No help found for \"$1\" - else - help:$1 - fi - else - cat >&2 < -ENDHELP - exit 1 - fi -} - -#------------------------------------------------------------------------------ -# Option processing -# -special_update_command='' -while [[ $# != 0 ]]; do - case $1 in - - --) - shift - break - ;; - - --args|-a) - ARG_ARGS="$2" - shift 2 - ;; - - --config|-c) - ARG_CONFIG="$2" - shift 2 - ;; - - --image|-i) - ARG_IMAGE="$2" - shift 2 - ;; - update|update-image|update-script) - special_update_command=$1 - break - ;; - -*) - err Unknown option \"$1\" - command:help - exit - ;; - - *) - break - ;; - - esac -done - -# The precedence for options is: -# 1. command-line arguments -# 2. environment variables -# 3. defaults - -# Source the config file if it exists -DEFAULT_DOCKCROSS_CONFIG=~/.dockcross -FINAL_CONFIG=${ARG_CONFIG-${DOCKCROSS_CONFIG-$DEFAULT_DOCKCROSS_CONFIG}} - -[[ -f "$FINAL_CONFIG" ]] && source "$FINAL_CONFIG" - -# Set the docker image -FINAL_IMAGE=${ARG_IMAGE-${DOCKCROSS_IMAGE-$DEFAULT_DOCKCROSS_IMAGE}} - -# Handle special update command -if [ "$special_update_command" != "" ]; then - case $special_update_command in - - update) - command:update - exit $? - ;; - - update-image) - command:update-image - exit $? - ;; - - update-script) - command:update-script - exit $? - ;; - - esac -fi - -# Set the docker run extra args (if any) -FINAL_ARGS=${ARG_ARGS-${DOCKCROSS_ARGS}} - -# Bash on Ubuntu on Windows -UBUNTU_ON_WINDOWS=$([ -e /proc/version ] && grep -l Microsoft /proc/version || echo "") -# MSYS, Git Bash, etc. -MSYS=$([ -e /proc/version ] && grep -l MINGW /proc/version || echo "") - -if [ -z "$UBUNTU_ON_WINDOWS" -a -z "$MSYS" ]; then - USER_IDS=(-e BUILDER_UID="$( id -u )" -e BUILDER_GID="$( id -g )" -e BUILDER_USER="$( id -un )" -e BUILDER_GROUP="$( id -gn )") -fi - -# Change the PWD when working in Docker on Windows -if [ -n "$UBUNTU_ON_WINDOWS" ]; then - WSL_ROOT="/mnt/" - CFG_FILE=/etc/wsl.conf - if [ -f "$CFG_FILE" ]; then - CFG_CONTENT=$(cat $CFG_FILE | sed -r '/[^=]+=[^=]+/!d' | sed -r 's/\s+=\s/=/g') - eval "$CFG_CONTENT" - if [ -n "$root" ]; then - WSL_ROOT=$root - fi - fi - HOST_PWD=`pwd -P` - HOST_PWD=${HOST_PWD/$WSL_ROOT//} -elif [ -n "$MSYS" ]; then - HOST_PWD=$PWD - HOST_PWD=${HOST_PWD/\//} - HOST_PWD=${HOST_PWD/\//:\/} -else - HOST_PWD=$PWD - [ -L $HOST_PWD ] && HOST_PWD=$(readlink $HOST_PWD) -fi - -# Mount Additional Volumes -if [ -z "$SSH_DIR" ]; then - SSH_DIR="$HOME/.ssh" -fi - -HOST_VOLUMES= -if [ -e "$SSH_DIR" -a -z "$MSYS" ]; then - HOST_VOLUMES+="-v $SSH_DIR:/home/$(id -un)/.ssh" -fi - -#------------------------------------------------------------------------------ -# Now, finally, run the command in a container -# -TTY_ARGS= -tty -s && [ -z "$MSYS" ] && TTY_ARGS=-ti -CONTAINER_NAME=dockcross_$RANDOM -docker run --runtime nvidia $TTY_ARGS --name $CONTAINER_NAME \ - -v "$HOST_PWD":/work \ - $HOST_VOLUMES \ - "${USER_IDS[@]}" \ - $FINAL_ARGS \ - $FINAL_IMAGE "$@" -run_exit_code=$? - -# Attempt to delete container -rm_output=$(docker rm -f $CONTAINER_NAME 2>&1) -rm_exit_code=$? -if [[ $rm_exit_code != 0 ]]; then - if [[ "$CIRCLECI" == "true" ]] && [[ $rm_output == *"Driver btrfs failed to remove"* ]]; then - : # Ignore error because of https://circleci.com/docs/docker-btrfs-error/ - else - echo "$rm_output" - exit $rm_exit_code - fi -fi - -exit $run_exit_code - -################################################################################ -# -# This image is not intended to be run manually. -# -# To create a dockcross helper script for the -# gigony/manylinux2014-x64:cuda110 image, run: -# -# docker run --rm gigony/manylinux2014-x64:cuda110 > gigony-manylinux2014-x64-cuda111 -# chmod +x gigony-manylinux2014-x64-cuda111 -# -# You may then wish to move the dockcross script to your PATH. -# -################################################################################ diff --git a/docker/Dockerfile-claratrain b/docker/Dockerfile-claratrain deleted file mode 100644 index 4526ebbdd..000000000 --- a/docker/Dockerfile-claratrain +++ /dev/null @@ -1,28 +0,0 @@ -# -# Copyright (c) 2020, NVIDIA CORPORATION. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -FROM nvcr.io/nvidian/dlmed/clara-train-sdk:v3.1-ga-qa-5 - -RUN apt-get update \ - && apt-get install --yes --fix-missing --no-install-recommends \ - libopenslide0 \ - && rm -rf /var/lib/apt/lists/* - -COPY ./docker/requirements-claratrain.txt ./ -COPY ./*.whl ./ - -# Use `python -m pip` to avoid using an old script wrapper. -RUN python -m pip install --no-cache-dir --upgrade pip setuptools wheel \ - && python -m pip install --no-cache-dir -r requirements-claratrain.txt \ - && python -m pip install cu*.whl diff --git a/docker/Dockerfile-cmake b/docker/Dockerfile-cmake deleted file mode 100644 index edf32abca..000000000 --- a/docker/Dockerfile-cmake +++ /dev/null @@ -1,76 +0,0 @@ -# -# Copyright (c) 2020-2021, NVIDIA CORPORATION. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -FROM nvidia/cuda:11.0-devel-ubuntu18.04 - -ENV LC_ALL=C.UTF-8 -ENV LANG=C.UTF-8 -ENV DEBIAN_FRONTEND=noninteractive - -# Download and install Python3 PIP. -RUN apt-get update --yes \ - && apt-get upgrade --yes \ - && apt-get install --yes --fix-missing --no-install-recommends \ - software-properties-common \ - ca-certificates \ - python3-minimal \ - python3-pip \ - && add-apt-repository ppa:ubuntu-toolchain-r/test \ - && rm -rf /var/lib/apt/lists/* - -RUN python3 --version - -# Set additional environment values that make usage more pleasant. -ENV TERM=xterm-256color - -# Make /usr/bin/python point to the ${VERSION_PYTHON3} version of python -RUN VERSION_PYTHON3=$(python3 --version | cut -c8-) && VERSION_PYTHON3=${VERSION_PYTHON3%.*} \ - && rm -f /usr/bin/python \ - && rm -f /usr/bin/python`echo ${VERSION_PYTHON3} | cut -c1-1` \ - && ln -s /usr/bin/python${VERSION_PYTHON3} /usr/bin/python \ - && ln -s /usr/bin/python${VERSION_PYTHON3} /usr/bin/python`echo ${VERSION_PYTHON3} | cut -c1-1` - -# Make /usr/bin/pip point to the ${VERSION_PIP3} version of python -RUN rm -f /usr/bin/pip \ - && ln -s /usr/bin/pip3 /usr/bin/pip - -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - python3-dev \ - gcc-9 \ - g++-9 \ - libopenslide-dev \ - wget \ - git \ - curl \ - && apt-get autoremove -y \ - && rm -rf /var/lib/apt/lists/* \ - && rm -rf /var/cache/apt/archives/partial/* - -WORKDIR /workspace -ENV HOME=/workspace - -# Use `python -m pip` to avoid using an old script wrapper. -RUN python -m pip install --no-cache-dir --upgrade pip setuptools wheel \ - && python -m pip install cmake - -# Setup gcc-9 -RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 10 \ - && update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 20 \ - && update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 10 \ - && update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 20 - -ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/nvvm/lib64 - -ENTRYPOINT ["/bin/bash"] diff --git a/docker/Dockerfile-jupyter b/docker/Dockerfile-jupyter deleted file mode 100644 index cc6a2403b..000000000 --- a/docker/Dockerfile-jupyter +++ /dev/null @@ -1,91 +0,0 @@ -# -# Copyright (c) 2020-2021, NVIDIA CORPORATION. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -FROM nvidia/cuda:11.0-devel-ubuntu18.04 - -ARG NODE_VERSION=v14.13.1 -ARG NODE_DISTRO=linux-x64 - -ENV LC_ALL=C.UTF-8 -ENV LANG=C.UTF-8 -ENV DEBIAN_FRONTEND=noninteractive - -# Download and install Python3 PIP. -RUN apt-get update --yes \ - && apt-get upgrade --yes \ - && apt-get install --yes --fix-missing --no-install-recommends \ - ca-certificates \ - python3-minimal \ - python3-pip \ - && rm -rf /var/lib/apt/lists/* - -RUN python3 --version - -# Set additional environment values that make usage more pleasant. -ENV TERM=xterm-256color - -# Make /usr/bin/python point to the ${VERSION_PYTHON3} version of python -RUN VERSION_PYTHON3=$(python3 --version | cut -c8-) && VERSION_PYTHON3=${VERSION_PYTHON3%.*} \ - && rm -f /usr/bin/python \ - && rm -f /usr/bin/python`echo ${VERSION_PYTHON3} | cut -c1-1` \ - && ln -s /usr/bin/python${VERSION_PYTHON3} /usr/bin/python \ - && ln -s /usr/bin/python${VERSION_PYTHON3} /usr/bin/python`echo ${VERSION_PYTHON3} | cut -c1-1` - -# Make /usr/bin/pip point to the ${VERSION_PIP3} version of python -RUN rm -f /usr/bin/pip \ - && ln -s /usr/bin/pip3 /usr/bin/pip - -# libgl1 is needed for opencv at `cucim convert` CLI command. -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - python3-dev \ - gcc \ - g++ \ - libopenslide-dev \ - libsm6 \ - libxext6 \ - libxrender-dev \ - libglib2.0-0 \ - libgl1 \ - wget \ - git \ - xz-utils \ - curl \ - && apt-get autoremove -y \ - && rm -rf /var/lib/apt/lists/* \ - && rm -rf /var/cache/apt/archives/partial/* - -WORKDIR /workspace -ENV HOME=/workspace - -# Install nodejs -RUN mkdir -p /usr/local/lib/nodejs \ - && wget https://nodejs.org/dist/$NODE_VERSION/node-${NODE_VERSION}-${NODE_DISTRO}.tar.xz \ - && tar -xJvf node-${NODE_VERSION}-${NODE_DISTRO}.tar.xz -C /usr/local/lib/nodejs \ - && rm node-${NODE_VERSION}-${NODE_DISTRO}.tar.xz -ENV PATH=/usr/local/lib/nodejs/node-$NODE_VERSION-$NODE_DISTRO/bin:$PATH - -COPY ./docker/requirements-jupyter.txt ./ - -# Use `python -m pip` to avoid using an old script wrapper. -RUN python -m pip install --no-cache-dir --upgrade pip setuptools wheel \ - && python -m pip install --no-cache-dir -r requirements-jupyter.txt - -# Install Jupyter Extensions -RUN jupyter labextension install dask-labextension \ - && jupyter serverextension enable dask_labextension - -ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/nvvm/lib64 - -ENTRYPOINT ["/bin/bash"] diff --git a/docker/Dockerfile-jupyter-dev b/docker/Dockerfile-jupyter-dev deleted file mode 100644 index 5c7e7c2b1..000000000 --- a/docker/Dockerfile-jupyter-dev +++ /dev/null @@ -1,112 +0,0 @@ -# -# Copyright (c) 2020-2021, NVIDIA CORPORATION. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -FROM nvidia/cuda:11.0-devel-ubuntu18.04 - -ARG NODE_VERSION=v14.13.1 -ARG NODE_DISTRO=linux-x64 - -ENV LC_ALL=C.UTF-8 -ENV LANG=C.UTF-8 -ENV DEBIAN_FRONTEND=noninteractive - -RUN apt-get update \ - && apt-get install --yes --fix-missing --no-install-recommends \ - ca-certificates \ - && rm -rf /var/lib/apt/lists/* - -# Download and install Python3 PIP. -RUN apt-get update \ - && apt-get install --yes --fix-missing --no-install-recommends \ - python3-minimal \ - python3-pip \ - && rm -rf /var/lib/apt/lists/* - -RUN python3 --version - -# Set additional environment values that make usage more pleasant. -ENV TERM=xterm-256color - -# Make /usr/bin/python point to the ${VERSION_PYTHON3} version of python -RUN VERSION_PYTHON3=$(python3 --version | cut -c8-) && VERSION_PYTHON3=${VERSION_PYTHON3%.*} \ - && rm -f /usr/bin/python \ - && rm -f /usr/bin/python`echo ${VERSION_PYTHON3} | cut -c1-1` \ - && ln -s /usr/bin/python${VERSION_PYTHON3} /usr/bin/python \ - && ln -s /usr/bin/python${VERSION_PYTHON3} /usr/bin/python`echo ${VERSION_PYTHON3} | cut -c1-1` - -# Make /usr/bin/pip point to the ${VERSION_PIP3} version of python -RUN rm -f /usr/bin/pip \ - && ln -s /usr/bin/pip3 /usr/bin/pip - -# libgl1 is needed for opencv at `cucim convert` CLI command. -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - python3-dev \ - gcc \ - g++ \ - libopenslide-dev \ - libsm6 \ - libxext6 \ - libxrender-dev \ - libglib2.0-0 \ - libgl1 \ - wget \ - git \ - xz-utils \ - && apt-get autoremove -y \ - && rm -rf /var/lib/apt/lists/* \ - && rm -rf /var/cache/apt/archives/partial/* - -WORKDIR /workspace -ENV HOME=/workspace - -# Install nodejs -RUN mkdir -p /usr/local/lib/nodejs \ - && wget https://nodejs.org/dist/$NODE_VERSION/node-${NODE_VERSION}-${NODE_DISTRO}.tar.xz \ - && tar -xJvf node-${NODE_VERSION}-${NODE_DISTRO}.tar.xz -C /usr/local/lib/nodejs \ - && rm node-${NODE_VERSION}-${NODE_DISTRO}.tar.xz -ENV PATH=/usr/local/lib/nodejs/node-$NODE_VERSION-$NODE_DISTRO/bin:$PATH - -COPY ./docker/requirements-jupyter-dev.txt ./ - -# Use `python -m pip` to avoid using an old script wrapper. -RUN python -m pip install --no-cache-dir --upgrade pip setuptools wheel \ - && python -m pip install --no-cache-dir -r requirements-jupyter-dev.txt - -# Install Jupyter Extensions -RUN jupyter labextension install dask-labextension \ - && jupyter serverextension enable dask_labextension - -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - curl \ -# build-essential \ -# cmake \ -# git \ -# zlib1g-dev \ -# libssl-dev \ - && apt-get autoremove -y \ - && rm -rf /var/lib/apt/lists/* - -# Download TRITON Client -ARG TRITON_CLIENTS_URL=https://github.com/triton-inference-server/server/releases/download/v2.5.0/v2.5.0_ubuntu1804.clients.tar.gz -RUN mkdir -p /opt/nvidia/triton-clients \ - && curl -L ${TRITON_CLIENTS_URL} | tar xvz -C /opt/nvidia/triton-clients - -RUN pip install --no-cache-dir \ - /opt/nvidia/triton-clients/python/*manylinux1_x86_64.whl - -ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/nvvm/lib64 - -ENTRYPOINT ["/bin/bash"] diff --git a/docker/Dockerfile-jupyter-gds b/docker/Dockerfile-jupyter-gds deleted file mode 100644 index 1238c7265..000000000 --- a/docker/Dockerfile-jupyter-gds +++ /dev/null @@ -1,142 +0,0 @@ -# -# Copyright (c) 2020-2021, NVIDIA CORPORATION. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -ARG UBUNTU_VER=18.04 -FROM nvidia/cuda:11.0-devel-ubuntu${UBUNTU_VER} - -ARG UBUNTU_VER=18.04 -ARG NODE_VERSION=v14.13.1 -ARG NODE_DISTRO=linux-x64 -ENV UBUNTU_VER=${UBUNTU_VER} - -ENV LC_ALL=C.UTF-8 -ENV LANG=C.UTF-8 -ENV DEBIAN_FRONTEND=noninteractive - -# Download and install Python3 PIP. -RUN apt-get update --yes \ - && apt-get upgrade --yes \ - && apt-get install --yes --fix-missing --no-install-recommends \ - ca-certificates \ - python3-minimal \ - python3-pip \ - && rm -rf /var/lib/apt/lists/* - -RUN python3 --version - -# Set additional environment values that make usage more pleasant. -ENV TERM=xterm-256color - -# Make /usr/bin/python point to the ${VERSION_PYTHON3} version of python -RUN VERSION_PYTHON3=$(python3 --version | cut -c8-) && VERSION_PYTHON3=${VERSION_PYTHON3%.*} \ - && rm -f /usr/bin/python \ - && rm -f /usr/bin/python`echo ${VERSION_PYTHON3} | cut -c1-1` \ - && ln -s /usr/bin/python${VERSION_PYTHON3} /usr/bin/python \ - && ln -s /usr/bin/python${VERSION_PYTHON3} /usr/bin/python`echo ${VERSION_PYTHON3} | cut -c1-1` - -# Make /usr/bin/pip point to the ${VERSION_PIP3} version of python -RUN rm -f /usr/bin/pip \ - && ln -s /usr/bin/pip3 /usr/bin/pip - -# libgl1 is needed for opencv at `cucim convert` CLI command. -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - python3-dev \ - gcc \ - g++ \ - libopenslide-dev \ - libsm6 \ - libxext6 \ - libxrender-dev \ - libglib2.0-0 \ - libgl1 \ - wget \ - git \ - xz-utils \ - curl \ - && apt-get autoremove -y \ - && rm -rf /var/lib/apt/lists/* \ - && rm -rf /var/cache/apt/archives/partial/* - -WORKDIR /workspace -ENV HOME=/workspace - -# Install nodejs -RUN mkdir -p /usr/local/lib/nodejs \ - && wget https://nodejs.org/dist/$NODE_VERSION/node-${NODE_VERSION}-${NODE_DISTRO}.tar.xz \ - && tar -xJvf node-${NODE_VERSION}-${NODE_DISTRO}.tar.xz -C /usr/local/lib/nodejs \ - && rm node-${NODE_VERSION}-${NODE_DISTRO}.tar.xz -ENV PATH=/usr/local/lib/nodejs/node-$NODE_VERSION-$NODE_DISTRO/bin:$PATH - -COPY ./docker/requirements-jupyter.txt ./ - -# Use `python -m pip` to avoid using an old script wrapper. -RUN python -m pip install --no-cache-dir --upgrade pip setuptools wheel \ - && python -m pip install --no-cache-dir -r requirements-jupyter.txt - -# Install Jupyter Extensions -RUN jupyter labextension install dask-labextension \ - && jupyter serverextension enable dask_labextension - -# Supporting GDS - -ARG GDS_VER=0.9.0 -ARG MLNX_OFED_VER=5.1-2.5.8.0 - -COPY ./temp/gds/tools/README /usr/local/cuda/gds/ -COPY ./temp/gds/samples/ /usr/local/cuda/gds/samples/ -COPY ./temp/gds/tools/ /usr/local/cuda/gds/tools/ -COPY ./temp/gds/lib64/cufile.h /usr/local/cuda/lib64/cufile.h -COPY ./temp/gds/lib64/libcufile.so.${GDS_VER} /usr/local/cuda/lib64/libcufile.so.${GDS_VER} -COPY ./temp/gds/lib64/libcufile_rdma.so.${GDS_VER} /usr/local/cuda/lib64/libcufile_rdma.so.${GDS_VER} - -# Somehow libcufile.so.0 and libcufile_rdma.so.0 are auto-generated during the copy - #&& ln -s libcufile.so.${GDS_VER} /usr/local/cuda/lib64/libcufile.so.0 \ - #&& ln -s libcufile_rdma.so.${GDS_VER} /usr/local/cuda/lib64/libcufile_rdma.so.0 -RUN ln -sfn /usr/local/cuda/gds /usr/local/gds \ - && ln -s libcufile.so.${GDS_VER} /usr/local/cuda/lib64/libcufile.so \ - && ln -s libcufile_rdma.so.${GDS_VER} /usr/local/cuda/lib64/libcufile_rdma.so - -# dpkg: dependency problems prevent configuration of mlnx-iproute2: -# mlnx-iproute2 depends on libcap2 (>= 1:2.10); however: -# Package libcap2 is not installed. -# -# liburcu-bp.so.6 => not found -# liburcu-cds.so.6 => not found -# libjsoncpp.so.1 => not found -RUN apt-get update \ - && apt-get install --yes --fix-missing --no-install-recommends \ - libcap2 \ - liburcu-dev \ - libjsoncpp-dev \ - && wget http://content.mellanox.com/ofed/MLNX_OFED-${MLNX_OFED_VER}/MLNX_OFED_LINUX-${MLNX_OFED_VER}-ubuntu${UBUNTU_VER}-x86_64.tgz \ - && tar -xzvf MLNX_OFED_LINUX-${MLNX_OFED_VER}-ubuntu${UBUNTU_VER}-x86_64.tgz \ - && MLNX_OFED_LINUX-${MLNX_OFED_VER}-ubuntu${UBUNTU_VER}-x86_64/mlnxofedinstall --user-space-only --without-fw-update --all -q --force \ - && rm -rf MLNX_OFED_LINUX* \ - && apt-get autoremove -y \ - && rm -rf /var/lib/apt/lists/* \ - && rm -rf /var/cache/apt/archives/partial/* - -# Installation of MLNX_OFED would install python2, overwriting /usr/bin/python -RUN ln -sf python3 /usr/bin/python \ - && ln -sf pip3 /usr/bin/pip - -COPY ./docker/cufile.json /etc/cufile.json -RUN sed -i 's/"allow_compat_mode": false,/"allow_compat_mode": true,/' /etc/cufile.json \ - && echo "/usr/local/gds/lib/" > /etc/ld.so.conf.d/cufile.conf \ - && ldconfig - -ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/nvvm/lib64 - -ENTRYPOINT ["/bin/bash"] diff --git a/docker/Dockerfile-jupyter-gds-dev b/docker/Dockerfile-jupyter-gds-dev deleted file mode 100644 index cc7e2ef2c..000000000 --- a/docker/Dockerfile-jupyter-gds-dev +++ /dev/null @@ -1,160 +0,0 @@ -# -# Copyright (c) 2020-2021, NVIDIA CORPORATION. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -ARG UBUNTU_VER=18.04 -FROM nvidia/cuda:11.0-devel-ubuntu${UBUNTU_VER} - -ARG UBUNTU_VER=18.04 -ARG NODE_VERSION=v14.13.1 -ARG NODE_DISTRO=linux-x64 -ENV UBUNTU_VER=${UBUNTU_VER} - -ENV LC_ALL=C.UTF-8 -ENV LANG=C.UTF-8 -ENV DEBIAN_FRONTEND=noninteractive - -# Download and install Python3 PIP. -RUN apt-get update --yes \ - && apt-get upgrade --yes \ - && apt-get install --yes --fix-missing --no-install-recommends \ - ca-certificates \ - python3-minimal \ - python3-pip \ - && rm -rf /var/lib/apt/lists/* - -RUN python3 --version - -# Set additional environment values that make usage more pleasant. -ENV TERM=xterm-256color - -# Make /usr/bin/python point to the ${VERSION_PYTHON3} version of python -RUN VERSION_PYTHON3=$(python3 --version | cut -c8-) && VERSION_PYTHON3=${VERSION_PYTHON3%.*} \ - && rm -f /usr/bin/python \ - && rm -f /usr/bin/python`echo ${VERSION_PYTHON3} | cut -c1-1` \ - && ln -s /usr/bin/python${VERSION_PYTHON3} /usr/bin/python \ - && ln -s /usr/bin/python${VERSION_PYTHON3} /usr/bin/python`echo ${VERSION_PYTHON3} | cut -c1-1` - -# Make /usr/bin/pip point to the ${VERSION_PIP3} version of python -RUN rm -f /usr/bin/pip \ - && ln -s /usr/bin/pip3 /usr/bin/pip - -# libgl1 is needed for opencv at `cucim convert` CLI command. -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - python3-dev \ - gcc \ - g++ \ - libopenslide-dev \ - libsm6 \ - libxext6 \ - libxrender-dev \ - libglib2.0-0 \ - libgl1 \ - wget \ - git \ - xz-utils \ - && apt-get autoremove -y \ - && rm -rf /var/lib/apt/lists/* \ - && rm -rf /var/cache/apt/archives/partial/* - -WORKDIR /workspace -ENV HOME=/workspace - -# Install nodejs -RUN mkdir -p /usr/local/lib/nodejs \ - && wget https://nodejs.org/dist/$NODE_VERSION/node-${NODE_VERSION}-${NODE_DISTRO}.tar.xz \ - && tar -xJvf node-${NODE_VERSION}-${NODE_DISTRO}.tar.xz -C /usr/local/lib/nodejs \ - && rm node-${NODE_VERSION}-${NODE_DISTRO}.tar.xz -ENV PATH=/usr/local/lib/nodejs/node-$NODE_VERSION-$NODE_DISTRO/bin:$PATH - -COPY docker/requirements-jupyter-dev.txt ./ - -# Use `python -m pip` to avoid using an old script wrapper. -RUN python -m pip install --no-cache-dir --upgrade pip setuptools wheel \ - && python -m pip install --no-cache-dir -r requirements-jupyter-dev.txt - -# Install Jupyter Extensions -RUN jupyter labextension install dask-labextension \ - && jupyter serverextension enable dask_labextension - -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - curl \ -# build-essential \ -# cmake \ -# git \ -# zlib1g-dev \ -# libssl-dev \ - && apt-get autoremove -y \ - && rm -rf /var/lib/apt/lists/* - -# Download TRITON Client -ARG TRITON_CLIENTS_URL=https://github.com/triton-inference-server/server/releases/download/v2.5.0/v2.5.0_ubuntu1804.clients.tar.gz -RUN mkdir -p /opt/nvidia/triton-clients \ - && curl -L ${TRITON_CLIENTS_URL} | tar xvz -C /opt/nvidia/triton-clients - -RUN pip install --no-cache-dir \ - /opt/nvidia/triton-clients/python/*manylinux1_x86_64.whl - -# Supporting GDS - -ARG GDS_VER=0.9.0 -ARG MLNX_OFED_VER=5.1-2.5.8.0 - -COPY ./temp/gds/tools/README /usr/local/cuda/gds/ -COPY ./temp/gds/samples/ /usr/local/cuda/gds/samples/ -COPY ./temp/gds/tools/ /usr/local/cuda/gds/tools/ -COPY ./temp/gds/lib64/cufile.h /usr/local/cuda/lib64/cufile.h -COPY ./temp/gds/lib64/libcufile.so.${GDS_VER} /usr/local/cuda/lib64/libcufile.so.${GDS_VER} -COPY ./temp/gds/lib64/libcufile_rdma.so.${GDS_VER} /usr/local/cuda/lib64/libcufile_rdma.so.${GDS_VER} - -# Somehow libcufile.so.0 and libcufile_rdma.so.0 are auto-generated during the copy - #&& ln -s libcufile.so.${GDS_VER} /usr/local/cuda/lib64/libcufile.so.0 \ - #&& ln -s libcufile_rdma.so.${GDS_VER} /usr/local/cuda/lib64/libcufile_rdma.so.0 -RUN ln -sfn /usr/local/cuda/gds /usr/local/gds \ - && ln -s libcufile.so.${GDS_VER} /usr/local/cuda/lib64/libcufile.so \ - && ln -s libcufile_rdma.so.${GDS_VER} /usr/local/cuda/lib64/libcufile_rdma.so - -# dpkg: dependency problems prevent configuration of mlnx-iproute2: -# mlnx-iproute2 depends on libcap2 (>= 1:2.10); however: -# Package libcap2 is not installed. -# -# liburcu-bp.so.6 => not found -# liburcu-cds.so.6 => not found -# libjsoncpp.so.1 => not found -RUN apt-get update \ - && apt-get install --yes --fix-missing --no-install-recommends \ - libcap2 \ - liburcu-dev \ - libjsoncpp-dev \ - && wget http://content.mellanox.com/ofed/MLNX_OFED-${MLNX_OFED_VER}/MLNX_OFED_LINUX-${MLNX_OFED_VER}-ubuntu${UBUNTU_VER}-x86_64.tgz \ - && tar -xzvf MLNX_OFED_LINUX-${MLNX_OFED_VER}-ubuntu${UBUNTU_VER}-x86_64.tgz \ - && MLNX_OFED_LINUX-${MLNX_OFED_VER}-ubuntu${UBUNTU_VER}-x86_64/mlnxofedinstall --user-space-only --without-fw-update --all -q --force \ - && rm -rf MLNX_OFED_LINUX* \ - && apt-get autoremove -y \ - && rm -rf /var/lib/apt/lists/* \ - && rm -rf /var/cache/apt/archives/partial/* - -# Installation of MLNX_OFED would install python2, overwriting /usr/bin/python -RUN ln -sf python3 /usr/bin/python \ - && ln -sf pip3 /usr/bin/pip - -COPY ./docker/cufile.json /etc/cufile.json -RUN sed -i 's/"allow_compat_mode": false,/"allow_compat_mode": true,/' /etc/cufile.json \ - && echo "/usr/local/gds/lib/" > /etc/ld.so.conf.d/cufile.conf \ - && ldconfig - -ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/nvvm/lib64 - -ENTRYPOINT ["/bin/bash"] diff --git a/docker/cufile.json b/docker/cufile.json deleted file mode 100644 index 55930426c..000000000 --- a/docker/cufile.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - // NOTE : Application can override custom configuration via export CUFILE_ENV_PATH_JSON= - // e.g : export CUFILE_ENV_PATH_JSON="/home//cufile.json" - - "logging": { - // log directory, if not enabled will create log file under current working directory - //"dir": "/home/", - - // ERROR|WARN|INFO|DEBUG|TRACE (in decreasing order of priority) - "level": "ERROR" - }, - - "profile": { - // nvtx profiling on/off - "nvtx": false, - // cufile stats level(0-3) - "cufile_stats": 0 - }, - - "properties": { - // max IO chunk size (parameter should be 4K aligned) used by cuFileRead/Write internally per IO request - "max_direct_io_size_kb" : 16384, - // device memory size (parameter should be 4K aligned) for reserving bounce buffers for the entire GPU - "max_device_cache_size_kb" : 131072, - // limit on maximum device memory size (parameter should be 4K aligned) that can be pinned for a given process - "max_device_pinned_mem_size_kb" : 33554432, - // true or false (true will enable asynchronous io submission to nvidia-fs driver) - // Note : currently the overall IO will still be synchronous - "use_poll_mode" : false, - // maximum IO request size (parameter should be 4K aligned) within or equal to which library will use polling for IO completion - "poll_mode_max_size_kb": 4, - // allow compat mode, this will enable use of cuFile posix read/writes - "allow_compat_mode": false, - // client-side rdma addr list for user-space file-systems(e.g ["10.0.1.0", "10.0.2.0"]) - "rdma_dev_addr_list": [ ], - // load balancing policy for RDMA memory registration(MR), (RoundRobin, RoundRobinMaxMin) - // In RoundRobin, MRs will be distributed uniformly across NICS closest to a GPU - // In RoundRobinMaxMin, MRs will be distributed across NICS closest to a GPU - // with minimal sharing of NICS acros GPUS - "rdma_load_balancing_policy": "RoundRobin" - }, - - "fs": { - "generic": { - - // for unaligned writes, setting it to true will, cuFileWrite use posix write internally instead of regular GDS write - "posix_unaligned_writes" : false - }, - - "lustre": { - - // IO threshold for read/write (param should be 4K aligned)) equal to or below which cuFile will use posix read/write - "posix_gds_min_kb" : 0 - }, - - "weka": { - - // enable/disable RDMA write - "rdma_write_support" : false - } - }, - - "denylist": { - // specify list of vendor driver modules to deny for nvidia-fs (e.g. ["nvme" , "nvme_rdma"]) - "drivers": [ ], - - // specify list of block devices to prevent IO using cuFile (e.g. [ "/dev/nvme0n1" ]) - "devices": [ ], - - // specify list of mount points to prevent IO using cuFile (e.g. ["/mnt/test"]) - "mounts": [ ], - - // specify list of file-systems to prevent IO using cuFile (e.g ["lustre", "wekafs"]) - "filesystems": [ ] - }, - - "miscellaneous": { - // enable only for enforcing strict checks at API level for debugging - "api_check_aggressive": false - } -} diff --git a/docker/requirements-claratrain.txt b/docker/requirements-claratrain.txt deleted file mode 100644 index 485192268..000000000 --- a/docker/requirements-claratrain.txt +++ /dev/null @@ -1,10 +0,0 @@ -openslide-python==1.1.2 -tifffile>=2022.7.28 -itk==5.1.2 -dask[array,delayed,distributed]==2021.2.0 -dask-cuda==0.17.0 -zarr==2.6.1 -fsspec==0.8.5 -numpy # 1.17.3 already exists in the image -opencv-contrib-python==4.5.1.48 -imagecodecs>=2021.6.8 diff --git a/docker/requirements-jupyter-dev.txt b/docker/requirements-jupyter-dev.txt deleted file mode 100644 index 57a46ed8b..000000000 --- a/docker/requirements-jupyter-dev.txt +++ /dev/null @@ -1,20 +0,0 @@ -openslide-python==1.1.2 -tifffile>=2022.7.28 -itk==5.1.2 -dask[array,delayed,distributed]==2021.2.0 -dask-cuda==0.17.0 -zarr==2.6.1 -fsspec==0.8.5 -numpy==1.19.5 -opencv-contrib-python==4.5.1.48 -imagecodecs>=2021.6.8 -cupy-cuda110==8.4.0 -jupyterlab==3.0.7 -dask_labextension==5.0.0 -cmake>=3.18 ---extra-index-url https://developer.download.nvidia.com/compute/redist -nvidia-dali-cuda110 ---find-links https://download.pytorch.org/whl/torch_stable.html -torch==1.7.1+cu110 -torchvision==0.8.2+cu110 -torchaudio===0.7.2 diff --git a/docker/requirements-jupyter.txt b/docker/requirements-jupyter.txt deleted file mode 100644 index 57a46ed8b..000000000 --- a/docker/requirements-jupyter.txt +++ /dev/null @@ -1,20 +0,0 @@ -openslide-python==1.1.2 -tifffile>=2022.7.28 -itk==5.1.2 -dask[array,delayed,distributed]==2021.2.0 -dask-cuda==0.17.0 -zarr==2.6.1 -fsspec==0.8.5 -numpy==1.19.5 -opencv-contrib-python==4.5.1.48 -imagecodecs>=2021.6.8 -cupy-cuda110==8.4.0 -jupyterlab==3.0.7 -dask_labextension==5.0.0 -cmake>=3.18 ---extra-index-url https://developer.download.nvidia.com/compute/redist -nvidia-dali-cuda110 ---find-links https://download.pytorch.org/whl/torch_stable.html -torch==1.7.1+cu110 -torchvision==0.8.2+cu110 -torchaudio===0.7.2 diff --git a/run b/run index b66c2f75a..d0a7df295 100755 --- a/run +++ b/run @@ -262,24 +262,6 @@ is_x86_64() { # Section: Build #================================================================================== -build_manylinux2014_desc() { echo 'Build manylinux2014 image - -Arguments: - $1 - cuda version (e.g., 110, 111) -' -} -build_manylinux2014() { - local cuda_version="${1:-110}" - run_command docker build -f ${TOP}/Dockerfile-cuda${cuda_version} -t gigony/manylinux2014-x64:cuda${cuda_version} ${TOP} - - read -n 1 -r -p "$(c_str R "Do you want to update dockcross-manylinux2014-x64 with " G "cuda${cuda_version}" R " (y/n)?")" - echo - if [[ $REPLY =~ ^[Yy]$ ]]; then - sed -i -e "s/manylinux2014-x64:cuda.../manylinux2014-x64:cuda${cuda_version}/g" ${TOP}/dockcross-manylinux2014-x64 - c_echo W "Done" - fi -} - build_local_libcucim_() { local source_folder=${1:-${TOP}} local build_type=${2:-debug} diff --git a/run_gds.sh b/run_gds.sh deleted file mode 100644 index 74b0d235a..000000000 --- a/run_gds.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2020-2021, NVIDIA CORPORATION. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -MNT_PATH=/nvme -GDS_IMAGE=cucim-gds - -BUILD_VER=`uname -r` -NV_DRIVER=`nvidia-smi -q -i 0 | sed -n 's/Driver Version.*: *\(.*\) *$/\1/p'` -echo "using nvidia driver version $NV_DRIVER on kernel $BUILD_VER" - - -ofed_version=$(ofed_info -s | grep MLNX) -if [ $? -eq 0 ]; then - rdma_core=$(dpkg -s libibverbs-dev | grep "Source: rdma-core") - if [ $? -eq 0 ]; then - CONFIG_MOFED_VERSION=$(echo $ofed_version | cut -d '-' -f 2) - echo "Found MOFED version $CONFIG_MOFED_VERSION" - fi - MLNX_SRCS="--volume /usr/src/mlnx-ofed-kernel-${CONFIG_MOFED_VERSION}:/usr/src/mlnx-ofed-kernel-${CONFIG_MOFED_VERSION}:ro" - MOFED_DEVS="--net=host --volume /sys/class/infiniband_verbs:/sys/class/infiniband_verbs/ " -fi - -docker run \ - --ipc host \ - -it - --rm - --gpus all \ - --volume /run/udev:/run/udev:ro \ - --volume /sys/kernel/config:/sys/kernel/config/ \ - --volume /usr/src/nvidia-$NV_DRIVER:/usr/src/nvidia-$NV_DRIVER:ro ${MLNX_SRCS}\ - --volume /dev:/dev:ro \ - --privileged \ - --env NV_DRIVER=${NV_DRIVER} \ - --volume /lib/modules/$BUILD_VER/:/lib/modules/$BUILD_VER \ - --volume "${MNT_PATH}/data:/data:rw" \ - --volume "${MNT_PATH}/results:/results:rw" ${MOFED_DEVS} \ - -itd ${REPO_URI}/${GDS_IMAGE} \ - /bin/bash diff --git a/scripts/auditwheel_repair.py b/scripts/auditwheel_repair.py deleted file mode 100644 index 2581ea977..000000000 --- a/scripts/auditwheel_repair.py +++ /dev/null @@ -1,104 +0,0 @@ -# Apache License, Version 2.0 -# Copyright 2020 NVIDIA Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import functools -import re -from unittest.mock import patch - -import auditwheel.elfutils -from auditwheel.main import main -from auditwheel.wheeltools import InWheelCtx - -# How auditwheel repair works? -# -# From https://github.com/pypa/auditwheel/blob/3.2.0/auditwheel/wheel_abi.py#L38 -# 1) Find a Python extension libraries(.so) -# if so ==> A, else ==> B -# 2) `needed_libs` <== external libraries needed by A and B -# 3) From b in B, -# if b is not in `needed_libs`, b is added to A -# 4) Only external libraries in A are patched to use locally copied .so files -# - external libraries that exists under wheel path are discarded -# - https://github.com/pypa/auditwheel/blob/3.2.0/auditwheel/policy/external_references.py#L61 -# - https://github.com/pypa/auditwheel/blob/3.2.0/auditwheel/repair.py#L62 -# -# With current implementation, -# - `cucim/_cucim.cpython-XX-x86_64-linux-gnu.so` files are in A by 1) -# - `cucim/libcucim.so.??` is in B by 1) -# - `cucim/libcucim.so.??` and `libcudart.so.11.0` are in `needed_libs` by 2) -# - `cucim/cucim.kit.cuslide@??.??.??.so` is in A by 3) -# -# And only libz and libcudart are considered as external libraries. - -# To work with cuCIM, we need to -# 1) make `cucim/libcucim.so.??` as Python extension library -# - Patch elf_is_python_extension : https://github.com/pypa/auditwheel/blob/3.2.0/auditwheel/elfutils.py#L81 -# 2) control how to copy external libraries -# - Patch copylib: https://github.com/pypa/auditwheel/blob/3.2.0/auditwheel/repair.py#L108 -# - Need for libnvjpeg library -# 3) preprocess wheel metadata -# - patch InWheelCtx.__enter__ : https://github.com/pypa/auditwheel/blob/3.2.0/auditwheel/wheeltools.py#L158 -# - `Root-Is-Purelib: true` -> `Root-Is-Purelib: false` from WHEEL file - - -# Parameters -PYTHON_EXTENSION_LIBRARIES = [r"cucim/libcucim\.so\.\d{1,2}"] - -# 1) auditwheel.elfutils.elf_is_python_extension replacement -orig_elf_is_python_extension = auditwheel.elfutils.elf_is_python_extension - - -@functools.wraps(orig_elf_is_python_extension) -def elf_is_python_extension(fn, elf): - if any(map(lambda x: re.fullmatch(x, fn), PYTHON_EXTENSION_LIBRARIES)): - print("[cuCIM] Consider {} as a python extension.".format(fn)) - return True, 3 - return orig_elf_is_python_extension(fn, elf) - - -# 3) auditwheel.wheeltools.InWheelCtx.__enter__ replacement -orig_inwheelctx_enter = InWheelCtx.__enter__ - - -@functools.wraps(orig_inwheelctx_enter) -def inwheelctx_enter(self): - rtn = orig_inwheelctx_enter(self) - - # `self.path` is a path that extracted files from the wheel file exists - - # base_dir = glob.glob(join(self.path, '*.dist-info')) - # wheel_path = join(base_dir[0], 'WHEEL') - # with open(wheel_path, 'r') as f: - # wheel_text = f.read() - - # wheel_text = wheel_text.replace('Root-Is-Purelib: true', 'Root-Is-Purelib: false') # noqa: E501 - - # with open(wheel_path, 'w') as f: - # f.write(wheel_text) - - return rtn - - -# # sys.argv replacement -# testargs = ["auditwheel_repair.py", "repair", "--plat", "manylinux2014_x86_64", "-w", "wherehouse", "cuclara_image-0.1.1-py3-none-manylinux2014_x86_64.whl"] # noqa: E501 -# with patch.object(sys, 'argv', testargs): - -if __name__ == "__main__": - # Patch - with patch.object( - auditwheel.elfutils, "elf_is_python_extension", elf_is_python_extension - ): - with patch.object(InWheelCtx, "__enter__", inwheelctx_enter): - main() diff --git a/scripts/run-dist b/scripts/run-dist deleted file mode 100755 index 60ed771e0..000000000 --- a/scripts/run-dist +++ /dev/null @@ -1,500 +0,0 @@ -#!/bin/bash -# -# Copyright (c) 2020, NVIDIA CORPORATION. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -init_globals() { - if [ "$0" != "/bin/bash" ]; then - SCRIPT_DIR=$(dirname "$(readlink -f "$0")") - export RUN_SCRIPT_FILE="$(readlink -f "$0")" - else - export RUN_SCRIPT_FILE="$(readlink -f "${BASH_SOURCE[0]}")" - fi - - export TOP=$(dirname "${RUN_SCRIPT_FILE}") -} - -################################################################################ -# Utility functions -################################################################################ - -####################################### -# Get list of available commands from a given input file. -# -# Available commands and command summary are extracted by checking a pattern -# "_desc() { echo '". -# Section title is extracted by checking a pattern "# Section: ". -# This command is used for listing available commands in CLI. -# -# e.g.) -# "# Section: String/IO functions" -# => "# String/IO functions" -# "to_lower_desc() { echo 'Convert to lower case" -# => "to_lower ----------------- Convert to lower case" -# -# Arguments: -# $1 - input file that defines commands -# Returns: -# Print list of available commands from $1 -####################################### -get_list_of_available_commands() { - local file_name="$1" - if [ ! -e "$1" ]; then - echo "$1 doesn't exist!" - fi - - local line_str='--------------------------------' - local IFS= cmd_lines="$(IFS= cat "$1" | grep -E -e "^(([[:alpha:]_[:digit:]]+)_desc\(\)|# Section: )" | sed "s/_desc() *{ *echo '/ : /")" - local line - while IFS= read -r line; do - local cmd=$(echo "$line" | cut -d":" -f1) - local desc=$(echo "$line" | cut -d":" -f2-) - if [ "$cmd" = "# Section" ]; then - c_echo B "${desc}" - else - # there is no substring operation in 'sh' so use 'cut' - local dash_line="$(echo "${line_str}" | cut -c ${#cmd}-)" # = "${line_str:${#cmd}}" - c_echo Y " ${cmd}" w " ${dash_line} ${desc}" - fi - # use <&2 echo "$@" -} - -c_echo_err() { - >&2 c_echo "$@" -} - -printf_err() { - >&2 printf "$@" -} - -get_item_ranges() { - local indexes="$1" - local list="$2" - echo -n "$(echo "${list}" | xargs | cut -d " " -f "${indexes}")" - return $? -} - -get_unused_ports() { - local num_of_ports=${1:-1} - local start=${2:-49152} - local end=${3:-61000} - comm -23 \ - <(seq ${start} ${end} | sort) \ - <(ss -tan | awk '{print $4}' | while read line; do echo ${line##*\:}; done | grep '[0-9]\{1,5\}' | sort -u) \ - | shuf | tail -n ${num_of_ports} # use tail instead head to avoid broken pipe in VSCode terminal -} - -newline() { - echo -} - -info() { - c_echo W "$(date -u '+%Y-%m-%d %H:%M:%S') [INFO] " Z "$@" -} - -error() { - echo R "$(date -u '+%Y-%m-%d %H:%M:%S') [ERROR] " Z "$@" -} - -fatal() { - echo R "$(date -u '+%Y-%m-%d %H:%M:%S') [FATAL] " Z "$@" - echo - if [ -n "${SCRIPT_DIR}" ]; then - exit 1 - fi -} - -run_command() { - local status=0 - local cmd="$*" - - c_echo B "$(date -u '+%Y-%m-%d %H:%M:%S') " W "\$ " G "${cmd}" - - [ "$(echo -n "$@")" = "" ] && return 1 # return 1 if there is no command available - - "$@" - status=$? - - unset IFS - - return $status -} - -retry() { - local retries=$1 - shift - - local count=0 - until run_command "$@"; do - exit=$? - wait=$((2 ** count)) - count=$((count + 1)) - if [ $count -lt $retries ]; then - info "Retry $count/$retries. Exit code=$exit, Retrying in $wait seconds..." - sleep $wait - else - fatal "Retry $count/$retries. Exit code=$exit, no more retries left." - return 1 - fi - done - return 0 -} - -#================================================================================== -# Section: Example -#================================================================================== - -download_testdata_desc() { echo 'Download test data from Docker Hub -' -} -download_testdata() { - c_echo W "Downloading test data..." - run_command mkdir -p ${TOP}/notebooks/input - if [ ! -e ${TOP}/notebooks/input/README.md ]; then - run_command rm -rf ${TOP}/notebooks/input - id=$(docker create gigony/svs-testdata:little-big) - run_command docker cp $id:/input ${TOP}/notebooks - run_command docker rm -v $id - c_echo G "Test data is downloaded to ${TOP}/notebooks/input!" - else - c_echo G "Test data already exists at ${TOP}/notebooks/input!" - fi -} - -copy_gds_files_() { - [ ! -d /usr/local/cuda/gds ] && c_echo_err R "GDS is not available at /usr/local/cuda/gds !" && return 1 - - rm -rf ${TOP}/temp/gds - mkdir -p ${TOP}/temp/gds/lib64 - cp -P -r /usr/local/cuda/gds/* ${TOP}/temp/gds/ - cp -P /usr/local/cuda/lib64/cufile.h /usr/local/cuda/lib64/libcufile* ${TOP}/temp/gds/lib64/ -} - -launch_notebooks_desc() { echo 'Launch jupyter notebooks - -Arguments: - -p - port number - -h - hostname to serve documentation on (default: 0.0.0.0) - -g - launch GDS-enabled container -' -} -launch_notebooks() { - local OPTIND - local port=$(get_unused_ports 1 10000 10030) - local host='0.0.0.0' - local gds_postfix='' - local gds_nvme_path='' - - while getopts 'p:h:g:' option; - do - case "${option}" in - p) - port="$OPTARG" - ;; - h) - host="$OPTARG" - ;; - g) - gds_postfix='-gds' - echo "# OPTARG:$OPTARG" - [ -z "$OPTARG" ] && c_echo_err R "Please specify NVMe path!" && return 1 - gds_nvme_path=$(readlink -f "$OPTARG") - [ ! -d "$gds_nvme_path" ] && c_echo_err R "Folder $gds_nvme_path doesn't exist!" && return 1 - - # Copy cufile SDK from host system to temp/gds - copy_gds_files_ - ;; - *) - return 1 - esac - done - - download_testdata - - run_command cp ${TOP}/*.whl ${TOP}/notebooks - - run_command docker build --runtime nvidia -t cucim-jupyter${gds_postfix} -f ${TOP}/docker/Dockerfile-jupyter${gds_postfix} ${TOP} - - [ $? -ne 0 ] && return 1 - - c_echo W "Port " G "$port" W " would be used...(" B "http://$(hostname -I | cut -d' ' -f 1):${port}" W ")" - - if [ -z "${gds_postfix}" ]; then - run_command docker run --runtime nvidia --gpus all -it --rm \ - -v ${TOP}/notebooks:/notebooks \ - -p ${port}:${port} \ - cucim-jupyter \ - -c "echo -n 'Enter New Password: '; jupyter lab --ServerApp.password=\"\$(python3 -u -c \"from jupyter_server.auth import passwd;pw=input();print(passwd(pw));\" | egrep 'sha|argon')\" --ServerApp.root_dir=/notebooks --allow-root --port=${port} --ip=${host} --no-browser" - else - local MNT_PATH=/nvme - local GDS_IMAGE=cucim-jupyter${gds_postfix} - - local BUILD_VER=`uname -r` - local NV_DRIVER=`nvidia-smi -q -i 0 | sed -n 's/Driver Version.*: *\(.*\) *$/\1/p'` - echo "using nvidia driver version $NV_DRIVER on kernel $BUILD_VER" - - local ofed_version=$(ofed_info -s | grep MLNX) - if [ $? -eq 0 ]; then - local rdma_core=$(dpkg -s libibverbs-dev | grep "Source: rdma-core") - if [ $? -eq 0 ]; then - local CONFIG_MOFED_VERSION=$(echo $ofed_version | cut -d '-' -f 2) - echo "Found MOFED version $CONFIG_MOFED_VERSION" - fi - local MLNX_SRCS="--volume /usr/src/mlnx-ofed-kernel-${CONFIG_MOFED_VERSION}:/usr/src/mlnx-ofed-kernel-${CONFIG_MOFED_VERSION}:ro" - local MOFED_DEVS="--net=host --volume /sys/class/infiniband_verbs:/sys/class/infiniband_verbs/ " - fi - - docker run \ - --ipc host \ - -it \ - --rm \ - --gpus all \ - -v ${TOP}/notebooks:/notebooks \ - -p ${port}:${port} \ - --volume /run/udev:/run/udev:ro \ - --volume /sys/kernel/config:/sys/kernel/config/ \ - --volume /usr/src/nvidia-$NV_DRIVER:/usr/src/nvidia-$NV_DRIVER:ro ${MLNX_SRCS}\ - --volume /dev:/dev:ro \ - --privileged \ - --env NV_DRIVER=${NV_DRIVER} \ - --volume /lib/modules/$BUILD_VER/:/lib/modules/$BUILD_VER \ - --volume "${MNT_PATH}:/notebooks/nvme:rw" \ - ${MOFED_DEVS} \ - ${GDS_IMAGE} \ - -c "echo -n 'Enter New Password: '; jupyter lab --ServerApp.password=\"\$(python3 -u -c \"from jupyter_server.auth import passwd;pw=input();print(passwd(pw));\" | egrep 'sha|argon')\" --ServerApp.root_dir=/notebooks --allow-root --port=${port} --ip=${host} --no-browser" - fi -} - -#================================================================================== -# Section: Build -#================================================================================== - -build_train() { - local image_name=${1:-cucim-train} - run_command docker build -t ${image_name} -f ${TOP}/docker/Dockerfile-claratrain ${TOP}/docker -} - -build_train_desc() { echo 'Build Clara Train Docker image with cuCIM (& OpenSlide) - -Build image from docker/Dockerfile-claratrain - -Arguments: - $1 - docker image name (default:cucim-train) -' -} -build_train() { - local image_name=${1:-cucim-train} - run_command docker build -t ${image_name} -f ${TOP}/docker/Dockerfile-claratrain ${TOP} -} - -build_examples_desc() { echo 'Build cuCIM C++ examples -' -} -build_examples() { - local image_name=cucim-cmake - run_command docker build -t ${image_name} -f ${TOP}/docker/Dockerfile-cmake ${TOP}/docker - run_command docker run -it --rm \ - -v ${TOP}:/workspace \ - ${image_name} \ - -c " - mkdir -p /workspace/examples/cpp/build; - rm -rf /workspace/examples/cpp/build/*; - cd /workspace/examples/cpp/build; - cmake .. && make" - c_echo W "Copying binary files to ${TOP}/bin folder..." - run_command mkdir -p ${TOP}/bin - run_command cp ${TOP}/examples/cpp/build/bin/* ${TOP}/bin - - download_testdata - - c_echo W "Execute the binary with the following commands:" - c_echo " # Set library path" - c_echo B " export LD_LIBRARY_PATH=${TOP}/install/lib:\$LD_LIBRARY_PATH" - c_echo " # Execute" - c_echo B " ./bin/tiff_image notebooks/input/image.tif ." -} - -parse_args() { - local OPTIND - while getopts 'yh' option; - do - case "${option}" in - y) - ALWAYS_YES=true; - ;; - h) - print_usage - exit 1 - ;; - *) - ;; - esac - done - shift $((OPTIND-1)) - - CMD="$1" - shift - - ARGS=("$@") -} - -print_usage() { - set +x - echo_err - echo_err "USAGE: $0 [command] [arguments]..." - echo_err "" - c_echo_err W "Global Arguments" - echo_err - c_echo_err W "Command List" - c_echo_err Y " help " w "---------------------------- Print detailed description for a given argument (command name)" - echo_err "$(get_list_of_available_commands "${RUN_SCRIPT_FILE}" | my_cat_prefix " ")" - echo_err -} - -print_cmd_help_messages() { - local cmd="$1" - if [ -n "${cmd}" ]; then - if type ${cmd}_desc > /dev/null 2>&1; then - ${cmd}_desc - exit 0 - else - c_echo_err R "Command '${cmd}' doesn't exist!" - exit 1 - fi - fi - print_usage - return 0 -} - -main() { - local ret=0 - parse_args "$@" - - case "$CMD" in - help) - print_cmd_help_messages "${ARGS[@]}" - exit 0 - ;; - build) - build_examples "${ARGS[@]}" - ;; - notebooks) - launch_notebooks "${ARGS[@]}" - ;; - ''|main) - print_usage - ;; - *) - if type ${CMD} > /dev/null 2>&1; then - "$CMD" "${ARGS[@]}" - else - print_usage - exit 1 - fi - ;; - esac - ret=$? - if [ -n "${SCRIPT_DIR}" ]; then - exit $ret - fi -} - -init_globals - -if [ -n "${SCRIPT_DIR}" ]; then - main "$@" -fi