You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by li...@apache.org on 2022/10/28 20:49:40 UTC

[arrow-adbc] branch main updated: ci(c/driver_manager,c/driver/postgres): make wheel upload more robust (#158)

This is an automated email from the ASF dual-hosted git repository.

lidavidm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git


The following commit(s) were added to refs/heads/main by this push:
     new 0f021fb  ci(c/driver_manager,c/driver/postgres): make wheel upload more robust (#158)
0f021fb is described below

commit 0f021fb62e0350f98f6373f65708a291651c5142
Author: David Li <li...@gmail.com>
AuthorDate: Fri Oct 28 16:49:36 2022 -0400

    ci(c/driver_manager,c/driver/postgres): make wheel upload more robust (#158)
---
 .github/workflows/packaging-wheels.yml | 16 +---------------
 ci/scripts/python_wheel_upload.sh      | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+), 15 deletions(-)

diff --git a/.github/workflows/packaging-wheels.yml b/.github/workflows/packaging-wheels.yml
index dc89219..954b961 100644
--- a/.github/workflows/packaging-wheels.yml
+++ b/.github/workflows/packaging-wheels.yml
@@ -78,20 +78,6 @@ jobs:
         shell: bash
         if: github.ref == 'refs/heads/main' && (github.event.schedule || github.event.inputs.upload_wheels)
         run: |
-          path=$(ls python/adbc_driver_manager/repaired_wheels/*.whl)
-          response_code=$(curl --silent -o output.txt -w '%{http_code}' -F "package=@${path}" https://${GEMFURY_PUSH_TOKEN}@push.fury.io/arrow-adbc-nightlies/)
-          if [[ $response_code -ge 300 ]]; then
-            cat output.txt
-            exit 1
-          fi
-
-          sleep 1
-
-          path=$(ls python/adbc_driver_postgres/repaired_wheels/*.whl)
-          response_code=$(curl --silent -o output.txt -w '%{http_code}' -F "package=@${path}" https://${GEMFURY_PUSH_TOKEN}@push.fury.io/arrow-adbc-nightlies/)
-          if [[ $response_code -ge 300 ]]; then
-            cat output.txt
-            exit 1
-          fi
+          ./ci/scripts/python_wheel_upload.sh python/adbc_driver_{manager,postgres}/repaired_wheels/*.whl
         env:
           GEMFURY_PUSH_TOKEN: ${{ secrets.GEMFURY_PUSH_TOKEN }}
diff --git a/ci/scripts/python_wheel_upload.sh b/ci/scripts/python_wheel_upload.sh
new file mode 100755
index 0000000..8b62aed
--- /dev/null
+++ b/ci/scripts/python_wheel_upload.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+main() {
+    touch curl_output.txt
+    for wheel in "$@"
+    do
+        echo "==== Uploading $wheel"
+        local response_code=$(curl \
+                                  --silent \
+                                  -o curl_output.txt \
+                                  -w '%{http_code}' \
+                                  -F "package=@${wheel}" \
+                                  https://${GEMFURY_PUSH_TOKEN}@push.fury.io/arrow-adbc-nightlies/)
+        cat curl_output.txt
+        if [[ $response_code -eq 409 ]]; then
+            # Ignore the failure, since we build 'none' wheels, we may have duplicate wheels across pipelines
+            true
+        elif [[ $response_code -ge 300 ]]; then
+            exit 1
+        fi
+    done
+}
+
+main "$@"