Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix paddle install version issue #83

Merged
merged 2 commits into from
Jul 3, 2023
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
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,6 @@ Typically, you can choose `full` / `full-cuda` if you have enough disk space and
|:-------------------------:|:-------------------------------------------:|:-----------------:|:--------------------------------------------------------------------------------------------------------------------:|
| cuda_11.7, cuda | https://hub.docker.com/r/qpod/cuda_11.7 | qpod/base | Version 11.7 of NVIDIA cuda and cudnn libs, including runtime and devel. |
| cuda_11.2 | https://hub.docker.com/r/qpod/cuda_11.2 | qpod/base | Version 11.2 of NVIDIA cuda and cudnn libs, including runtime and devel. |
| cuda_10.2 | https://hub.docker.com/r/qpod/cuda_10.2 | qpod/base | Version 10.2 of NVIDIA cuda and cudnn libs, including runtime and devel. |
| cuda_10.0 | https://hub.docker.com/r/qpod/cuda_10.0 | qpod/base | Version 10.0 of NVIDIA cuda and cudnn libs, including runtime and devel. (Specifically retained for tensorflow 1.15) |
| tf1-cuda100, tf1 | https://hub.docker.com/r/qpod/tf1 | qpod/cuda_10.0 | Tensorflow 1.1x environment with GPU (cuda 10.0). |
| tf2-cuda112, tf2 | https://hub.docker.com/r/qpod/tf2 | qpod/cuda_11.2 | Tensorflow 2.x environment with GPU (cuda 11.2). |
| torch-cuda117, torch | https://hub.docker.com/r/qpod/torch | qpod/torch | Pytorch 1.x environment with GPU (cuda 11.7). |
| torch-cuda112 | https://hub.docker.com/r/qpod/torch-cuda112 | qpod/torch-cuda12 | Pytorch 1.x environment with GPU (cuda 10.2). |
Expand Down
11 changes: 4 additions & 7 deletions docker_core/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,13 @@ RUN source /opt/utils/script-utils.sh \
&& pip install --pre -U ${V} -f "https://download.pytorch.org/whl/${IDX}/torch_stable.html" \
) || echo "Skip pytorch install" ) \
# Handle paddle installation, cpu/gpu: https://www.paddlepaddle.org.cn/
# URL_PADDLE=$(curl -sL "https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html" |tr "<>" "\n" | grep "${PADDLE_VER}" | grep href | cut -d '=' -f 2)
&& ( $(grep -q "paddle" <<< "${ARG_PROFILE_PYTHON}") && ( \
PADDLE=$( [ -x "$(command -v nvcc)" ] && echo "paddlepaddle-gpu" || echo "paddlepaddle") \
&& PADDLE_VER=$(pip index versions ${PADDLE} | grep '(' | cut -d "(" -f 2 | tr -d ')[:space:]') \
URL_PYPI_PADDLE="https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html" \
&& CUDA_VER=$(echo "${CUDA_VERSION:0:4}" | sed 's/\.//' ) \
&& V=$($(grep -q "11" <<< "${CUDA_VER}") && echo ".post${CUDA_VER}" || echo "" ) \
&& V=$(echo ${PADDLE}==${PADDLE_VER}${V}) && echo "to install paddle: ${V}" \
&& pip install pip==21.3.1 && pip --version \
&& PADDLE=$( [ -x "$(command -v nvcc)" ] && echo "paddlepaddle-gpu" || echo "paddlepaddle") \
&& PADDLE_VER=$(pip index versions ${PADDLE} -f ${URL_PYPI_PADDLE} | grep 'Available' | cut -d ":" -f 2 | tr ', ' '\n' | grep ${CUDA_VER:-'.'} | head -n 1) \
&& V=$(echo ${PADDLE}==${PADDLE_VER}) && echo "to install paddle: ${V}" \
&& pip install ${V} -f "https://www.paddlepaddle.org.cn/whl/linux/mkl/avx/stable.html" \
&& pip install -U pip \
) || echo "Skip paddle install" )


Expand Down
11 changes: 11 additions & 0 deletions tool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ push_image() {
done
}

clear_images() {
KEYWORD=${1:-'days ago\|weeks ago\|months ago\|years ago'}; # if no keyword is provided, clear all images build days ago
IMGS_1=$(docker images | grep "${KEYWORD}" | awk '{print $1 ":" $2}') ;
IMGS_2=$(docker images | grep "${KEYWORD}" | awk '{print $3}') ;

for IMG in $(echo "$IMGS_1 $IMGS_2" | tr " " "\n") ; do
docker rmi "${IMG}" || true; status=$?; echo "[${status}] image removed > ${IMG}";
done
docker image prune --force && docker images ;
}

remove_folder() {
sudo du -h -d1 "$1" || true ;
sudo rm -rf "$1" || true ;
Expand Down