diff --git a/.github/workflows/build-langflow-responses.yml b/.github/workflows/build-langflow-responses.yml deleted file mode 100644 index 0f9d3d08..00000000 --- a/.github/workflows/build-langflow-responses.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: Build Langflow Responses Multi-Arch - -on: - workflow_dispatch: - -jobs: - build: - strategy: - fail-fast: false - matrix: - include: - - platform: linux/amd64 - arch: amd64 - runs-on: ubuntu-latest - - platform: linux/arm64 - arch: arm64 - runs-on: [self-hosted, linux, ARM64, langflow-ai-arm64-2] - - 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 langflow (${{ matrix.arch }}) - uses: docker/build-push-action@v5 - with: - context: . - file: ./Dockerfile.langflow - platforms: ${{ matrix.platform }} - push: true - tags: phact/langflow:responses-${{ matrix.arch }} - cache-from: type=gha,scope=langflow-responses-${{ matrix.arch }} - cache-to: type=gha,mode=max,scope=langflow-responses-${{ matrix.arch }} - - manifest: - needs: build - runs-on: ubuntu-latest - steps: - - 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 manifest - run: | - docker buildx imagetools create -t phact/langflow:responses \ - phact/langflow:responses-amd64 \ - phact/langflow:responses-arm64 \ No newline at end of file diff --git a/.github/workflows/build-multiarch.yml b/.github/workflows/build-multiarch.yml index 620bcf3b..64c13b91 100644 --- a/.github/workflows/build-multiarch.yml +++ b/.github/workflows/build-multiarch.yml @@ -1,16 +1,95 @@ -name: Build Multi-Architecture Docker Images +name: Release + Docker Images (multi-arch) on: + push: + branches: + - main + paths: + - 'pyproject.toml' workflow_dispatch: - inputs: - update_latest: - description: 'Update latest tags (production release)' - required: false - default: false - type: boolean jobs: + build-python-packages: + runs-on: ubuntu-latest + outputs: + skip_release: ${{ steps.version.outputs.skip_release }} + version: ${{ steps.version.outputs.version }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.13' + + - name: Install uv + uses: astral-sh/setup-uv@v3 + + - name: Extract version from pyproject.toml + id: version + run: | + VERSION=$(grep '^version = ' pyproject.toml | cut -d '"' -f 2) + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "Version: $VERSION" + + # Check if tag already exists + if git rev-parse "v$VERSION" >/dev/null 2>&1; then + echo "Tag v$VERSION already exists, skipping release" + echo "skip_release=true" >> $GITHUB_OUTPUT + exit 0 + fi + echo "skip_release=false" >> $GITHUB_OUTPUT + + # Check if version is numeric (e.g., 0.1.16) vs prerelease (e.g., 0.1.16-rc1) + if [[ "$VERSION" =~ ^[0-9.-]+$ ]]; then + echo "is_prerelease=false" >> $GITHUB_OUTPUT + echo "Release type: Production" + else + echo "is_prerelease=true" >> $GITHUB_OUTPUT + echo "Release type: Prerelease" + fi + + - name: Build wheel and source distribution + if: steps.version.outputs.skip_release != 'true' + run: | + uv build + + - name: List built artifacts + if: steps.version.outputs.skip_release != 'true' + run: | + ls -la dist/ + echo "Built artifacts:" + for file in dist/*; do + echo " - $(basename $file) ($(stat -c%s $file | numfmt --to=iec-i)B)" + done + + - name: Upload build artifacts + if: steps.version.outputs.skip_release != 'true' + uses: actions/upload-artifact@v4 + with: + name: python-packages + path: dist/ + retention-days: 30 + + - name: Create Release + if: steps.version.outputs.skip_release != 'true' + uses: softprops/action-gh-release@v2 + with: + tag_name: v${{ steps.version.outputs.version }} + name: Release ${{ steps.version.outputs.version }} + draft: false + prerelease: ${{ steps.version.outputs.is_prerelease }} + generate_release_notes: true + files: | + dist/*.whl + dist/*.tar.gz + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + build: + needs: build-python-packages + if: needs.build-python-packages.outputs.skip_release != 'true' strategy: fail-fast: false matrix: @@ -106,9 +185,9 @@ jobs: cache-to: type=gha,mode=max,scope=${{ matrix.image }}-${{ matrix.arch }} manifest: - needs: build + needs: [build, build-python-packages] runs-on: ubuntu-latest - if: github.event_name != 'pull_request' + if: github.event_name != 'pull_request' && needs.build-python-packages.outputs.skip_release != 'true' steps: - name: Checkout uses: actions/checkout@v4 @@ -146,8 +225,8 @@ jobs: phact/openrag-opensearch:$VERSION-amd64 \ phact/openrag-opensearch:$VERSION-arm64 - # Only update latest tags if version is numeric AND checkbox is checked - if [[ "$VERSION" =~ ^[0-9.-]+$ ]] && [[ "${{ github.event.inputs.update_latest }}" == "true" ]]; then + # Only update latest tags if version is numeric + if [[ "$VERSION" =~ ^[0-9.-]+$ ]]; then echo "Updating latest tags for production release: $VERSION" docker buildx imagetools create -t phact/openrag-backend:latest \ phact/openrag-backend:$VERSION-amd64 \ @@ -165,5 +244,5 @@ jobs: phact/openrag-opensearch:$VERSION-amd64 \ phact/openrag-opensearch:$VERSION-arm64 else - echo "Skipping latest tags - version: $VERSION, update_latest: ${{ github.event.inputs.update_latest }}" + echo "Skipping latest tags - version: $VERSION (not numeric)" fi diff --git a/.gitignore b/.gitignore index 484db58d..625097a6 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,8 @@ wheels/ 1001*.pdf *.json !flows/*.json +!src/tui/_assets/flows/*.json +!src/tui/_assets/flows/components/*.json .DS_Store config/ diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..d0f089fc --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +recursive-include src/tui/_assets * \ No newline at end of file diff --git a/docs/docs/core-components/agents.mdx b/docs/docs/core-components/agents.mdx index 3ee4617b..7e3548dc 100644 --- a/docs/docs/core-components/agents.mdx +++ b/docs/docs/core-components/agents.mdx @@ -34,11 +34,11 @@ In an agentic context, tools are functions that the agent can run to perform tas -## Use the OpenRAG OpenSearch Agent flow +## Use the OpenRAG OpenSearch Agent flow {#flow} If you've chatted with your knowledge in OpenRAG, you've already experienced the OpenRAG OpenSearch Agent chat flow. To switch OpenRAG over to the [Langflow visual editor](https://docs.langflow.org/concepts-overview) and view the OpenRAG OpenSearch Agentflow, click