OpenRAG is a comprehensive, single package Retrieval-Augmented Generation platform built on Langflow, Docling, and Opensearch.
Python
feat: added nightly build workflow (#1156)
Lucas Oliveira91525c0b843c
diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.ymlnew file mode 100644index 000000000..72d7a77ec--- /dev/null+++ b/.github/workflows/nightly-build.yml@@ -0,0 +1,182 @@+name: Nightly Docker Build++on:+ schedule:+ # Runs daily at 04:00 UTC+ - cron: '0 4 * * *'+ workflow_dispatch:++jobs:+ check-version:+ if: github.repository == 'langflow-ai/openrag'+ runs-on: ubuntu-latest+ outputs:+ nightly_version: ${{ steps.vars.outputs.nightly_version }}+ steps:+ - name: Determine Nightly Version+ id: vars+ run: |+ DATE_PART=$(date -u +%y%m%d)+ # Use the GitHub run number to create a unique, auto-incrementing suffix+ NIGHTLY_VERSION="nightly-${DATE_PART}.${{ github.run_number }}.${{ github.run_attempt }}"+ echo "nightly_version=$NIGHTLY_VERSION" >> "$GITHUB_OUTPUT"+ echo "Nightly version: $NIGHTLY_VERSION"++ build:+ needs: check-version+ strategy:+ fail-fast: false+ matrix:+ include:+ # backend+ - image: backend+ file: ./Dockerfile.backend+ service: openrag-backend+ platform: linux/amd64+ arch: amd64+ runs-on: ubuntu-latest+ - image: backend+ file: ./Dockerfile.backend+ service: openrag-backend+ platform: linux/arm64+ arch: arm64+ runs-on: [self-hosted, Linux, ARM64, langflow-ai-arm64-40gb-ephemeral]++ # frontend+ - image: frontend+ file: ./Dockerfile.frontend+ service: openrag-frontend+ platform: linux/amd64+ arch: amd64+ runs-on: ubuntu-latest+ - image: frontend+ file: ./Dockerfile.frontend+ service: openrag-frontend+ platform: linux/arm64+ arch: arm64+ runs-on: [self-hosted, Linux, ARM64, langflow-ai-arm64-40gb-ephemeral]++ # langflow+ - image: langflow+ file: ./Dockerfile.langflow+ service: openrag-langflow+ platform: linux/amd64+ arch: amd64+ runs-on: ubuntu-latest+ - image: langflow+ file: ./Dockerfile.langflow+ service: openrag-langflow+ platform: linux/arm64+ arch: arm64+ runs-on: [self-hosted, Linux, ARM64, langflow-ai-arm64-40gb-ephemeral]+++ runs-on: ${{ matrix.runs-on }}+ steps:+ - name: Checkout+ uses: actions/checkout@v4++ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3++ - name: Login to Docker Hub+ uses: docker/login-action@v3+ with:+ username: ${{ secrets.DOCKER_USERNAME }}+ password: ${{ secrets.DOCKER_PASSWORD }}++ - name: Build and push ${{ matrix.image }} (${{ matrix.arch }})+ uses: docker/build-push-action@v6+ with:+ context: .+ file: ${{ matrix.file }}+ platforms: ${{ matrix.platform }}+ push: true+ tags: ${{ secrets.DOCKER_NAMESPACE }}/${{ matrix.service }}:${{ needs.check-version.outputs.nightly_version }}-${{ matrix.arch }}+ cache-from: type=gha,scope=nightly-${{ matrix.image }}-${{ matrix.arch }}+ cache-to: type=gha,mode=max,scope=nightly-${{ matrix.image }}-${{ matrix.arch }}++ - name: Record built service+ run: |+ echo "${{ matrix.service }}" > service-${{ matrix.service }}-${{ matrix.arch }}.txt++ - name: Upload built service artifact+ uses: actions/upload-artifact@v4+ with:+ name: built-service-${{ matrix.service }}-${{ matrix.arch }}+ path: service-${{ matrix.service }}-${{ matrix.arch }}.txt++ manifest:+ needs: [build, check-version]+ runs-on: ubuntu-latest+ steps:+ - name: Download built service artifacts+ uses: actions/download-artifact@v4+ with:+ pattern: built-service-*+ merge-multiple: true++ - name: Login to Docker Hub+ uses: docker/login-action@v3+ with:+ username: ${{ secrets.DOCKER_USERNAME }}+ password: ${{ secrets.DOCKER_PASSWORD }}++ - name: Create and push multi-arch manifests+ run: |+ NS=${{ secrets.DOCKER_NAMESPACE }}+ VERSION=${{ needs.check-version.outputs.nightly_version }}++ # Derive the list of services from the artifacts produced by the build matrix+ mapfile -t SERVICES < <(find . -name 'service-*.txt' -print0 | xargs -0 cat | sort -u)++ for SVC in "${SERVICES[@]}"; do+ echo "Creating manifest for $SVC..."++ # Create versioned multi-arch manifest+ docker buildx imagetools create -t $NS/$SVC:$VERSION \+ $NS/$SVC:$VERSION-amd64 \+ $NS/$SVC:$VERSION-arm64++ # Update floating nightly tag+ docker buildx imagetools create -t $NS/$SVC:nightly \+ $NS/$SVC:$VERSION-amd64 \+ $NS/$SVC:$VERSION-arm64+ done+ publish-pypi:+ needs: [check-version]+ runs-on: ubuntu-latest+ if: github.repository == 'langflow-ai/openrag'+ steps:+ - name: Checkout+ uses: actions/checkout@v4++ - name: Set up Python+ uses: actions/setup-python@v6+ with:+ python-version: '3.13'++ - name: Install uv+ uses: astral-sh/setup-uv@v3++ - name: Update version for nightly+ run: |+ python3 -c "+ import re+ with open('pyproject.toml', 'r') as f:+ content = f.read()+ # Append .dev + run_number + run_attempt to the version (PEP 440 compliant and unique per attempt)+ new_content = re.sub(r'^version = \"([^\"]+)\"', r'version = \"\1.dev${{ github.run_number }}${{ github.run_attempt }}\"', content, flags=re.M)+ with open('pyproject.toml', 'w') as f:+ f.write(new_content)+ "++ - name: Build wheel and source distribution+ run: |+ uv build++ - name: Publish to PyPI+ run: |+ uv publish+ env:+ UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN }}