Skip to content

Commit

Permalink
add python3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
tianshuo78520a committed Oct 16, 2023
1 parent f0cad76 commit 550460f
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 27 deletions.
7 changes: 5 additions & 2 deletions tools/dockerfile/Dockerfile.centos
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,22 @@ RUN wget https://raw.githubusercontent.com/PaddlePaddle/Paddle/develop/python/re
RUN LD_LIBRARY_PATH=/opt/_internal/cpython-3.8.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.8.0/bin/pip3 install setuptools -U && \
LD_LIBRARY_PATH=/opt/_internal/cpython-3.9.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.9.0/bin/pip3 install setuptools -U && \
LD_LIBRARY_PATH=/opt/_internal/cpython-3.10.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.10.0/bin/pip3 install setuptools -U && \
LD_LIBRARY_PATH=/opt/_internal/cpython-3.11.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.11.0/bin/pip3 install setuptools -U
LD_LIBRARY_PATH=/opt/_internal/cpython-3.11.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.11.0/bin/pip3 install setuptools -U && \
LD_LIBRARY_PATH=/opt/_internal/cpython-3.12.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.12.0/bin/pip3 install setuptools -U

RUN LD_LIBRARY_PATH=/opt/_internal/cpython-3.8.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.8.0/bin/pip3 install -r /root/requirements.txt && \
LD_LIBRARY_PATH=/opt/_internal/cpython-3.9.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.9.0/bin/pip3 install -r /root/requirements.txt && \
LD_LIBRARY_PATH=/opt/_internal/cpython-3.10.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.10.0/bin/pip3 install -r /root/requirements.txt && \
LD_LIBRARY_PATH=/opt/_internal/cpython-3.11.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.11.0/bin/pip3 install -r /root/requirements.txt && \
LD_LIBRARY_PATH=/opt/_internal/cpython-3.12.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.12.0/bin/pip3 install -r /root/requirements.txt && \
go get github.com/Masterminds/glide && \
rm -rf /root/requirements.txt

RUN LD_LIBRARY_PATH=/opt/_internal/cpython-3.8.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.8.0/bin/pip3 install pre-commit 'ipython==5.3.0' && \
LD_LIBRARY_PATH=/opt/_internal/cpython-3.9.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.9.0/bin/pip3 install pre-commit 'ipython==5.3.0' && \
LD_LIBRARY_PATH=/opt/_internal/cpython-3.10.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.10.0/bin/pip3 install pre-commit 'ipython==5.3.0' && \
LD_LIBRARY_PATH=/opt/_internal/cpython-3.11.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.11.0/bin/pip3 install pre-commit 'ipython==5.3.0'
LD_LIBRARY_PATH=/opt/_internal/cpython-3.11.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.11.0/bin/pip3 install pre-commit 'ipython==5.3.0' && \
LD_LIBRARY_PATH=/opt/_internal/cpython-3.12.0/lib/:${LD_LIBRARY_PATH} /opt/_internal/cpython-3.12.0/bin/pip3 install pre-commit 'ipython==5.3.0'

RUN wget -O /opt/swig-2.0.12.tar.gz --no-check-certificate https://sourceforge.net/projects/swig/files/swig/swig-2.0.12/swig-2.0.12.tar.gz/download && \
cd /opt && tar xzf swig-2.0.12.tar.gz && cd /opt/swig-2.0.12 && ./configure && make && make install && cd /opt && rm swig-2.0.12.tar.gz
Expand Down
47 changes: 23 additions & 24 deletions tools/dockerfile/Dockerfile.ubuntu20
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ RUN wget -q https://cmake.org/files/v3.18/cmake-3.18.0-Linux-x86_64.tar.gz && ta
ENV PATH=/home/cmake-3.18.0-Linux-x86_64/bin:$PATH

RUN apt-get update && \
apt-get install -y python3.7 python3.7-dev python3.7-distutils\
python3.8 python3.8-dev python3.8-distutils \
apt-get install python3.8 python3.8-dev python3.8-distutils \
python3.9 python3.9-dev python3.9-distutils \
python3.10 python3.10-dev python3.10-distutils \
python3.11 python3.11-dev python3.11-distutils && \
python3.12 python3.12-dev python3.12-distutils && \
apt-get install python-is-python3 && \
rm /usr/bin/python && ln -s /usr/bin/python3.9 /usr/bin/python && \
rm /usr/bin/python3 && ln -s /usr/bin/python3.9 /usr/bin/python3
Expand All @@ -72,19 +72,19 @@ RUN wget https://files.pythonhosted.org/packages/a7/e0/30642b9c2df516506d40b563b
WORKDIR /home/setuptools-50.3.2
RUN python3.9 setup.py build && python3.9 setup.py install && \
python3.8 setup.py build && python3.8 setup.py install && \
python3.7 setup.py build && python3.7 setup.py install && \
python3.10 setup.py build && python3.10 setup.py install && \
python3.11 setup.py build && python3.11 setup.py install
python3.11 setup.py build && python3.11 setup.py install && \
python3.12 setup.py build && python3.12 setup.py install

WORKDIR /home
RUN wget https://files.pythonhosted.org/packages/28/af/2c76c8aa46ccdf7578b83d97a11a2d1858794d4be4a1610ade0d30182e8b/pip-20.0.1.tar.gz && tar -zxvf pip-20.0.1.tar.gz
WORKDIR pip-20.0.1

RUN python3.9 setup.py install && \
python3.8 setup.py install && \
python3.7 setup.py install && \
python3.10 setup.py install && \
python3.11 setup.py install
python3.11 setup.py install && \
python3.12 setup.py install

