Skip to content

Commit

Permalink
apacheGH-43536: [Python][CI] Add a Crossbow job with the free-threade…
Browse files Browse the repository at this point in the history
…d build
  • Loading branch information
lysnikolaou committed Aug 13, 2024
1 parent 483bc7b commit 1cb315b
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 0 deletions.
51 changes: 51 additions & 0 deletions ci/docker/linux-apt-python-313-freethreading-test.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.

ARG base
FROM ${base}

RUN apt install -y -q --no-install-recommends software-properties-common && \
add-apt-repository -y ppa:deadsnakes/ppa && \
apt update && \
apt install -y -q --no-install-recommends python3.13-nogil

COPY python/requirements-build.txt \
python/requirements-test.txt \
/arrow/python/

ENV ARROW_PYTHON_VENV /arrow-dev
RUN python3.13t -m venv ${ARROW_PYTHON_VENV} && \
. ${ARROW_PYTHON_VENV}/bin/activate && \
pip install -U pip setuptools wheel && \
pip install \
--pre \
--extra-index-url "https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" \
-r arrow/python/requirements-build.txt \
-r arrow/python/requirements-test.txt

ENV ARROW_ACERO=ON \
ARROW_BUILD_STATIC=OFF \
ARROW_BUILD_TESTS=OFF \
ARROW_BUILD_UTILITIES=OFF \
ARROW_COMPUTE=ON \
ARROW_CSV=ON \
ARROW_DATASET=ON \
ARROW_FILESYSTEM=ON \
ARROW_GDB=ON \
ARROW_HDFS=ON \
ARROW_JSON=ON \
ARROW_USE_GLOG=OFF
8 changes: 8 additions & 0 deletions dev/tasks/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1254,6 +1254,14 @@ tasks:
PYTHON: "3.10"
image: conda-python-cython2

test-ubuntu-22.04-python-313-freethreading:
ci: github
template: docker-tests/github.linux.yml
params:
env:
UBUNTU: 22.04
image: ubuntu-python-313-freethreading-test

test-debian-12-python-3-amd64:
ci: github
template: docker-tests/github.linux.yml
Expand Down
33 changes: 33 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ x-hierarchy:
- ubuntu-lint
- ubuntu-python
- ubuntu-python-sdist-test
- ubuntu-python-313-freethreading-test
- ubuntu-r
- ubuntu-r-only-r
- ubuntu-cpp-bundled
Expand Down Expand Up @@ -1086,6 +1087,38 @@ services:
/arrow/ci/scripts/cpp_build.sh /arrow /build &&
/arrow/ci/scripts/python_sdist_test.sh /arrow"
############################ Python free-threading ##########################

ubuntu-python-313-freethreading-test:
# Usage:
# docker-compose build ubuntu-cpp
# docker-compose build ubuntu-python-313-freethreading-test
# docker-compose run --rm ubuntu-python-313-freethreading-test
# Parameters:
# ARCH: amd64, arm64v8, ...
# PYARROW_VERSION: The test target pyarrow version such as "3.0.0"
# UBUNTU: 20.04, 22.04
image: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-python-313-freethreading-test
build:
context: .
dockerfile: ci/docker/linux-apt-python-313-freethreading-test.dockerfile
cache_from:
- ${REPO}:${ARCH}-ubuntu-${UBUNTU}-python-313-freethreading-test
args:
base: ${REPO}:${ARCH}-ubuntu-${UBUNTU}-cpp
shm_size: *shm-size
environment:
<<: [*common, *ccache]
# Bundled build of OpenTelemetry needs a git client
ARROW_WITH_OPENTELEMETRY: "OFF"
PYARROW_VERSION: ${PYARROW_VERSION:-}
volumes: *ubuntu-volumes
command: >
/bin/bash -c "
/arrow/ci/scripts/cpp_build.sh /arrow /build &&
/arrow/ci/scripts/python_build.sh /arrow /build &&
/arrow/ci/scripts/python_test.sh /arrow"
############################ Python wheels ##################################

# See available versions at:
Expand Down

0 comments on commit 1cb315b

Please sign in to comment.