Skip to content

Commit

Permalink
chore(release) install Python 3.8+ in older distributions
Browse files Browse the repository at this point in the history
Fixing V8 build issues, see NVIDIA/DeepLearningExamples#1016

Fixes #430
  • Loading branch information
thibaultcha committed Oct 30, 2023
1 parent 0f00725 commit 19f0e1f
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 8 deletions.
14 changes: 9 additions & 5 deletions assets/release/Dockerfiles/Dockerfile.amd64.centos7
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
FROM amd64/centos:7
# Use Python 3.8+ (required by V8's GN build system)
# See https://hub.docker.com/r/centos/python-38-centos7
FROM centos/python-38-centos7
#FROM registry.access.redhat.com/ubi8/python-38
COPY . /ngx_wasm_module
USER root

RUN yum install -y epel-release && \
yum update -y && \
RUN yum update -y && \
yum install -y epel-release && \
yum install -y centos-release-scl && \
yum install -y \
devtoolset-8 \
Expand All @@ -13,16 +17,16 @@ RUN yum install -y epel-release && \
cmake3 \
make \
gcc \
python3 \
git \
glib2-devel \
perl \
perl-IPC-Cmd \
perl-Test-Simple

RUN ln -nfs $(which cmake3) /usr/bin/cmake

ENV RUSTUP_HOME=/usr/local/rustup CARGO_HOME=/usr/local/cargo
ENV PATH $CARGO_HOME/bin:$PATH
RUN ln -nfs $(which cmake3) /usr/bin/cmake
RUN mkdir -p "$CARGO_HOME" && mkdir -p "$RUSTUP_HOME" && \
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable && \
chmod -R a=rwX $CARGO_HOME $RUSTUP_HOME
Expand Down
2 changes: 1 addition & 1 deletion assets/release/Dockerfiles/Dockerfile.amd64.centos8
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-* && \
libstdc++-devel \
libatomic \
perl \
python3 \
python39 \
git \
glib2-devel

Expand Down
11 changes: 9 additions & 2 deletions assets/release/Dockerfiles/Dockerfile.amd64.ubuntu-18.04
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@ FROM amd64/ubuntu:18.04
COPY . /ngx_wasm_module

ARG DEBIAN_FRONTEND=noninteractive

# Install Python 3.8+ (required by V8's GN build system)
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository -y ppa:deadsnakes/ppa && \
apt-get update && \
apt-get install -y python3.8 && \
ln -nfs $(which python3.8) /usr/bin/python3

RUN apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates \
build-essential \
ninja-build \
python3 \
cmake \
gcc-8 \
libstdc++-8-dev \
git \
Expand Down
20 changes: 20 additions & 0 deletions util/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,26 @@ release_bin() {

notice "Building $arch binary..."

notice "Debug"
ps -p $$
[[ $- == *i* ]] && echo 'Interactive' || echo 'Not interactive'
shopt -q login_shell && echo 'Login shell' || echo 'Not login shell'
if [ -x "$(command -v python)" ]; then
python -V
else
echo "no python"
fi
if [ -x "$(command -v python3)" ]; then
python3 -V
else
echo "no python3"
fi
if [ -f ~/.profile ]; then
cat ~/.profile
else
echo "no .profile"
fi

if [ "$(get_distro)" = "centos7" ]; then
notice "Enabling devtoolset-8 for CentOS..."
source /opt/rh/devtoolset-8/enable
Expand Down

0 comments on commit 19f0e1f

Please sign in to comment.