Skip to content
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

ARROW-16190: [CI][R] Implement CI on Apple M1 for R #14099

Merged
merged 6 commits into from
Sep 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dev/tasks/macros.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ on:
{# use filter to cast to string and convert to lowercase to match yaml boolean #}
{% set is_fork = (not is_upstream_b)|lower %}

{% set r_release = '4.2' %}
{% set r_oldrel = '4.1' %}
{% set r_release = {"ver": "4.2", "rt" : "42"} %}
{% set r_oldrel = {"ver": "4.1", "rt" : "40"} %}

{%- macro github_set_env(env) -%}
{% if env is defined %}
Expand Down
16 changes: 8 additions & 8 deletions dev/tasks/python-wheels/github.osx.arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
- name: Install Vcpkg
env:
MACOSX_DEPLOYMENT_TARGET: "11.0"
run: arch -arm64 arrow/ci/scripts/install_vcpkg.sh $VCPKG_ROOT $VCPKG_VERSION
run: arrow/ci/scripts/install_vcpkg.sh $VCPKG_ROOT $VCPKG_VERSION

- name: Add Vcpkg to PATH
run: echo ${VCPKG_ROOT} >> $GITHUB_PATH
Expand All @@ -67,7 +67,7 @@ jobs:
env:
VCPKG_DEFAULT_TRIPLET: arm64-osx-static-release
run: |
arch -arm64 vcpkg install \
vcpkg install \
--clean-after-build \
--x-install-root=${VCPKG_ROOT}/installed \
--x-manifest-root=arrow/ci/vcpkg \
Expand All @@ -85,14 +85,14 @@ jobs:
$PYTHON -m venv build-arm64-env
source build-arm64-env/bin/activate
pip install --upgrade pip wheel
arch -arm64 arrow/ci/scripts/python_wheel_macos_build.sh arm64 $(pwd)/arrow $(pwd)/build
arrow/ci/scripts/python_wheel_macos_build.sh arm64 $(pwd)/arrow $(pwd)/build

{% if arch == "universal2" %}
- name: Install AMD64 Packages
env:
VCPKG_DEFAULT_TRIPLET: amd64-osx-static-release
run: |
arch -arm64 vcpkg install \
vcpkg install \
--clean-after-build \
--x-install-root=${VCPKG_ROOT}/installed \
--x-manifest-root=arrow/ci/vcpkg \
Expand Down Expand Up @@ -138,10 +138,10 @@ jobs:
# libffi has to be installed on the m1 runner which causes issues with
# the cffi wheel. We build cffi with the flags pointing to the correct libffi location.
LDFLAGS=-L$(brew --prefix libffi)/lib CFLAGS=-I$(brew --prefix libffi)/include \
arch -arm64 pip install cffi --no-binary :all:
arch -arm64 pip install -r arrow/python/requirements-wheel-test.txt
PYTHON=python arch -arm64 arrow/ci/scripts/install_gcs_testbench.sh default
arch -arm64 arrow/ci/scripts/python_wheel_unix_test.sh $(pwd)/arrow
pip install cffi --no-binary :all:
pip install -r arrow/python/requirements-wheel-test.txt
PYTHON=python arrow/ci/scripts/install_gcs_testbench.sh default
arrow/ci/scripts/python_wheel_unix_test.sh $(pwd)/arrow

{% if arch == "universal2" %}
- name: Test Wheel on AMD64
Expand Down
4 changes: 2 additions & 2 deletions dev/tasks/r/github.macos.autobrew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
- macos-11
- macos-10.13 # self-hosted
r-version:
- {{ macros.r_release }}
- {{ macros.r_oldrel }}
- "{{ macros.r_release.ver }}"
- "{{ macros.r_oldrel.ver }}"
steps:
{{ macros.github_checkout_arrow()|indent }}
- name: Configure autobrew script
Expand Down
28 changes: 17 additions & 11 deletions dev/tasks/r/github.packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,31 +130,36 @@ jobs:

r-packages:
needs: [source, windows-cpp]
name: {{ '${{ matrix.platform }} ${{ matrix.r_version.r }}' }}
runs-on: {{ '${{ matrix.platform }}' }}
name: {{ '${{ matrix.platform.name }} ${{ matrix.r_version.r }}' }}
runs-on: {{ '${{ matrix.platform.runs_on }}' }}
strategy:
fail-fast: false
matrix:
platform:
- windows-latest
- macos-10.13 # self-hosted
# - devops-managed # No M1 until the runner application runs native
- { runs_on: 'windows-latest', name: "Windows"}
- { runs_on: ["self-hosted", "macos-10.13"], name: "macOS High Sierra"}
- { runs_on: ["self-hosted", "macOS", "arm64", "devops-managed"], name: "macOS Big Sur" }
r_version:
- { rtools: 40, r: "4.1" }
- { rtools: 42, r: "4.2" }
- { rtools: "{{ macros.r_release.rt }}", r: "{{ macros.r_release.ver }}" }
- { rtools: "{{ macros.r_oldrel.rt }}", r: "{{ macros.r_oldrel.ver }}" }
steps:
- uses: r-lib/actions/setup-r@v2
if: matrix.platform != 'macos-10.13'
# expression marker prevents the ! being parsed as yaml tag
if: {{ "${{ !contains(matrix.platform.runs_on, 'self-hosted') }}" }}
with:
r-version: {{ '${{ matrix.r_version.r }}' }}
rtools-version: {{ '${{ matrix.r_version.rtools }}' }}
Ncpus: 2
- name: Setup R Self-Hosted
if: matrix.platform == 'macos-10.13'
if: contains(matrix.platform.runs_on, 'self-hosted')
run: |
if [ "{{ "${{ contains(matrix.platform.runs_on, 'arm64') }}" }}" == "true" ]; then
rig_arch="-arm64"
fi
# rig is a system utility that allows for switching
# between pre-installed R version on the self-hosted runners
rig default {{ '${{ matrix.r_version.r }}' }}
rig default {{ '${{ matrix.r_version.r }}' }}$rig_arch

rig system setup-user-lib
rig system add-pak
{{ macros.github_setup_local_r_repo(false, true)|indent }}
Expand All @@ -163,7 +168,8 @@ jobs:
shell: bash
run: |
tar -xzf repo/src/contrib/arrow_*.tar.gz arrow/DESCRIPTION
- uses: r-lib/actions/setup-r-dependencies@v2
- name: Install dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
working-directory: 'arrow'
extra-packages: cpp11
Expand Down
3 changes: 2 additions & 1 deletion dev/tasks/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,8 @@ tasks:
- r-pkg__bin__windows__contrib__4.2__arrow_[0-9\.]+\.zip
- r-pkg__bin__macosx__contrib__4.1__arrow_[0-9\.]+\.tgz
- r-pkg__bin__macosx__contrib__4.2__arrow_[0-9\.]+\.tgz
- r-pkg__bin__macosx__big-sur-arm64__contrib__4.1__arrow_[0-9\.]+\.tgz
- r-pkg__bin__macosx__big-sur-arm64__contrib__4.2__arrow_[0-9\.]+\.tgz
- r-pkg__src__contrib__arrow_[0-9\.]+\.tar\.gz


Expand Down Expand Up @@ -1085,7 +1087,6 @@ tasks:
env:
PYTEST_ADDOPTS: "-k 'not test_cancellation'"
github_runner: ["self-hosted", "macOS", "arm64"]
arch_emulation: arm64
target: "wheels"

######################## Windows verification ##############################
Expand Down
2 changes: 1 addition & 1 deletion dev/tasks/verify-rc/github.macos.arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ jobs:
export PATH="$(brew --prefix node@16)/bin:$PATH"
export PATH="$(brew --prefix ruby)/bin:$PATH"
export PKG_CONFIG_PATH="$(brew --prefix ruby)/lib/pkgconfig"
arch -{{ arch_emulation|default("arm64") }} arrow/dev/release/verify-release-candidate.sh \
arrow/dev/release/verify-release-candidate.sh \
{{ release|default("") }} {{ rc|default("") }}