WORKDIR /home
RUN rm setuptools-50.3.2.zip pip-20.0.1.tar.gz && \
Expand Down Expand Up @@ -115,56 +115,55 @@ RUN git config --global credential.helper store
RUN localedef -i en_US -f UTF-8 en_US.UTF-8

#For pre-commit
RUN python3.7 -m pip --no-cache-dir install --upgrade pip && \
python3.8 -m pip --no-cache-dir install --upgrade pip && \
RUN python3.8 -m pip --no-cache-dir install --upgrade pip && \
python3.9 -m pip --no-cache-dir install --upgrade pip && \
python3.10 -m pip --no-cache-dir install --upgrade pip && \
python3.11 -m pip --no-cache-dir install --upgrade pip
python3.11 -m pip --no-cache-dir install --upgrade pip && \
python3.12 -m pip --no-cache-dir install --upgrade pip

RUN rm -f /usr/local/bin/pip && ln -s /usr/local/bin/pip3.9 /usr/local/bin/pip && \
rm -f /usr/local/bin/pip3 && ln -s /usr/local/bin/pip3.9 /usr/local/bin/pip3

RUN pip3.7 --no-cache-dir install ipython==5.3.0 && \
pip3.7 --no-cache-dir install ipykernel==4.6.0 wheel && \
pip3.8 --no-cache-dir install ipython==5.3.0 && \
RUN pip3.8 --no-cache-dir install ipython==5.3.0 && \
pip3.8 --no-cache-dir install ipykernel==4.6.0 wheel && \
pip3.9 --no-cache-dir install ipython==5.3.0 && \
pip3.9 --no-cache-dir install ipykernel==4.6.0 wheel && \
pip3.10 --no-cache-dir install ipython==5.3.0 && \
pip3.10 --no-cache-dir install ipykernel==4.6.0 wheel && \
pip3.11 --no-cache-dir install ipython==5.3.0 && \
pip3.11 --no-cache-dir install ipykernel==4.6.0 wheel
pip3.11 --no-cache-dir install ipykernel==4.6.0 wheel && \
pip3.12 --no-cache-dir install ipython==5.3.0 && \
pip3.12 --no-cache-dir install ipykernel==4.6.0 wheel

#For docstring checker
RUN pip3.7 --no-cache-dir install pytest astroid isort && \
pip3.8 --no-cache-dir install pytest astroid isort && \
RUN pip3.8 --no-cache-dir install pytest astroid isort && \
pip3.9 --no-cache-dir install pytest astroid isort && \
pip3.10 --no-cache-dir install pytest astroid isort && \
pip3.11 --no-cache-dir install pytest astroid isort
pip3.11 --no-cache-dir install pytest astroid isort && \
pip3.12 --no-cache-dir install pytest astroid isort

RUN pip3.7 --no-cache-dir install pre-commit==2.17.0 pylint==2.12.0 && \
pip3.8 --no-cache-dir install pre-commit==2.17.0 pylint==2.12.0 && \
RUN pip3.8 --no-cache-dir install pre-commit==2.17.0 pylint==2.12.0 && \
pip3.9 --no-cache-dir install pre-commit==2.17.0 pylint==2.12.0 && \
pip3.10 --no-cache-dir install pre-commit==2.17.0 pylint==2.12.0 && \
pip3.7 --no-cache-dir install cpplint==1.6.0 clang-format==13.0.0 && \
pip3.8 --no-cache-dir install cpplint==1.6.0 clang-format==13.0.0 && \
pip3.9 --no-cache-dir install cpplint==1.6.0 clang-format==13.0.0 && \
pip3.10 --no-cache-dir install cpplint==1.6.0 clang-format==13.0.0 && \
pip3.11 --no-cache-dir install cpplint==1.6.0 clang-format==13.0.0
pip3.11 --no-cache-dir install cpplint==1.6.0 clang-format==13.0.0 && \
pip3.12 --no-cache-dir install cpplint==1.6.0 clang-format==13.0.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 && \
RUN pip3.8 --no-cache-dir install -r /root/requirements.txt && \
pip3.8 --no-cache-dir install -r /home/requirements.txt && \
pip3.9 --no-cache-dir install -r /root/requirements.txt && \
pip3.9 --no-cache-dir install -r /home/requirements.txt && \
pip3.10 --no-cache-dir install -r /root/requirements.txt && \
pip3.10 --no-cache-dir install -r /home/requirements.txt && \
pip3.11 --no-cache-dir install -r /root/requirements.txt && \
pip3.11 --no-cache-dir install -r /home/requirements.txt
pip3.11 --no-cache-dir install -r /home/requirements.txt && \
pip3.12 --no-cache-dir install -r /root/requirements.txt && \
pip3.12 --no-cache-dir install -r /home/requirements.txt


# ccache 4.2.0
Expand Down
2 changes: 1 addition & 1 deletion tools/dockerfile/build_scripts/build_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ function do_cpython_build {
LD_LIBRARY_PATH="/usr/local/ssl/lib:${prefix}/lib" ${prefix}/bin/python -m pip config set global.index-url http://mirrors.aliyun.com/pypi/simple/
fi
LD_LIBRARY_PATH="/usr/local/ssl/lib:${prefix}/lib" ${prefix}/bin/python get-pip.py
LD_LIBRARY_PATH="/usr/local/ssl/lib:${prefix}/lib" ${prefix}/bin/pip install wheel==0.32.2
LD_LIBRARY_PATH="/usr/local/ssl/lib:${prefix}/lib" ${prefix}/bin/pip install wheel==0.40.0
cd /
ls ${MY_DIR}
local abi_tag=$(LD_LIBRARY_PATH="${prefix}/lib" ${prefix}/bin/python ${MY_DIR}/python-tag-abi-tag.py)
Expand Down

0 comments on commit 550460f

Please sign in to comment.