Skip to content

Fix Python38 Installation Issue #55

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

Open
wants to merge 12 commits into
base: PublicCI
Choose a base branch
from
Open
35 changes: 22 additions & 13 deletions tensorflow/tools/ci_build/Dockerfile.cpu-py38
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
FROM ubuntu:16.04
FROM ubuntu:18.04

LABEL maintainer="Gauri Deshpande <gauri1.deshpande@intel.com>"
LABEL maintainer="Ravi Gupta <ravi1.gupta@intel.com>"

# Copy and run the install scripts.
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install cmake -y

COPY install/*.sh /install/
RUN /install/install_bootstrap_deb_packages.sh
RUN add-apt-repository -y ppa:openjdk-r/ppa && \
add-apt-repository -y ppa:george-edison55/cmake-3.x
RUN /install/install_deb_packages.sh
RUN bash -x /install/install_bootstrap_deb_packages.sh
RUN add-apt-repository -y ppa:openjdk-r/ppa
RUN bash -x /install/install_deb_packages.sh

# Install gcc 7
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
Expand All @@ -16,15 +19,21 @@ RUN apt -y install gcc-7 g++-7
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 700 \
--slave /usr/bin/g++ g++ /usr/bin/g++-7

# The following line installs the Python 3.8 cross-compilation toolchain.
RUN /install/install_pi_python3x_toolchain.sh "3.8"
# Install Python 3.8
# libffi-dev is needed for ctypes module of python3.8
RUN apt install libffi-dev
# libsqlite3-dev is needed for module named '_sqlite3'
RUN apt install libsqlite3-dev
RUN chmod 777 /install/install_python38.sh
RUN /install/install_python38.sh
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 0
RUN python3 -V
RUN /install/install_pip_packages_by_version.sh pip3

RUN /install/install_bazel.sh
RUN /install/install_proto3.sh
RUN /install/install_buildifier.sh
RUN /install/install_auditwheel.sh
RUN /install/install_golang.sh
RUN bash -x /install/install_bazel.sh
RUN bash -x /install/install_proto3.sh
RUN bash -x /install/install_buildifier.sh
RUN bash -x /install/install_auditwheel.sh
RUN bash -x /install/install_golang.sh
# Set up the master bazelrc configuration file.
COPY install/.bazelrc /etc/bazel.bazelrc
2 changes: 1 addition & 1 deletion tensorflow/tools/ci_build/install/install_bazel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# ==============================================================================

# Select bazel version.
BAZEL_VERSION="3.7.2"
BAZEL_VERSION="5.1.1"

set +e
local_bazel_ver=$(bazel version 2>&1 | grep -i label | awk '{print $3}')
Expand Down
1 change: 0 additions & 1 deletion tensorflow/tools/ci_build/install/install_deb_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ if [[ "$1" != "" ]] && [[ "$1" != "--without_cmake" ]]; then
fi

# Install dependencies from ubuntu deb repository.
apt-key adv --keyserver keyserver.ubuntu.com --recv 084ECFC5828AB726
apt-get update

if [[ "$ubuntu_version" == "14" ]]; then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ PACKAGES=(
"protobuf"
"scipy"
"scikit-learn"
"packaging"
"pandas"
"psutil"
"py-cpuinfo"
Expand All @@ -57,7 +58,7 @@ PACKAGES=(
"keras_preprocessing"
"h5py"
"tf-estimator-nightly"
"tb-nightly"
"tb-nightly>=2.9.0a20220210"
"argparse"
"dm-tree"
"dill"
Expand Down
25 changes: 25 additions & 0 deletions tensorflow/tools/ci_build/install/install_python38.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# 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.
# ==============================================================================

cd /usr/src
wget https://www.python.org/ftp/python/3.8.10/Python-3.8.10.tgz
tar xzf Python-3.8.10.tgz
cd Python-3.8.10
./configure --enable-optimizations --with-ensurepip=install --prefix=/usr/
make altinstall
rm /usr/src/Python-3.8.10.tgz
rm -rf /usr/src/Python-3.8.10