Skip to content

Commit

Permalink
Remove manual Python installation from Ubuntu 20.04
Browse files Browse the repository at this point in the history
  • Loading branch information
raulcd committed Sep 16, 2024
1 parent c8a7e97 commit 0bc40f3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 53 deletions.
14 changes: 0 additions & 14 deletions ci/docker/linux-apt-python-3.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,6 @@ COPY python/requirements-build.txt \

ENV ARROW_PYTHON_VENV /arrow-dev

ARG ubuntu
ARG python="3.12"
COPY ci/scripts/install_python.sh /arrow/ci/scripts/
# Ubuntu 20.04 uses python 3.8 which is unsuported for pyarrow
RUN if [ "${ubuntu}" = "20.04" ]; then \
quiet=$([ "${DEBUG}" = "yes" ] || echo "-qq") && \
apt update ${quiet} && \
apt install -y -V ${quiet} \
xz-utils && \
apt clean && \
rm -rf /var/lib/apt/lists/* && \
/arrow/ci/scripts/install_python.sh linux ${python} \
; fi

RUN python3 -m venv ${ARROW_PYTHON_VENV} && \
. ${ARROW_PYTHON_VENV}/bin/activate && \
pip install -U pip setuptools wheel && \
Expand Down
23 changes: 0 additions & 23 deletions ci/scripts/install_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,29 +68,6 @@ if [ $platform = "macOS" ]; then
python="/Library/Frameworks/Python.framework/Versions/${version}/bin/python${version}"
pip="${python} -m pip"

$python -m ensurepip
$pip install -U pip setuptools
elif [ $platform = "Linux" ] ; then
echo "Downloading Python installer..."

if [ "$version" = "3.13" ];
then
fname="Python-${full_version}rc1.tar.xz"
else
fname="Python-${full_version}.tar.xz"
fi
wget "https://www.python.org/ftp/python/${full_version}/${fname}"

echo "Building and installing Python..."
tar -xf ${fname}
rm $fname
pushd Python-3.*
./configure
make install
popd
python=/usr/local/bin/python3
pip="${python} -m pip"

$python -m ensurepip
$pip install -U pip setuptools
else
Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/r_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ SCRIPT="as_cran <- !identical(tolower(Sys.getenv('NOT_CRAN')), 'true')
if (requireNamespace('reticulate', quietly = TRUE) && reticulate::py_module_available('pyarrow')) {
message('Running flight demo server for tests.')
pid_flight <- sys::exec_background(
'python3',
'python',
c(
'-c',
paste0(
Expand Down
24 changes: 9 additions & 15 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -917,19 +917,17 @@ services:
# Parameters:
# ARCH: amd64
# CUDA: <depends on your nvidia driver, should match system CUDA>
# UBUNTU: 20.04, 22.04, ...
# UBUNTU: 22.04, 24.04
# PYTHON: 3.9, 3.10, 3.11, ...
image: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-cuda-${CUDA}-python-${PYTHON}
image: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-cuda-${CUDA}-python-3
build:
context: .
dockerfile: ci/docker/linux-apt-python-3.dockerfile
cache_from:
- ${REPO}:${ARCH}-ubuntu-${UBUNTU}-cuda-${CUDA}-python-${PYTHON}
- ${REPO}:${ARCH}-ubuntu-${UBUNTU}-cuda-${CUDA}-python-3
args:
base: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-cuda-${CUDA}-cpp
numba: ${NUMBA}
ubuntu: ${UBUNTU}
python: ${PYTHON}
shm_size: *shm-size
environment:
<<: [*common, *ccache, *sccache]
Expand Down Expand Up @@ -988,18 +986,16 @@ services:
# docker-compose run --rm ubuntu-python
# Parameters:
# ARCH: amd64, arm64v8, ...
# UBUNTU: 20.04, 22.04
# UBUNTU: 22.04, 24.04
# PYTHON: 3.9, 3.10, ...
image: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-python-${PYTHON}
image: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-python-3
build:
context: .
dockerfile: ci/docker/linux-apt-python-3.dockerfile
cache_from:
- ${REPO}:${ARCH}-ubuntu-${UBUNTU}-python-${PYTHON}
- ${REPO}:${ARCH}-ubuntu-${UBUNTU}-python-3
args:
base: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-cpp
ubuntu: ${UBUNTU}
python: ${PYTHON}
shm_size: *shm-size
environment:
<<: [*common, *ccache]
Expand Down Expand Up @@ -1071,18 +1067,16 @@ services:
# Parameters:
# ARCH: amd64, arm64v8, ...
# PYARROW_VERSION: The test target pyarrow version such as "3.0.0"
# UBUNTU: 20.04, 22.04
# UBUNTU: 22.04, 24.04
# PYTHON: 3.9, 3.10, 3.11, ...
image: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-python-${PYTHON}
image: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-python-3
build:
context: .
dockerfile: ci/docker/linux-apt-python-3.dockerfile
cache_from:
- ${REPO}:${ARCH}-ubuntu-${UBUNTU}-python-${PYTHON}
- ${REPO}:${ARCH}-ubuntu-${UBUNTU}-python-3
args:
base: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-cpp
ubuntu: ${UBUNTU}
python: ${PYTHON}
shm_size: *shm-size
environment:
<<: [*common, *ccache]
Expand Down

0 comments on commit 0bc40f3

Please sign in to comment.