diff --git a/tools/dockerfile/Dockerfile.ubuntu20 b/tools/dockerfile/Dockerfile.ubuntu20 index e499b1a35cd25627328dc93e348ca1bce4f4bc3c..2b7967d16245ebeacdba8c0bb1faf1a3eead0865 100644 --- a/tools/dockerfile/Dockerfile.ubuntu20 +++ b/tools/dockerfile/Dockerfile.ubuntu20 @@ -146,6 +146,7 @@ RUN pip3.7 --no-cache-dir install pre-commit==2.17.0 pylint==2.12.0 && \ COPY ./python/requirements.txt /root/ COPY ./python/unittest_py/requirements.txt /home/ + RUN pip3.7 --no-cache-dir install -r /root/requirements.txt && \ pip3.7 --no-cache-dir install -r /home/requirements.txt && \ pip3.8 --no-cache-dir install -r /root/requirements.txt && \ diff --git a/tools/dockerfile/ci_dockerfile.sh b/tools/dockerfile/ci_dockerfile.sh index 408b5a63dc25c7dd5ae595a26c810aea49958097..defcdfb5fed97beec3200eba293d178c0c61373a 100644 --- a/tools/dockerfile/ci_dockerfile.sh +++ b/tools/dockerfile/ci_dockerfile.sh @@ -50,7 +50,7 @@ function make_ubuntu_trt7_dockerfile(){ RUN apt remove -y libnccl* --allow-change-held-packages \&\& apt-get install -y --allow-unauthenticated libsndfile1 libnccl2=2.8.4-1+cuda10.2 libnccl-dev=2.8.4-1+cuda10.2 zstd pigz --allow-change-held-packages #g" ${dockerfile_name} } -function make_centos_dockerfile(){ +function make_cpu_dockerfile(){ dockerfile_name="Dockerfile.cuda9_cudnn7_gcc48_py35_centos6" sed "s##ubuntu:20.04#g" ./Dockerfile.ubuntu20 >${dockerfile_name} sed -i "s###g" ${dockerfile_name} @@ -73,26 +73,6 @@ function make_centos_dockerfile(){ } -function make_cinn_dockerfile(){ - dockerfile_name="Dockerfile.cuda11_cudnn8_gcc82_ubuntu18_cinn" - sed "s##nvidia/cuda:11.2.0-cudnn8-devel-ubuntu18.04#g" ./Dockerfile.ubuntu18 >${dockerfile_name} - sed -i "s##ENV LD_LIBRARY_PATH=/usr/local/cuda-11.2/targets/x86_64-linux/lib:\$LD_LIBRARY_PATH #g" ${dockerfile_name} - sed -i 's###g' ${dockerfile_name} - sed -i "7i ENV TZ=Asia/Beijing" ${dockerfile_name} - sed -i "8i RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone" ${dockerfile_name} - sed -i "27i RUN apt-get update && apt-get install -y liblzma-dev openmpi-bin openmpi-doc libopenmpi-dev libsndfile1" ${dockerfile_name} - dockerfile_line=$(wc -l ${dockerfile_name}|awk '{print $1}') - sed -i "${dockerfile_line}i RUN wget --no-check-certificate -q https://paddle-edl.bj.bcebos.com/hadoop-2.7.7.tar.gz \&\& \ - tar -xzf hadoop-2.7.7.tar.gz && mv hadoop-2.7.7 /usr/local/" ${dockerfile_name} - sed -i "${dockerfile_line}i RUN apt remove git -y \&\& apt install -y libcurl4-openssl-dev gettext pigz zstd ninja-build \&\& wget -q https://paddle-ci.gz.bcebos.com/git-2.17.1.tar.gz \&\& \ - tar -xvf git-2.17.1.tar.gz \&\& \ - cd git-2.17.1 \&\& \ - ./configure --with-openssl --with-curl --prefix=/usr/local \&\& \ - make -j8 \&\& make install " ${dockerfile_name} - sed -i "${dockerfile_line}i RUN pip install wheel \&\& pip3 install PyGithub wheel distro \&\& pip3.7 install PyGithub \&\& pip3.8 install distro" ${dockerfile_name} -} - - function make_ce_framework_dockcerfile(){ dockerfile_name="Dockerfile.cuda11.2_cudnn8_gcc82_trt8" sed "s##nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04#g" ./Dockerfile.ubuntu20 >${dockerfile_name} @@ -111,7 +91,8 @@ function make_ce_framework_dockcerfile(){ sed -i 's#RUN bash /build_scripts/install_trt.sh#RUN bash /build_scripts/install_trt.sh trt8531#g' ${dockerfile_name} } -function make_unbuntu18_cu117_dockerfile(){ + +function make_unbuntu20_cu12_dockerfile(){ dockerfile_name="Dockerfile.cuda117_cudnn8_gcc82_ubuntu18_coverage" sed "s##nvidia/cuda:12.0.1-cudnn8-devel-ubuntu20.04#g" ./Dockerfile.ubuntu20 >${dockerfile_name} sed -i "s##ENV LD_LIBRARY_PATH=/usr/local/cuda-12.0/targets/x86_64-linux/lib:\$LD_LIBRARY_PATH #g" ${dockerfile_name} @@ -132,11 +113,11 @@ function make_unbuntu18_cu117_dockerfile(){ sed -i 's#Run bash /build_scripts/install_cudnn.sh cudnn841#RUN bash /build_scripts/install_cudnn.sh cudnn891#g' ${dockerfile_name} } -function make_ubuntu18_cu112_dockerfile(){ + +function make_ubuntu20_cu112_dockerfile(){ dockerfile_name="Dockerfile.cuda11.2_cudnn8.1_trt8.4_gcc8.2_ubuntu18" - sed "s##nvidia/cuda:11.2.0-cudnn8-devel-ubuntu18.04#g" ./Dockerfile.ubuntu18 >${dockerfile_name} + sed "s##nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04#g" ./Dockerfile.ubuntu20 >${dockerfile_name} sed -i "s##ENV LD_LIBRARY_PATH=/usr/local/cuda-11.2/targets/x86_64-linux/lib:\$LD_LIBRARY_PATH #g" ${dockerfile_name} - sed -i "s#liblzma-dev#liblzma-dev openmpi-bin openmpi-doc libopenmpi-dev#g" ${dockerfile_name} dockerfile_line=$(wc -l ${dockerfile_name}|awk '{print $1}') sed -i 's#RUN bash /build_scripts/install_trt.sh#RUN bash /build_scripts/install_trt.sh trt8431#g' ${dockerfile_name} sed -i "${dockerfile_line}i RUN wget --no-check-certificate -q https://paddle-edl.bj.bcebos.com/hadoop-2.7.7.tar.gz \&\& \ @@ -149,23 +130,18 @@ function make_ubuntu18_cu112_dockerfile(){ sed -i "${dockerfile_line}i RUN pip install wheel \&\& pip3 install PyGithub wheel \&\& pip3.7 install PyGithub distro \&\& pip3.8 install PyGithub distro" ${dockerfile_name} sed -i 's###g' ${dockerfile_name} sed -i "s##WORKDIR /usr/bin \\ - COPY tools/dockerfile/build_scripts /build_scripts \\ - RUN bash /build_scripts/install_gcc.sh gcc82 \&\& rm -rf /build_scripts \\ - RUN cp gcc gcc.bak \&\& cp g++ g++.bak \&\& rm gcc \&\& rm g++ \\ - RUN ln -s /usr/local/gcc-8.2/bin/gcc /usr/local/bin/gcc \\ - RUN ln -s /usr/local/gcc-8.2/bin/g++ /usr/local/bin/g++ \\ - RUN ln -s /usr/local/gcc-8.2/bin/gcc /usr/bin/gcc \\ - RUN ln -s /usr/local/gcc-8.2/bin/g++ /usr/bin/g++ \\ ENV PATH=/usr/local/gcc-8.2/bin:\$PATH #g" ${dockerfile_name} + sed -i "s#gcc121#gcc82#g" ${dockerfile_name} + sed -i "s#gcc-12.1#gcc-8.2#g" ${dockerfile_name} + sed -i 's#RUN bash /build_scripts/install_trt.sh#RUN bash /build_scripts/install_trt.sh trt8531#g' ${dockerfile_name} } function main() { make_ubuntu_trt7_dockerfile - make_centos_dockerfile - make_cinn_dockerfile + make_cpu_dockerfile make_ce_framework_dockcerfile - make_unbuntu18_cu117_dockerfile - make_ubuntu18_cu112_dockerfile + make_unbuntu20_cu12_dockerfile + make_ubuntu20_cu112_dockerfile } main "$@"