Skip to content

Commit 826536d

Browse files
authored
Merge pull request #188 from scaleapi/add-tests-to-image
Add tests to image
2 parents 81c6ab0 + 7aaffde commit 826536d

File tree

50 files changed

+581
-242
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+581
-242
lines changed

.github/workflows/build-and-push-tutorial-agent.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ jobs:
190190
fi
191191
192192
# Build command - add --push only if we should push
193-
BUILD_ARGS="--manifest ${{ matrix.agent_path }}/manifest.yaml --registry ${REGISTRY} --tag ${VERSION_TAG} --platforms linux/amd64 --repository-name ${REPOSITORY_NAME}"
193+
BUILD_ARGS="--manifest ${{ matrix.agent_path }}/manifest.yaml --registry ${REGISTRY} --tag ${VERSION_TAG} --platforms linux/amd64,linux/arm64 --repository-name ${REPOSITORY_NAME}"
194194
195195
if [ "$SHOULD_PUSH" = "true" ]; then
196196
agentex agents build $BUILD_ARGS --push

examples/tutorials/00_sync/000_hello_acp/Dockerfile

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,28 @@ ENV UV_HTTP_TIMEOUT=1000
2424

2525

2626
# Copy pyproject.toml and README.md to install dependencies
27-
COPY 000_hello_acp/pyproject.toml /app/000_hello_acp/pyproject.toml
28-
COPY 000_hello_acp/README.md /app/000_hello_acp/README.md
27+
COPY 00_sync/000_hello_acp/pyproject.toml /app/000_hello_acp/pyproject.toml
28+
COPY 00_sync/000_hello_acp/README.md /app/000_hello_acp/README.md
2929

3030
WORKDIR /app/000_hello_acp
3131

3232
# Copy the project code
33-
COPY 000_hello_acp/project /app/000_hello_acp/project
33+
COPY 00_sync/000_hello_acp/project /app/000_hello_acp/project
3434

35-
# Install the required Python packages from pyproject.toml
36-
RUN uv pip install --system .
35+
# Copy the test files
36+
COPY 00_sync/000_hello_acp/tests /app/000_hello_acp/tests
37+
38+
# Copy shared test utilities
39+
COPY test_utils /app/test_utils
40+
41+
# Install the required Python packages with dev dependencies
42+
RUN uv pip install --system .[dev]
3743

3844
# Set environment variables
3945
ENV PYTHONPATH=/app
4046

47+
# Set test environment variables
48+
ENV AGENT_NAME=000-hello-acp
49+
4150
# Run the agent using uvicorn
4251
CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"]

examples/tutorials/00_sync/000_hello_acp/manifest.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,25 @@
1515
build:
1616
context:
1717
# Root directory for the build context
18-
root: ../ # Keep this as the default root
18+
root: ../../ # Up to tutorials level to include test_utils
1919

2020
# Paths to include in the Docker build context
2121
# Must include:
2222
# - Your agent's directory (your custom agent code)
2323
# These paths are collected and sent to the Docker daemon for building
2424
include_paths:
25-
- 000_hello_acp
25+
- 00_sync/000_hello_acp
26+
- test_utils
2627

2728
# Path to your agent's Dockerfile
2829
# This defines how your agent's image is built from the context
2930
# Relative to the root directory
30-
dockerfile: 000_hello_acp/Dockerfile
31+
dockerfile: 00_sync/000_hello_acp/Dockerfile
3132

3233
# Path to your agent's .dockerignore
3334
# Filters unnecessary files from the build context
3435
# Helps keep build context small and builds fast
35-
dockerignore: 000_hello_acp/.dockerignore
36+
dockerignore: 00_sync/000_hello_acp/.dockerignore
3637

3738
# Local Development Configuration
3839
# -----------------------------

examples/tutorials/00_sync/000_hello_acp/pyproject.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,22 @@ requires = ["hatchling"]
33
build-backend = "hatchling.build"
44

55
[project]
6-
name = "s000-hello-acp"
6+
name = "000-hello-acp"
77
version = "0.1.0"
88
description = "An AgentEx agent that just says hello and acknowledges the user's message"
99
readme = "README.md"
1010
requires-python = ">=3.12"
1111
dependencies = [
1212
"agentex-sdk",
1313
"scale-gp",
14-
"pytest",
15-
"pytest-xdist"
1614
]
1715

