You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/07/01 00:20:39 UTC

[GitHub] [arrow] kou commented on a diff in pull request #13453: ARROW-16901: [R][CI] Prune R nightly builds

kou commented on code in PR #13453:
URL: https://github.com/apache/arrow/pull/13453#discussion_r911526028


##########
.github/workflows/r_nightly.yml:
##########
@@ -77,10 +86,47 @@ jobs:
             echo "No files found. Stopping upload."
             exit 1
           fi
+      - name: Cache Repo
+        uses: actions/cache@v3
+        with:
+          path: repo
+          key: r-nightly-${{ github.run_id }}
+          restore-keys: r-nightly-
+      - name: Sync from Remote
+        env:
+          RSYNC_PATH: repo
+          SSH_KEY: "${{ secrets.NIGHTLIES_RSYNC_KEY }}"
+          PORT: "${{ secrets.NIGHTLIES_RSYNC_PORT }}"
+          USER: "${{ secrets.NIGHTLIES_RSYNC_USER }}"
+          HOST: "${{ secrets.NIGHTLIES_RSYNC_HOST }}"
+          HOST_KEY: "${{ secrets.NIGHTLIES_RSYNC_HOST_KEY }}"
+          REMOTE_PATH: "${{ secrets.NIGHTLIES_RSYNC_PATH }}/arrow/r"
+        run: |
+            # Make SSH key available and add remote to known hosts
+            eval "$(ssh-agent)" > /dev/null
+            echo "$SSH_KEY" | tr -d '\r' | DISPLAY=1 ssh-add - >/dev/null
+            mkdir -p ~/.ssh
+            echo "$HOST_KEY" >> ~/.ssh/known_hosts
+
+            # strict errors
+            set -eu
+
+            # avzrh - archive mode, verbose, with compression, recurse into dirs, human readable numbers
+            # transfer only new files, delete files not in source, show progress info
+            RSYNC_SWITCHES="-avzrh --update --delete --progress"
+            # We have to use a custom remote shell to supply the port
+            RSH="ssh -p $PORT"
+            LOCAL_PATH="$GITHUB_WORKSPACE/$RSYNC_PATH"
+            DSN="$USER@$HOST"
+
+            # Deploy. It is important to append '/*' to the source path otherwise
+            # the entire source dir will be created as a sub dir in the destination
+            sh -c "rsync $RSYNC_SWITCHES -e '$RSH' $DSN:$REMOTE_PATH/* $LOCAL_PATH"
+      - run: tree repo

Review Comment:
   Thanks.
   Could you try `rsync -avzh --update --delete src/ dest`? (`/` is appended to `src`.)



##########
.github/actions/sync-nightlies/action.yml:
##########
@@ -0,0 +1,92 @@
+# 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: 'Sync nightlies'
+description: 'Sync files to and from nightlies.apache.org'
+inputs:
+  upload:
+    description: 'Sync from local to remote'
+    default: false
+    required: false
+  switches:
+    description: 'see rsync --help'
+    required: true
+  local_path:
+    description: 'The relative local path within $GITHUB_WORKSPACE'
+    required: true
+  remote_path:
+    description: 'The remote path incl. sub dirs e.g. {{secrets.path}}/arrow/r'
+    required: true
+  remote_host:
+    description: 'The remote host'
+    required: true
+  remote_port:
+    description: 'The remote port'
+    required: false
+    default: 22
+  remote_user:
+    description: 'The remote user'
+    required: true
+  remote_key:
+    description: 'The remote key'
+    required: true
+  remote_host_key:
+    description: 'The host key fot Stricthostkeychecking'

Review Comment:
   ```suggestion
       description: 'The host key for StrictHostKeyChecking'
   
   ```



##########
.github/actions/sync-nightlies/action.yml:
##########
@@ -0,0 +1,92 @@
+# 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: 'Sync nightlies'
+description: 'Sync files to and from nightlies.apache.org'
+inputs:
+  upload:
+    description: 'Sync from local to remote'
+    default: false
+    required: false
+  switches:
+    description: 'see rsync --help'
+    required: true
+  local_path:
+    description: 'The relative local path within $GITHUB_WORKSPACE'
+    required: true
+  remote_path:
+    description: 'The remote path incl. sub dirs e.g. {{secrets.path}}/arrow/r'
+    required: true
+  remote_host:
+    description: 'The remote host'
+    required: true
+  remote_port:
+    description: 'The remote port'
+    required: false
+    default: 22
+  remote_user:
+    description: 'The remote user'
+    required: true
+  remote_key:
+    description: 'The remote key'
+    required: true
+  remote_host_key:
+    description: 'The host key fot Stricthostkeychecking'
+    required: true
+
+runs:
+  using: "composite"
+  steps:
+    - name: Sync files
+      shell: bash
+      env:
+          SWITCHES: "${{ inputs.switches }}"
+          LOCAL_PATH: "${{ github.workspace}}/${{ inputs.local_path }}"

Review Comment:
   ```suggestion
             LOCAL_PATH: "${{ github.workspace }}/${{ inputs.local_path }}"
   
   ```



-- 
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