|
97 | 97 | # ENVIRONMENT secret on `agent-publish` (NOT a repo |
98 | 98 | # secret) so it is unreadable until the gate is |
99 | 99 | # approved. |
| 100 | +# R2_ACCESS_KEY_ID — R2 S3 credentials + account, from an R2 API token |
| 101 | +# R2_SECRET_ACCESS_KEY with Object Read & Write on the hub bucket |
| 102 | +# CLOUDFLARE_ACCOUNT_ID (Cloudflare → R2 → Manage R2 API Tokens). REQUIRED |
| 103 | +# for every release, not optional: the Linux sidecar |
| 104 | +# is past the Worker's request-body cap, so it is |
| 105 | +# PUT straight to R2 and published by reference. |
| 106 | +# Same ENVIRONMENT-secret placement as above. |
100 | 107 | # Variables: |
101 | 108 | # GAIA_HUB_BASE_URL — public Worker origin for downloads + the lock |
102 | 109 | # baseUrl. Default https://hub.amd-gaia.ai. |
@@ -381,8 +388,14 @@ jobs: |
381 | 388 | # rather than resolved from PyPI — the frozen binary must contain the |
382 | 389 | # ChatAgent this commit was developed against, not whatever is |
383 | 390 | # published. |
| 391 | + # |
| 392 | + # `rag` is required, not optional, in THIS lane: the agent's own |
| 393 | + # pyproject leaves it out because a wheel gets it from `gaia init` |
| 394 | + # into the active interpreter (#2358), and a frozen binary has no |
| 395 | + # interpreter to install into. Without it faiss/pypdf are absent, the |
| 396 | + # RAG tools still register, and document Q&A fails on every call. |
384 | 397 | uv pip install --python .venv-freeze \ |
385 | | - -e ".[api]" \ |
| 398 | + -e ".[api,rag]" \ |
386 | 399 | -e hub/agents/chat/python \ |
387 | 400 | -e hub/agents/gaia/python \ |
388 | 401 | pyinstaller |
@@ -625,7 +638,9 @@ jobs: |
625 | 638 | shell: bash |
626 | 639 | run: | |
627 | 640 | set -euo pipefail |
628 | | - uv pip install --system -e ".[api]" -e hub/agents/chat/python -e hub/agents/gaia/python pytest |
| 641 | + # Same extras as the freeze env: testing without `rag` would exercise |
| 642 | + # a dependency set no released binary ever has. |
| 643 | + uv pip install --system -e ".[api,rag]" -e hub/agents/chat/python -e hub/agents/gaia/python pytest |
629 | 644 |
|
630 | 645 | - name: Python tests (hub/agents/gaia/python/tests) |
631 | 646 | shell: bash |
@@ -692,7 +707,11 @@ jobs: |
692 | 707 | shell: bash |
693 | 708 | run: | |
694 | 709 | set -euo pipefail |
695 | | - python -m pip install --upgrade requests pyyaml |
| 710 | + # boto3 is not optional here: the Linux sidecar exceeds the Worker's |
| 711 | + # request-body cap, so it uploads over the S3 API. Without it the |
| 712 | + # publish dies on that artifact with the smaller platforms already |
| 713 | + # stored immutably. |
| 714 | + python -m pip install --upgrade requests pyyaml boto3 |
696 | 715 |
|
697 | 716 | # Re-run of the `version` job's gates AFTER the approval pause: the gate |
698 | 717 | # can sit for hours, and this job re-checks out the ref. Cheap insurance |
@@ -727,18 +746,33 @@ jobs: |
727 | 746 | echo "version=${VERSION}" >> "$GITHUB_OUTPUT" |
728 | 747 | echo "base_url=${GAIA_HUB_BASE_URL:-https://hub.amd-gaia.ai}/${HUB_PREFIX}/${VERSION}" >> "$GITHUB_OUTPUT" |
729 | 748 |
|
730 | | - - name: Assert hub publish token present |
| 749 | + - name: Assert publish credentials present |
731 | 750 | shell: bash |
732 | | - # Secret goes through env (never inlined into the script text) so a |
733 | | - # value with shell metacharacters can't break parsing or defeat masking. |
| 751 | + # Secrets go through env (never inlined into the script text) so a value |
| 752 | + # with shell metacharacters can't break parsing or defeat masking. |
734 | 753 | env: |
735 | 754 | GAIA_HUB_TOKEN: ${{ secrets.GAIA_HUB_TOKEN }} |
| 755 | + R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }} |
| 756 | + R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }} |
| 757 | + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} |
736 | 758 | run: | |
737 | 759 | set -euo pipefail |
738 | 760 | if [ -z "${GAIA_HUB_TOKEN:-}" ]; then |
739 | 761 | echo "::error::missing environment secret GAIA_HUB_TOKEN on the agent-publish environment — the Agent Hub Bearer publish token (must match the Worker's PUBLISH_TOKENS). See workers/agent-hub/README.md." |
740 | 762 | exit 1 |
741 | 763 | fi |
| 764 | + # The Linux sidecar is past the Worker's request-body cap, so every |
| 765 | + # release needs the direct-to-R2 lane. publish_to_r2.py refuses to |
| 766 | + # store anything without these; checking here names all three missing |
| 767 | + # secrets at once, before the artifact downloads. |
| 768 | + missing="" |
| 769 | + for name in R2_ACCESS_KEY_ID R2_SECRET_ACCESS_KEY CLOUDFLARE_ACCOUNT_ID; do |
| 770 | + [ -n "${!name:-}" ] || missing="${missing} ${name}" |
| 771 | + done |
| 772 | + if [ -n "${missing}" ]; then |
| 773 | + echo "::error::missing secret(s):${missing}. The Linux sidecar exceeds the Cloudflare Worker request-body cap and uploads straight to R2, so these are required for every release. Create an R2 API token with Object Read & Write (Cloudflare -> R2 -> Manage R2 API Tokens) and add them as ENVIRONMENT secrets on 'agent-publish' (a repo secret is also read, but keep them behind the approval gate). See workers/agent-hub/README.md." |
| 774 | + exit 1 |
| 775 | + fi |
742 | 776 |
|
743 | 777 | - name: Download sidecar artifacts |
744 | 778 | uses: actions/download-artifact@v8 |
@@ -841,6 +875,14 @@ jobs: |
841 | 875 | # hub.amd-gaia.ai (GETs aren't blocked). |
842 | 876 | GAIA_HUB_PUBLISH_URL: ${{ vars.GAIA_HUB_PUBLISH_URL }} |
843 | 877 | GAIA_HUB_BASE_URL: ${{ vars.GAIA_HUB_BASE_URL }} |
| 878 | + # The sidecar crosses the Worker's request-body cap on Linux |
| 879 | + # (measured 120,677,152 bytes with the RAG deps compiled in), so that |
| 880 | + # artifact is uploaded straight to R2 over the S3 API and published by |
| 881 | + # reference. Without these the publish dies partway through, after the |
| 882 | + # smaller platforms have already been stored immutably. |
| 883 | + R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }} |
| 884 | + R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }} |
| 885 | + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} |
844 | 886 | run: | |
845 | 887 | set -euo pipefail |
846 | 888 | for required in "${README}" "${CHANGELOG}"; do |
@@ -874,9 +916,18 @@ jobs: |
874 | 916 | exit 1 |
875 | 917 | fi |
876 | 918 |
|
| 919 | + # --strict-immutable: the publisher's lenient default skips an already |
| 920 | + # published artifact whose bytes differ and reports the PUBLISHED hash |
| 921 | + # in its --summary-out. This lane does not use that summary — the lock |
| 922 | + # is rebuilt from the freeze metas below — so a skipped artifact would |
| 923 | + # be recorded with this run's local rebuild hash and only blow up two |
| 924 | + # steps later, in the fetch-verify, blaming the bytes the hub serves. |
| 925 | + # Fail here instead, where the error says to bump the version. Drop |
| 926 | + # this flag if the lock is ever switched to --summary-out. |
877 | 927 | python "${PACKAGING}/publish_to_r2.py" \ |
878 | 928 | --base-url "${GAIA_HUB_PUBLISH_URL:-${GAIA_HUB_BASE_URL:-https://hub.amd-gaia.ai}}" \ |
879 | 929 | --manifest "${MANIFEST}" \ |
| 930 | + --strict-immutable \ |
880 | 931 | "${doc_args[@]}" \ |
881 | 932 | "${args[@]}" |
882 | 933 |
|
|
0 commit comments