From 430bab15fd4bc82c3c76703fa399e1ccc36f0b39 Mon Sep 17 00:00:00 2001 From: Roxanne Farhad Date: Wed, 29 Oct 2025 12:59:18 -0400 Subject: [PATCH 1/9] adding the integration test workflow --- .github/workflows/build-agentex.yml | 96 +++++++++++++++++++++++++ .github/workflows/integration-tests.yml | 66 ++++++++++++++++- 2 files changed, 160 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build-agentex.yml diff --git a/.github/workflows/build-agentex.yml b/.github/workflows/build-agentex.yml new file mode 100644 index 0000000..5b14510 --- /dev/null +++ b/.github/workflows/build-agentex.yml @@ -0,0 +1,96 @@ +# .github/workflows/release.yml +name: Release AgentEx + +on: + workflow_call: + commit-sha: + description: "Commit SHA to release (defaults to latest commit on main)" + required: true + type: string + default: github.sha + +permissions: + contents: read # This is needed for checking out code + packages: write # This is needed for pushing to GHCR + +env: + AGENTEX_SERVER_IMAGE_NAME: agentex + AGENTEX_AUTH_IMAGE_NAME: agentex-auth + +jobs: + build-stable-image: + name: "Push Stable Images to GHCR" + runs-on: ubuntu-latest + + steps: + # Checkout repository + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ inputs.commit-sha || 'main' }} + + # Set up Python and uv for documentation building + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install uv + uses: astral-sh/setup-uv@v4 + with: + version: "0.7.3" + + # Set up Docker Buildx + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + # Login to GitHub Container Registry + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Build documentation + - name: Build documentation + working-directory: ./agentex + run: | + # Install docs dependencies + uv sync --group docs + # Build documentation + cd docs && uv run mkdocs build + + # Build and push server image to GHCR + - name: Build and push AgentEx server image to GHCR + uses: docker/build-push-action@v5 + with: + context: . + file: ./agentex/Dockerfile + push: true + build-args: | + INCLUDE_DOCS=true + tags: | + ghcr.io/${{ github.repository }}/${{ env.AGENTEX_SERVER_IMAGE_NAME }}:${{ inputs.commit-sha }} + cache-from: type=gha,scope=${{ env.AGENTEX_SERVER_IMAGE_NAME }}-release + cache-to: type=gha,mode=max,scope=${{ env.AGENTEX_SERVER_IMAGE_NAME }}-release + + # Build and push auth image to GHCR + - name: Build and push AgentEx auth image to GHCR + uses: docker/build-push-action@v5 + with: + context: . + file: ./agentex-auth/Dockerfile + push: true + tags: | + ghcr.io/${{ github.repository }}/${{ env.AGENTEX_AUTH_IMAGE_NAME }}:${{ inputs.commit-sha }} + ghcr.io/${{ github.repository }}/${{ env.AGENTEX_AUTH_IMAGE_NAME }} + cache-from: type=gha,scope=${{ env.AGENTEX_AUTH_IMAGE_NAME }}-release + cache-to: type=gha,mode=max,scope=${{ env.AGENTEX_AUTH_IMAGE_NAME }}-release + + # Summary + - name: Release Summary + run: | + echo "โœ… Release complete!" + echo "๐Ÿ“ฆ Server image: ghcr.io/${{ github.repository }}/${{ env.AGENTEX_SERVER_IMAGE_NAME }}:${{ inputs.commit-sha }}" + echo "๐Ÿ” Auth image: ghcr.io/${{ github.repository }}/${{ env.AGENTEX_AUTH_IMAGE_NAME }}:${{ inputs.commit-sha }}" diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index a0f6b0c..33b042d 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -4,6 +4,68 @@ on: workflow_dispatch: inputs: commit-sha: - description: "Commit SHA to test against" - required: true + description: "Commit SHA to test against (defaults to main)" + required: false type: string + default: main + +jobs: + build-images: + name: "Build AgentEx Images" + uses: ./.github/workflows/build-agentex.yml + with: + commit-sha: ${{ inputs.commit-sha || 'main' }} + + pull-agent-images: + name: "Pull AgentEx Images" + needs: build-images + runs-on: ubuntu-latest + steps: + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Discover available images + id: discover + run: | + echo "๐Ÿ” Discovering available images..." + + # Get packages, excluding the current repo to avoid conflicts + PACKAGES=$(gh api repos/scaleapi/agentex-python/packages?package_type=container --jq '.[].name') echo "๐Ÿ“ฆ Available packages:" + echo "$PACKAGES" + + # Store for other jobs + echo "images<> $GITHUB_OUTPUT + echo "$PACKAGES" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + + # # Pull images + # for package in $PACKAGES; do + # echo "๐Ÿณ Pulling ghcr.io/${{ github.repository_owner }}/$package:latest" + # docker pull "ghcr.io/${{ github.repository_owner }}/$package:latest" || echo "โš ๏ธ Couldn't pull $package:latest, trying main..." + # docker pull "ghcr.io/${{ github.repository_owner }}/$package:main" 2>/dev/null || echo "โ„น๏ธ $package:main not available" + # done + # + - name: Pull images from GHCR + run: | + docker pull ghcr.io/your-org/repo-name/image-name:tag + docker pull ghcr.io/your-org/another-repo/service:latest + + run-integration-tests: + name: "Run Integration Tests" + needs: build-images + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ inputs.commit-sha || 'main' }} + + - name: Placeholder - Integration Tests + run: | + echo "๐Ÿงช Integration tests will run here" + echo "๐Ÿ“ฆ AgentEx images have been built with commit SHA: ${{ inputs.commit-sha || 'main' }}" + echo "๐Ÿ”„ This is where actual integration test commands should be added" From 5b08fd55e0ac4444b94c446d5ea748b0d8b4d25e Mon Sep 17 00:00:00 2001 From: Roxanne Farhad Date: Wed, 29 Oct 2025 13:00:51 -0400 Subject: [PATCH 2/9] only test pulling images --- .github/workflows/build-agentex.yml | 2 +- .github/workflows/integration-tests.yml | 99 +++++++++++++++---------- 2 files changed, 59 insertions(+), 42 deletions(-) diff --git a/.github/workflows/build-agentex.yml b/.github/workflows/build-agentex.yml index 5b14510..d94f85a 100644 --- a/.github/workflows/build-agentex.yml +++ b/.github/workflows/build-agentex.yml @@ -1,4 +1,4 @@ -# .github/workflows/release.yml +# .github/workflows/build-agentex.yml name: Release AgentEx on: diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 33b042d..4f315f9 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -9,16 +9,19 @@ on: type: string default: main -jobs: - build-images: - name: "Build AgentEx Images" - uses: ./.github/workflows/build-agentex.yml - with: - commit-sha: ${{ inputs.commit-sha || 'main' }} +permissions: + contents: read + packages: read +jobs: + # build-images: + # name: "Build AgentEx Images" + # uses: ./.github/workflows/build-agentex.yml + # with: + # commit-sha: ${{ inputs.commit-sha || 'main' }} + # pull-agent-images: name: "Pull AgentEx Images" - needs: build-images runs-on: ubuntu-latest steps: - name: Login to GitHub Container Registry @@ -28,44 +31,58 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Discover available images - id: discover + - name: Discover and pull agentex-python packages + env: + GH_TOKEN: ${{ github.token }} run: | - echo "๐Ÿ” Discovering available images..." + echo "๐Ÿ” Discovering packages from agentex-python repo..." - # Get packages, excluding the current repo to avoid conflicts - PACKAGES=$(gh api repos/scaleapi/agentex-python/packages?package_type=container --jq '.[].name') echo "๐Ÿ“ฆ Available packages:" - echo "$PACKAGES" + # Get package names using the API query + PACKAGES=$(gh api "orgs/scaleapi/packages?package_type=container" --jq '.[] | select(.repository.name == "agentex-python") | .name') - # Store for other jobs - echo "images<> $GITHUB_OUTPUT - echo "$PACKAGES" >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT + if [ -z "$PACKAGES" ]; then + echo "โŒ No packages found in agentex-python repo" + exit 0 + fi - # # Pull images - # for package in $PACKAGES; do - # echo "๐Ÿณ Pulling ghcr.io/${{ github.repository_owner }}/$package:latest" - # docker pull "ghcr.io/${{ github.repository_owner }}/$package:latest" || echo "โš ๏ธ Couldn't pull $package:latest, trying main..." - # docker pull "ghcr.io/${{ github.repository_owner }}/$package:main" 2>/dev/null || echo "โ„น๏ธ $package:main not available" - # done - # - - name: Pull images from GHCR - run: | - docker pull ghcr.io/your-org/repo-name/image-name:tag - docker pull ghcr.io/your-org/another-repo/service:latest + echo "๐Ÿ“ฆ Found packages:" + echo "$PACKAGES" - run-integration-tests: - name: "Run Integration Tests" - needs: build-images - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ inputs.commit-sha || 'main' }} + # Pull each package + for package in $PACKAGES; do + echo "๐Ÿณ Pulling ghcr.io/scaleapi/$package:latest" + docker pull "ghcr.io/scaleapi/$package:latest" || echo "โš ๏ธ Failed to pull $package:latest" + done - - name: Placeholder - Integration Tests + - name: Show pulled images run: | - echo "๐Ÿงช Integration tests will run here" - echo "๐Ÿ“ฆ AgentEx images have been built with commit SHA: ${{ inputs.commit-sha || 'main' }}" - echo "๐Ÿ”„ This is where actual integration test commands should be added" + echo "๐Ÿณ Successfully pulled images:" + docker images | grep "ghcr.io/scaleapi" || echo "No scaleapi images found" + + # run-integration-tests: + # name: "Run Integration Tests" + # needs: pull-agent-images + # runs-on: ubuntu-latest + # steps: + # - name: Checkout + # uses: actions/checkout@v4 + # with: + # ref: ${{ inputs.commit-sha || 'main' }} + # + # - name: Login to GitHub Container Registry + # uses: docker/login-action@v3 + # with: + # registry: ghcr.io + # username: ${{ github.repository_owner }} + # password: ${{ secrets.GITHUB_TOKEN }} + # + # - name: Verify available images + # run: | + # echo "๐Ÿณ Available Docker images for testing:" + # docker images | grep "ghcr.io/scaleapi" || echo "No scaleapi images available" + # + # - name: Placeholder - Integration Tests + # run: | + # echo "๐Ÿงช Integration tests will run here" + # echo "๐Ÿ“ฆ AgentEx Python dependency images are available for testing" + # echo "๐Ÿ”„ This is where actual integration test commands should be added" From 288bde6552ffb450442106a0b301341be0fe1261 Mon Sep 17 00:00:00 2001 From: Roxanne Farhad Date: Wed, 29 Oct 2025 16:43:03 -0400 Subject: [PATCH 3/9] adding the build step --- .github/workflows/build-agentex.yml | 11 ++++++----- .github/workflows/integration-tests.yml | 14 +++++++------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-agentex.yml b/.github/workflows/build-agentex.yml index d94f85a..4f9f235 100644 --- a/.github/workflows/build-agentex.yml +++ b/.github/workflows/build-agentex.yml @@ -3,11 +3,12 @@ name: Release AgentEx on: workflow_call: - commit-sha: - description: "Commit SHA to release (defaults to latest commit on main)" - required: true - type: string - default: github.sha + inputs: + commit-sha: + description: "Commit SHA to release (defaults to latest commit on main)" + required: true + type: string + default: github.sha permissions: contents: read # This is needed for checking out code diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 4f315f9..142b5dd 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -11,15 +11,15 @@ on: permissions: contents: read - packages: read + packages: write jobs: - # build-images: - # name: "Build AgentEx Images" - # uses: ./.github/workflows/build-agentex.yml - # with: - # commit-sha: ${{ inputs.commit-sha || 'main' }} - # + build-images: + name: "Build AgentEx Images" + uses: ./.github/workflows/build-agentex.yml + with: + commit-sha: ${{ inputs.commit-sha || 'main' }} + pull-agent-images: name: "Pull AgentEx Images" runs-on: ubuntu-latest From 7e2ad1980a0655ce1a60abd50290118ce490225d Mon Sep 17 00:00:00 2001 From: Roxanne Farhad Date: Wed, 29 Oct 2025 17:06:51 -0400 Subject: [PATCH 4/9] make the package public --- .github/workflows/build-agentex.yml | 34 ++++++++++++++++++----------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-agentex.yml b/.github/workflows/build-agentex.yml index 4f9f235..f189c90 100644 --- a/.github/workflows/build-agentex.yml +++ b/.github/workflows/build-agentex.yml @@ -76,22 +76,30 @@ jobs: cache-from: type=gha,scope=${{ env.AGENTEX_SERVER_IMAGE_NAME }}-release cache-to: type=gha,mode=max,scope=${{ env.AGENTEX_SERVER_IMAGE_NAME }}-release - # Build and push auth image to GHCR - - name: Build and push AgentEx auth image to GHCR - uses: docker/build-push-action@v5 - with: - context: . - file: ./agentex-auth/Dockerfile - push: true - tags: | - ghcr.io/${{ github.repository }}/${{ env.AGENTEX_AUTH_IMAGE_NAME }}:${{ inputs.commit-sha }} - ghcr.io/${{ github.repository }}/${{ env.AGENTEX_AUTH_IMAGE_NAME }} - cache-from: type=gha,scope=${{ env.AGENTEX_AUTH_IMAGE_NAME }}-release - cache-to: type=gha,mode=max,scope=${{ env.AGENTEX_AUTH_IMAGE_NAME }}-release + # Make package public + - name: Make package public + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + echo "๐Ÿ”“ Making package public..." + + # Extract package name from repository + PACKAGE_NAME="${{ env.AGENTEX_SERVER_IMAGE_NAME }}" + ORG_NAME="${{ github.repository_owner }}" + + # Set package visibility to public + gh api \ + --method PATCH \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "/orgs/$ORG_NAME/packages/container/$PACKAGE_NAME" \ + -f visibility='public' || echo "โš ๏ธ Could not set package visibility (may already be public or insufficient permissions)" + + echo "โœ… Package visibility updated" # Summary - name: Release Summary run: | echo "โœ… Release complete!" echo "๐Ÿ“ฆ Server image: ghcr.io/${{ github.repository }}/${{ env.AGENTEX_SERVER_IMAGE_NAME }}:${{ inputs.commit-sha }}" - echo "๐Ÿ” Auth image: ghcr.io/${{ github.repository }}/${{ env.AGENTEX_AUTH_IMAGE_NAME }}:${{ inputs.commit-sha }}" + echo "๐Ÿ”“ Package set to public visibility" From 3cbc59bf6d84396e80b25b3d6ec76e7772d871ce Mon Sep 17 00:00:00 2001 From: Roxanne Farhad Date: Wed, 29 Oct 2025 17:18:40 -0400 Subject: [PATCH 5/9] make the packages public --- .github/workflows/build-agentex.yml | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build-agentex.yml b/.github/workflows/build-agentex.yml index f189c90..93d40ab 100644 --- a/.github/workflows/build-agentex.yml +++ b/.github/workflows/build-agentex.yml @@ -71,32 +71,15 @@ jobs: push: true build-args: | INCLUDE_DOCS=true + labels: | + org.opencontainers.image.source=https://github.com/${{ github.owner }}/${{ github.repository }} + org.opencontainers.image.description=AgentEx Platform + org.opencontainers.image.licenses=MIT tags: | ghcr.io/${{ github.repository }}/${{ env.AGENTEX_SERVER_IMAGE_NAME }}:${{ inputs.commit-sha }} cache-from: type=gha,scope=${{ env.AGENTEX_SERVER_IMAGE_NAME }}-release cache-to: type=gha,mode=max,scope=${{ env.AGENTEX_SERVER_IMAGE_NAME }}-release - # Make package public - - name: Make package public - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - echo "๐Ÿ”“ Making package public..." - - # Extract package name from repository - PACKAGE_NAME="${{ env.AGENTEX_SERVER_IMAGE_NAME }}" - ORG_NAME="${{ github.repository_owner }}" - - # Set package visibility to public - gh api \ - --method PATCH \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - "/orgs/$ORG_NAME/packages/container/$PACKAGE_NAME" \ - -f visibility='public' || echo "โš ๏ธ Could not set package visibility (may already be public or insufficient permissions)" - - echo "โœ… Package visibility updated" - # Summary - name: Release Summary run: | From 9d155295c8ed7c166f136454e13bdc4b86cb5471 Mon Sep 17 00:00:00 2001 From: Roxanne Farhad Date: Mon, 3 Nov 2025 18:59:30 -0500 Subject: [PATCH 6/9] trying this again --- .github/workflows/integration-tests.yml | 47 +++++++++++++++++++------ 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 142b5dd..9df5d10 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -14,12 +14,6 @@ permissions: packages: write jobs: - build-images: - name: "Build AgentEx Images" - uses: ./.github/workflows/build-agentex.yml - with: - commit-sha: ${{ inputs.commit-sha || 'main' }} - pull-agent-images: name: "Pull AgentEx Images" runs-on: ubuntu-latest @@ -31,17 +25,48 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Discover and pull agentex-python packages + - name: Debug API Permissions + env: + GH_TOKEN: ${{ github.token }} + run: | + echo "๐Ÿ” Testing API permissions..." + + # Test basic user access + echo "๐Ÿ‘ค Current user:" + gh api user --jq '.login' || echo "โŒ User API failed" + + # Test organization access + echo "๐Ÿข Organization access:" + gh api orgs/scaleapi --jq '.login' || echo "โŒ Org API failed" + + # Test different package API endpoints + echo "๐Ÿ“ฆ Testing package API endpoints:" + + echo "1. Basic packages endpoint:" + gh api "orgs/scaleapi/packages" --jq 'length' || echo "โŒ Basic packages API failed" + + echo "2. Container packages endpoint:" + gh api "orgs/scaleapi/packages?package_type=container" --jq 'length' || echo "โŒ Container packages API failed" + + echo "3. Public packages endpoint:" + gh api "orgs/scaleapi/packages?package_type=container&visibility=public" --jq 'length' || echo "โŒ Public packages API failed" + + - name: Discover and pull scale-agentex-python packages env: GH_TOKEN: ${{ github.token }} run: | - echo "๐Ÿ” Discovering packages from agentex-python repo..." + echo "๐Ÿ” Discovering packages from scale-agentex-python repo..." + + # First get all packages and save to temp file to avoid shell issues + gh api "orgs/scaleapi/packages?package_type=container" > /tmp/packages.json - # Get package names using the API query - PACKAGES=$(gh api "orgs/scaleapi/packages?package_type=container" --jq '.[] | select(.repository.name == "agentex-python") | .name') + # Extract packages from scale-agentex-python repo + PACKAGES=$(cat /tmp/packages.json | jq -r '.[] | select(.repository.name == "scale-agentex-python") | .name') if [ -z "$PACKAGES" ]; then - echo "โŒ No packages found in agentex-python repo" + echo "โŒ No packages found in scale-agentex-python repo" + echo "๐Ÿ” Available packages and their repos:" + cat /tmp/packages.json | jq -r '.[] | "\(.name) -> \(.repository.name // "null")"' exit 0 fi From 1f6678d5d1bd1eaeb6cb38809311722d8ca8fa48 Mon Sep 17 00:00:00 2001 From: Roxanne Farhad Date: Tue, 4 Nov 2025 10:32:12 -0500 Subject: [PATCH 7/9] adding the integration wf --- .github/workflows/integration-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 9df5d10..2000240 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -27,7 +27,7 @@ jobs: - name: Debug API Permissions env: - GH_TOKEN: ${{ github.token }} + GH_TOKEN: ${{ secrets.GH_READ_PACKAGES_SECRET }} run: | echo "๐Ÿ” Testing API permissions..." From 5462ed076e8bf52d062d40e7aad141120b69e6d6 Mon Sep 17 00:00:00 2001 From: Roxanne Farhad Date: Tue, 4 Nov 2025 21:34:25 -0500 Subject: [PATCH 8/9] adding the basic testing framework --- .github/workflows/build-agentex.yml | 88 ----------- .github/workflows/integration-tests.yml | 187 ++++++++++++++---------- agentex/Dockerfile | 2 + agentex/Makefile | 8 + agentex/docker-compose.host-access.yml | 10 ++ 5 files changed, 130 insertions(+), 165 deletions(-) delete mode 100644 .github/workflows/build-agentex.yml create mode 100644 agentex/docker-compose.host-access.yml diff --git a/.github/workflows/build-agentex.yml b/.github/workflows/build-agentex.yml deleted file mode 100644 index 93d40ab..0000000 --- a/.github/workflows/build-agentex.yml +++ /dev/null @@ -1,88 +0,0 @@ -# .github/workflows/build-agentex.yml -name: Release AgentEx - -on: - workflow_call: - inputs: - commit-sha: - description: "Commit SHA to release (defaults to latest commit on main)" - required: true - type: string - default: github.sha - -permissions: - contents: read # This is needed for checking out code - packages: write # This is needed for pushing to GHCR - -env: - AGENTEX_SERVER_IMAGE_NAME: agentex - AGENTEX_AUTH_IMAGE_NAME: agentex-auth - -jobs: - build-stable-image: - name: "Push Stable Images to GHCR" - runs-on: ubuntu-latest - - steps: - # Checkout repository - - name: Checkout - uses: actions/checkout@v4 - with: - ref: ${{ inputs.commit-sha || 'main' }} - - # Set up Python and uv for documentation building - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - - name: Install uv - uses: astral-sh/setup-uv@v4 - with: - version: "0.7.3" - - # Set up Docker Buildx - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - # Login to GitHub Container Registry - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - # Build documentation - - name: Build documentation - working-directory: ./agentex - run: | - # Install docs dependencies - uv sync --group docs - # Build documentation - cd docs && uv run mkdocs build - - # Build and push server image to GHCR - - name: Build and push AgentEx server image to GHCR - uses: docker/build-push-action@v5 - with: - context: . - file: ./agentex/Dockerfile - push: true - build-args: | - INCLUDE_DOCS=true - labels: | - org.opencontainers.image.source=https://github.com/${{ github.owner }}/${{ github.repository }} - org.opencontainers.image.description=AgentEx Platform - org.opencontainers.image.licenses=MIT - tags: | - ghcr.io/${{ github.repository }}/${{ env.AGENTEX_SERVER_IMAGE_NAME }}:${{ inputs.commit-sha }} - cache-from: type=gha,scope=${{ env.AGENTEX_SERVER_IMAGE_NAME }}-release - cache-to: type=gha,mode=max,scope=${{ env.AGENTEX_SERVER_IMAGE_NAME }}-release - - # Summary - - name: Release Summary - run: | - echo "โœ… Release complete!" - echo "๐Ÿ“ฆ Server image: ghcr.io/${{ github.repository }}/${{ env.AGENTEX_SERVER_IMAGE_NAME }}:${{ inputs.commit-sha }}" - echo "๐Ÿ”“ Package set to public visibility" diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 2000240..71be7c0 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -4,20 +4,24 @@ on: workflow_dispatch: inputs: commit-sha: - description: "Commit SHA to test against (defaults to main)" + description: "Commit SHA to test against (defaults to current branch)" required: false type: string - default: main permissions: contents: read packages: write jobs: - pull-agent-images: - name: "Pull AgentEx Images" + run-integration-tests: + name: "Run Integration Tests - s000-hello-acp" runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@v4 + with: + ref: ${{ inputs.commit-sha || github.ref }} + - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: @@ -25,89 +29,118 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Debug API Permissions - env: - GH_TOKEN: ${{ secrets.GH_READ_PACKAGES_SECRET }} + - name: Pull agent image run: | - echo "๐Ÿ” Testing API permissions..." - - # Test basic user access - echo "๐Ÿ‘ค Current user:" - gh api user --jq '.login' || echo "โŒ User API failed" - - # Test organization access - echo "๐Ÿข Organization access:" - gh api orgs/scaleapi --jq '.login' || echo "โŒ Org API failed" + echo "๐Ÿณ Pulling agent image..." + docker pull ghcr.io/scaleapi/scale-agentex-python/tutorial-agents/00_sync-000_hello_acp:latest + echo "โœ… Agent image pulled successfully" - # Test different package API endpoints - echo "๐Ÿ“ฆ Testing package API endpoints:" - - echo "1. Basic packages endpoint:" - gh api "orgs/scaleapi/packages" --jq 'length' || echo "โŒ Basic packages API failed" + - name: Start AgentEx services with host access + working-directory: ./agentex + run: | + echo "๐Ÿš€ Starting AgentEx services with host access override..." + docker compose -f docker-compose.yml -f docker-compose.host-access.yml up -d + echo "โณ Waiting for services to be ready..." + sleep 30 + docker compose ps - echo "2. Container packages endpoint:" - gh api "orgs/scaleapi/packages?package_type=container" --jq 'length' || echo "โŒ Container packages API failed" + - name: Run agent integration test + run: | + echo "๐Ÿงช Running integration test for agent: s000-hello-acp" + echo "๐Ÿณ Using image: ghcr.io/scaleapi/scale-agentex-python/tutorial-agents/00_sync-000_hello_acp:latest" + + # Start the agent container + docker run -d --name agent-test-s000-hello-acp \ + -e AGENT_NAME=s000-hello-acp \ + -e ACP_URL=http://localhost \ + -e ACP_PORT=8000 \ + -e ACP_TYPE=sync \ + -e AGENTEX_BASE_URL=http://agentex:5003 \ + -e AGENTEX_API_BASE_URL=http://agentex:5003 \ + -p 8000:8000 \ + --network agentex-network \ + ghcr.io/scaleapi/scale-agentex-python/tutorial-agents/00_sync-000_hello_acp:latest + + echo "โณ Waiting for agent to start..." + sleep 10 + + # Check for "Application startup complete" log message + echo "๐Ÿ” Waiting for 'Application startup complete' log message..." + TIMEOUT=60 + ELAPSED=0 + + while [ $ELAPSED -lt $TIMEOUT ]; do + if docker logs agent-test-s000-hello-acp 2>&1 | grep -q "Application startup complete"; then + echo "โœ… Agent application has started successfully" + break + fi + + echo "โณ Still waiting for startup... (${ELAPSED}s/${TIMEOUT}s)" + sleep 2 + ELAPSED=$((ELAPSED + 2)) + done - echo "3. Public packages endpoint:" - gh api "orgs/scaleapi/packages?package_type=container&visibility=public" --jq 'length' || echo "โŒ Public packages API failed" + if [ $ELAPSED -ge $TIMEOUT ]; then + echo "โŒ Timeout waiting for 'Application startup complete' message" + echo "๐Ÿ“‹ Container logs:" + docker logs agent-test-s000-hello-acp + exit 1 + fi - - name: Discover and pull scale-agentex-python packages - env: - GH_TOKEN: ${{ github.token }} + - name: Run agent tests with retry run: | - echo "๐Ÿ” Discovering packages from scale-agentex-python repo..." + echo "๐Ÿงช Running pytest tests against the agent..." + MAX_ATTEMPTS=2 + ATTEMPT=1 + SUCCESS=false + + while [ $ATTEMPT -le $MAX_ATTEMPTS ] && [ "$SUCCESS" = false ]; do + echo "๐Ÿ“ Test attempt $ATTEMPT/$MAX_ATTEMPTS" + + if docker exec agent-test-s000-hello-acp pytest tests/test_agent.py -v; then + echo "โœ… Tests passed on attempt $ATTEMPT!" + SUCCESS=true + else + echo "โŒ Tests failed on attempt $ATTEMPT" + if [ $ATTEMPT -lt $MAX_ATTEMPTS ]; then + echo "โณ Waiting 5 seconds before retry..." + sleep 5 + fi + fi + + ATTEMPT=$((ATTEMPT + 1)) + done - # First get all packages and save to temp file to avoid shell issues - gh api "orgs/scaleapi/packages?package_type=container" > /tmp/packages.json + if [ "$SUCCESS" = false ]; then + echo "โŒ All $MAX_ATTEMPTS test attempts failed" + exit 1 + fi - # Extract packages from scale-agentex-python repo - PACKAGES=$(cat /tmp/packages.json | jq -r '.[] | select(.repository.name == "scale-agentex-python") | .name') + echo "๐ŸŽ‰ Agent tests completed successfully!" - if [ -z "$PACKAGES" ]; then - echo "โŒ No packages found in scale-agentex-python repo" - echo "๐Ÿ” Available packages and their repos:" - cat /tmp/packages.json | jq -r '.[] | "\(.name) -> \(.repository.name // "null")"' - exit 0 - fi + - name: Show agent logs + if: always() + run: | + echo "๐Ÿ“‹ Agent logs for s000-hello-acp:" + docker logs agent-test-s000-hello-acp || echo "No logs available" - echo "๐Ÿ“ฆ Found packages:" - echo "$PACKAGES" + - name: Show AgentEx server logs + if: always() + run: | + echo "๐Ÿ“‹ AgentEx server logs:" + docker logs agentex || echo "No AgentEx server logs available" - # Pull each package - for package in $PACKAGES; do - echo "๐Ÿณ Pulling ghcr.io/scaleapi/$package:latest" - docker pull "ghcr.io/scaleapi/$package:latest" || echo "โš ๏ธ Failed to pull $package:latest" - done + - name: Cleanup agent container + if: always() + run: | + echo "๐Ÿงน Cleaning up agent container..." + docker stop agent-test-s000-hello-acp || true + docker rm agent-test-s000-hello-acp || true - - name: Show pulled images + - name: Cleanup services + if: always() + working-directory: ./agentex run: | - echo "๐Ÿณ Successfully pulled images:" - docker images | grep "ghcr.io/scaleapi" || echo "No scaleapi images found" - - # run-integration-tests: - # name: "Run Integration Tests" - # needs: pull-agent-images - # runs-on: ubuntu-latest - # steps: - # - name: Checkout - # uses: actions/checkout@v4 - # with: - # ref: ${{ inputs.commit-sha || 'main' }} - # - # - name: Login to GitHub Container Registry - # uses: docker/login-action@v3 - # with: - # registry: ghcr.io - # username: ${{ github.repository_owner }} - # password: ${{ secrets.GITHUB_TOKEN }} - # - # - name: Verify available images - # run: | - # echo "๐Ÿณ Available Docker images for testing:" - # docker images | grep "ghcr.io/scaleapi" || echo "No scaleapi images available" - # - # - name: Placeholder - Integration Tests - # run: | - # echo "๐Ÿงช Integration tests will run here" - # echo "๐Ÿ“ฆ AgentEx Python dependency images are available for testing" - # echo "๐Ÿ”„ This is where actual integration test commands should be added" + echo "๐Ÿงน Cleaning up services..." + docker compose -f docker-compose.yml -f docker-compose.host-access.yml down + docker system prune -f diff --git a/agentex/Dockerfile b/agentex/Dockerfile index da6cdc5..47029c3 100644 --- a/agentex/Dockerfile +++ b/agentex/Dockerfile @@ -32,6 +32,8 @@ FROM base AS dev RUN uv sync --group dev COPY agentex/src/ ./src/ +COPY agentex/tests/ ./tests/ +COPY agentex/pyproject.toml ./pyproject.toml EXPOSE 5003 ENV PYTHONPATH=/app CMD ["ddtrace-run", "uvicorn", "src.api.app:app", "--host", "0.0.0.0", "--port", "5003", "--reload"] diff --git a/agentex/Makefile b/agentex/Makefile index b94353b..fbedf74 100644 --- a/agentex/Makefile +++ b/agentex/Makefile @@ -53,6 +53,14 @@ dev-wipe: ## Stop dev server and wipe DB @echo "Stopping dev server and wiping DB" docker compose down -v +dev-test: install-dev ## Start development server with host access for testing + @echo "๐Ÿš€ Starting development server with host access for testing..." + docker compose -f docker-compose.yml -f docker-compose.host-access.yml up --build + +dev-test-stop: ## Stop development server with host access configuration + @echo "Stopping dev test server with host access configuration" + docker compose -f docker-compose.yml -f docker-compose.host-access.yml down + # Database Commands # diff --git a/agentex/docker-compose.host-access.yml b/agentex/docker-compose.host-access.yml new file mode 100644 index 0000000..55033ce --- /dev/null +++ b/agentex/docker-compose.host-access.yml @@ -0,0 +1,10 @@ +# docker-compose.host-access.yml +# Override file to add host access when needed +# Usage: docker-compose -f docker-compose.yml -f docker-compose.host-access.yml up +# docker-compose.host-access.yml +services: + agentex: + networks: + agentex-network: + aliases: + - localhost # Make agentex reachable as localhost From b4ef4b5e66364888471e8837a8aeb1ec4b608889 Mon Sep 17 00:00:00 2001 From: Roxanne Farhad Date: Tue, 4 Nov 2025 22:05:40 -0500 Subject: [PATCH 9/9] try the other acp url --- .github/workflows/integration-tests.yml | 21 ++++++++++++++++++++- agentex/Dockerfile | 2 -- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration-tests.yml b/.github/workflows/integration-tests.yml index 71be7c0..44c0d5c 100644 --- a/.github/workflows/integration-tests.yml +++ b/.github/workflows/integration-tests.yml @@ -50,9 +50,10 @@ jobs: echo "๐Ÿณ Using image: ghcr.io/scaleapi/scale-agentex-python/tutorial-agents/00_sync-000_hello_acp:latest" # Start the agent container + docker run -d --name agent-test-s000-hello-acp \ -e AGENT_NAME=s000-hello-acp \ - -e ACP_URL=http://localhost \ + -e ACP_URL=http://agent-test-s000-hello-acp:8000 \ -e ACP_PORT=8000 \ -e ACP_TYPE=sync \ -e AGENTEX_BASE_URL=http://agentex:5003 \ @@ -90,6 +91,24 @@ jobs: - name: Run agent tests with retry run: | echo "๐Ÿงช Running pytest tests against the agent..." + + echo "๐Ÿ”— Testing connectivity from agentex container to agent..." + echo "๐Ÿ“ก From agentex container, try to reach agent:" + docker exec agentex curl -v http://agent-test-s000-hello-acp:8000 + echo "๐Ÿฅ From agentex container, try to reach agent health endpoint:" + docker exec agentex curl -v http://agent-test-s000-hello-acp:8000/health + + echo "๐Ÿ”— Testing connectivity from agent container to agentex..." + echo "๐Ÿ“ก From agent container, try to reach agentex:" + docker exec agent-test-s000-hello-acp curl -v http://agentex:5003 + echo "๐Ÿฅ From agent container, try to reach agentex health endpoint:" + docker exec agent-test-s000-hello-acp curl -v http://agentex:5003/health + + echo "๐Ÿ”— Testing basic network connectivity (ping)..." + echo "๐Ÿ“ Ping from agentex to agent:" + docker exec agentex ping -c 3 agent-test-s000-hello-acp + echo "๐Ÿ“ Ping from agent to agentex:" + docker exec agent-test-s000-hello-acp ping -c 3 agentex MAX_ATTEMPTS=2 ATTEMPT=1 SUCCESS=false diff --git a/agentex/Dockerfile b/agentex/Dockerfile index 47029c3..da6cdc5 100644 --- a/agentex/Dockerfile +++ b/agentex/Dockerfile @@ -32,8 +32,6 @@ FROM base AS dev RUN uv sync --group dev COPY agentex/src/ ./src/ -COPY agentex/tests/ ./tests/ -COPY agentex/pyproject.toml ./pyproject.toml EXPOSE 5003 ENV PYTHONPATH=/app CMD ["ddtrace-run", "uvicorn", "src.api.app:app", "--host", "0.0.0.0", "--port", "5003", "--reload"]