1816
[project.optional-dependencies]
1917
dev = [
2018
"pytest",
19+
"pytest-asyncio",
20+
"pytest-xdist",
21+
"httpx",
2122
"black",
2223
"isort",
2324
"flake8",

examples/tutorials/00_sync/010_multiturn/Dockerfile

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,29 @@ RUN uv pip install --system --upgrade pip setuptools wheel
2323
ENV UV_HTTP_TIMEOUT=1000
2424

2525
# Copy pyproject.toml and README.md to install dependencies
26-
COPY 010_multiturn/pyproject.toml /app/010_multiturn/pyproject.toml
27-
COPY 010_multiturn/README.md /app/010_multiturn/README.md
26+
COPY 00_sync/010_multiturn/pyproject.toml /app/010_multiturn/pyproject.toml
27+
COPY 00_sync/010_multiturn/README.md /app/010_multiturn/README.md
2828

2929
WORKDIR /app/010_multiturn
3030

3131
# Copy the project code
32-
COPY 010_multiturn/project /app/010_multiturn/project
32+
COPY 00_sync/010_multiturn/project /app/010_multiturn/project
3333

34-
# Install the required Python packages from pyproject.toml
35-
RUN uv pip install --system .
34+
# Copy the test files
35+
COPY 00_sync/010_multiturn/tests /app/010_multiturn/tests
36+
37+
# Copy shared test utilities
38+
COPY test_utils /app/test_utils
39+
40+
# Install the required Python packages with dev dependencies
41+
RUN uv pip install --system .[dev]
3642

3743
WORKDIR /app/010_multiturn
3844
# Set environment variables
3945
ENV PYTHONPATH=/app
4046

47+
# Set test environment variables
48+
ENV AGENT_NAME=010-multiturn
49+
4150
# Run the agent using uvicorn
4251
CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"]

examples/tutorials/00_sync/010_multiturn/manifest.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,24 +15,25 @@
1515
build:
1616
context:
1717
# Root directory for the build context
18-
root: ../ # Keep this as the default root
18+
root: ../../ # Up to tutorials level to include test_utils
1919

2020
# Paths to include in the Docker build context
2121
# Must include:
2222
# - Your agent's directory (your custom agent code)
2323
# These paths are collected and sent to the Docker daemon for building
2424
include_paths:
25-
- 010_multiturn
25+
- 00_sync/010_multiturn
26+
- test_utils
2627

2728
# Path to your agent's Dockerfile
2829
# This defines how your agent's image is built from the context
2930
# Relative to the root directory
30-
dockerfile: 010_multiturn/Dockerfile
31+
dockerfile: 00_sync/010_multiturn/Dockerfile
3132

3233
# Path to your agent's .dockerignore
3334
# Filters unnecessary files from the build context
3435
# Helps keep build context small and builds fast
35-
dockerignore: 010_multiturn/.dockerignore
36+
dockerignore: 00_sync/010_multiturn/.dockerignore
3637

3738

3839
# Local Development Configuration

examples/tutorials/00_sync/010_multiturn/pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["hatchling"]
33
build-backend = "hatchling.build"
44

55
[project]
6-
name = "s010-multiturn"
6+
name = "010-multiturn"
77
version = "0.1.0"
88
description = "An AgentEx agent"
99
readme = "README.md"
@@ -16,6 +16,8 @@ dependencies = [
1616
[project.optional-dependencies]
1717
dev = [
1818
"pytest",
19+
"pytest-asyncio",
20+
"httpx",
1921
"black",
2022
"isort",
2123
"flake8",

examples/tutorials/00_sync/020_streaming/Dockerfile

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,28 @@ RUN uv pip install --system --upgrade pip setuptools wheel
2323
ENV UV_HTTP_TIMEOUT=1000
2424

2525
# Copy pyproject.toml and README.md to install dependencies
26-
COPY 020_streaming/pyproject.toml /app/020_streaming/pyproject.toml
27-
COPY 020_streaming/README.md /app/020_streaming/README.md
26+
COPY 00_sync/020_streaming/pyproject.toml /app/020_streaming/pyproject.toml
27+
COPY 00_sync/020_streaming/README.md /app/020_streaming/README.md
2828

2929
WORKDIR /app/020_streaming
3030

3131
# Copy the project code
32-
COPY 020_streaming/project /app/020_streaming/project
32+
COPY 00_sync/020_streaming/project /app/020_streaming/project
3333

34-
# Install the required Python packages from pyproject.toml
35-
RUN uv pip install --system .
34+
# Copy the test files
35+
COPY 00_sync/020_streaming/tests /app/020_streaming/tests
36+
37+
# Copy shared test utilities
38+
COPY test_utils /app/test_utils
39+
40+
# Install the required Python packages with dev dependencies
41+
RUN uv pip install --system .[dev]
3642

3743
# Set environment variables
3844
ENV PYTHONPATH=/app
3945

46+
# Set test environment variables
47+
ENV AGENT_NAME=020-streaming
48+
4049
# Run the agent using uvicorn
4150
CMD ["uvicorn", "project.acp:acp", "--host", "0.0.0.0", "--port", "8000"]

examples/tutorials/00_sync/020_streaming/manifest.yaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,26 @@
1515
build:
1616
context:
1717
# Root directory for the build context
18-
root: ../ # Keep this as the default root
18+
root: ../../ # Up to tutorials level to include test_utils
1919

2020
# Paths to include in the Docker build context
2121
# Must include:
2222
# - Your agent's directory (your custom agent code)
2323
# These paths are collected and sent to the Docker daemon for building
2424

2525
include_paths:
26-
- 020_streaming
26+
- 00_sync/020_streaming
27+
- test_utils
2728

2829
# Path to your agent's Dockerfile
2930
# This defines how your agent's image is built from the context
3031
# Relative to the root directory
31-
dockerfile: 020_streaming/Dockerfile
32+
dockerfile: 00_sync/020_streaming/Dockerfile
3233

3334
# Path to your agent's .dockerignore
3435
# Filters unnecessary files from the build context
3536
# Helps keep build context small and builds fast
36-
dockerignore: 020_streaming/.dockerignore
37+
dockerignore: 00_sync/020_streaming/.dockerignore
3738

3839

3940
# Local Development Configuration

examples/tutorials/00_sync/020_streaming/pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["hatchling"]
33
build-backend = "hatchling.build"
44

55
[project]
6-
name = "s020-streaming"
6+
name = "020-streaming"
77
version = "0.1.0"
88
description = "An AgentEx agent that does multiturn streaming chat"
99
readme = "README.md"
@@ -16,6 +16,8 @@ dependencies = [
1616
[project.optional-dependencies]
1717
dev = [
1818
"pytest",
19+
"pytest-asyncio",
20+
"httpx",
1921
"black",
2022
"isort",
2123
"flake8",

0 commit comments

Comments
 (0)