Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions .github/workflows/post-merge-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,27 +141,28 @@ jobs:
azure_acr_password: ${{ secrets.AZURE_ACR_PASSWORD }}
extra_tags: |
${{ secrets.AZURE_ACR_HOSTNAME }}/ai-dynamo/dynamo:${{ github.sha }}-power-agent

power-agent-test:
name: Power Agent # group under the same UI umbrella as the build job
if: github.event_name != 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Refresh BuildKit builder
# The runtime build above can leave the remote BuildKit connection stale;
# re-establish it (re-routing only if unhealthy) before the test build.
uses: ./.github/actions/builder-refresher
with:
builder_name: b-${{ github.run_id }}-${{ github.run_attempt }}
flavor: general
arch: linux/amd64
- name: Run unit tests inside the container image
# Build the Dockerfile `test` stage (FROM runtime): its RUN pytest runs
# the suite against the exact shipped image (Python 3.12 + baked deps),
# validating the container itself rather than a pip-installed runner env.
run: docker build --target test -f deploy/power-agent/Dockerfile deploy/power-agent

power-agent-helm-tests:
name: Power Agent # group under the same UI umbrella as the build job
if: github.event_name != 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# Reuses the builder + ECR Docker Hub mirror the build step set up above
# (runtime layers are a cache hit); no --push/--load runs pytest without
# exporting the never-shipped test image.
env:
ECR_HOSTNAME: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com
run: |
docker buildx build --builder b-${{ github.run_id }}-${{ github.run_attempt }} \
--target test \
--build-arg DOCKER_PROXY=${ECR_HOSTNAME}/dockerhub/ \
-f deploy/power-agent/Dockerfile deploy/power-agent
- name: Set up Helm
uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0
with:
Expand Down
39 changes: 18 additions & 21 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ jobs:
- snapshot-placeholder-vllm
- snapshot-placeholder-sglang
- power-agent
- power-agent-test
- power-agent-helm-tests
- vllm-build
- vllm-dev-build
- vllm-test
Expand Down Expand Up @@ -229,29 +227,28 @@ jobs:
builder_name: ${{ needs.changed-files.outputs.builder_name }}
aws_default_region: ${{ secrets.AWS_DEFAULT_REGION }}
aws_account_id: ${{ secrets.AWS_ACCOUNT_ID }}

power-agent-test:
needs: changed-files
if: needs.changed-files.outputs.power_agent == 'true'
name: Power Agent # group under the same UI umbrella as the build job
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Refresh BuildKit builder
# The runtime build above can leave the remote BuildKit connection stale;
# re-establish it (re-routing only if unhealthy) before the test build.
uses: ./.github/actions/builder-refresher
with:
builder_name: ${{ needs.changed-files.outputs.builder_name }}
flavor: general
arch: linux/amd64
- name: Run unit tests inside the container image
# Build the Dockerfile `test` stage (FROM runtime): its RUN pytest runs
# the suite against the exact shipped image (Python 3.12 + baked deps),
# validating the container itself rather than a pip-installed runner env.
run: docker build --target test -f deploy/power-agent/Dockerfile deploy/power-agent

power-agent-helm-tests:
needs: changed-files
if: needs.changed-files.outputs.power_agent == 'true'
name: Power Agent # group under the same UI umbrella as the build job
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# Reuses the builder + ECR Docker Hub mirror the build step set up above
# (runtime layers are a cache hit); no --push/--load runs pytest without
# exporting the never-shipped test image.
env:
ECR_HOSTNAME: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.${{ secrets.AWS_DEFAULT_REGION }}.amazonaws.com
run: |
docker buildx build --builder ${{ needs.changed-files.outputs.builder_name }} \
--target test \
--build-arg DOCKER_PROXY=${ECR_HOSTNAME}/dockerhub/ \
-f deploy/power-agent/Dockerfile deploy/power-agent
- name: Set up Helm
uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0
with:
Expand Down
6 changes: 1 addition & 5 deletions deploy/power-agent/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@
# filterwarnings=error with TRTLLM/pydantic-specific filters (and extra plugins)
# that are absent from the power-agent CI image, which installs only
# pytest + pynvml + kubernetes + prometheus-client (see .github/workflows/pr.yaml
# and post-merge-ci.yml power-agent-test job).
# and post-merge-ci.yml power-agent job).
[pytest]
testpaths = tests
# rootdir is deploy/power-agent (this file); "." puts it on sys.path so
# `from power_agent import …` resolves both locally and inside the container
# image's test stage (WORKDIR /app, where power_agent.py + this file live).
pythonpath = .
addopts = -ra --strict-markers --strict-config
markers =
pre_merge: marks tests to run before merging
gpu_0: marks tests that don't require GPU
unit: marks tests as unit tests
3 changes: 0 additions & 3 deletions deploy/power-agent/tests/test_annotation_scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@
from unittest.mock import MagicMock, patch

import power_agent
import pytest
from power_agent import POWER_ANNOTATION_KEY, PowerAgent

pytestmark = [pytest.mark.pre_merge, pytest.mark.gpu_0, pytest.mark.unit]

SAFE_DEFAULT = 500


Expand Down
3 changes: 0 additions & 3 deletions deploy/power-agent/tests/test_reconcile_failsafe.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@
import unittest
from unittest.mock import MagicMock

import pytest
from power_agent import PowerAgent

pytestmark = [pytest.mark.pre_merge, pytest.mark.gpu_0, pytest.mark.unit]


def _make_agent(core_v1, device_count: int = 2) -> PowerAgent:
"""Build a PowerAgent without touching NVML / K8s (bypass __init__)."""
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ addopts = [
"--ignore-glob=components/src/dynamo/sglang/multimodal_utils/*",
"--ignore-glob=components/src/dynamo/vllm/multimodal_utils/*",
"--ignore-glob=examples/backends/sglang/slurm_jobs/*",
# power-agent is a self-contained deployable with its own pytest.ini; its
# `tests` package is tested inside its container, and collecting it here
# collides with the repo-root `tests` package.
"--ignore-glob=deploy/power-agent/*",
# FIXME: Get relative/generic blob paths to work here
]
xfail_strict = true
Expand Down
Loading