You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "kou (via GitHub)" <gi...@apache.org> on 2025/10/07 02:58:34 UTC
[PR] GH-47704: [R] Update paths in nightly libarrow upload job [arrow]
kou opened a new pull request, #47727:
URL: https://github.com/apache/arrow/pull/47727
### Rationale for this change
#45964 changed paths of pre-built Apache Arrow C++ binaries for R. But we forgot to update the nightly upload job.
### What changes are included in this PR?
Update paths in the nightly upload job.
### Are these changes tested?
No...
### Are there any user-facing changes?
Yes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47704: [R] Update paths in nightly libarrow upload job [arrow]
Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on code in PR #47727:
URL: https://github.com/apache/arrow/pull/47727#discussion_r2412295138
##########
.github/workflows/r_nightly.yml:
##########
@@ -1,193 +1,217 @@
-# 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.
-
-name: Upload R Nightly builds
-# This workflow downloads the (nightly) binaries created in crossbow and uploads them
-# to nightlies.apache.org. Due to authorization requirements, this upload can't be done
-# from the crossbow repository.
-
-on:
- workflow_dispatch:
- inputs:
- prefix:
- description: Job prefix to use.
- required: false
- default: ''
- keep:
- description: Number of versions to keep.
- required: false
- default: 14
-
- schedule:
- #Crossbow packaging runs at 0 8 * * *
- - cron: '0 14 * * *'
-
-permissions:
- contents: read
-
-jobs:
- upload:
- if: github.repository == 'apache/arrow'
- runs-on: ubuntu-latest
- steps:
- - name: Checkout Arrow
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- with:
- fetch-depth: 1
- path: arrow
- repository: apache/arrow
- ref: main
- submodules: recursive
- - name: Checkout Crossbow
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- with:
- fetch-depth: 0
- path: crossbow
- repository: ursacomputing/crossbow
- ref: main
- - name: Set up Python
+# 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.
+
+name: Upload R Nightly builds
+# This workflow downloads the (nightly) binaries created in crossbow and uploads them
+# to nightlies.apache.org. Due to authorization requirements, this upload can't be done
+# from the crossbow repository.
+
+on:
+ workflow_dispatch:
+ inputs:
+ prefix:
+ description: Job prefix to use.
+ required: false
+ default: ''
+ keep:
+ description: Number of versions to keep.
+ required: false
+ default: 14
+
+ schedule:
+ #Crossbow packaging runs at 0 8 * * *
+ - cron: '0 14 * * *'
+
+permissions:
+ contents: read
+
+jobs:
+ upload:
+ if: github.repository == 'apache/arrow'
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Arrow
+ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ with:
+ fetch-depth: 1
+ path: arrow
+ repository: apache/arrow
+ ref: main
+ submodules: recursive
+ - name: Checkout Crossbow
+ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ with:
+ fetch-depth: 0
+ path: crossbow
+ repository: ursacomputing/crossbow
+ ref: main
+ - name: Set up Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
- with:
- cache: 'pip'
- python-version: 3.12
- - name: Install Archery
- shell: bash
- run: pip install -e arrow/dev/archery[all]
- - run: mkdir -p binaries
- - name: Download Artifacts
- env:
- PREFIX: ${{ github.event.inputs.prefix || ''}}
- run: |
- if [ -z $PREFIX ]; then
- PREFIX=nightly-packaging-$(date +%Y-%m-%d)-0
- fi
- echo $PREFIX
-
- archery crossbow download-artifacts -f r-binary-packages -t binaries $PREFIX
-
- if [ -n "$(ls -A binaries/*/*/)" ]; then
- echo "Found files!"
- else
- echo "No files found. Stopping upload."
- exit 1
- fi
- - name: Cache Repo
- uses: actions/cache@v4
- with:
- path: repo
- key: r-nightly-${{ github.run_id }}
- restore-keys: r-nightly-
- - name: Sync from Remote
- uses: ./arrow/.github/actions/sync-nightlies
- with:
- switches: -avzh --update --delete --progress
- local_path: repo
- remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/arrow/r
- remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
- remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
- remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }}
- remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
- remote_host_key: ${{ secrets.NIGHTLIES_RSYNC_HOST_KEY }}
- - run: tree repo
- - uses: r-lib/actions/setup-r@v2
- - name: Build Repository
- shell: Rscript {0}
- run: |
- # folder that we sync to nightlies.apache.org
- repo_root <- "repo"
- # The binaries are in a nested dir
- # so we need to find the correct path.
- art_path <- list.files("binaries",
- recursive = TRUE,
- include.dirs = TRUE,
- pattern = "r-binary-packages$",
- full.names = TRUE
- )
-
- current_path <- list.files(art_path, full.names = TRUE, recursive = TRUE)
- files <- sub("r-(pkg|lib)", repo_root, current_path)
-
- # decode contrib.url from artifact name:
- # bin__windows__contrib__4.1 -> bin/windows/contrib/4.1
- new_paths <- gsub("__", "/", files)
- # strip superfluous nested dirs
- new_paths <- sub(art_path, ".", new_paths)
- dirs <- dirname(new_paths)
- sapply(dirs, dir.create, recursive = TRUE, showWarnings = FALSE)
-
- # overwrite allows us to "force push" a new version with the same name
- copy_result <- file.copy(current_path, new_paths, overwrite = TRUE)
-
- if (!all(copy_result)) {
- stop("There was an issue while copying the files!")
- }
- - name: Prune Repository
- shell: bash
- env:
- KEEP: ${{ github.event.inputs.keep || 14 }}
- run: |
- prune() {
- # list files | retain $KEEP newest files | delete everything else
- ls -t $1/arrow* | tail -n +$((KEEP + 1)) | xargs --no-run-if-empty rm
- }
-
- # find leaf sub dirs
- repo_dirs=$(find repo -type d -links 2)
-
- # We want to retain $keep (14) versions of each pkg/lib so we call
- # prune on each leaf dir and not on repo/.
- for dir in ${repo_dirs[@]}; do
- prune $dir
- done
- - name: Update Repository Index
- shell: Rscript {0}
- run: |
- # folder that we sync to nightlies.apache.org
- repo_root <- "repo"
- tools::write_PACKAGES(file.path(repo_root, "src/contrib"),
- type = "source",
- verbose = TRUE,
- latestOnly = FALSE
- )
-
- repo_dirs <- list.dirs(repo_root)
- # find dirs with binary R packages: e.g. */contrib/4.1
- pkg_dirs <- grep(".+contrib\\/\\d.+", repo_dirs, value = TRUE)
-
-
- for (dir in pkg_dirs) {
- on_win <- grepl("windows", dir)
- tools::write_PACKAGES(dir,
- type = ifelse(on_win, "win.binary", "mac.binary"),
- verbose = TRUE,
- latestOnly = FALSE
- )
- }
- - name: Show repo contents
- run: tree repo
- - name: Sync to Remote
- uses: ./arrow/.github/actions/sync-nightlies
- with:
- upload: true
- switches: -avzh --update --delete --progress
- local_path: repo
- remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/arrow/r
- remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
- remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
- remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }}
- remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
- remote_host_key: ${{ secrets.NIGHTLIES_RSYNC_HOST_KEY }}
+ with:
+ cache: 'pip'
+ python-version: 3.12
+ - name: Install Archery
+ shell: bash
+ run: pip install -e arrow/dev/archery[all]
+ - run: mkdir -p binaries
+ - name: Download Artifacts
+ env:
+ PREFIX: ${{ github.event.inputs.prefix || ''}}
+ run: |
+ if [ -z $PREFIX ]; then
+ PREFIX=nightly-packaging-$(date +%Y-%m-%d)-0
+ fi
+ echo $PREFIX
+
+ archery crossbow download-artifacts -f r-binary-packages -t binaries $PREFIX
+
+ if [ -n "$(ls -A binaries/*/*/)" ]; then
+ echo "Found files!"
+ else
+ echo "No files found. Stopping upload."
+ exit 1
+ fi
+ - name: Cache Repo
+ uses: actions/cache@v4
+ with:
+ path: repo
+ key: r-nightly-${{ github.run_id }}
+ restore-keys: r-nightly-
+ - name: Sync from Remote
+ uses: ./arrow/.github/actions/sync-nightlies
+ with:
+ switches: -avzh --update --delete --progress
+ local_path: repo
+ remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/arrow/r
+ remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
+ remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
+ remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }}
+ remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
+ remote_host_key: ${{ secrets.NIGHTLIES_RSYNC_HOST_KEY }}
+ - run: tree repo
+ - uses: r-lib/actions/setup-r@v2
+ - name: Build Repository
+ shell: Rscript {0}
+ run: |
+ # folder that we sync to nightlies.apache.org
+ repo_root <- "repo"
+ # The binaries are in a nested dir
+ # so we need to find the correct path.
+ art_path <- list.files("binaries",
+ recursive = TRUE,
+ include.dirs = TRUE,
+ pattern = "r-binary-packages$",
+ full.names = TRUE
+ )
+
+ current_pkg_path <- list.files(art_path,
+ full.names = TRUE,
+ pattern = "r-pkg",
+ recursive = TRUE
+ )
+ current_lib_path <- list.files(art_path,
+ full.names = TRUE,
+ pattern = "r-lib",
+ recursive = TRUE
+ )
+ files <- c(
+ sub("r-pkg", repo_root, current_pkg_path),
+ sub("r-lib", paste0(repo_root, "__r-lib"), current_lib_path),
+ )
+
+ # decode contrib.url from artifact name:
+ # bin__windows__contrib__4.1 -> bin/windows/contrib/4.1
+ new_paths <- gsub("__", "/", files)
+ # strip superfluous nested dirs
+ new_paths <- sub(art_path, ".", new_paths)
+ dirs <- dirname(new_paths)
+ sapply(dirs, dir.create, recursive = TRUE, showWarnings = FALSE)
+
+ # overwrite allows us to "force push" a new version with the same name
+ copy_result <- file.copy(current_path, new_paths, overwrite = TRUE)
+
+ if (!all(copy_result)) {
+ stop("There was an issue while copying the files!")
+ }
+ - name: Prune Repository
+ shell: bash
+ env:
+ KEEP: ${{ github.event.inputs.keep || 14 }}
+ run: |
+ prune() {
+ # list files | retain $KEEP newest files | delete everything else
+ ls -t "$@" | tail -n +$((KEEP + 1)) | xargs --no-run-if-empty rm
+ }
+
+ # find leaf sub dirs
+ repo_dirs=$(find repo -type d -links 2)
+
+ # Old packages: repo/libarrow/bin/${TARGET}/arrow-${VERSION}.zip
+ #
+ # We want to retain $keep (14) versions of each pkg/lib so we call
+ # prune on each leaf dir and not on repo/.
+ for dir in "${repo_dirs[@]}"; do
+ prune $dir/arrow*
+ done
+
+ # New packages: repo/libarrow/${TARGET}-arrow-${VERSION}.zip
+ prune repo/libarrow/r-libarrow-darwin-arm64-openssl-1.1-* || :
Review Comment:
My case:
* Use `true` for condition:
* e.g.: `while true; do ...`
* Use `:` for ignoring, doing nothing, ...:
* e.g.: `... || :`: Ignore error
* e.g.: `: command line`: Ignore this command line (same as `# command line` but it works with multiline command line. I also use `echo command line` for this case.)
* e.g.: `if ...; do :; fi`: Do nothing (like `pass` in Python)
* e.g.: `: ${VARIABLE:=DEFAULT_VALUE}`: Do nothing (setting default value by `${...:=...}` is the important part)
##########
.github/workflows/r_nightly.yml:
##########
@@ -1,193 +1,217 @@
-# 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.
-
-name: Upload R Nightly builds
-# This workflow downloads the (nightly) binaries created in crossbow and uploads them
-# to nightlies.apache.org. Due to authorization requirements, this upload can't be done
-# from the crossbow repository.
-
-on:
- workflow_dispatch:
- inputs:
- prefix:
- description: Job prefix to use.
- required: false
- default: ''
- keep:
- description: Number of versions to keep.
- required: false
- default: 14
-
- schedule:
- #Crossbow packaging runs at 0 8 * * *
- - cron: '0 14 * * *'
-
-permissions:
- contents: read
-
-jobs:
- upload:
- if: github.repository == 'apache/arrow'
- runs-on: ubuntu-latest
- steps:
- - name: Checkout Arrow
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- with:
- fetch-depth: 1
- path: arrow
- repository: apache/arrow
- ref: main
- submodules: recursive
- - name: Checkout Crossbow
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- with:
- fetch-depth: 0
- path: crossbow
- repository: ursacomputing/crossbow
- ref: main
- - name: Set up Python
+# 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.
+
+name: Upload R Nightly builds
+# This workflow downloads the (nightly) binaries created in crossbow and uploads them
+# to nightlies.apache.org. Due to authorization requirements, this upload can't be done
+# from the crossbow repository.
+
+on:
+ workflow_dispatch:
+ inputs:
+ prefix:
+ description: Job prefix to use.
+ required: false
+ default: ''
+ keep:
+ description: Number of versions to keep.
+ required: false
+ default: 14
+
+ schedule:
+ #Crossbow packaging runs at 0 8 * * *
+ - cron: '0 14 * * *'
+
+permissions:
+ contents: read
+
+jobs:
+ upload:
+ if: github.repository == 'apache/arrow'
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Arrow
+ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ with:
+ fetch-depth: 1
+ path: arrow
+ repository: apache/arrow
+ ref: main
+ submodules: recursive
+ - name: Checkout Crossbow
+ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ with:
+ fetch-depth: 0
+ path: crossbow
+ repository: ursacomputing/crossbow
+ ref: main
+ - name: Set up Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
- with:
- cache: 'pip'
- python-version: 3.12
- - name: Install Archery
- shell: bash
- run: pip install -e arrow/dev/archery[all]
- - run: mkdir -p binaries
- - name: Download Artifacts
- env:
- PREFIX: ${{ github.event.inputs.prefix || ''}}
- run: |
- if [ -z $PREFIX ]; then
- PREFIX=nightly-packaging-$(date +%Y-%m-%d)-0
- fi
- echo $PREFIX
-
- archery crossbow download-artifacts -f r-binary-packages -t binaries $PREFIX
-
- if [ -n "$(ls -A binaries/*/*/)" ]; then
- echo "Found files!"
- else
- echo "No files found. Stopping upload."
- exit 1
- fi
- - name: Cache Repo
- uses: actions/cache@v4
- with:
- path: repo
- key: r-nightly-${{ github.run_id }}
- restore-keys: r-nightly-
- - name: Sync from Remote
- uses: ./arrow/.github/actions/sync-nightlies
- with:
- switches: -avzh --update --delete --progress
- local_path: repo
- remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/arrow/r
- remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
- remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
- remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }}
- remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
- remote_host_key: ${{ secrets.NIGHTLIES_RSYNC_HOST_KEY }}
- - run: tree repo
- - uses: r-lib/actions/setup-r@v2
- - name: Build Repository
- shell: Rscript {0}
- run: |
- # folder that we sync to nightlies.apache.org
- repo_root <- "repo"
- # The binaries are in a nested dir
- # so we need to find the correct path.
- art_path <- list.files("binaries",
- recursive = TRUE,
- include.dirs = TRUE,
- pattern = "r-binary-packages$",
- full.names = TRUE
- )
-
- current_path <- list.files(art_path, full.names = TRUE, recursive = TRUE)
- files <- sub("r-(pkg|lib)", repo_root, current_path)
-
- # decode contrib.url from artifact name:
- # bin__windows__contrib__4.1 -> bin/windows/contrib/4.1
- new_paths <- gsub("__", "/", files)
- # strip superfluous nested dirs
- new_paths <- sub(art_path, ".", new_paths)
- dirs <- dirname(new_paths)
- sapply(dirs, dir.create, recursive = TRUE, showWarnings = FALSE)
-
- # overwrite allows us to "force push" a new version with the same name
- copy_result <- file.copy(current_path, new_paths, overwrite = TRUE)
-
- if (!all(copy_result)) {
- stop("There was an issue while copying the files!")
- }
- - name: Prune Repository
- shell: bash
- env:
- KEEP: ${{ github.event.inputs.keep || 14 }}
- run: |
- prune() {
- # list files | retain $KEEP newest files | delete everything else
- ls -t $1/arrow* | tail -n +$((KEEP + 1)) | xargs --no-run-if-empty rm
- }
-
- # find leaf sub dirs
- repo_dirs=$(find repo -type d -links 2)
-
- # We want to retain $keep (14) versions of each pkg/lib so we call
- # prune on each leaf dir and not on repo/.
- for dir in ${repo_dirs[@]}; do
- prune $dir
- done
- - name: Update Repository Index
- shell: Rscript {0}
- run: |
- # folder that we sync to nightlies.apache.org
- repo_root <- "repo"
- tools::write_PACKAGES(file.path(repo_root, "src/contrib"),
- type = "source",
- verbose = TRUE,
- latestOnly = FALSE
- )
-
- repo_dirs <- list.dirs(repo_root)
- # find dirs with binary R packages: e.g. */contrib/4.1
- pkg_dirs <- grep(".+contrib\\/\\d.+", repo_dirs, value = TRUE)
-
-
- for (dir in pkg_dirs) {
- on_win <- grepl("windows", dir)
- tools::write_PACKAGES(dir,
- type = ifelse(on_win, "win.binary", "mac.binary"),
- verbose = TRUE,
- latestOnly = FALSE
- )
- }
- - name: Show repo contents
- run: tree repo
- - name: Sync to Remote
- uses: ./arrow/.github/actions/sync-nightlies
- with:
- upload: true
- switches: -avzh --update --delete --progress
- local_path: repo
- remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/arrow/r
- remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
- remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
- remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }}
- remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
- remote_host_key: ${{ secrets.NIGHTLIES_RSYNC_HOST_KEY }}
+ with:
+ cache: 'pip'
+ python-version: 3.12
+ - name: Install Archery
+ shell: bash
+ run: pip install -e arrow/dev/archery[all]
+ - run: mkdir -p binaries
+ - name: Download Artifacts
+ env:
+ PREFIX: ${{ github.event.inputs.prefix || ''}}
+ run: |
+ if [ -z $PREFIX ]; then
+ PREFIX=nightly-packaging-$(date +%Y-%m-%d)-0
+ fi
+ echo $PREFIX
+
+ archery crossbow download-artifacts -f r-binary-packages -t binaries $PREFIX
+
+ if [ -n "$(ls -A binaries/*/*/)" ]; then
+ echo "Found files!"
+ else
+ echo "No files found. Stopping upload."
+ exit 1
+ fi
+ - name: Cache Repo
+ uses: actions/cache@v4
+ with:
+ path: repo
+ key: r-nightly-${{ github.run_id }}
+ restore-keys: r-nightly-
+ - name: Sync from Remote
+ uses: ./arrow/.github/actions/sync-nightlies
+ with:
+ switches: -avzh --update --delete --progress
+ local_path: repo
+ remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/arrow/r
+ remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
+ remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
+ remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }}
+ remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
+ remote_host_key: ${{ secrets.NIGHTLIES_RSYNC_HOST_KEY }}
+ - run: tree repo
+ - uses: r-lib/actions/setup-r@v2
+ - name: Build Repository
+ shell: Rscript {0}
+ run: |
+ # folder that we sync to nightlies.apache.org
+ repo_root <- "repo"
+ # The binaries are in a nested dir
+ # so we need to find the correct path.
+ art_path <- list.files("binaries",
+ recursive = TRUE,
+ include.dirs = TRUE,
+ pattern = "r-binary-packages$",
+ full.names = TRUE
+ )
+
+ current_pkg_path <- list.files(art_path,
+ full.names = TRUE,
+ pattern = "r-pkg",
+ recursive = TRUE
+ )
+ current_lib_path <- list.files(art_path,
+ full.names = TRUE,
+ pattern = "r-lib",
+ recursive = TRUE
+ )
+ files <- c(
+ sub("r-pkg", repo_root, current_pkg_path),
+ sub("r-lib", paste0(repo_root, "__r-lib"), current_lib_path),
+ )
+
+ # decode contrib.url from artifact name:
+ # bin__windows__contrib__4.1 -> bin/windows/contrib/4.1
+ new_paths <- gsub("__", "/", files)
+ # strip superfluous nested dirs
+ new_paths <- sub(art_path, ".", new_paths)
+ dirs <- dirname(new_paths)
+ sapply(dirs, dir.create, recursive = TRUE, showWarnings = FALSE)
+
+ # overwrite allows us to "force push" a new version with the same name
+ copy_result <- file.copy(current_path, new_paths, overwrite = TRUE)
+
+ if (!all(copy_result)) {
+ stop("There was an issue while copying the files!")
+ }
+ - name: Prune Repository
+ shell: bash
+ env:
+ KEEP: ${{ github.event.inputs.keep || 14 }}
+ run: |
+ prune() {
+ # list files | retain $KEEP newest files | delete everything else
+ ls -t "$@" | tail -n +$((KEEP + 1)) | xargs --no-run-if-empty rm
+ }
+
+ # find leaf sub dirs
+ repo_dirs=$(find repo -type d -links 2)
+
+ # Old packages: repo/libarrow/bin/${TARGET}/arrow-${VERSION}.zip
+ #
+ # We want to retain $keep (14) versions of each pkg/lib so we call
+ # prune on each leaf dir and not on repo/.
+ for dir in "${repo_dirs[@]}"; do
+ prune $dir/arrow*
+ done
+
+ # New packages: repo/libarrow/${TARGET}-arrow-${VERSION}.zip
+ prune repo/libarrow/r-libarrow-darwin-arm64-openssl-1.1-* || :
Review Comment:
My cases:
* Use `true` for condition:
* e.g.: `while true; do ...`
* Use `:` for ignoring, doing nothing, ...:
* e.g.: `... || :`: Ignore error
* e.g.: `: command line`: Ignore this command line (same as `# command line` but it works with multiline command line. I also use `echo command line` for this case.)
* e.g.: `if ...; do :; fi`: Do nothing (like `pass` in Python)
* e.g.: `: ${VARIABLE:=DEFAULT_VALUE}`: Do nothing (setting default value by `${...:=...}` is the important part)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47704: [R] Update paths in nightly libarrow upload job [arrow]
Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on PR #47727:
URL: https://github.com/apache/arrow/pull/47727#issuecomment-3384070010
https://github.com/apache/arrow/issues/47765
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47704: [R] Update paths in nightly libarrow upload job [arrow]
Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on PR #47727:
URL: https://github.com/apache/arrow/pull/47727#issuecomment-3384064441
Failed...:
https://github.com/apache/arrow/actions/runs/18347253579/job/52257191377#step:7:72
```text
ls: cannot access 'binaries/*/*/': No such file or directory
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47704: [R] Update paths in nightly libarrow upload job [arrow]
Posted by "conbench-apache-arrow[bot] (via GitHub)" <gi...@apache.org>.
conbench-apache-arrow[bot] commented on PR #47727:
URL: https://github.com/apache/arrow/pull/47727#issuecomment-3378721174
After merging your PR, Conbench analyzed the 2 benchmarking runs that have been run so far on merge-commit e5c8ccd174e0e19024cbe696c32df03b0a34f78b.
There were no benchmark performance regressions. 🎉
The [full Conbench report](https://github.com/apache/arrow/runs/52191196363) has more details. It also includes information about 6 possible false positives for unstable benchmarks that are known to sometimes produce them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47704: [R] Update paths in nightly libarrow upload job [arrow]
Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on PR #47727:
URL: https://github.com/apache/arrow/pull/47727#issuecomment-3384066792
Ah, the r-binary-packages job failed:
https://github.com/apache/arrow/actions/runs/18347253579/job/52257191377#step:7:30
```text
[ state] Task / Branch Artifacts
-------------------------------------------------------------------------------
[FAILURE] r-binary-packages uploaded 0 / 15
â”” https://github.com/ursacomputing/crossbow/actions/runs/18338842929/job/5***36686030
â”” https://github.com/ursacomputing/crossbow/actions/runs/18338842929/job/5***35913601
â”” https://github.com/ursacomputing/crossbow/actions/runs/18338842929/job/5***35913431
â”” https://github.com/ursacomputing/crossbow/actions/runs/18338842929/job/5***35913418
â”” https://github.com/ursacomputing/crossbow/actions/runs/18338842929/job/5***35913414
â”” https://github.com/ursacomputing/crossbow/actions/runs/18338842929/job/5***35913406
â”” https://github.com/ursacomputing/crossbow/actions/runs/18338842929/job/5***35913403
â”” https://github.com/ursacomputing/crossbow/actions/runs/18338842929/job/5***30434300
â”” https://github.com/ursacomputing/crossbow/actions/runs/18338842929/job/5***30119121
â”” https://github.com/ursacomputing/crossbow/actions/runs/18338842929/job/5***30119120
â”” https://github.com/ursacomputing/crossbow/actions/runs/18338842929/job/5***30119118
â”” https://github.com/ursacomputing/crossbow/actions/runs/18338842929/job/5***30119107
â”” https://github.com/ursacomputing/crossbow/actions/runs/18338842929/job/5***30119100
â”” https://github.com/ursacomputing/crossbow/actions/runs/18338842929/job/5***9330491
â”” https://github.com/ursacomputing/crossbow/actions/runs/18338842929/job/5***9330483
â”” https://github.com/ursacomputing/crossbow/actions/runs/18338842929/job/5***9330479
â”” https://github.com/ursacomputing/crossbow/actions/runs/18338842929/job/5***9330476
â”” https://github.com/ursacomputing/crossbow/actions/runs/18338842929/job/5***9330472
â”” https://github.com/ursacomputing/crossbow/actions/runs/18338842929/job/5***9330469
â”” https://github.com/ursacomputing/crossbow/actions/runs/18338842929/job/5***9330467
â”” https://github.com/ursacomputing/crossbow/actions/runs/18338842929/job/5***9330460
â”” https://github.com/ursacomputing/crossbow/actions/runs/18338842929/job/5***9330450
â”” https://github.com/ursacomputing/crossbow/actions/runs/18338842929/job/5***9330449
â”” https://github.com/ursacomputing/crossbow/actions/runs/18338842929/job/5***9105899
r-libarrow-windows-x86_64-21.0.0.100000191\.zip [MISSING]
r-libarrow-linux-x86_64-openssl-1.0-21.0.0.100000191\.zip [MISSING]
r-libarrow-linux-x86_64-openssl-1.1-21.0.0.100000191\.zip [MISSING]
r-libarrow-linux-x86_64-openssl-3.0-21.0.0.100000191\.zip [MISSING]
r-libarrow-darwin-arm64-openssl-1.1-21.0.0.100000191\.zip [MISSING]
r-libarrow-darwin-arm64-openssl-3.0-21.0.0.100000191\.zip [MISSING]
r-libarrow-darwin-x86_64-openssl-1.1-21.0.0.100000191\.zip [MISSING]
r-libarrow-darwin-x86_64-openssl-3.0-21.0.0.100000191\.zip [MISSING]
r-pkg__bin__windows__contrib__4.5__arrow_21.0.0.100000191\.zip [MISSING]
r-pkg__bin__windows__contrib__4.4__arrow_21.0.0.100000191\.zip [MISSING]
r-pkg__bin__macosx__big-sur-x86_64__contrib__4.5__arrow_21.0.0.100000191\.tgz [MISSING]
r-pkg__bin__macosx__big-sur-x86_64__contrib__4.4__arrow_21.0.0.100000191\.tgz [MISSING]
r-pkg__bin__macosx__big-sur-arm64__contrib__4.5__arrow_21.0.0.100000191\.tgz [MISSING]
r-pkg__bin__macosx__big-sur-arm64__contrib__4.4__arrow_21.0.0.100000191\.tgz [MISSING]
r-pkg__src__contrib__arrow_21.0.0.100000191\.tar\.gz [MISSING]
ls: cannot access 'binaries/*/*/': No such file or directory
No files found. Stopping upload.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47704: [R] Update paths in nightly libarrow upload job [arrow]
Posted by "assignUser (via GitHub)" <gi...@apache.org>.
assignUser commented on code in PR #47727:
URL: https://github.com/apache/arrow/pull/47727#discussion_r2412076545
##########
.github/workflows/r_nightly.yml:
##########
@@ -1,193 +1,217 @@
-# 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.
-
-name: Upload R Nightly builds
-# This workflow downloads the (nightly) binaries created in crossbow and uploads them
-# to nightlies.apache.org. Due to authorization requirements, this upload can't be done
-# from the crossbow repository.
-
-on:
- workflow_dispatch:
- inputs:
- prefix:
- description: Job prefix to use.
- required: false
- default: ''
- keep:
- description: Number of versions to keep.
- required: false
- default: 14
-
- schedule:
- #Crossbow packaging runs at 0 8 * * *
- - cron: '0 14 * * *'
-
-permissions:
- contents: read
-
-jobs:
- upload:
- if: github.repository == 'apache/arrow'
- runs-on: ubuntu-latest
- steps:
- - name: Checkout Arrow
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- with:
- fetch-depth: 1
- path: arrow
- repository: apache/arrow
- ref: main
- submodules: recursive
- - name: Checkout Crossbow
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- with:
- fetch-depth: 0
- path: crossbow
- repository: ursacomputing/crossbow
- ref: main
- - name: Set up Python
+# 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.
+
+name: Upload R Nightly builds
+# This workflow downloads the (nightly) binaries created in crossbow and uploads them
+# to nightlies.apache.org. Due to authorization requirements, this upload can't be done
+# from the crossbow repository.
+
+on:
+ workflow_dispatch:
+ inputs:
+ prefix:
+ description: Job prefix to use.
+ required: false
+ default: ''
+ keep:
+ description: Number of versions to keep.
+ required: false
+ default: 14
+
+ schedule:
+ #Crossbow packaging runs at 0 8 * * *
+ - cron: '0 14 * * *'
+
+permissions:
+ contents: read
+
+jobs:
+ upload:
+ if: github.repository == 'apache/arrow'
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Arrow
+ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ with:
+ fetch-depth: 1
+ path: arrow
+ repository: apache/arrow
+ ref: main
+ submodules: recursive
+ - name: Checkout Crossbow
+ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ with:
+ fetch-depth: 0
+ path: crossbow
+ repository: ursacomputing/crossbow
+ ref: main
+ - name: Set up Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
- with:
- cache: 'pip'
- python-version: 3.12
- - name: Install Archery
- shell: bash
- run: pip install -e arrow/dev/archery[all]
- - run: mkdir -p binaries
- - name: Download Artifacts
- env:
- PREFIX: ${{ github.event.inputs.prefix || ''}}
- run: |
- if [ -z $PREFIX ]; then
- PREFIX=nightly-packaging-$(date +%Y-%m-%d)-0
- fi
- echo $PREFIX
-
- archery crossbow download-artifacts -f r-binary-packages -t binaries $PREFIX
-
- if [ -n "$(ls -A binaries/*/*/)" ]; then
- echo "Found files!"
- else
- echo "No files found. Stopping upload."
- exit 1
- fi
- - name: Cache Repo
- uses: actions/cache@v4
- with:
- path: repo
- key: r-nightly-${{ github.run_id }}
- restore-keys: r-nightly-
- - name: Sync from Remote
- uses: ./arrow/.github/actions/sync-nightlies
- with:
- switches: -avzh --update --delete --progress
- local_path: repo
- remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/arrow/r
- remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
- remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
- remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }}
- remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
- remote_host_key: ${{ secrets.NIGHTLIES_RSYNC_HOST_KEY }}
- - run: tree repo
- - uses: r-lib/actions/setup-r@v2
- - name: Build Repository
- shell: Rscript {0}
- run: |
- # folder that we sync to nightlies.apache.org
- repo_root <- "repo"
- # The binaries are in a nested dir
- # so we need to find the correct path.
- art_path <- list.files("binaries",
- recursive = TRUE,
- include.dirs = TRUE,
- pattern = "r-binary-packages$",
- full.names = TRUE
- )
-
- current_path <- list.files(art_path, full.names = TRUE, recursive = TRUE)
- files <- sub("r-(pkg|lib)", repo_root, current_path)
-
- # decode contrib.url from artifact name:
- # bin__windows__contrib__4.1 -> bin/windows/contrib/4.1
- new_paths <- gsub("__", "/", files)
- # strip superfluous nested dirs
- new_paths <- sub(art_path, ".", new_paths)
- dirs <- dirname(new_paths)
- sapply(dirs, dir.create, recursive = TRUE, showWarnings = FALSE)
-
- # overwrite allows us to "force push" a new version with the same name
- copy_result <- file.copy(current_path, new_paths, overwrite = TRUE)
-
- if (!all(copy_result)) {
- stop("There was an issue while copying the files!")
- }
- - name: Prune Repository
- shell: bash
- env:
- KEEP: ${{ github.event.inputs.keep || 14 }}
- run: |
- prune() {
- # list files | retain $KEEP newest files | delete everything else
- ls -t $1/arrow* | tail -n +$((KEEP + 1)) | xargs --no-run-if-empty rm
- }
-
- # find leaf sub dirs
- repo_dirs=$(find repo -type d -links 2)
-
- # We want to retain $keep (14) versions of each pkg/lib so we call
- # prune on each leaf dir and not on repo/.
- for dir in ${repo_dirs[@]}; do
- prune $dir
- done
- - name: Update Repository Index
- shell: Rscript {0}
- run: |
- # folder that we sync to nightlies.apache.org
- repo_root <- "repo"
- tools::write_PACKAGES(file.path(repo_root, "src/contrib"),
- type = "source",
- verbose = TRUE,
- latestOnly = FALSE
- )
-
- repo_dirs <- list.dirs(repo_root)
- # find dirs with binary R packages: e.g. */contrib/4.1
- pkg_dirs <- grep(".+contrib\\/\\d.+", repo_dirs, value = TRUE)
-
-
- for (dir in pkg_dirs) {
- on_win <- grepl("windows", dir)
- tools::write_PACKAGES(dir,
- type = ifelse(on_win, "win.binary", "mac.binary"),
- verbose = TRUE,
- latestOnly = FALSE
- )
- }
- - name: Show repo contents
- run: tree repo
- - name: Sync to Remote
- uses: ./arrow/.github/actions/sync-nightlies
- with:
- upload: true
- switches: -avzh --update --delete --progress
- local_path: repo
- remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/arrow/r
- remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
- remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
- remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }}
- remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
- remote_host_key: ${{ secrets.NIGHTLIES_RSYNC_HOST_KEY }}
+ with:
+ cache: 'pip'
+ python-version: 3.12
+ - name: Install Archery
+ shell: bash
+ run: pip install -e arrow/dev/archery[all]
+ - run: mkdir -p binaries
+ - name: Download Artifacts
+ env:
+ PREFIX: ${{ github.event.inputs.prefix || ''}}
+ run: |
+ if [ -z $PREFIX ]; then
+ PREFIX=nightly-packaging-$(date +%Y-%m-%d)-0
+ fi
+ echo $PREFIX
+
+ archery crossbow download-artifacts -f r-binary-packages -t binaries $PREFIX
+
+ if [ -n "$(ls -A binaries/*/*/)" ]; then
+ echo "Found files!"
+ else
+ echo "No files found. Stopping upload."
+ exit 1
+ fi
+ - name: Cache Repo
+ uses: actions/cache@v4
+ with:
+ path: repo
+ key: r-nightly-${{ github.run_id }}
+ restore-keys: r-nightly-
+ - name: Sync from Remote
+ uses: ./arrow/.github/actions/sync-nightlies
+ with:
+ switches: -avzh --update --delete --progress
+ local_path: repo
+ remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/arrow/r
+ remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
+ remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
+ remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }}
+ remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
+ remote_host_key: ${{ secrets.NIGHTLIES_RSYNC_HOST_KEY }}
+ - run: tree repo
+ - uses: r-lib/actions/setup-r@v2
+ - name: Build Repository
+ shell: Rscript {0}
+ run: |
+ # folder that we sync to nightlies.apache.org
+ repo_root <- "repo"
+ # The binaries are in a nested dir
+ # so we need to find the correct path.
+ art_path <- list.files("binaries",
+ recursive = TRUE,
+ include.dirs = TRUE,
+ pattern = "r-binary-packages$",
+ full.names = TRUE
+ )
+
+ current_pkg_path <- list.files(art_path,
+ full.names = TRUE,
+ pattern = "r-pkg",
+ recursive = TRUE
+ )
+ current_lib_path <- list.files(art_path,
+ full.names = TRUE,
+ pattern = "r-lib",
+ recursive = TRUE
+ )
+ files <- c(
+ sub("r-pkg", repo_root, current_pkg_path),
+ sub("r-lib", paste0(repo_root, "__r-lib"), current_lib_path),
+ )
+
+ # decode contrib.url from artifact name:
+ # bin__windows__contrib__4.1 -> bin/windows/contrib/4.1
+ new_paths <- gsub("__", "/", files)
+ # strip superfluous nested dirs
+ new_paths <- sub(art_path, ".", new_paths)
+ dirs <- dirname(new_paths)
+ sapply(dirs, dir.create, recursive = TRUE, showWarnings = FALSE)
+
+ # overwrite allows us to "force push" a new version with the same name
+ copy_result <- file.copy(current_path, new_paths, overwrite = TRUE)
+
+ if (!all(copy_result)) {
+ stop("There was an issue while copying the files!")
+ }
+ - name: Prune Repository
+ shell: bash
+ env:
+ KEEP: ${{ github.event.inputs.keep || 14 }}
+ run: |
+ prune() {
+ # list files | retain $KEEP newest files | delete everything else
+ ls -t "$@" | tail -n +$((KEEP + 1)) | xargs --no-run-if-empty rm
+ }
+
+ # find leaf sub dirs
+ repo_dirs=$(find repo -type d -links 2)
+
+ # Old packages: repo/libarrow/bin/${TARGET}/arrow-${VERSION}.zip
+ #
+ # We want to retain $keep (14) versions of each pkg/lib so we call
+ # prune on each leaf dir and not on repo/.
+ for dir in "${repo_dirs[@]}"; do
+ prune $dir/arrow*
+ done
+
+ # New packages: repo/libarrow/${TARGET}-arrow-${VERSION}.zip
+ prune repo/libarrow/r-libarrow-darwin-arm64-openssl-1.1-* || :
Review Comment:
[tldr](https://unix.stackexchange.com/a/718628): no practical difference
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47704: [R] Update paths in nightly libarrow upload job [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #47727:
URL: https://github.com/apache/arrow/pull/47727#issuecomment-3374984454
:warning: GitHub issue #47704 **has been automatically assigned in GitHub** to PR creator.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47704: [R] Update paths in nightly libarrow upload job [arrow]
Posted by "jonkeane (via GitHub)" <gi...@apache.org>.
jonkeane commented on code in PR #47727:
URL: https://github.com/apache/arrow/pull/47727#discussion_r2410696955
##########
.github/workflows/r_nightly.yml:
##########
@@ -1,193 +1,217 @@
-# 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.
-
-name: Upload R Nightly builds
-# This workflow downloads the (nightly) binaries created in crossbow and uploads them
-# to nightlies.apache.org. Due to authorization requirements, this upload can't be done
-# from the crossbow repository.
-
-on:
- workflow_dispatch:
- inputs:
- prefix:
- description: Job prefix to use.
- required: false
- default: ''
- keep:
- description: Number of versions to keep.
- required: false
- default: 14
-
- schedule:
- #Crossbow packaging runs at 0 8 * * *
- - cron: '0 14 * * *'
-
-permissions:
- contents: read
-
-jobs:
- upload:
- if: github.repository == 'apache/arrow'
- runs-on: ubuntu-latest
- steps:
- - name: Checkout Arrow
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- with:
- fetch-depth: 1
- path: arrow
- repository: apache/arrow
- ref: main
- submodules: recursive
- - name: Checkout Crossbow
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- with:
- fetch-depth: 0
- path: crossbow
- repository: ursacomputing/crossbow
- ref: main
- - name: Set up Python
+# 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.
+
+name: Upload R Nightly builds
+# This workflow downloads the (nightly) binaries created in crossbow and uploads them
+# to nightlies.apache.org. Due to authorization requirements, this upload can't be done
+# from the crossbow repository.
+
+on:
+ workflow_dispatch:
+ inputs:
+ prefix:
+ description: Job prefix to use.
+ required: false
+ default: ''
+ keep:
+ description: Number of versions to keep.
+ required: false
+ default: 14
+
+ schedule:
+ #Crossbow packaging runs at 0 8 * * *
+ - cron: '0 14 * * *'
+
+permissions:
+ contents: read
+
+jobs:
+ upload:
+ if: github.repository == 'apache/arrow'
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout Arrow
+ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ with:
+ fetch-depth: 1
+ path: arrow
+ repository: apache/arrow
+ ref: main
+ submodules: recursive
+ - name: Checkout Crossbow
+ uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
+ with:
+ fetch-depth: 0
+ path: crossbow
+ repository: ursacomputing/crossbow
+ ref: main
+ - name: Set up Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
- with:
- cache: 'pip'
- python-version: 3.12
- - name: Install Archery
- shell: bash
- run: pip install -e arrow/dev/archery[all]
- - run: mkdir -p binaries
- - name: Download Artifacts
- env:
- PREFIX: ${{ github.event.inputs.prefix || ''}}
- run: |
- if [ -z $PREFIX ]; then
- PREFIX=nightly-packaging-$(date +%Y-%m-%d)-0
- fi
- echo $PREFIX
-
- archery crossbow download-artifacts -f r-binary-packages -t binaries $PREFIX
-
- if [ -n "$(ls -A binaries/*/*/)" ]; then
- echo "Found files!"
- else
- echo "No files found. Stopping upload."
- exit 1
- fi
- - name: Cache Repo
- uses: actions/cache@v4
- with:
- path: repo
- key: r-nightly-${{ github.run_id }}
- restore-keys: r-nightly-
- - name: Sync from Remote
- uses: ./arrow/.github/actions/sync-nightlies
- with:
- switches: -avzh --update --delete --progress
- local_path: repo
- remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/arrow/r
- remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
- remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
- remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }}
- remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
- remote_host_key: ${{ secrets.NIGHTLIES_RSYNC_HOST_KEY }}
- - run: tree repo
- - uses: r-lib/actions/setup-r@v2
- - name: Build Repository
- shell: Rscript {0}
- run: |
- # folder that we sync to nightlies.apache.org
- repo_root <- "repo"
- # The binaries are in a nested dir
- # so we need to find the correct path.
- art_path <- list.files("binaries",
- recursive = TRUE,
- include.dirs = TRUE,
- pattern = "r-binary-packages$",
- full.names = TRUE
- )
-
- current_path <- list.files(art_path, full.names = TRUE, recursive = TRUE)
- files <- sub("r-(pkg|lib)", repo_root, current_path)
-
- # decode contrib.url from artifact name:
- # bin__windows__contrib__4.1 -> bin/windows/contrib/4.1
- new_paths <- gsub("__", "/", files)
- # strip superfluous nested dirs
- new_paths <- sub(art_path, ".", new_paths)
- dirs <- dirname(new_paths)
- sapply(dirs, dir.create, recursive = TRUE, showWarnings = FALSE)
-
- # overwrite allows us to "force push" a new version with the same name
- copy_result <- file.copy(current_path, new_paths, overwrite = TRUE)
-
- if (!all(copy_result)) {
- stop("There was an issue while copying the files!")
- }
- - name: Prune Repository
- shell: bash
- env:
- KEEP: ${{ github.event.inputs.keep || 14 }}
- run: |
- prune() {
- # list files | retain $KEEP newest files | delete everything else
- ls -t $1/arrow* | tail -n +$((KEEP + 1)) | xargs --no-run-if-empty rm
- }
-
- # find leaf sub dirs
- repo_dirs=$(find repo -type d -links 2)
-
- # We want to retain $keep (14) versions of each pkg/lib so we call
- # prune on each leaf dir and not on repo/.
- for dir in ${repo_dirs[@]}; do
- prune $dir
- done
- - name: Update Repository Index
- shell: Rscript {0}
- run: |
- # folder that we sync to nightlies.apache.org
- repo_root <- "repo"
- tools::write_PACKAGES(file.path(repo_root, "src/contrib"),
- type = "source",
- verbose = TRUE,
- latestOnly = FALSE
- )
-
- repo_dirs <- list.dirs(repo_root)
- # find dirs with binary R packages: e.g. */contrib/4.1
- pkg_dirs <- grep(".+contrib\\/\\d.+", repo_dirs, value = TRUE)
-
-
- for (dir in pkg_dirs) {
- on_win <- grepl("windows", dir)
- tools::write_PACKAGES(dir,
- type = ifelse(on_win, "win.binary", "mac.binary"),
- verbose = TRUE,
- latestOnly = FALSE
- )
- }
- - name: Show repo contents
- run: tree repo
- - name: Sync to Remote
- uses: ./arrow/.github/actions/sync-nightlies
- with:
- upload: true
- switches: -avzh --update --delete --progress
- local_path: repo
- remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/arrow/r
- remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
- remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
- remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }}
- remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
- remote_host_key: ${{ secrets.NIGHTLIES_RSYNC_HOST_KEY }}
+ with:
+ cache: 'pip'
+ python-version: 3.12
+ - name: Install Archery
+ shell: bash
+ run: pip install -e arrow/dev/archery[all]
+ - run: mkdir -p binaries
+ - name: Download Artifacts
+ env:
+ PREFIX: ${{ github.event.inputs.prefix || ''}}
+ run: |
+ if [ -z $PREFIX ]; then
+ PREFIX=nightly-packaging-$(date +%Y-%m-%d)-0
+ fi
+ echo $PREFIX
+
+ archery crossbow download-artifacts -f r-binary-packages -t binaries $PREFIX
+
+ if [ -n "$(ls -A binaries/*/*/)" ]; then
+ echo "Found files!"
+ else
+ echo "No files found. Stopping upload."
+ exit 1
+ fi
+ - name: Cache Repo
+ uses: actions/cache@v4
+ with:
+ path: repo
+ key: r-nightly-${{ github.run_id }}
+ restore-keys: r-nightly-
+ - name: Sync from Remote
+ uses: ./arrow/.github/actions/sync-nightlies
+ with:
+ switches: -avzh --update --delete --progress
+ local_path: repo
+ remote_path: ${{ secrets.NIGHTLIES_RSYNC_PATH }}/arrow/r
+ remote_host: ${{ secrets.NIGHTLIES_RSYNC_HOST }}
+ remote_port: ${{ secrets.NIGHTLIES_RSYNC_PORT }}
+ remote_user: ${{ secrets.NIGHTLIES_RSYNC_USER }}
+ remote_key: ${{ secrets.NIGHTLIES_RSYNC_KEY }}
+ remote_host_key: ${{ secrets.NIGHTLIES_RSYNC_HOST_KEY }}
+ - run: tree repo
+ - uses: r-lib/actions/setup-r@v2
+ - name: Build Repository
+ shell: Rscript {0}
+ run: |
+ # folder that we sync to nightlies.apache.org
+ repo_root <- "repo"
+ # The binaries are in a nested dir
+ # so we need to find the correct path.
+ art_path <- list.files("binaries",
+ recursive = TRUE,
+ include.dirs = TRUE,
+ pattern = "r-binary-packages$",
+ full.names = TRUE
+ )
+
+ current_pkg_path <- list.files(art_path,
+ full.names = TRUE,
+ pattern = "r-pkg",
+ recursive = TRUE
+ )
+ current_lib_path <- list.files(art_path,
+ full.names = TRUE,
+ pattern = "r-lib",
+ recursive = TRUE
+ )
+ files <- c(
+ sub("r-pkg", repo_root, current_pkg_path),
+ sub("r-lib", paste0(repo_root, "__r-lib"), current_lib_path),
+ )
+
+ # decode contrib.url from artifact name:
+ # bin__windows__contrib__4.1 -> bin/windows/contrib/4.1
+ new_paths <- gsub("__", "/", files)
+ # strip superfluous nested dirs
+ new_paths <- sub(art_path, ".", new_paths)
+ dirs <- dirname(new_paths)
+ sapply(dirs, dir.create, recursive = TRUE, showWarnings = FALSE)
+
+ # overwrite allows us to "force push" a new version with the same name
+ copy_result <- file.copy(current_path, new_paths, overwrite = TRUE)
+
+ if (!all(copy_result)) {
+ stop("There was an issue while copying the files!")
+ }
+ - name: Prune Repository
+ shell: bash
+ env:
+ KEEP: ${{ github.event.inputs.keep || 14 }}
+ run: |
+ prune() {
+ # list files | retain $KEEP newest files | delete everything else
+ ls -t "$@" | tail -n +$((KEEP + 1)) | xargs --no-run-if-empty rm
+ }
+
+ # find leaf sub dirs
+ repo_dirs=$(find repo -type d -links 2)
+
+ # Old packages: repo/libarrow/bin/${TARGET}/arrow-${VERSION}.zip
+ #
+ # We want to retain $keep (14) versions of each pkg/lib so we call
+ # prune on each leaf dir and not on repo/.
+ for dir in "${repo_dirs[@]}"; do
+ prune $dir/arrow*
+ done
+
+ # New packages: repo/libarrow/${TARGET}-arrow-${VERSION}.zip
+ prune repo/libarrow/r-libarrow-darwin-arm64-openssl-1.1-* || :
Review Comment:
TIL what `|| :` does. I think I've used `|| true` or the like for similar behavior elsewhere. Out of curiosity: is one better / more compatible / more idiomatic than the other?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47704: [R] Update paths in nightly libarrow upload job [arrow]
Posted by "kou (via GitHub)" <gi...@apache.org>.
kou commented on PR #47727:
URL: https://github.com/apache/arrow/pull/47727#issuecomment-3374986162
This unifies new line style (mixing CR LF and LF only -> LF only). Please use `w=1`, sorry: https://github.com/apache/arrow/pull/47727/files?w=1
Can we test this without merge...? Do we need to merge to main to test this...?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-47704: [R] Update paths in nightly libarrow upload job [arrow]
Posted by "thisisnic (via GitHub)" <gi...@apache.org>.
thisisnic merged PR #47727:
URL: https://github.com/apache/arrow/pull/47727
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org