From 5a6a3b9501620c5fa3ed5403061fa153d51eb203 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Tue, 5 Nov 2024 15:02:55 +0900 Subject: [PATCH 01/33] GH-43951: [CI][Python] Use GitHub Packages for vcpkg cache --- ci/docker/python-wheel-manylinux.dockerfile | 13 ++++++++---- ci/scripts/install_vcpkg.sh | 19 +++++++++++++++-- dev/tasks/python-wheels/github.linux.yml | 10 ++++++++- docker-compose.yml | 23 +++++++++++++-------- 4 files changed, 49 insertions(+), 16 deletions(-) diff --git a/ci/docker/python-wheel-manylinux.dockerfile b/ci/docker/python-wheel-manylinux.dockerfile index 452809ad09c6b..aaf96b03b4e03 100644 --- a/ci/docker/python-wheel-manylinux.dockerfile +++ b/ci/docker/python-wheel-manylinux.dockerfile @@ -66,6 +66,8 @@ COPY ci/scripts/install_ccache.sh arrow/ci/scripts/ RUN /arrow/ci/scripts/install_ccache.sh ${ccache} /usr/local # Install vcpkg +ARG GITHUB_ACTOR +ARG GITHUB_TOKEN ARG vcpkg COPY ci/vcpkg/*.patch \ ci/vcpkg/*linux*.cmake \ @@ -75,10 +77,13 @@ COPY ci/scripts/install_vcpkg.sh \ ENV VCPKG_ROOT=/opt/vcpkg ARG build_type=release ENV CMAKE_BUILD_TYPE=${build_type} \ - VCPKG_FORCE_SYSTEM_BINARIES=1 \ - VCPKG_OVERLAY_TRIPLETS=/arrow/ci/vcpkg \ + GITHUB_ACTOR="${GITHUB_ACTOR}" \ + GITHUB_TOKEN="${GITHUB_TOKEN}" \ + VCPKG_BINARY_SOURCES="clear;nuget,https://nuget.pkg.github.com/${GITHUB_ACTOR}/index.json,readwrite" \ VCPKG_DEFAULT_TRIPLET=${arch_short}-linux-static-${build_type} \ - VCPKG_FEATURE_FLAGS="manifests" + VCPKG_FEATURE_FLAGS="manifests" \ + VCPKG_FORCE_SYSTEM_BINARIES=1 \ + VCPKG_OVERLAY_TRIPLETS=/arrow/ci/vcpkg RUN arrow/ci/scripts/install_vcpkg.sh ${VCPKG_ROOT} ${vcpkg} ENV PATH="${PATH}:${VCPKG_ROOT}" @@ -93,7 +98,7 @@ RUN vcpkg install \ --clean-after-build \ --x-install-root=${VCPKG_ROOT}/installed \ --x-manifest-root=/arrow/ci/vcpkg \ - --x-feature=azure \ + --x-feature=azure \ --x-feature=flight \ --x-feature=gcs \ --x-feature=json \ diff --git a/ci/scripts/install_vcpkg.sh b/ci/scripts/install_vcpkg.sh index 08989d6444827..9c9d81bd69322 100755 --- a/ci/scripts/install_vcpkg.sh +++ b/ci/scripts/install_vcpkg.sh @@ -17,7 +17,7 @@ # specific language governing permissions and limitations # under the License. -set -e +set -eu if [ "$#" -lt 1 ]; then echo "Usage: $0 `` [ []]" @@ -42,7 +42,7 @@ pushd ${vcpkg_destination} git checkout "${vcpkg_version}" -if [[ "$OSTYPE" == "msys" ]]; then +if [[ "${OSTYPE:-}" == "msys" ]]; then ./bootstrap-vcpkg.bat -disableMetrics else ./bootstrap-vcpkg.sh -disableMetrics @@ -53,4 +53,19 @@ if [ -f "${vcpkg_ports_patch}" ]; then echo "Patch successfully applied to the VCPKG port files!" fi +if [ -n "${GITHUB_TOKEN:-}" ] && [ -n "${GITHUB_ACTOR:-}" ]; then + PATH="${PATH}:${VCPKG_ROOT}" + nuget_url="https://nuget.pkg.github.com/${GITHUB_ACTOR}/index.json" + "$(vcpkg fetch nuget)" \ + sources add \ + -Source "${nuget_url}" \ + -StorePasswordInClearText \ + -Name GitHubPackages \ + -UserName "${GITHUB_ACTOR}" \ + -Password "${GITHUB_TOKEN}" + "$(vcpkg fetch nuget)" \ + setapikey "${GITHUB_TOKEN}" \ + -Source "${nuget_url}" +fi + popd diff --git a/dev/tasks/python-wheels/github.linux.yml b/dev/tasks/python-wheels/github.linux.yml index 7a1c8fb4f9d80..b2afc93fdd523 100644 --- a/dev/tasks/python-wheels/github.linux.yml +++ b/dev/tasks/python-wheels/github.linux.yml @@ -19,6 +19,9 @@ {{ macros.github_header() }} +permissions: + packages: write + jobs: build: name: "Build wheel for manylinux {{ manylinux_version }}" @@ -49,7 +52,12 @@ jobs: - name: Build wheel shell: bash - run: archery docker run -e SETUPTOOLS_SCM_PRETEND_VERSION={{ arrow.no_rc_version }} python-wheel-manylinux-{{ manylinux_version }} + run: | + archery docker run \ + -e SETUPTOOLS_SCM_PRETEND_VERSION={{ arrow.no_rc_version }} \ + python-wheel-manylinux-{{ manylinux_version }} + env: + GITHUB_TOKEN: {{ '${{ secrets.GITHUB_TOKEN }}' }} - uses: actions/upload-artifact@v4 with: diff --git a/docker-compose.yml b/docker-compose.yml index 0882121d598bb..b5966c98bc93f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -53,9 +53,6 @@ # # See more in cpp/build-support/run-test.sh::print_coredumps -x-common: &common - GITHUB_ACTIONS: - x-ccache: &ccache CCACHE_COMPILERCHECK: content CCACHE_COMPRESS: 1 @@ -63,6 +60,13 @@ x-ccache: &ccache CCACHE_MAXSIZE: 1G CCACHE_DIR: /ccache +x-common: &common + GITHUB_ACTIONS: + +x-cpp: &cpp + ARROW_RUNTIME_SIMD_LEVEL: + ARROW_SIMD_LEVEL: + x-sccache: &sccache AWS_ACCESS_KEY_ID: AWS_SECRET_ACCESS_KEY: @@ -70,9 +74,10 @@ x-sccache: &sccache SCCACHE_REGION: SCCACHE_S3_KEY_PREFIX: ${SCCACHE_S3_KEY_PREFIX:-sccache} -x-cpp: &cpp - ARROW_RUNTIME_SIMD_LEVEL: - ARROW_SIMD_LEVEL: +x-vcpkg-build-args: &vcpkg-build-args + vcpkg: ${VCPKG} + GITHUB_ACTOR: + GITHUB_TOKEN: # CPU/memory limit presets to pass to Docker. # @@ -1120,10 +1125,10 @@ services: image: ${REPO}:${ARCH}-python-${PYTHON}-wheel-manylinux-2014-vcpkg-${VCPKG} build: args: + <<: *vcpkg-build-args arch: ${ARCH} arch_short: ${ARCH_SHORT} base: quay.io/pypa/manylinux2014_${ARCH_ALIAS}:2024-08-03-32dfa47 - vcpkg: ${VCPKG} python: ${PYTHON} python_abi_tag: ${PYTHON_ABI_TAG} manylinux: 2014 @@ -1144,10 +1149,10 @@ services: image: ${REPO}:${ARCH}-python-${PYTHON}-wheel-manylinux-2-28-vcpkg-${VCPKG} build: args: + <<: *vcpkg-build-args arch: ${ARCH} arch_short: ${ARCH_SHORT} base: quay.io/pypa/manylinux_2_28_${ARCH_ALIAS}:2024-08-03-32dfa47 - vcpkg: ${VCPKG} python: ${PYTHON} python_abi_tag: ${PYTHON_ABI_TAG} manylinux: 2_28 @@ -1239,7 +1244,7 @@ services: image: ${REPO}:python-${PYTHON}-wheel-windows-vs2019-vcpkg-${VCPKG}-${PYTHON_WHEEL_WINDOWS_IMAGE_REVISION} build: args: - vcpkg: ${VCPKG} + <<: *vcpkg-build-args python: ${PYTHON} context: . dockerfile: ci/docker/python-wheel-windows-vs2019.dockerfile From 44ab0636279407d92d6f5cc4abed771669a5a556 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Tue, 5 Nov 2024 16:26:07 +0900 Subject: [PATCH 02/33] Install NuGet --- ci/scripts/install_vcpkg.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ci/scripts/install_vcpkg.sh b/ci/scripts/install_vcpkg.sh index 9c9d81bd69322..8f6a215918259 100755 --- a/ci/scripts/install_vcpkg.sh +++ b/ci/scripts/install_vcpkg.sh @@ -55,6 +55,12 @@ fi if [ -n "${GITHUB_TOKEN:-}" ] && [ -n "${GITHUB_ACTOR:-}" ]; then PATH="${PATH}:${VCPKG_ROOT}" + vcpkg install \ + --clean-after-build \ + --x-install-root=${VCPKG_ROOT}/installed \ + --x-manifest-root=/arrow/ci/vcpkg \ + nuget + nuget_url="https://nuget.pkg.github.com/${GITHUB_ACTOR}/index.json" "$(vcpkg fetch nuget)" \ sources add \ From 4fd9bb3f8c8cc9c352173963752e0d3c2154e728 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Tue, 5 Nov 2024 16:36:42 +0900 Subject: [PATCH 03/33] Copy --- ci/docker/python-wheel-manylinux.dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/docker/python-wheel-manylinux.dockerfile b/ci/docker/python-wheel-manylinux.dockerfile index aaf96b03b4e03..ce655aa78105b 100644 --- a/ci/docker/python-wheel-manylinux.dockerfile +++ b/ci/docker/python-wheel-manylinux.dockerfile @@ -74,6 +74,7 @@ COPY ci/vcpkg/*.patch \ arrow/ci/vcpkg/ COPY ci/scripts/install_vcpkg.sh \ arrow/ci/scripts/ +COPY ci/vcpkg/vcpkg.json arrow/ci/vcpkg/ ENV VCPKG_ROOT=/opt/vcpkg ARG build_type=release ENV CMAKE_BUILD_TYPE=${build_type} \ @@ -88,7 +89,6 @@ ENV CMAKE_BUILD_TYPE=${build_type} \ RUN arrow/ci/scripts/install_vcpkg.sh ${VCPKG_ROOT} ${vcpkg} ENV PATH="${PATH}:${VCPKG_ROOT}" -COPY ci/vcpkg/vcpkg.json arrow/ci/vcpkg/ # cannot use the S3 feature here because while aws-sdk-cpp=1.9.160 contains # ssl related fixes as well as we can patch the vcpkg portfile to support # arm machines it hits ARROW-15141 where we would need to fall back to 1.8.186 From 245a8604f148af8388280fa849b0a0c678f254e1 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Tue, 5 Nov 2024 16:53:34 +0900 Subject: [PATCH 04/33] Use nuget.config --- ci/docker/python-wheel-manylinux.dockerfile | 4 +-- ci/scripts/install_vcpkg.sh | 38 ++++++++++++--------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/ci/docker/python-wheel-manylinux.dockerfile b/ci/docker/python-wheel-manylinux.dockerfile index ce655aa78105b..d5728a38fcca5 100644 --- a/ci/docker/python-wheel-manylinux.dockerfile +++ b/ci/docker/python-wheel-manylinux.dockerfile @@ -74,13 +74,12 @@ COPY ci/vcpkg/*.patch \ arrow/ci/vcpkg/ COPY ci/scripts/install_vcpkg.sh \ arrow/ci/scripts/ -COPY ci/vcpkg/vcpkg.json arrow/ci/vcpkg/ ENV VCPKG_ROOT=/opt/vcpkg ARG build_type=release ENV CMAKE_BUILD_TYPE=${build_type} \ GITHUB_ACTOR="${GITHUB_ACTOR}" \ GITHUB_TOKEN="${GITHUB_TOKEN}" \ - VCPKG_BINARY_SOURCES="clear;nuget,https://nuget.pkg.github.com/${GITHUB_ACTOR}/index.json,readwrite" \ + VCPKG_BINARY_SOURCES="clear;nugetconfig,${VCPKG_ROOT}/nuget.config" \ VCPKG_DEFAULT_TRIPLET=${arch_short}-linux-static-${build_type} \ VCPKG_FEATURE_FLAGS="manifests" \ VCPKG_FORCE_SYSTEM_BINARIES=1 \ @@ -89,6 +88,7 @@ ENV CMAKE_BUILD_TYPE=${build_type} \ RUN arrow/ci/scripts/install_vcpkg.sh ${VCPKG_ROOT} ${vcpkg} ENV PATH="${PATH}:${VCPKG_ROOT}" +COPY ci/vcpkg/vcpkg.json arrow/ci/vcpkg/ # cannot use the S3 feature here because while aws-sdk-cpp=1.9.160 contains # ssl related fixes as well as we can patch the vcpkg portfile to support # arm machines it hits ARROW-15141 where we would need to fall back to 1.8.186 diff --git a/ci/scripts/install_vcpkg.sh b/ci/scripts/install_vcpkg.sh index 8f6a215918259..db7061f2570c9 100755 --- a/ci/scripts/install_vcpkg.sh +++ b/ci/scripts/install_vcpkg.sh @@ -54,24 +54,28 @@ if [ -f "${vcpkg_ports_patch}" ]; then fi if [ -n "${GITHUB_TOKEN:-}" ] && [ -n "${GITHUB_ACTOR:-}" ]; then - PATH="${PATH}:${VCPKG_ROOT}" - vcpkg install \ - --clean-after-build \ - --x-install-root=${VCPKG_ROOT}/installed \ - --x-manifest-root=/arrow/ci/vcpkg \ - nuget - nuget_url="https://nuget.pkg.github.com/${GITHUB_ACTOR}/index.json" - "$(vcpkg fetch nuget)" \ - sources add \ - -Source "${nuget_url}" \ - -StorePasswordInClearText \ - -Name GitHubPackages \ - -UserName "${GITHUB_ACTOR}" \ - -Password "${GITHUB_TOKEN}" - "$(vcpkg fetch nuget)" \ - setapikey "${GITHUB_TOKEN}" \ - -Source "${nuget_url}" + cat < "${VCPKG_ROOT}/nuget.config" + + + + + + + + + + + + + + + + + + + +NUGET_CONFIG fi popd From dbae9ac1735c2eca6b930c0c6a76544e19acb6e4 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Tue, 5 Nov 2024 17:33:43 +0900 Subject: [PATCH 05/33] Install Mono --- ci/scripts/install_vcpkg.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ci/scripts/install_vcpkg.sh b/ci/scripts/install_vcpkg.sh index db7061f2570c9..9d28c69068bb0 100755 --- a/ci/scripts/install_vcpkg.sh +++ b/ci/scripts/install_vcpkg.sh @@ -54,6 +54,10 @@ if [ -f "${vcpkg_ports_patch}" ]; then fi if [ -n "${GITHUB_TOKEN:-}" ] && [ -n "${GITHUB_ACTOR:-}" ]; then + if type dnf 2>/dev/null; then + dnf install -y epel-release + dnf install -y mono-complete + fi nuget_url="https://nuget.pkg.github.com/${GITHUB_ACTOR}/index.json" cat < "${VCPKG_ROOT}/nuget.config" From 96a0de0ee95c1648f3fad4550e7a3a59e4e4a132 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 6 Nov 2024 10:06:58 +0900 Subject: [PATCH 06/33] Use actions/cache instead of NuGet --- ci/docker/python-wheel-manylinux.dockerfile | 12 ++++----- ci/scripts/install_vcpkg.sh | 29 --------------------- dev/tasks/python-wheels/github.linux.yml | 14 ++++++++++ docker-compose.yml | 4 +-- 4 files changed, 22 insertions(+), 37 deletions(-) diff --git a/ci/docker/python-wheel-manylinux.dockerfile b/ci/docker/python-wheel-manylinux.dockerfile index d5728a38fcca5..50984d462fa10 100644 --- a/ci/docker/python-wheel-manylinux.dockerfile +++ b/ci/docker/python-wheel-manylinux.dockerfile @@ -66,8 +66,8 @@ COPY ci/scripts/install_ccache.sh arrow/ci/scripts/ RUN /arrow/ci/scripts/install_ccache.sh ${ccache} /usr/local # Install vcpkg -ARG GITHUB_ACTOR -ARG GITHUB_TOKEN +ARG ACTIONS_CACHE_URL +ARG ACTIONS_RUNTIME_TOKEN ARG vcpkg COPY ci/vcpkg/*.patch \ ci/vcpkg/*linux*.cmake \ @@ -76,10 +76,10 @@ COPY ci/scripts/install_vcpkg.sh \ arrow/ci/scripts/ ENV VCPKG_ROOT=/opt/vcpkg ARG build_type=release -ENV CMAKE_BUILD_TYPE=${build_type} \ - GITHUB_ACTOR="${GITHUB_ACTOR}" \ - GITHUB_TOKEN="${GITHUB_TOKEN}" \ - VCPKG_BINARY_SOURCES="clear;nugetconfig,${VCPKG_ROOT}/nuget.config" \ +ENV ACTIONS_CACHE_URL="${ACTIONS_CACHE_URL}" \ + ACTIONS_RUNTIME_TOKEN="${ACTIONS_RUNTIME_TOKEN}" \ + CMAKE_BUILD_TYPE=${build_type} \ + VCPKG_BINARY_SOURCES="clear;x-gha,readwrite" \ VCPKG_DEFAULT_TRIPLET=${arch_short}-linux-static-${build_type} \ VCPKG_FEATURE_FLAGS="manifests" \ VCPKG_FORCE_SYSTEM_BINARIES=1 \ diff --git a/ci/scripts/install_vcpkg.sh b/ci/scripts/install_vcpkg.sh index 9d28c69068bb0..d9ee26b5da402 100755 --- a/ci/scripts/install_vcpkg.sh +++ b/ci/scripts/install_vcpkg.sh @@ -53,33 +53,4 @@ if [ -f "${vcpkg_ports_patch}" ]; then echo "Patch successfully applied to the VCPKG port files!" fi -if [ -n "${GITHUB_TOKEN:-}" ] && [ -n "${GITHUB_ACTOR:-}" ]; then - if type dnf 2>/dev/null; then - dnf install -y epel-release - dnf install -y mono-complete - fi - nuget_url="https://nuget.pkg.github.com/${GITHUB_ACTOR}/index.json" - cat < "${VCPKG_ROOT}/nuget.config" - - - - - - - - - - - - - - - - - - - -NUGET_CONFIG -fi - popd diff --git a/dev/tasks/python-wheels/github.linux.yml b/dev/tasks/python-wheels/github.linux.yml index b2afc93fdd523..727a0e53caac0 100644 --- a/dev/tasks/python-wheels/github.linux.yml +++ b/dev/tasks/python-wheels/github.linux.yml @@ -50,6 +50,20 @@ jobs: {{ macros.github_install_archery()|indent }} {{ macros.github_login_dockerhub()|indent }} + - name: Cache vcpkg + uses: actions/cache@v4 + with: + path: vcpkg + key: python-wheel-manylinux-{{ manylinux_version }}-{{ "${{ hashFiles('ci/vcpkg/vcpkg.json') }}" }} + restore-keys: python-wheel-manylinux-{{ manylinux_version }}- + + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + - name: Build wheel shell: bash run: | diff --git a/docker-compose.yml b/docker-compose.yml index b5966c98bc93f..02af944b0169c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -76,8 +76,8 @@ x-sccache: &sccache x-vcpkg-build-args: &vcpkg-build-args vcpkg: ${VCPKG} - GITHUB_ACTOR: - GITHUB_TOKEN: + ACTIONS_CACHE_URL: + ACTIONS_RUNTIME_TOKEN: # CPU/memory limit presets to pass to Docker. # From f3b63f7b7750ac34b6dfc938294e89006c5c8b36 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 6 Nov 2024 10:15:34 +0900 Subject: [PATCH 07/33] Use file based cache too --- ci/docker/python-wheel-manylinux.dockerfile | 3 ++- docker-compose.yml | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ci/docker/python-wheel-manylinux.dockerfile b/ci/docker/python-wheel-manylinux.dockerfile index 50984d462fa10..b45bfe67d796b 100644 --- a/ci/docker/python-wheel-manylinux.dockerfile +++ b/ci/docker/python-wheel-manylinux.dockerfile @@ -68,6 +68,7 @@ RUN /arrow/ci/scripts/install_ccache.sh ${ccache} /usr/local # Install vcpkg ARG ACTIONS_CACHE_URL ARG ACTIONS_RUNTIME_TOKEN +ARG VCPKG_BINARY_SOURCES ARG vcpkg COPY ci/vcpkg/*.patch \ ci/vcpkg/*linux*.cmake \ @@ -79,7 +80,7 @@ ARG build_type=release ENV ACTIONS_CACHE_URL="${ACTIONS_CACHE_URL}" \ ACTIONS_RUNTIME_TOKEN="${ACTIONS_RUNTIME_TOKEN}" \ CMAKE_BUILD_TYPE=${build_type} \ - VCPKG_BINARY_SOURCES="clear;x-gha,readwrite" \ + VCPKG_BINARY_SOURCES="${VCPKG_BINARY_SOURCES}" \ VCPKG_DEFAULT_TRIPLET=${arch_short}-linux-static-${build_type} \ VCPKG_FEATURE_FLAGS="manifests" \ VCPKG_FORCE_SYSTEM_BINARIES=1 \ diff --git a/docker-compose.yml b/docker-compose.yml index 02af944b0169c..2947d31ab4531 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -78,6 +78,7 @@ x-vcpkg-build-args: &vcpkg-build-args vcpkg: ${VCPKG} ACTIONS_CACHE_URL: ACTIONS_RUNTIME_TOKEN: + VCPKG_BINARY_SOURCES: clear;x-gha,rw;files,/vcpkg-cache,rw # CPU/memory limit presets to pass to Docker. # @@ -199,8 +200,12 @@ volumes: name: maven-cache python-wheel-manylinux2014-ccache: name: python-wheel-manylinux2014-ccache + python-wheel-manylinux2014-vcpkg-cache: + name: python-wheel-manylinux2014-vcpkg-cache python-wheel-manylinux-2-28-ccache: name: python-wheel-manylinux-2-28-ccache + python-wheel-manylinux-2-28-vcpkg-cache: + name: python-wheel-manylinux-2-28-vcpkg-ccache python-wheel-windows-clcache: name: python-wheel-windows-clcache ubuntu-ccache: @@ -1141,6 +1146,7 @@ services: volumes: - .:/arrow:delegated - ${DOCKER_VOLUME_PREFIX}python-wheel-manylinux2014-ccache:/ccache:delegated + - ${DOCKER_VOLUME_PREFIX}python-wheel-manylinux2014-vcpkg-cache:/vcpkg-cache:delegated command: /arrow/ci/scripts/python_wheel_manylinux_build.sh # See available versions at: @@ -1165,6 +1171,7 @@ services: volumes: - .:/arrow:delegated - ${DOCKER_VOLUME_PREFIX}python-wheel-manylinux-2-28-ccache:/ccache:delegated + - ${DOCKER_VOLUME_PREFIX}python-wheel-manylinux-2-28-vcpkg-cache:/vcpkg-ccache:delegated command: /arrow/ci/scripts/python_wheel_manylinux_build.sh python-wheel-manylinux-test-imports: From 516723648d47a94ae3ddd7eb4c6cc277265593ca Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 6 Nov 2024 20:06:30 +0900 Subject: [PATCH 08/33] Use NuGet --- ci/docker/python-wheel-manylinux.dockerfile | 13 ++++--- ci/scripts/install_vcpkg.sh | 38 +++++++++++++++++++++ docker-compose.yml | 11 ++---- 3 files changed, 46 insertions(+), 16 deletions(-) diff --git a/ci/docker/python-wheel-manylinux.dockerfile b/ci/docker/python-wheel-manylinux.dockerfile index b45bfe67d796b..d5728a38fcca5 100644 --- a/ci/docker/python-wheel-manylinux.dockerfile +++ b/ci/docker/python-wheel-manylinux.dockerfile @@ -66,9 +66,8 @@ COPY ci/scripts/install_ccache.sh arrow/ci/scripts/ RUN /arrow/ci/scripts/install_ccache.sh ${ccache} /usr/local # Install vcpkg -ARG ACTIONS_CACHE_URL -ARG ACTIONS_RUNTIME_TOKEN -ARG VCPKG_BINARY_SOURCES +ARG GITHUB_ACTOR +ARG GITHUB_TOKEN ARG vcpkg COPY ci/vcpkg/*.patch \ ci/vcpkg/*linux*.cmake \ @@ -77,10 +76,10 @@ COPY ci/scripts/install_vcpkg.sh \ arrow/ci/scripts/ ENV VCPKG_ROOT=/opt/vcpkg ARG build_type=release -ENV ACTIONS_CACHE_URL="${ACTIONS_CACHE_URL}" \ - ACTIONS_RUNTIME_TOKEN="${ACTIONS_RUNTIME_TOKEN}" \ - CMAKE_BUILD_TYPE=${build_type} \ - VCPKG_BINARY_SOURCES="${VCPKG_BINARY_SOURCES}" \ +ENV CMAKE_BUILD_TYPE=${build_type} \ + GITHUB_ACTOR="${GITHUB_ACTOR}" \ + GITHUB_TOKEN="${GITHUB_TOKEN}" \ + VCPKG_BINARY_SOURCES="clear;nugetconfig,${VCPKG_ROOT}/nuget.config" \ VCPKG_DEFAULT_TRIPLET=${arch_short}-linux-static-${build_type} \ VCPKG_FEATURE_FLAGS="manifests" \ VCPKG_FORCE_SYSTEM_BINARIES=1 \ diff --git a/ci/scripts/install_vcpkg.sh b/ci/scripts/install_vcpkg.sh index d9ee26b5da402..5c1842c4da1b5 100755 --- a/ci/scripts/install_vcpkg.sh +++ b/ci/scripts/install_vcpkg.sh @@ -53,4 +53,42 @@ if [ -f "${vcpkg_ports_patch}" ]; then echo "Patch successfully applied to the VCPKG port files!" fi +if [ -n "${GITHUB_TOKEN:-}" ] && [ -n "${GITHUB_ACTOR:-}" ]; then + if type dnf 2>/dev/null; then + dnf install -y epel-release + dnf install -y mono-complete + wget https://dist.nuget.org/win-x86-commandline/v6.10.0/nuget.exe + mv nuget.exe /usr/libexec/ + cat < /usr/bin/nuget +#!/bin/sh + +exec mono /usr/libexec/nuget.exe "$@" +NUGET + chmod +x /usr/bin/nuget + fi + nuget help + nuget_url="https://nuget.pkg.github.com/${GITHUB_ACTOR}/index.json" + cat < "${VCPKG_ROOT}/nuget.config" + + + + + + + + + + + + + + + + + + + +NUGET_CONFIG +fi + popd diff --git a/docker-compose.yml b/docker-compose.yml index 2947d31ab4531..b5966c98bc93f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -76,9 +76,8 @@ x-sccache: &sccache x-vcpkg-build-args: &vcpkg-build-args vcpkg: ${VCPKG} - ACTIONS_CACHE_URL: - ACTIONS_RUNTIME_TOKEN: - VCPKG_BINARY_SOURCES: clear;x-gha,rw;files,/vcpkg-cache,rw + GITHUB_ACTOR: + GITHUB_TOKEN: # CPU/memory limit presets to pass to Docker. # @@ -200,12 +199,8 @@ volumes: name: maven-cache python-wheel-manylinux2014-ccache: name: python-wheel-manylinux2014-ccache - python-wheel-manylinux2014-vcpkg-cache: - name: python-wheel-manylinux2014-vcpkg-cache python-wheel-manylinux-2-28-ccache: name: python-wheel-manylinux-2-28-ccache - python-wheel-manylinux-2-28-vcpkg-cache: - name: python-wheel-manylinux-2-28-vcpkg-ccache python-wheel-windows-clcache: name: python-wheel-windows-clcache ubuntu-ccache: @@ -1146,7 +1141,6 @@ services: volumes: - .:/arrow:delegated - ${DOCKER_VOLUME_PREFIX}python-wheel-manylinux2014-ccache:/ccache:delegated - - ${DOCKER_VOLUME_PREFIX}python-wheel-manylinux2014-vcpkg-cache:/vcpkg-cache:delegated command: /arrow/ci/scripts/python_wheel_manylinux_build.sh # See available versions at: @@ -1171,7 +1165,6 @@ services: volumes: - .:/arrow:delegated - ${DOCKER_VOLUME_PREFIX}python-wheel-manylinux-2-28-ccache:/ccache:delegated - - ${DOCKER_VOLUME_PREFIX}python-wheel-manylinux-2-28-vcpkg-cache:/vcpkg-ccache:delegated command: /arrow/ci/scripts/python_wheel_manylinux_build.sh python-wheel-manylinux-test-imports: From f69667fb61d615f514accba0e0c23de0f5a699cd Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 6 Nov 2024 20:14:04 +0900 Subject: [PATCH 09/33] Add missing escape --- ci/scripts/install_vcpkg.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/scripts/install_vcpkg.sh b/ci/scripts/install_vcpkg.sh index 5c1842c4da1b5..800ba00a89972 100755 --- a/ci/scripts/install_vcpkg.sh +++ b/ci/scripts/install_vcpkg.sh @@ -62,11 +62,11 @@ if [ -n "${GITHUB_TOKEN:-}" ] && [ -n "${GITHUB_ACTOR:-}" ]; then cat < /usr/bin/nuget #!/bin/sh -exec mono /usr/libexec/nuget.exe "$@" +exec mono /usr/libexec/nuget.exe "\$@" NUGET chmod +x /usr/bin/nuget + nuget help fi - nuget help nuget_url="https://nuget.pkg.github.com/${GITHUB_ACTOR}/index.json" cat < "${VCPKG_ROOT}/nuget.config" From b089958e7d45a29b09dfd41a8a3b7be2ce7fb8f0 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 6 Nov 2024 20:14:12 +0900 Subject: [PATCH 10/33] Remove garbage --- dev/tasks/python-wheels/github.linux.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/dev/tasks/python-wheels/github.linux.yml b/dev/tasks/python-wheels/github.linux.yml index 727a0e53caac0..b2afc93fdd523 100644 --- a/dev/tasks/python-wheels/github.linux.yml +++ b/dev/tasks/python-wheels/github.linux.yml @@ -50,20 +50,6 @@ jobs: {{ macros.github_install_archery()|indent }} {{ macros.github_login_dockerhub()|indent }} - - name: Cache vcpkg - uses: actions/cache@v4 - with: - path: vcpkg - key: python-wheel-manylinux-{{ manylinux_version }}-{{ "${{ hashFiles('ci/vcpkg/vcpkg.json') }}" }} - restore-keys: python-wheel-manylinux-{{ manylinux_version }}- - - - name: Export GitHub Actions cache environment variables - uses: actions/github-script@v7 - with: - script: | - core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - - name: Build wheel shell: bash run: | From 4f45593d2ccf95161326291c2fd8f69c66dbccc8 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 6 Nov 2024 20:23:25 +0900 Subject: [PATCH 11/33] Debug --- ci/scripts/install_vcpkg.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ci/scripts/install_vcpkg.sh b/ci/scripts/install_vcpkg.sh index 800ba00a89972..418c1b85a532a 100755 --- a/ci/scripts/install_vcpkg.sh +++ b/ci/scripts/install_vcpkg.sh @@ -57,7 +57,7 @@ if [ -n "${GITHUB_TOKEN:-}" ] && [ -n "${GITHUB_ACTOR:-}" ]; then if type dnf 2>/dev/null; then dnf install -y epel-release dnf install -y mono-complete - wget https://dist.nuget.org/win-x86-commandline/v6.10.0/nuget.exe + wget --no-verbose https://dist.nuget.org/win-x86-commandline/v6.10.0/nuget.exe mv nuget.exe /usr/libexec/ cat < /usr/bin/nuget #!/bin/sh @@ -65,10 +65,9 @@ if [ -n "${GITHUB_TOKEN:-}" ] && [ -n "${GITHUB_ACTOR:-}" ]; then exec mono /usr/libexec/nuget.exe "\$@" NUGET chmod +x /usr/bin/nuget - nuget help fi nuget_url="https://nuget.pkg.github.com/${GITHUB_ACTOR}/index.json" - cat < "${VCPKG_ROOT}/nuget.config" + cat < From c58ebb66dca9f2b486031196831844964e9562b6 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 6 Nov 2024 20:31:56 +0900 Subject: [PATCH 12/33] Use GITHUB_REPOSITORY_OWNER --- ci/docker/python-wheel-manylinux.dockerfile | 6 ++-- ci/scripts/install_vcpkg.sh | 35 +++++++-------------- docker-compose.yml | 2 +- 3 files changed, 16 insertions(+), 27 deletions(-) diff --git a/ci/docker/python-wheel-manylinux.dockerfile b/ci/docker/python-wheel-manylinux.dockerfile index d5728a38fcca5..cdaf34ac0b2ba 100644 --- a/ci/docker/python-wheel-manylinux.dockerfile +++ b/ci/docker/python-wheel-manylinux.dockerfile @@ -66,7 +66,7 @@ COPY ci/scripts/install_ccache.sh arrow/ci/scripts/ RUN /arrow/ci/scripts/install_ccache.sh ${ccache} /usr/local # Install vcpkg -ARG GITHUB_ACTOR +ARG GITHUB_REPOSITORY_OWNER ARG GITHUB_TOKEN ARG vcpkg COPY ci/vcpkg/*.patch \ @@ -77,9 +77,9 @@ COPY ci/scripts/install_vcpkg.sh \ ENV VCPKG_ROOT=/opt/vcpkg ARG build_type=release ENV CMAKE_BUILD_TYPE=${build_type} \ - GITHUB_ACTOR="${GITHUB_ACTOR}" \ + GITHUB_REPOSITORY_OWNER="${GITHUB_REPOSITORY_OWNER}" \ GITHUB_TOKEN="${GITHUB_TOKEN}" \ - VCPKG_BINARY_SOURCES="clear;nugetconfig,${VCPKG_ROOT}/nuget.config" \ + VCPKG_BINARY_SOURCES="clear;nuget,GitHub,readwrite" \ VCPKG_DEFAULT_TRIPLET=${arch_short}-linux-static-${build_type} \ VCPKG_FEATURE_FLAGS="manifests" \ VCPKG_FORCE_SYSTEM_BINARIES=1 \ diff --git a/ci/scripts/install_vcpkg.sh b/ci/scripts/install_vcpkg.sh index 418c1b85a532a..33fd004039203 100755 --- a/ci/scripts/install_vcpkg.sh +++ b/ci/scripts/install_vcpkg.sh @@ -53,7 +53,7 @@ if [ -f "${vcpkg_ports_patch}" ]; then echo "Patch successfully applied to the VCPKG port files!" fi -if [ -n "${GITHUB_TOKEN:-}" ] && [ -n "${GITHUB_ACTOR:-}" ]; then +if [ -n "${GITHUB_TOKEN:-}" ] && [ -n "${GITHUB_REPOSITORY_OWNER:-}" ]; then if type dnf 2>/dev/null; then dnf install -y epel-release dnf install -y mono-complete @@ -66,28 +66,17 @@ exec mono /usr/libexec/nuget.exe "\$@" NUGET chmod +x /usr/bin/nuget fi - nuget_url="https://nuget.pkg.github.com/${GITHUB_ACTOR}/index.json" - cat < - - - - - - - - - - - - - - - - - - -NUGET_CONFIG + nuget_url="https://nuget.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/index.json" + nuget \ + sources add \ + -source "${nuget_url}" \ + -storepasswordincleartext \ + -name "GitHub" \ + -username "${GITHUB_REPOSITORY_OWNER}" \ + -password "${GITHUB_TOKEN}" + nuget \ + setapikey "${GITHUB_TOKEN}" \ + -source "${nuget_url}" fi popd diff --git a/docker-compose.yml b/docker-compose.yml index b5966c98bc93f..dc0e38bf369ca 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -76,7 +76,7 @@ x-sccache: &sccache x-vcpkg-build-args: &vcpkg-build-args vcpkg: ${VCPKG} - GITHUB_ACTOR: + GITHUB_REPOSITORY_OWNER: GITHUB_TOKEN: # CPU/memory limit presets to pass to Docker. From cec044e47e0c7b0f40a366eb041be53c926c16d6 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 7 Nov 2024 05:45:05 +0900 Subject: [PATCH 13/33] Debug --- ci/docker/python-wheel-manylinux.dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/docker/python-wheel-manylinux.dockerfile b/ci/docker/python-wheel-manylinux.dockerfile index cdaf34ac0b2ba..bfe9ff855e3b4 100644 --- a/ci/docker/python-wheel-manylinux.dockerfile +++ b/ci/docker/python-wheel-manylinux.dockerfile @@ -96,6 +96,7 @@ COPY ci/vcpkg/vcpkg.json arrow/ci/vcpkg/ # previous versions => use bundled S3 build RUN vcpkg install \ --clean-after-build \ + --debug \ --x-install-root=${VCPKG_ROOT}/installed \ --x-manifest-root=/arrow/ci/vcpkg \ --x-feature=azure \ From b1d41caed4afe8111d1f38a3edee295c1ab2c8bd Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 7 Nov 2024 05:57:41 +0900 Subject: [PATCH 14/33] Debug --- ci/scripts/install_vcpkg.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/ci/scripts/install_vcpkg.sh b/ci/scripts/install_vcpkg.sh index 33fd004039203..4c8be5def9fcd 100755 --- a/ci/scripts/install_vcpkg.sh +++ b/ci/scripts/install_vcpkg.sh @@ -58,23 +58,19 @@ if [ -n "${GITHUB_TOKEN:-}" ] && [ -n "${GITHUB_REPOSITORY_OWNER:-}" ]; then dnf install -y epel-release dnf install -y mono-complete wget --no-verbose https://dist.nuget.org/win-x86-commandline/v6.10.0/nuget.exe - mv nuget.exe /usr/libexec/ - cat < /usr/bin/nuget -#!/bin/sh - -exec mono /usr/libexec/nuget.exe "\$@" -NUGET + mv nuget.exe /usr/bin/nuget chmod +x /usr/bin/nuget fi + vcpkg fetch nuget || : nuget_url="https://nuget.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/index.json" - nuget \ + mono /usr/bin/nuget \ sources add \ -source "${nuget_url}" \ -storepasswordincleartext \ -name "GitHub" \ -username "${GITHUB_REPOSITORY_OWNER}" \ -password "${GITHUB_TOKEN}" - nuget \ + mono /usr/bin/nuget \ setapikey "${GITHUB_TOKEN}" \ -source "${nuget_url}" fi From faf85b8fcd626e56266782510720b18e76dcd118 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 7 Nov 2024 06:16:35 +0900 Subject: [PATCH 15/33] Set GITHUB_TOKEN --- .github/workflows/java_jni.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/java_jni.yml b/.github/workflows/java_jni.yml index 5682f8e84167e..a5da0ecb34a2a 100644 --- a/.github/workflows/java_jni.yml +++ b/.github/workflows/java_jni.yml @@ -86,6 +86,7 @@ jobs: env: ARCHERY_DOCKER_USER: ${{ secrets.DOCKERHUB_USER }} ARCHERY_DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | source ci/scripts/util_enable_core_dumps.sh archery docker run java-jni-manylinux-2014 From ec8074396859a141e06882924ede7d2c2814e64e Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 7 Nov 2024 06:50:06 +0900 Subject: [PATCH 16/33] Simplify --- ci/docker/python-wheel-manylinux.dockerfile | 1 - ci/scripts/install_vcpkg.sh | 12 +++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ci/docker/python-wheel-manylinux.dockerfile b/ci/docker/python-wheel-manylinux.dockerfile index bfe9ff855e3b4..cdaf34ac0b2ba 100644 --- a/ci/docker/python-wheel-manylinux.dockerfile +++ b/ci/docker/python-wheel-manylinux.dockerfile @@ -96,7 +96,6 @@ COPY ci/vcpkg/vcpkg.json arrow/ci/vcpkg/ # previous versions => use bundled S3 build RUN vcpkg install \ --clean-after-build \ - --debug \ --x-install-root=${VCPKG_ROOT}/installed \ --x-manifest-root=/arrow/ci/vcpkg \ --x-feature=azure \ diff --git a/ci/scripts/install_vcpkg.sh b/ci/scripts/install_vcpkg.sh index 4c8be5def9fcd..a76453cb976ea 100755 --- a/ci/scripts/install_vcpkg.sh +++ b/ci/scripts/install_vcpkg.sh @@ -57,20 +57,22 @@ if [ -n "${GITHUB_TOKEN:-}" ] && [ -n "${GITHUB_REPOSITORY_OWNER:-}" ]; then if type dnf 2>/dev/null; then dnf install -y epel-release dnf install -y mono-complete - wget --no-verbose https://dist.nuget.org/win-x86-commandline/v6.10.0/nuget.exe - mv nuget.exe /usr/bin/nuget - chmod +x /usr/bin/nuget + curl \ + --location \ + --output "${vcpkg_destination}/nuget" \ + https://dist.nuget.org/win-x86-commandline/latest/nuget.exe fi + PATH="${vcpkg_destination}:${PATH}" vcpkg fetch nuget || : nuget_url="https://nuget.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/index.json" - mono /usr/bin/nuget \ + mono $(vcpkg fetch nuget | tail -n 1) \ sources add \ -source "${nuget_url}" \ -storepasswordincleartext \ -name "GitHub" \ -username "${GITHUB_REPOSITORY_OWNER}" \ -password "${GITHUB_TOKEN}" - mono /usr/bin/nuget \ + mono $(vcpkg fetch nuget | tail -n 1) \ setapikey "${GITHUB_TOKEN}" \ -source "${nuget_url}" fi From a4a24f1a8e371a13c03d07d7735085a59ef226b9 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 7 Nov 2024 09:48:44 +0900 Subject: [PATCH 17/33] Reuse cache setup --- ci/scripts/install_vcpkg.sh | 1 - dev/tasks/python-wheels/github.osx.yml | 18 ++---------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/ci/scripts/install_vcpkg.sh b/ci/scripts/install_vcpkg.sh index a76453cb976ea..acc4f29c7b773 100755 --- a/ci/scripts/install_vcpkg.sh +++ b/ci/scripts/install_vcpkg.sh @@ -63,7 +63,6 @@ if [ -n "${GITHUB_TOKEN:-}" ] && [ -n "${GITHUB_REPOSITORY_OWNER:-}" ]; then https://dist.nuget.org/win-x86-commandline/latest/nuget.exe fi PATH="${vcpkg_destination}:${PATH}" - vcpkg fetch nuget || : nuget_url="https://nuget.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/index.json" mono $(vcpkg fetch nuget | tail -n 1) \ sources add \ diff --git a/dev/tasks/python-wheels/github.osx.yml b/dev/tasks/python-wheels/github.osx.yml index d5a4774ab2b0d..d57a09e79e075 100644 --- a/dev/tasks/python-wheels/github.osx.yml +++ b/dev/tasks/python-wheels/github.osx.yml @@ -69,27 +69,13 @@ jobs: echo "VCPKG_VERSION=$vcpkg_version" >> $GITHUB_ENV - name: Install Vcpkg + env: + GITHUB_TOKEN: {{ '${{ secrets.GITHUB_TOKEN }}' }} run: arrow/ci/scripts/install_vcpkg.sh $VCPKG_ROOT $VCPKG_VERSION - name: Add Vcpkg to PATH run: echo ${VCPKG_ROOT} >> $GITHUB_PATH - - name: Setup NuGet Credentials - env: - GITHUB_TOKEN: {{ '${{ secrets.GITHUB_TOKEN }}' }} - run: | - mono $(vcpkg fetch nuget | tail -n 1) \ - sources add \ - -source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json" \ - -storepasswordincleartext \ - -name "GitHub" \ - -username "$GITHUB_REPOSITORY_OWNER" \ - -password "$GITHUB_TOKEN" \ - - mono $(vcpkg fetch nuget | tail -n 1) \ - setapikey "$GITHUB_TOKEN" \ - -source "https://nuget.pkg.github.com/$GITHUB_REPOSITORY_OWNER/index.json" - - name: Install Packages run: | vcpkg install \ From 5c46134957d2b3aeb23e5597ec73e63206b42d96 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 7 Nov 2024 09:59:05 +0900 Subject: [PATCH 18/33] Reuse cache setup --- ci/docker/python-wheel-windows-vs2019.dockerfile | 7 ++++++- ci/scripts/install_vcpkg.sh | 8 ++++++-- dev/tasks/python-wheels/github.linux.yml | 4 ++-- dev/tasks/python-wheels/github.windows.yml | 2 ++ 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ci/docker/python-wheel-windows-vs2019.dockerfile b/ci/docker/python-wheel-windows-vs2019.dockerfile index f9d31eb5771ef..f827e57f4e61f 100644 --- a/ci/docker/python-wheel-windows-vs2019.dockerfile +++ b/ci/docker/python-wheel-windows-vs2019.dockerfile @@ -34,12 +34,17 @@ RUN setx path "%path%;C:\Program Files\Git\usr\bin" # # Compiling vcpkg itself from a git tag doesn't work anymore since vcpkg has # started to ship precompiled binaries for the vcpkg-tool. +ARG GITHUB_REPOSITORY_OWNER +ARG GITHUB_TOKEN ARG vcpkg COPY ci/vcpkg/*.patch \ ci/vcpkg/*windows*.cmake \ arrow/ci/vcpkg/ COPY ci/scripts/install_vcpkg.sh arrow/ci/scripts/ -ENV VCPKG_ROOT=C:\\vcpkg +ENV GITHUB_REPOSITORY_OWNER="${GITHUB_REPOSITORY_OWNER}" \ + GITHUB_TOKEN="${GITHUB_TOKEN}" \ + VCPKG_BINARY_SOURCES="clear;nuget,GitHub,readwrite" \ + VCPKG_ROOT=C:\\vcpkg RUN bash arrow/ci/scripts/install_vcpkg.sh /c/vcpkg %vcpkg% && \ setx PATH "%PATH%;%VCPKG_ROOT%" diff --git a/ci/scripts/install_vcpkg.sh b/ci/scripts/install_vcpkg.sh index acc4f29c7b773..b12a20522b961 100755 --- a/ci/scripts/install_vcpkg.sh +++ b/ci/scripts/install_vcpkg.sh @@ -64,14 +64,18 @@ if [ -n "${GITHUB_TOKEN:-}" ] && [ -n "${GITHUB_REPOSITORY_OWNER:-}" ]; then fi PATH="${vcpkg_destination}:${PATH}" nuget_url="https://nuget.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/index.json" - mono $(vcpkg fetch nuget | tail -n 1) \ + nuget="$(vcpkg fetch nuget | tail -n 1)" + if type mono 2>/dev/null; then + nuget="mono ${nuget}" + fi + ${nuget} \ sources add \ -source "${nuget_url}" \ -storepasswordincleartext \ -name "GitHub" \ -username "${GITHUB_REPOSITORY_OWNER}" \ -password "${GITHUB_TOKEN}" - mono $(vcpkg fetch nuget | tail -n 1) \ + ${nuget} \ setapikey "${GITHUB_TOKEN}" \ -source "${nuget_url}" fi diff --git a/dev/tasks/python-wheels/github.linux.yml b/dev/tasks/python-wheels/github.linux.yml index b2afc93fdd523..c1c856c3c465b 100644 --- a/dev/tasks/python-wheels/github.linux.yml +++ b/dev/tasks/python-wheels/github.linux.yml @@ -52,12 +52,12 @@ jobs: - name: Build wheel shell: bash + env: + GITHUB_TOKEN: {{ '${{ secrets.GITHUB_TOKEN }}' }} run: | archery docker run \ -e SETUPTOOLS_SCM_PRETEND_VERSION={{ arrow.no_rc_version }} \ python-wheel-manylinux-{{ manylinux_version }} - env: - GITHUB_TOKEN: {{ '${{ secrets.GITHUB_TOKEN }}' }} - uses: actions/upload-artifact@v4 with: diff --git a/dev/tasks/python-wheels/github.windows.yml b/dev/tasks/python-wheels/github.windows.yml index 2bcda4966db8b..221c6ba00ca8a 100644 --- a/dev/tasks/python-wheels/github.windows.yml +++ b/dev/tasks/python-wheels/github.windows.yml @@ -43,6 +43,8 @@ jobs: - name: Build wheel shell: cmd + env: + GITHUB_TOKEN: {{ '${{ secrets.GITHUB_TOKEN }}' }} run: | cd arrow @rem We want to use only From 8fdf349e3e2fdd4872ee98549718a543d7110024 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 7 Nov 2024 10:28:02 +0900 Subject: [PATCH 19/33] Try removing workaround --- dev/tasks/python-wheels/github.windows.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/dev/tasks/python-wheels/github.windows.yml b/dev/tasks/python-wheels/github.windows.yml index 221c6ba00ca8a..6047946faacff 100644 --- a/dev/tasks/python-wheels/github.windows.yml +++ b/dev/tasks/python-wheels/github.windows.yml @@ -47,18 +47,9 @@ jobs: GITHUB_TOKEN: {{ '${{ secrets.GITHUB_TOKEN }}' }} run: | cd arrow - @rem We want to use only - @rem archery docker run -e SETUPTOOLS_SCM_PRETEND_VERSION={{ arrow.no_rc_version }} python-wheel-windows-vs2019 - @rem but it doesn't use pulled caches. - @rem It always build an image from scratch. - @rem We can remove this workaround once we find a way to use - @rem pulled caches when build an image. - echo on - archery docker pull --no-ignore-pull-failures python-wheel-windows-vs2019 - if errorlevel 1 ( - archery docker build --no-pull python-wheel-windows-vs2019 || exit /B 1 - ) - archery docker run --no-build -e SETUPTOOLS_SCM_PRETEND_VERSION={{ arrow.no_rc_version }} python-wheel-windows-vs2019 + archery docker run ^ + -e SETUPTOOLS_SCM_PRETEND_VERSION={{ arrow.no_rc_version }} ^ + python-wheel-windows-vs2019 - uses: actions/upload-artifact@v4 with: From ba97e21b871970ab8895a8400198f476abd04db5 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 7 Nov 2024 14:36:58 +0900 Subject: [PATCH 20/33] Try push --- dev/tasks/python-wheels/github.windows.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/dev/tasks/python-wheels/github.windows.yml b/dev/tasks/python-wheels/github.windows.yml index 6047946faacff..661b41dd75f6b 100644 --- a/dev/tasks/python-wheels/github.windows.yml +++ b/dev/tasks/python-wheels/github.windows.yml @@ -66,10 +66,8 @@ jobs: {{ macros.github_upload_gemfury("arrow/python/dist/*.whl")|indent }} {{ macros.github_upload_wheel_scientific_python("arrow/python/dist/*.whl")|indent }} - {% if arrow.is_default_branch() %} - name: Push Docker Image shell: cmd run: | cd arrow archery docker push python-wheel-windows-vs2019 - {% endif %} From c9400dd5f7b1ab614399b6dd51c4265161a91aa6 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 7 Nov 2024 16:33:49 +0900 Subject: [PATCH 21/33] Revert --quiet --- dev/archery/archery/docker/core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/archery/archery/docker/core.py b/dev/archery/archery/docker/core.py index 2bc2a9939e4b9..1c486e7aae629 100644 --- a/dev/archery/archery/docker/core.py +++ b/dev/archery/archery/docker/core.py @@ -232,7 +232,7 @@ def _execute_docker(self, *args, **kwargs): def pull(self, service_name, pull_leaf=True, ignore_pull_failures=True): def _pull(service): - args = ['pull', '--quiet'] + args = ['pull'] if service['image'] in self.pull_memory: return @@ -427,9 +427,9 @@ def run(self, service_name, command=None, *, env=None, volumes=None, def push(self, service_name, user=None, password=None): def _push(service): if self.config.using_docker: - return self._execute_docker('push', '--quiet', service['image']) + return self._execute_docker('push', service['image']) else: - return self._execute_compose('push', '--quiet', service['name']) + return self._execute_compose('push', service['name']) if user is not None: try: From 02d98a9dbe6785507c9e07a8abe54abb7e3be441 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 7 Nov 2024 16:40:48 +0900 Subject: [PATCH 22/33] Revert needless changes --- dev/tasks/python-wheels/github.windows.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/dev/tasks/python-wheels/github.windows.yml b/dev/tasks/python-wheels/github.windows.yml index 661b41dd75f6b..221c6ba00ca8a 100644 --- a/dev/tasks/python-wheels/github.windows.yml +++ b/dev/tasks/python-wheels/github.windows.yml @@ -47,9 +47,18 @@ jobs: GITHUB_TOKEN: {{ '${{ secrets.GITHUB_TOKEN }}' }} run: | cd arrow - archery docker run ^ - -e SETUPTOOLS_SCM_PRETEND_VERSION={{ arrow.no_rc_version }} ^ - python-wheel-windows-vs2019 + @rem We want to use only + @rem archery docker run -e SETUPTOOLS_SCM_PRETEND_VERSION={{ arrow.no_rc_version }} python-wheel-windows-vs2019 + @rem but it doesn't use pulled caches. + @rem It always build an image from scratch. + @rem We can remove this workaround once we find a way to use + @rem pulled caches when build an image. + echo on + archery docker pull --no-ignore-pull-failures python-wheel-windows-vs2019 + if errorlevel 1 ( + archery docker build --no-pull python-wheel-windows-vs2019 || exit /B 1 + ) + archery docker run --no-build -e SETUPTOOLS_SCM_PRETEND_VERSION={{ arrow.no_rc_version }} python-wheel-windows-vs2019 - uses: actions/upload-artifact@v4 with: @@ -66,8 +75,10 @@ jobs: {{ macros.github_upload_gemfury("arrow/python/dist/*.whl")|indent }} {{ macros.github_upload_wheel_scientific_python("arrow/python/dist/*.whl")|indent }} + {% if arrow.is_default_branch() %} - name: Push Docker Image shell: cmd run: | cd arrow archery docker push python-wheel-windows-vs2019 + {% endif %} From ff6a193a06b868d9a3f569058dfdb94d27fa15f1 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 7 Nov 2024 18:17:26 +0900 Subject: [PATCH 23/33] java-jars --- dev/tasks/java-jars/github.yml | 4 ++++ dev/tasks/python-wheels/github.osx.yml | 3 +++ dev/tasks/python-wheels/github.windows.yml | 3 +++ 3 files changed, 10 insertions(+) diff --git a/dev/tasks/java-jars/github.yml b/dev/tasks/java-jars/github.yml index e83552cc7c47c..13faa2f936cc6 100644 --- a/dev/tasks/java-jars/github.yml +++ b/dev/tasks/java-jars/github.yml @@ -19,6 +19,9 @@ {{ macros.github_header() }} +permissions: + packages: write + jobs: build-cpp-ubuntu: @@ -51,6 +54,7 @@ jobs: - name: Build C++ libraries env: {{ macros.github_set_sccache_envvars()|indent(8) }} + GITHUB_TOKEN: {{ '${{ secrets.GITHUB_TOKEN }}' }} run: | archery docker run \ -e ARROW_JAVA_BUILD=OFF \ diff --git a/dev/tasks/python-wheels/github.osx.yml b/dev/tasks/python-wheels/github.osx.yml index d57a09e79e075..1799bd6ad6b6f 100644 --- a/dev/tasks/python-wheels/github.osx.yml +++ b/dev/tasks/python-wheels/github.osx.yml @@ -37,6 +37,9 @@ VCPKG_OVERLAY_TRIPLETS: {{ "${{ github.workspace }}/arrow/ci/vcpkg" }} VCPKG_ROOT: {{ "${{ github.workspace }}/vcpkg" }} +permissions: + packages: write + jobs: build: name: Build wheel for Python {{ python_version }} on macOS diff --git a/dev/tasks/python-wheels/github.windows.yml b/dev/tasks/python-wheels/github.windows.yml index 221c6ba00ca8a..3b9d75e35c470 100644 --- a/dev/tasks/python-wheels/github.windows.yml +++ b/dev/tasks/python-wheels/github.windows.yml @@ -19,6 +19,9 @@ {{ macros.github_header() }} +permissions: + packages: write + jobs: build: name: "Build wheel for Windows" From d7114e7e75d659d96ce837a4fa41279ddb48eb61 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 7 Nov 2024 21:20:00 +0900 Subject: [PATCH 24/33] Use mono-core on CentOS 7 --- ci/scripts/install_vcpkg.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ci/scripts/install_vcpkg.sh b/ci/scripts/install_vcpkg.sh index b12a20522b961..037a32347b0ae 100755 --- a/ci/scripts/install_vcpkg.sh +++ b/ci/scripts/install_vcpkg.sh @@ -56,7 +56,9 @@ fi if [ -n "${GITHUB_TOKEN:-}" ] && [ -n "${GITHUB_REPOSITORY_OWNER:-}" ]; then if type dnf 2>/dev/null; then dnf install -y epel-release - dnf install -y mono-complete + # We can remove "|| dnf install -y mono-core" when we drop support + # for manylinux2014. + dnf install -y mono-complete || dnf install -y mono-core curl \ --location \ --output "${vcpkg_destination}/nuget" \ From e0bb0be5130f2df87d16a3e11381fe12c2fc3cf1 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Fri, 8 Nov 2024 11:42:42 +0900 Subject: [PATCH 25/33] Don't use NuGet cache in manylinux2014_aarch64 --- ci/scripts/install_vcpkg.sh | 51 +++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/ci/scripts/install_vcpkg.sh b/ci/scripts/install_vcpkg.sh index 037a32347b0ae..8826a22a1eb91 100755 --- a/ci/scripts/install_vcpkg.sh +++ b/ci/scripts/install_vcpkg.sh @@ -54,32 +54,39 @@ if [ -f "${vcpkg_ports_patch}" ]; then fi if [ -n "${GITHUB_TOKEN:-}" ] && [ -n "${GITHUB_REPOSITORY_OWNER:-}" ]; then + can_use_nuget=yes if type dnf 2>/dev/null; then dnf install -y epel-release - # We can remove "|| dnf install -y mono-core" when we drop support - # for manylinux2014. - dnf install -y mono-complete || dnf install -y mono-core - curl \ - --location \ - --output "${vcpkg_destination}/nuget" \ - https://dist.nuget.org/win-x86-commandline/latest/nuget.exe + if dnf info mono-complete 2>/dev/null; then + dnf install -y mono-complete + curl \ + --location \ + --output "${vcpkg_destination}/nuget" \ + https://dist.nuget.org/win-x86-commandline/latest/nuget.exe + else + # manylinux2014_aarch64 image doesn't have mono-complete in + # EPEL. It has Mono but it's old. + can_use_nuget=no + fi fi - PATH="${vcpkg_destination}:${PATH}" - nuget_url="https://nuget.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/index.json" - nuget="$(vcpkg fetch nuget | tail -n 1)" - if type mono 2>/dev/null; then - nuget="mono ${nuget}" + if [ "${can_use_nuget}" = "yes" ]; then + PATH="${vcpkg_destination}:${PATH}" + nuget_url="https://nuget.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/index.json" + nuget="$(vcpkg fetch nuget | tail -n 1)" + if type mono 2>/dev/null; then + nuget="mono ${nuget}" + fi + ${nuget} \ + sources add \ + -source "${nuget_url}" \ + -storepasswordincleartext \ + -name "GitHub" \ + -username "${GITHUB_REPOSITORY_OWNER}" \ + -password "${GITHUB_TOKEN}" + ${nuget} \ + setapikey "${GITHUB_TOKEN}" \ + -source "${nuget_url}" fi - ${nuget} \ - sources add \ - -source "${nuget_url}" \ - -storepasswordincleartext \ - -name "GitHub" \ - -username "${GITHUB_REPOSITORY_OWNER}" \ - -password "${GITHUB_TOKEN}" - ${nuget} \ - setapikey "${GITHUB_TOKEN}" \ - -source "${nuget_url}" fi popd From 66940c71751f8cd06496ee978f2a4f02eeb9b5b3 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Sat, 9 Nov 2024 07:13:07 +0900 Subject: [PATCH 26/33] Enable VCPKG_BINARY_SOURCES explicitly --- ci/docker/python-wheel-manylinux.dockerfile | 4 +- ci/scripts/install_vcpkg.sh | 53 +++++++++------------ dev/tasks/java-jars/github.yml | 6 +++ dev/tasks/python-wheels/github.linux.yml | 6 +++ docker-compose.yml | 1 + 5 files changed, 39 insertions(+), 31 deletions(-) diff --git a/ci/docker/python-wheel-manylinux.dockerfile b/ci/docker/python-wheel-manylinux.dockerfile index cdaf34ac0b2ba..8e5989d6c712c 100644 --- a/ci/docker/python-wheel-manylinux.dockerfile +++ b/ci/docker/python-wheel-manylinux.dockerfile @@ -68,6 +68,7 @@ RUN /arrow/ci/scripts/install_ccache.sh ${ccache} /usr/local # Install vcpkg ARG GITHUB_REPOSITORY_OWNER ARG GITHUB_TOKEN +ARG VCPKG_BINARY_SOURCES ARG vcpkg COPY ci/vcpkg/*.patch \ ci/vcpkg/*linux*.cmake \ @@ -79,12 +80,13 @@ ARG build_type=release ENV CMAKE_BUILD_TYPE=${build_type} \ GITHUB_REPOSITORY_OWNER="${GITHUB_REPOSITORY_OWNER}" \ GITHUB_TOKEN="${GITHUB_TOKEN}" \ - VCPKG_BINARY_SOURCES="clear;nuget,GitHub,readwrite" \ + VCPKG_BINARY_SOURCES="${VCPKG_BINARY_SOURCES}" \ VCPKG_DEFAULT_TRIPLET=${arch_short}-linux-static-${build_type} \ VCPKG_FEATURE_FLAGS="manifests" \ VCPKG_FORCE_SYSTEM_BINARIES=1 \ VCPKG_OVERLAY_TRIPLETS=/arrow/ci/vcpkg +# TODO: Use --mount=type=secret for GITHUB_TOKEN RUN arrow/ci/scripts/install_vcpkg.sh ${VCPKG_ROOT} ${vcpkg} ENV PATH="${PATH}:${VCPKG_ROOT}" diff --git a/ci/scripts/install_vcpkg.sh b/ci/scripts/install_vcpkg.sh index 8826a22a1eb91..a1bc602403976 100755 --- a/ci/scripts/install_vcpkg.sh +++ b/ci/scripts/install_vcpkg.sh @@ -53,40 +53,33 @@ if [ -f "${vcpkg_ports_patch}" ]; then echo "Patch successfully applied to the VCPKG port files!" fi -if [ -n "${GITHUB_TOKEN:-}" ] && [ -n "${GITHUB_REPOSITORY_OWNER:-}" ]; then - can_use_nuget=yes +if [ -n "${GITHUB_TOKEN:-}" ] && \ + [ -n "${GITHUB_REPOSITORY_OWNER:-}" ] && \ + [ -n "${VCPKG_BINARY_SOURCES:-}" ] ; then if type dnf 2>/dev/null; then dnf install -y epel-release - if dnf info mono-complete 2>/dev/null; then - dnf install -y mono-complete - curl \ - --location \ - --output "${vcpkg_destination}/nuget" \ - https://dist.nuget.org/win-x86-commandline/latest/nuget.exe - else - # manylinux2014_aarch64 image doesn't have mono-complete in - # EPEL. It has Mono but it's old. - can_use_nuget=no - fi + dnf install -y mono-complete + curl \ + --location \ + --output "${vcpkg_destination}/nuget" \ + https://dist.nuget.org/win-x86-commandline/latest/nuget.exe fi - if [ "${can_use_nuget}" = "yes" ]; then - PATH="${vcpkg_destination}:${PATH}" - nuget_url="https://nuget.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/index.json" - nuget="$(vcpkg fetch nuget | tail -n 1)" - if type mono 2>/dev/null; then - nuget="mono ${nuget}" - fi - ${nuget} \ - sources add \ - -source "${nuget_url}" \ - -storepasswordincleartext \ - -name "GitHub" \ - -username "${GITHUB_REPOSITORY_OWNER}" \ - -password "${GITHUB_TOKEN}" - ${nuget} \ - setapikey "${GITHUB_TOKEN}" \ - -source "${nuget_url}" + PATH="${vcpkg_destination}:${PATH}" + nuget_url="https://nuget.pkg.github.com/${GITHUB_REPOSITORY_OWNER}/index.json" + nuget="$(vcpkg fetch nuget | tail -n 1)" + if type mono 2>/dev/null; then + nuget="mono ${nuget}" fi + ${nuget} \ + sources add \ + -source "${nuget_url}" \ + -storepasswordincleartext \ + -name "GitHub" \ + -username "${GITHUB_REPOSITORY_OWNER}" \ + -password "${GITHUB_TOKEN}" + ${nuget} \ + setapikey "${GITHUB_TOKEN}" \ + -source "${nuget_url}" fi popd diff --git a/dev/tasks/java-jars/github.yml b/dev/tasks/java-jars/github.yml index 13faa2f936cc6..755fe7762d887 100644 --- a/dev/tasks/java-jars/github.yml +++ b/dev/tasks/java-jars/github.yml @@ -56,6 +56,12 @@ jobs: {{ macros.github_set_sccache_envvars()|indent(8) }} GITHUB_TOKEN: {{ '${{ secrets.GITHUB_TOKEN }}' }} run: | + if [ "${ARCH}" = "aarch_64" ]; then + # We can't use NuGet on manylinux2014_aarch64 because Mono is old. + : + else + export VCPKG_BINARY_SOURCES="clear;nuget,GitHub,readwrite" + fi archery docker run \ -e ARROW_JAVA_BUILD=OFF \ -e ARROW_JAVA_TEST=OFF \ diff --git a/dev/tasks/python-wheels/github.linux.yml b/dev/tasks/python-wheels/github.linux.yml index c1c856c3c465b..dccdddfb0e43d 100644 --- a/dev/tasks/python-wheels/github.linux.yml +++ b/dev/tasks/python-wheels/github.linux.yml @@ -55,6 +55,12 @@ jobs: env: GITHUB_TOKEN: {{ '${{ secrets.GITHUB_TOKEN }}' }} run: | + if [ "{{ manylinux_version }}" = "2014" ] && [ "{{ arch }}" = "arm64" ]; then + # We can't use NuGet on manylinux2014_aarch64 because Mono is old. + : + else + export VCPKG_BINARY_SOURCES="clear;nuget,GitHub,readwrite" + fi archery docker run \ -e SETUPTOOLS_SCM_PRETEND_VERSION={{ arrow.no_rc_version }} \ python-wheel-manylinux-{{ manylinux_version }} diff --git a/docker-compose.yml b/docker-compose.yml index dc0e38bf369ca..b9271c7d76795 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -78,6 +78,7 @@ x-vcpkg-build-args: &vcpkg-build-args vcpkg: ${VCPKG} GITHUB_REPOSITORY_OWNER: GITHUB_TOKEN: + VCPKG_BINARY_SOURCES: # CPU/memory limit presets to pass to Docker. # From 141cc076bdc629563806824e322cf8336321f930 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Sat, 9 Nov 2024 07:22:22 +0900 Subject: [PATCH 27/33] Fix --- ci/docker/python-wheel-windows-vs2019.dockerfile | 1 + dev/archery/archery/docker/core.py | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ci/docker/python-wheel-windows-vs2019.dockerfile b/ci/docker/python-wheel-windows-vs2019.dockerfile index f827e57f4e61f..1602b551c48d9 100644 --- a/ci/docker/python-wheel-windows-vs2019.dockerfile +++ b/ci/docker/python-wheel-windows-vs2019.dockerfile @@ -45,6 +45,7 @@ ENV GITHUB_REPOSITORY_OWNER="${GITHUB_REPOSITORY_OWNER}" \ GITHUB_TOKEN="${GITHUB_TOKEN}" \ VCPKG_BINARY_SOURCES="clear;nuget,GitHub,readwrite" \ VCPKG_ROOT=C:\\vcpkg +# TODO: Use --mount=type=secret for GITHUB_TOKEN RUN bash arrow/ci/scripts/install_vcpkg.sh /c/vcpkg %vcpkg% && \ setx PATH "%PATH%;%VCPKG_ROOT%" diff --git a/dev/archery/archery/docker/core.py b/dev/archery/archery/docker/core.py index 1c486e7aae629..2bc2a9939e4b9 100644 --- a/dev/archery/archery/docker/core.py +++ b/dev/archery/archery/docker/core.py @@ -232,7 +232,7 @@ def _execute_docker(self, *args, **kwargs): def pull(self, service_name, pull_leaf=True, ignore_pull_failures=True): def _pull(service): - args = ['pull'] + args = ['pull', '--quiet'] if service['image'] in self.pull_memory: return @@ -427,9 +427,9 @@ def run(self, service_name, command=None, *, env=None, volumes=None, def push(self, service_name, user=None, password=None): def _push(service): if self.config.using_docker: - return self._execute_docker('push', service['image']) + return self._execute_docker('push', '--quiet', service['image']) else: - return self._execute_compose('push', service['name']) + return self._execute_compose('push', '--quiet', service['name']) if user is not None: try: From c239815750d792c0f2aff87e0588e2b6ec0a21f5 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Sat, 9 Nov 2024 11:13:04 +0900 Subject: [PATCH 28/33] Fix arch --- dev/tasks/java-jars/github.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tasks/java-jars/github.yml b/dev/tasks/java-jars/github.yml index 755fe7762d887..c3119946450e4 100644 --- a/dev/tasks/java-jars/github.yml +++ b/dev/tasks/java-jars/github.yml @@ -56,7 +56,7 @@ jobs: {{ macros.github_set_sccache_envvars()|indent(8) }} GITHUB_TOKEN: {{ '${{ secrets.GITHUB_TOKEN }}' }} run: | - if [ "${ARCH}" = "aarch_64" ]; then + if [ "${ARCH}" = "arm64v8" ]; then # We can't use NuGet on manylinux2014_aarch64 because Mono is old. : else From 6730902d3c38ea4eda4f1715dd0fb668c169cf21 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 13 Nov 2024 16:32:49 +0900 Subject: [PATCH 29/33] Use secret mount --- ci/docker/python-wheel-manylinux.dockerfile | 42 ++++++++++--------- .../python-wheel-windows-vs2019.dockerfile | 8 +--- dev/tasks/python-wheels/github.windows.yml | 9 ++-- docker-compose.yml | 21 +++++++--- 4 files changed, 43 insertions(+), 37 deletions(-) diff --git a/ci/docker/python-wheel-manylinux.dockerfile b/ci/docker/python-wheel-manylinux.dockerfile index 8e5989d6c712c..79c4e4457f6bb 100644 --- a/ci/docker/python-wheel-manylinux.dockerfile +++ b/ci/docker/python-wheel-manylinux.dockerfile @@ -66,37 +66,40 @@ COPY ci/scripts/install_ccache.sh arrow/ci/scripts/ RUN /arrow/ci/scripts/install_ccache.sh ${ccache} /usr/local # Install vcpkg -ARG GITHUB_REPOSITORY_OWNER -ARG GITHUB_TOKEN -ARG VCPKG_BINARY_SOURCES ARG vcpkg COPY ci/vcpkg/*.patch \ ci/vcpkg/*linux*.cmake \ + ci/vcpkg/vcpkg.json \ arrow/ci/vcpkg/ COPY ci/scripts/install_vcpkg.sh \ arrow/ci/scripts/ ENV VCPKG_ROOT=/opt/vcpkg ARG build_type=release ENV CMAKE_BUILD_TYPE=${build_type} \ - GITHUB_REPOSITORY_OWNER="${GITHUB_REPOSITORY_OWNER}" \ - GITHUB_TOKEN="${GITHUB_TOKEN}" \ - VCPKG_BINARY_SOURCES="${VCPKG_BINARY_SOURCES}" \ + PATH="${PATH}:${VCPKG_ROOT}" \ VCPKG_DEFAULT_TRIPLET=${arch_short}-linux-static-${build_type} \ VCPKG_FEATURE_FLAGS="manifests" \ VCPKG_FORCE_SYSTEM_BINARIES=1 \ VCPKG_OVERLAY_TRIPLETS=/arrow/ci/vcpkg - -# TODO: Use --mount=type=secret for GITHUB_TOKEN -RUN arrow/ci/scripts/install_vcpkg.sh ${VCPKG_ROOT} ${vcpkg} -ENV PATH="${PATH}:${VCPKG_ROOT}" - -COPY ci/vcpkg/vcpkg.json arrow/ci/vcpkg/ -# cannot use the S3 feature here because while aws-sdk-cpp=1.9.160 contains -# ssl related fixes as well as we can patch the vcpkg portfile to support -# arm machines it hits ARROW-15141 where we would need to fall back to 1.8.186 -# but we cannot patch those portfiles since vcpkg-tool handles the checkout of -# previous versions => use bundled S3 build -RUN vcpkg install \ +# For --mount=type=secret: GITHUB_TOKEN is only secret data but we use +# --mount=type=secret for GITHUB_REPOSITORY_OWNER and +# VCPKG_BINARY_SOURCES too. Because we don't want to store all of +# them to built image for easy to reuse built image cache. +# +# For vcpkg install: cannot use the S3 feature here because while +# aws-sdk-cpp=1.9.160 contains ssl related fixes as well as we can +# patch the vcpkg portfile to support arm machines it hits ARROW-15141 +# where we would need to fall back to 1.8.186 but we cannot patch +# those portfiles since vcpkg-tool handles the checkout of previous +# versions => use bundled S3 build +RUN --mount=type=secret,id=github_repository_owner \ + --mount=type=secret,id=github_token \ + --mount=type=secret,id=vcpkg_binary_sources \ + export GITHUB_REPOSITORY_OWNER=$(cat /run/secrets/github_repository_owner); \ + export GITHUB_TOKEN=$(cat /run/secrets/github_token); \ + export VCPKG_BINARY_SOURCES=$(cat /run/secrets/vcpkg_binary_sources); \ + arrow/ci/scripts/install_vcpkg.sh ${VCPKG_ROOT} ${vcpkg} && \ + vcpkg install \ --clean-after-build \ --x-install-root=${VCPKG_ROOT}/installed \ --x-manifest-root=/arrow/ci/vcpkg \ @@ -105,7 +108,8 @@ RUN vcpkg install \ --x-feature=gcs \ --x-feature=json \ --x-feature=parquet \ - --x-feature=s3 + --x-feature=s3 && \ + rm -rf ~/.config/NuGet/ # Make sure auditwheel is up-to-date RUN pipx upgrade auditwheel diff --git a/ci/docker/python-wheel-windows-vs2019.dockerfile b/ci/docker/python-wheel-windows-vs2019.dockerfile index 1602b551c48d9..f9d31eb5771ef 100644 --- a/ci/docker/python-wheel-windows-vs2019.dockerfile +++ b/ci/docker/python-wheel-windows-vs2019.dockerfile @@ -34,18 +34,12 @@ RUN setx path "%path%;C:\Program Files\Git\usr\bin" # # Compiling vcpkg itself from a git tag doesn't work anymore since vcpkg has # started to ship precompiled binaries for the vcpkg-tool. -ARG GITHUB_REPOSITORY_OWNER -ARG GITHUB_TOKEN ARG vcpkg COPY ci/vcpkg/*.patch \ ci/vcpkg/*windows*.cmake \ arrow/ci/vcpkg/ COPY ci/scripts/install_vcpkg.sh arrow/ci/scripts/ -ENV GITHUB_REPOSITORY_OWNER="${GITHUB_REPOSITORY_OWNER}" \ - GITHUB_TOKEN="${GITHUB_TOKEN}" \ - VCPKG_BINARY_SOURCES="clear;nuget,GitHub,readwrite" \ - VCPKG_ROOT=C:\\vcpkg -# TODO: Use --mount=type=secret for GITHUB_TOKEN +ENV VCPKG_ROOT=C:\\vcpkg RUN bash arrow/ci/scripts/install_vcpkg.sh /c/vcpkg %vcpkg% && \ setx PATH "%PATH%;%VCPKG_ROOT%" diff --git a/dev/tasks/python-wheels/github.windows.yml b/dev/tasks/python-wheels/github.windows.yml index 3b9d75e35c470..41585045f685d 100644 --- a/dev/tasks/python-wheels/github.windows.yml +++ b/dev/tasks/python-wheels/github.windows.yml @@ -19,9 +19,6 @@ {{ macros.github_header() }} -permissions: - packages: write - jobs: build: name: "Build wheel for Windows" @@ -36,7 +33,9 @@ jobs: # note that we don't run docker build since there wouldn't be a cache hit # and rebuilding the dependencies takes a fair amount of time REPO: ghcr.io/ursacomputing/arrow - # BuildKit isn't really supported on Windows for now + # BuildKit isn't really supported on Windows for now. + # NuGet + GitHub Packages based vcpkg cache is also disabled for now. + # Because secret mount requires BuildKit. DOCKER_BUILDKIT: 0 steps: @@ -46,8 +45,6 @@ jobs: - name: Build wheel shell: cmd - env: - GITHUB_TOKEN: {{ '${{ secrets.GITHUB_TOKEN }}' }} run: | cd arrow @rem We want to use only diff --git a/docker-compose.yml b/docker-compose.yml index b9271c7d76795..4553f39b9c7ec 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -74,8 +74,7 @@ x-sccache: &sccache SCCACHE_REGION: SCCACHE_S3_KEY_PREFIX: ${SCCACHE_S3_KEY_PREFIX:-sccache} -x-vcpkg-build-args: &vcpkg-build-args - vcpkg: ${VCPKG} +x-vcpkg-build-secrets: &vcpkg-build-secrets GITHUB_REPOSITORY_OWNER: GITHUB_TOKEN: VCPKG_BINARY_SOURCES: @@ -1126,17 +1125,19 @@ services: image: ${REPO}:${ARCH}-python-${PYTHON}-wheel-manylinux-2014-vcpkg-${VCPKG} build: args: - <<: *vcpkg-build-args arch: ${ARCH} arch_short: ${ARCH_SHORT} base: quay.io/pypa/manylinux2014_${ARCH_ALIAS}:2024-08-03-32dfa47 python: ${PYTHON} python_abi_tag: ${PYTHON_ABI_TAG} manylinux: 2014 + vcpkg: ${VCPKG} context: . dockerfile: ci/docker/python-wheel-manylinux.dockerfile cache_from: - ${REPO}:${ARCH}-python-${PYTHON}-wheel-manylinux-2014-vcpkg-${VCPKG} + secrets: + <<: *vcpkg-build-secrets environment: <<: [*common, *ccache] volumes: @@ -1150,17 +1151,19 @@ services: image: ${REPO}:${ARCH}-python-${PYTHON}-wheel-manylinux-2-28-vcpkg-${VCPKG} build: args: - <<: *vcpkg-build-args arch: ${ARCH} arch_short: ${ARCH_SHORT} base: quay.io/pypa/manylinux_2_28_${ARCH_ALIAS}:2024-08-03-32dfa47 python: ${PYTHON} python_abi_tag: ${PYTHON_ABI_TAG} manylinux: 2_28 + vcpkg: ${VCPKG} context: . dockerfile: ci/docker/python-wheel-manylinux.dockerfile cache_from: - ${REPO}:${ARCH}-python-${PYTHON}-wheel-manylinux-2-28-vcpkg-${VCPKG} + secrets: + <<: *vcpkg-build-secrets environment: <<: [*common, *ccache] volumes: @@ -1245,8 +1248,8 @@ services: image: ${REPO}:python-${PYTHON}-wheel-windows-vs2019-vcpkg-${VCPKG}-${PYTHON_WHEEL_WINDOWS_IMAGE_REVISION} build: args: - <<: *vcpkg-build-args python: ${PYTHON} + vcpkg: ${VCPKG} context: . dockerfile: ci/docker/python-wheel-windows-vs2019.dockerfile # This should make the pushed images reusable, but the image gets rebuilt. @@ -2125,3 +2128,11 @@ services: /bin/bash -c " git config --global --add safe.directory /arrow && /arrow/dev/release/verify-release-candidate.sh $${VERIFY_VERSION} $${VERIFY_RC}" + +secrets: + github_repository_owner: + environment: GITHUB_REPOSITORY_OWNER + github_token: + environment: GITHUB_TOKEN + vcpkg_binary_sources: + environment: VCPKG_BINARY_SOURCES From 5d009789b43b601a99d3c28117ed2c7d54abf8d8 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 13 Nov 2024 16:37:56 +0900 Subject: [PATCH 30/33] Style --- ci/scripts/install_vcpkg.sh | 2 +- docker-compose.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/scripts/install_vcpkg.sh b/ci/scripts/install_vcpkg.sh index a1bc602403976..1f45fb0ebf454 100755 --- a/ci/scripts/install_vcpkg.sh +++ b/ci/scripts/install_vcpkg.sh @@ -55,7 +55,7 @@ fi if [ -n "${GITHUB_TOKEN:-}" ] && \ [ -n "${GITHUB_REPOSITORY_OWNER:-}" ] && \ - [ -n "${VCPKG_BINARY_SOURCES:-}" ] ; then + [ "${VCPKG_BINARY_SOURCES:-}" = "clear;nuget,GitHub,readwrite" ] ; then if type dnf 2>/dev/null; then dnf install -y epel-release dnf install -y mono-complete diff --git a/docker-compose.yml b/docker-compose.yml index 4553f39b9c7ec..1b161b4f8acb8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1128,9 +1128,9 @@ services: arch: ${ARCH} arch_short: ${ARCH_SHORT} base: quay.io/pypa/manylinux2014_${ARCH_ALIAS}:2024-08-03-32dfa47 + manylinux: 2014 python: ${PYTHON} python_abi_tag: ${PYTHON_ABI_TAG} - manylinux: 2014 vcpkg: ${VCPKG} context: . dockerfile: ci/docker/python-wheel-manylinux.dockerfile @@ -1154,9 +1154,9 @@ services: arch: ${ARCH} arch_short: ${ARCH_SHORT} base: quay.io/pypa/manylinux_2_28_${ARCH_ALIAS}:2024-08-03-32dfa47 + manylinux: 2_28 python: ${PYTHON} python_abi_tag: ${PYTHON_ABI_TAG} - manylinux: 2_28 vcpkg: ${VCPKG} context: . dockerfile: ci/docker/python-wheel-manylinux.dockerfile From 013c5bb215589e119709feb41a4643a5787f1a58 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 13 Nov 2024 16:39:25 +0900 Subject: [PATCH 31/33] Remove java-jni --- .github/workflows/java_jni.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/java_jni.yml b/.github/workflows/java_jni.yml index a5da0ecb34a2a..5682f8e84167e 100644 --- a/.github/workflows/java_jni.yml +++ b/.github/workflows/java_jni.yml @@ -86,7 +86,6 @@ jobs: env: ARCHERY_DOCKER_USER: ${{ secrets.DOCKERHUB_USER }} ARCHERY_DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | source ci/scripts/util_enable_core_dumps.sh archery docker run java-jni-manylinux-2014 From 52b6ee9b1e8e1ddc491cd0bdde5fe2538b9062e9 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 13 Nov 2024 16:48:43 +0900 Subject: [PATCH 32/33] Fix syntax --- docker-compose.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 1b161b4f8acb8..21d9853943f11 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -75,9 +75,9 @@ x-sccache: &sccache SCCACHE_S3_KEY_PREFIX: ${SCCACHE_S3_KEY_PREFIX:-sccache} x-vcpkg-build-secrets: &vcpkg-build-secrets - GITHUB_REPOSITORY_OWNER: - GITHUB_TOKEN: - VCPKG_BINARY_SOURCES: + - github_repository_owner + - github_token + - vcpkg_binary_sources # CPU/memory limit presets to pass to Docker. # @@ -1136,8 +1136,7 @@ services: dockerfile: ci/docker/python-wheel-manylinux.dockerfile cache_from: - ${REPO}:${ARCH}-python-${PYTHON}-wheel-manylinux-2014-vcpkg-${VCPKG} - secrets: - <<: *vcpkg-build-secrets + secrets: *vcpkg-build-secrets environment: <<: [*common, *ccache] volumes: @@ -1162,8 +1161,7 @@ services: dockerfile: ci/docker/python-wheel-manylinux.dockerfile cache_from: - ${REPO}:${ARCH}-python-${PYTHON}-wheel-manylinux-2-28-vcpkg-${VCPKG} - secrets: - <<: *vcpkg-build-secrets + secrets: *vcpkg-build-secrets environment: <<: [*common, *ccache] volumes: From b2238ef0ab914253a5065024f340c10ddb4c93de Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Thu, 14 Nov 2024 06:30:07 +0900 Subject: [PATCH 33/33] Fix English MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Raúl Cumplido --- ci/docker/python-wheel-manylinux.dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/docker/python-wheel-manylinux.dockerfile b/ci/docker/python-wheel-manylinux.dockerfile index 79c4e4457f6bb..c6fa3cc0dce97 100644 --- a/ci/docker/python-wheel-manylinux.dockerfile +++ b/ci/docker/python-wheel-manylinux.dockerfile @@ -81,10 +81,10 @@ ENV CMAKE_BUILD_TYPE=${build_type} \ VCPKG_FEATURE_FLAGS="manifests" \ VCPKG_FORCE_SYSTEM_BINARIES=1 \ VCPKG_OVERLAY_TRIPLETS=/arrow/ci/vcpkg -# For --mount=type=secret: GITHUB_TOKEN is only secret data but we use +# For --mount=type=secret: The GITHUB_TOKEN is the only real secret but we use # --mount=type=secret for GITHUB_REPOSITORY_OWNER and -# VCPKG_BINARY_SOURCES too. Because we don't want to store all of -# them to built image for easy to reuse built image cache. +# VCPKG_BINARY_SOURCES too because we don't want to store them +# into the built image in order to easily reuse the built image cache. # # For vcpkg install: cannot use the S3 feature here because while # aws-sdk-cpp=1.9.160 contains ssl related fixes as well as we can