Publish Faiss Snapshot #63
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ################################################################################ | |
| # 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: Publish Faiss Snapshot | |
| on: | |
| schedule: | |
| # At the end of every day | |
| - cron: '0 1 * * *' | |
| workflow_dispatch: | |
| push: | |
| paths: | |
| - 'paimon-faiss/**' | |
| branches: | |
| - master | |
| env: | |
| JDK_VERSION: 8 | |
| MAVEN_OPTS: -Dmaven.wagon.httpconnectionManager.ttlSeconds=30 -Dmaven.wagon.http.retryHandler.requestSentEnabled=true | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.number || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| # Build native library for Linux AMD64 | |
| build-native-linux-amd64: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up JDK ${{ env.JDK_VERSION }} | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: ${{ env.JDK_VERSION }} | |
| distribution: 'temurin' | |
| - name: Build FAISS native library | |
| uses: ./.github/actions/build-faiss-native | |
| with: | |
| platform: linux-amd64 | |
| - name: Upload native library | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: native-linux-amd64 | |
| path: paimon-faiss/paimon-faiss-jni/src/main/resources/linux/amd64/ | |
| retention-days: 1 | |
| # Build native library for Linux AARCH64 | |
| build-native-linux-aarch64: | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up JDK ${{ env.JDK_VERSION }} | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: ${{ env.JDK_VERSION }} | |
| distribution: 'temurin' | |
| - name: Build FAISS native library | |
| uses: ./.github/actions/build-faiss-native | |
| with: | |
| platform: linux-aarch64 | |
| - name: Upload native library | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: native-linux-aarch64 | |
| path: paimon-faiss/paimon-faiss-jni/src/main/resources/linux/aarch64/ | |
| retention-days: 1 | |
| # Build native library for macOS ARM (Apple Silicon) | |
| build-native-macos-arm: | |
| runs-on: macos-14 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up JDK ${{ env.JDK_VERSION }} | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: ${{ env.JDK_VERSION }} | |
| distribution: 'zulu' | |
| - name: Build FAISS native library | |
| uses: ./.github/actions/build-faiss-native | |
| with: | |
| platform: darwin-aarch64 | |
| use-homebrew: 'true' | |
| - name: Upload native library | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: native-darwin-aarch64 | |
| path: paimon-faiss/paimon-faiss-jni/src/main/resources/darwin/aarch64/ | |
| retention-days: 1 | |
| # Package and publish | |
| package-and-publish: | |
| if: github.repository == 'apache/paimon' | |
| needs: [build-native-linux-amd64, build-native-linux-aarch64, build-native-macos-arm] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up JDK ${{ env.JDK_VERSION }} | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: ${{ env.JDK_VERSION }} | |
| distribution: 'zulu' | |
| - name: Download Linux AMD64 native library | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: native-linux-amd64 | |
| path: paimon-faiss/paimon-faiss-jni/src/main/resources/linux/amd64/ | |
| - name: Download Linux AARCH64 native library | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: native-linux-aarch64 | |
| path: paimon-faiss/paimon-faiss-jni/src/main/resources/linux/aarch64/ | |
| - name: Download macOS ARM native library | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: native-darwin-aarch64 | |
| path: paimon-faiss/paimon-faiss-jni/src/main/resources/darwin/aarch64/ | |
| - name: List all native libraries | |
| run: | | |
| echo "=== All native libraries ===" | |
| find paimon-faiss/paimon-faiss-jni/src/main/resources -type f \( -name "*.so" -o -name "*.so.*" -o -name "*.dylib" \) -exec ls -la {} \; | |
| - name: Cache local Maven repository | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.m2/repository | |
| key: faiss-snapshot-maven-${{ hashFiles('**/pom.xml') }} | |
| restore-keys: | | |
| faiss-snapshot-maven- | |
| - name: Build and package paimon-faiss-jni | |
| run: | | |
| mvn -B -ntp clean install -pl paimon-faiss/paimon-faiss-jni -am -DskipTests -Ppaimon-faiss -Drat.skip | |
| - name: Build and package paimon-faiss-index | |
| run: | | |
| mvn -B -ntp clean install -pl paimon-faiss/paimon-faiss-index -am -DskipTests -Ppaimon-faiss -Drat.skip | |
| - name: Publish snapshot | |
| env: | |
| ASF_USERNAME: ${{ secrets.NEXUS_USER }} | |
| ASF_PASSWORD: ${{ secrets.NEXUS_PW }} | |
| MAVEN_OPTS: -Xmx4096m | |
| run: | | |
| tmp_settings="tmp-settings.xml" | |
| echo "<settings><servers><server>" > $tmp_settings | |
| echo "<id>apache.snapshots.https</id><username>$ASF_USERNAME</username>" >> $tmp_settings | |
| echo "<password>$ASF_PASSWORD</password>" >> $tmp_settings | |
| echo "</server></servers></settings>" >> $tmp_settings | |
| mvn --settings $tmp_settings -ntp deploy -pl paimon-faiss/paimon-faiss-jni,paimon-faiss/paimon-faiss-index -Dgpg.skip -Drat.skip -DskipTests -Ppaimon-faiss | |
| rm $tmp_settings | |