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/11/10 15:19:01 UTC
[arrow-adbc] branch main updated: ci(java): add nightly JAR build (#171)
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 565741f ci(java): add nightly JAR build (#171)
565741f is described below
commit 565741f95d2416551ed9662426d932747b90bf4c
Author: David Li <li...@gmail.com>
AuthorDate: Thu Nov 10 10:18:56 2022 -0500
ci(java): add nightly JAR build (#171)
---
.env | 2 +
.github/workflows/packaging-wheels.yml | 47 +++++++++++++++++----
docker-compose.yml => ci/scripts/java_build.sh | 24 +++--------
ci/scripts/java_jar_upload.sh | 57 ++++++++++++++++++++++++++
docker-compose.yml => ci/scripts/java_test.sh | 24 +++--------
docker-compose.yml | 12 +++++-
java/pom.xml | 13 ++++++
7 files changed, 132 insertions(+), 47 deletions(-)
diff --git a/.env b/.env
index dc3d7b7..85a09dc 100644
--- a/.env
+++ b/.env
@@ -27,7 +27,9 @@ ARCH_ALIAS=x86_64
ARCH_SHORT=amd64
# Default versions for various dependencies
+JDK=8
MANYLINUX=2014
+MAVEN=3.5.4
PYTHON=3.8
# Used through docker-compose.yml and serves as the default version for the
diff --git a/.github/workflows/packaging-wheels.yml b/.github/workflows/packaging-wheels.yml
index 696248e..b7b27de 100644
--- a/.github/workflows/packaging-wheels.yml
+++ b/.github/workflows/packaging-wheels.yml
@@ -15,21 +15,50 @@
# specific language governing permissions and limitations
# under the License.
-name: Packaging - Python Wheels
+name: Packaging - Nightly Artifacts
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
inputs:
- upload_wheels:
- description: "Upload wheels to Gemfury"
+ upload_artifacts:
+ description: "Upload artifacts to Gemfury"
required: true
type: boolean
default: false
jobs:
- manylinux:
+ java:
+ name: "Java 1.8"
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ fetch-depth: 0
+ persist-credentials: false
+
+ - name: Show inputs
+ shell: bash
+ run: |
+ echo "upload_artifacts: ${{ github.event.inputs.upload_artifacts }}"
+ echo "schedule: ${{ github.event.schedule }}"
+ echo "ref: ${{ github.ref }}"
+
+ - name: Build and test
+ shell: bash
+ run: |
+ docker-compose run java-jars
+
+ - name: Upload JARs to Gemfury
+ shell: bash
+ if: github.ref == 'refs/heads/main' && (github.event.schedule || github.event.inputs.upload_artifacts == true)
+ run: |
+ ./ci/scripts/java_jar_upload.sh java/
+ env:
+ GEMFURY_PUSH_TOKEN: ${{ secrets.GEMFURY_PUSH_TOKEN }}
+
+ python-manylinux:
name: "Python ${{ matrix.python_version }} manylinux${{ matrix.manylinux_version }}"
runs-on: ubuntu-latest
strategy:
@@ -47,7 +76,7 @@ jobs:
- name: Show inputs
shell: bash
run: |
- echo "upload_wheels: ${{ github.event.inputs.upload_wheels }}"
+ echo "upload_artifacts: ${{ github.event.inputs.upload_artifacts }}"
echo "schedule: ${{ github.event.schedule }}"
echo "ref: ${{ github.ref }}"
@@ -76,13 +105,13 @@ jobs:
- name: Upload wheels to Gemfury
shell: bash
- if: github.ref == 'refs/heads/main' && (github.event.schedule || github.event.inputs.upload_wheels == 'true')
+ if: github.ref == 'refs/heads/main' && (github.event.schedule || github.event.inputs.upload_artifacts == true)
run: |
./ci/scripts/python_wheel_upload.sh python/adbc_driver_{manager,postgres}/repaired_wheels/*.whl
env:
GEMFURY_PUSH_TOKEN: ${{ secrets.GEMFURY_PUSH_TOKEN }}
- macos:
+ python-macos:
name: "Python ${{ matrix.python_version }} macOS"
runs-on: macos-latest
strategy:
@@ -107,7 +136,7 @@ jobs:
- name: Show inputs
shell: bash
run: |
- echo "upload_wheels: ${{ github.event.inputs.upload_wheels }}"
+ echo "upload_artifacts: ${{ github.event.inputs.upload_artifacts }}"
echo "schedule: ${{ github.event.schedule }}"
echo "ref: ${{ github.ref }}"
@@ -154,7 +183,7 @@ jobs:
- name: Upload wheels to Gemfury
shell: bash
- if: github.ref == 'refs/heads/main' && (github.event.schedule || github.event.inputs.upload_wheels == 'true')
+ if: github.ref == 'refs/heads/main' && (github.event.schedule || github.event.inputs.upload_artifacts == true)
run: |
./ci/scripts/python_wheel_upload.sh python/adbc_driver_{manager,postgres}/dist/*.whl
env:
diff --git a/docker-compose.yml b/ci/scripts/java_build.sh
old mode 100644
new mode 100755
similarity index 54%
copy from docker-compose.yml
copy to ci/scripts/java_build.sh
index 370e87a..3a68ebd
--- a/docker-compose.yml
+++ b/ci/scripts/java_build.sh
@@ -1,3 +1,4 @@
+#!/usr/bin/env bash
# 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
@@ -15,25 +16,12 @@
# specific language governing permissions and limitations
# under the License.
-version: '3.5'
+set -ex
-x-hierarchy:
- - python-wheel-manylinux-2014
+source_dir=${1}
-services:
- ############################ Python wheels ##################################
+pushd ${source_dir}/java
- # These reuse Arrow's images for simplicity. You won't be able to
- # build the image from here.
+mvn -B -DskipTests -T 2C install
- python-wheel-manylinux:
- image: ${REPO}:${ARCH}-python-${PYTHON}-wheel-manylinux-${MANYLINUX}-vcpkg-${VCPKG}
- volumes:
- - .:/adbc:delegated
- command: "'/adbc/ci/scripts/python_wheel_unix_build.sh x86_64 /adbc /adbc/build'"
-
- python-wheel-manylinux-test:
- image: ${ARCH}/python:${PYTHON}
- volumes:
- - .:/adbc:delegated
- command: /adbc/ci/scripts/python_wheel_unix_test.sh /adbc
+popd
diff --git a/ci/scripts/java_jar_upload.sh b/ci/scripts/java_jar_upload.sh
new file mode 100755
index 0000000..cd2a9d7
--- /dev/null
+++ b/ci/scripts/java_jar_upload.sh
@@ -0,0 +1,57 @@
+#!/usr/bin/env bash
+# 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.
+
+set -ex
+
+main() {
+ local -r source_dir="${1}"
+ local settings_file=$(mktemp adbc.settingsXXXXXXXX.xml --tmpdir)
+ trap 'rm -f "$settings_file"' ERR EXIT INT TERM
+
+ pushd "${source_dir}/java"
+
+ cat <<SETTINGS > "${settings_file}"
+<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
+ <servers>
+ <server>
+ <id>fury</id>
+ <username>${GEMFURY_PUSH_TOKEN}</username>
+ <password>NOPASS</password>
+ <configuration>
+ <httpConfiguration>
+ <all>
+ <usePreemptive>true</usePreemptive>
+ </all>
+ </httpConfiguration>
+ </configuration>
+ </server>
+ </servers>
+</settings>
+SETTINGS
+
+ mvn \
+ -Dmaven.install.skip=true \
+ --settings "${settings_file}" \
+ deploy
+
+ popd
+}
+
+main "$@"
diff --git a/docker-compose.yml b/ci/scripts/java_test.sh
old mode 100644
new mode 100755
similarity index 54%
copy from docker-compose.yml
copy to ci/scripts/java_test.sh
index 370e87a..dec1826
--- a/docker-compose.yml
+++ b/ci/scripts/java_test.sh
@@ -1,3 +1,4 @@
+#!/usr/bin/env bash
# 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
@@ -15,25 +16,12 @@
# specific language governing permissions and limitations
# under the License.
-version: '3.5'
+set -ex
-x-hierarchy:
- - python-wheel-manylinux-2014
+source_dir=${1}
-services:
- ############################ Python wheels ##################################
+pushd ${source_dir}/java
- # These reuse Arrow's images for simplicity. You won't be able to
- # build the image from here.
+mvn -B test
- python-wheel-manylinux:
- image: ${REPO}:${ARCH}-python-${PYTHON}-wheel-manylinux-${MANYLINUX}-vcpkg-${VCPKG}
- volumes:
- - .:/adbc:delegated
- command: "'/adbc/ci/scripts/python_wheel_unix_build.sh x86_64 /adbc /adbc/build'"
-
- python-wheel-manylinux-test:
- image: ${ARCH}/python:${PYTHON}
- volumes:
- - .:/adbc:delegated
- command: /adbc/ci/scripts/python_wheel_unix_test.sh /adbc
+popd
diff --git a/docker-compose.yml b/docker-compose.yml
index 370e87a..343f689 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -21,11 +21,19 @@ x-hierarchy:
- python-wheel-manylinux-2014
services:
- ############################ Python wheels ##################################
-
# These reuse Arrow's images for simplicity. You won't be able to
# build the image from here.
+ ############################ Java JARs ######################################
+
+ java-jars:
+ image: ${ARCH}/maven:${MAVEN}-jdk-${JDK}
+ volumes:
+ - .:/adbc:delegated
+ command: "/bin/bash -c '/adbc/ci/scripts/java_build.sh /adbc && /adbc/ci/scripts/java_test.sh /adbc'"
+
+ ############################ Python wheels ##################################
+
python-wheel-manylinux:
image: ${REPO}:${ARCH}-python-${PYTHON}-wheel-manylinux-${MANYLINUX}-vcpkg-${VCPKG}
volumes:
diff --git a/java/pom.xml b/java/pom.xml
index 97a8968..a205735 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -61,6 +61,19 @@
</mailingList>
</mailingLists>
+ <distributionManagement>
+ <repository>
+ <id>fury</id>
+ <name>Fury</name>
+ <url>https://maven.fury.io/arrow-adbc-nightlies/</url>
+ </repository>
+ <snapshotRepository>
+ <id>fury</id>
+ <name>Fury</name>
+ <url>https://maven.fury.io/arrow-adbc-nightlies/</url>
+ </snapshotRepository>
+ </distributionManagement>
+
<issueManagement>
<system>Jira</system>
<url>https://issues.apache.org/jira/browse/arrow</url>