Skip to content

Conversation

@RoxyFarhad
Copy link
Collaborator

@RoxyFarhad RoxyFarhad commented Jan 16, 2026

agentex agents package Command

Packages an agent's build context into a compressed tarball (.tar.gz) for cloud-based container builds.

What it does

  1. Reads the agent's manifest.yaml to determine:

    • Build context root directory
    • Files/directories to include (include_paths)
    • Dockerfile location
    • Dockerignore patterns (if specified)
  2. Prepares the build context by:

    • Copying only the files specified in include_paths
    • Filtering out files matching .dockerignore patterns
    • Including the Dockerfile
  3. Compresses everything into a .tar.gz archive

  4. Outputs the tarball and displays build parameters needed for the cloud build API

Usage

# Basic usage - uses tag from manifest's deployment.image.tag
agentex agents package --manifest manifest.yaml

# With custom tag
agentex agents package --manifest manifest.yaml --tag v1.0.0

# With custom output filename
agentex agents package --manifest manifest.yaml --output my-agent.tar.gz

# With build arguments
agentex agents package --manifest manifest.yaml --build-arg ARG1=value1 --build-arg ARG2=value2

Example

$ agentex agents package --manifest examples/tutorials/00_sync/000_hello_acp/manifest.yaml
Packaging build context from manifest: examples/tutorials/00_sync/000_hello_acp/manifest.yaml
2026-01-16 14:13:55,362 INFO [agentex.lib.cli.handlers.agent_handlers] [agent_handlers.py:248] - Agent: s000-hello-acp
2026-01-16 14:13:55,362 INFO [agentex.lib.cli.handlers.agent_handlers] [agent_handlers.py:249] - Image name:
<repository>
2026-01-16 14:13:55,362 INFO [agentex.lib.cli.handlers.agent_handlers] [agent_handlers.py:250] - Build context root:
/Users/roxanne.farhad/Desktop/scale/agentex-python/examples/tutorials
2026-01-16 14:13:55,362 INFO [agentex.lib.cli.handlers.agent_handlers] [agent_handlers.py:251] - Dockerfile:
00_sync/000_hello_acp/Dockerfile
2026-01-16 14:13:55,362 INFO [agentex.lib.cli.handlers.agent_handlers] [agent_handlers.py:252] - Tag: latest
2026-01-16 14:13:55,362 INFO [agentex.lib.cli.handlers.agent_handlers] [agent_handlers.py:255] - Include paths:
['00_sync/000_hello_acp', 'test_utils']
2026-01-16 14:13:55,362 INFO [agentex.lib.cli.handlers.agent_handlers] [agent_handlers.py:261] - Preparing build
context...
2026-01-16 14:13:55,364 INFO [agentex.lib.sdk.config.agent_manifest] [agent_manifest.py:146] - Adding
/Users/roxanne.farhad/Desktop/scale/agentex-python/examples/tutorials/00_sync/000_hello_acp/uv.lock to build context...
2026-01-16 14:13:55,365 INFO [agentex.lib.sdk.config.agent_manifest] [agent_manifest.py:146] - Adding
/Users/roxanne.farhad/Desktop/scale/agentex-python/examples/tutorials/00_sync/000_hello_acp/Dockerfile to build
context...
2026-01-16 14:13:55,366 INFO [agentex.lib.sdk.config.agent_manifest] [agent_manifest.py:146] - Adding
/Users/roxanne.farhad/Desktop/scale/agentex-python/examples/tutorials/00_sync/000_hello_acp/dev.ipynb to build
context...
2026-01-16 14:13:55,366 INFO [agentex.lib.sdk.config.agent_manifest] [agent_manifest.py:146] - Adding
/Users/roxanne.farhad/Desktop/scale/agentex-python/examples/tutorials/00_sync/000_hello_acp/pyproject.toml to build
context...
2026-01-16 14:13:55,366 INFO [agentex.lib.sdk.config.agent_manifest] [agent_manifest.py:146] - Adding
/Users/roxanne.farhad/Desktop/scale/agentex-python/examples/tutorials/00_sync/000_hello_acp/tests/test_agent.py to
build context...
2026-01-16 14:13:55,367 INFO [agentex.lib.sdk.config.agent_manifest] [agent_manifest.py:146] - Adding
/Users/roxanne.farhad/Desktop/scale/agentex-python/examples/tutorials/00_sync/000_hello_acp/README.md to build
context...
2026-01-16 14:13:55,367 INFO [agentex.lib.sdk.config.agent_manifest] [agent_manifest.py:146] - Adding
/Users/roxanne.farhad/Desktop/scale/agentex-python/examples/tutorials/00_sync/000_hello_acp/project/__init__.py to
build context...
2026-01-16 14:13:55,368 INFO [agentex.lib.sdk.config.agent_manifest] [agent_manifest.py:146] - Adding
/Users/roxanne.farhad/Desktop/scale/agentex-python/examples/tutorials/00_sync/000_hello_acp/project/acp.py to build
context...
2026-01-16 14:13:55,368 INFO [agentex.lib.sdk.config.agent_manifest] [agent_manifest.py:146] - Adding
/Users/roxanne.farhad/Desktop/scale/agentex-python/examples/tutorials/00_sync/000_hello_acp/.dockerignore to build
context...
2026-01-16 14:13:55,369 INFO [agentex.lib.sdk.config.agent_manifest] [agent_manifest.py:146] - Adding
/Users/roxanne.farhad/Desktop/scale/agentex-python/examples/tutorials/00_sync/000_hello_acp/manifest.yaml to build
context...
2026-01-16 14:13:55,369 INFO [agentex.lib.sdk.config.agent_manifest] [agent_manifest.py:146] - Adding
/Users/roxanne.farhad/Desktop/scale/agentex-python/examples/tutorials/test_utils/sync.py to build context...
2026-01-16 14:13:55,369 INFO [agentex.lib.sdk.config.agent_manifest] [agent_manifest.py:146] - Adding
/Users/roxanne.farhad/Desktop/scale/agentex-python/examples/tutorials/test_utils/async_utils.py to build context...
2026-01-16 14:13:55,382 INFO [agentex.lib.cli.handlers.agent_handlers] [agent_handlers.py:269] - Build context size:
164.4 KB

Tarball saved to: /Users/roxanne.farhad/Desktop/scale/agentex-python/s000-hello-acp-latest.tar.gz
Size: 164.4 KB

============================================================
Build Parameters for Cloud Build API:
============================================================
  agent_name:      s000-hello-acp
  image_name:      <repository>
  tag:             latest
  context_file:    /Users/roxanne.farhad/Desktop/scale/agentex-python/s000-hello-acp-latest.tar.gz

Command:
  sgp agentex build --context "/Users/roxanne.farhad/Desktop/scale/agentex-python/s000-hello-acp-latest.tar.gz"
--image-name "<repository>" --tag "latest"
============================================================

Output

Creates a tarball named <agent-name>-<tag>.tar.gz in the current directory and displays:

  • Agent name, image name, tag
  • Tarball size
  • Example command for cloud build API

filterwarnings = [
"error"
"error",
"ignore::pydantic.warnings.PydanticDeprecatedSince20",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i added this because otherwise my tests will fail from outdated code (need to fix, but don't want to add scope to this PR to do that)

@RoxyFarhad RoxyFarhad requested a review from smoreinis January 16, 2026 19:17
from typing import Any, Dict

from pydantic import Field
from pydantic import ConfigDict, Field
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this getting used somewhere?

Copy link
Contributor

@smoreinis smoreinis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! there's a couple of lint issues in lib still that should be easy to fix before landing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants