Browse the documentation

AEL 1.0.0

Deploying in containers

A program written in AEL, the Agent Engineering Language, runs in a container as a native program, with nothing else to start first. Programs build into standalone native binaries, including static Linux binaries, and minimal container images start with nothing to compile, install or download at startup. This tutorial puts a complete agent into an image, gives it its settings when it runs, follows its lifecycle and shows how to measure its start-up yourself.

Step 1: choose the image

Images come in two forms:

FormWhat it holds
MinimalNothing but your program and the files it needs, with no shell and no package manager.
On a small Linux distributionYour program and its files on a small distribution, for programs that need what the distribution provides.

Both are built from the Linux targets; Containers and Supported targets describe them. Each build records exactly what went into it, so you can check what an image contains.

Step 2: decide what goes in

  • Your program, as a static Linux executable built from compiled AEL.
  • The files it needs, each on purpose: prompts kept as files, assets, and the trust roots for verifying TLS certificates.
  • Nothing else: no AEL toolchain and no compiler.

Step 3: give it its settings when it runs

Settings and secrets come from files or environment variables when the container runs, and are never written into the image:

WhatHow it reaches the program
Configuration valuesNamed environment variables or files, read when a run starts, as layers above your defaults.
SecretsReferences to files or environment variables; a secret's value never appears in your source, the image or routine logs.
The system promptA file you mount, the environment or configuration, or none: the agent then runs on its input alone.
The model bindingThe deployment's binding: the endpoint, the model and a reference to the credentials.

Typed, reusable configuration is locked into a snapshot for each run, so a value changed in the container's environment applies to the runs that start afterwards. A missing required setting, credential, system prompt or file stops the program promptly with a clear error, never with a false report that it is ready.

Step 4: follow the process lifecycle

  1. Start. The program is the container's main process. No source is parsed, no package installed and no model weights downloaded when it starts.
  2. Ready. It reports ready once its own configuration, prompts and files are validated and it can accept a request: a console agent when it can accept input, an HTTP agent when its routes are bound and it is listening. Whether a model provider can be reached is reported separately, and readiness checks never call a model.
  3. Run. Structured logs go to standard error by default, so standard output carries only the program's result. Structured logs go to the console, a file, or custom or remote sinks, with redaction, rotation and retention; a file log needs a writable mount you declare.
  4. Stop. On a stop signal the program finishes or cancels its work within a bounded deadline, then exits. A one-shot program keeps its exit status.
  5. Restart. A restarted program keeps the budgets of the work it resumes, and never replays a side effect whose outcome is unknown.

Images run as a user other than root, with a read-only root file system. Per-agent CPU and memory limits state whether each limit is hard-enforced or accounted.

Step 5: measure start-up on your platform

Start-up depends on your program, your image, your platform and your workload, so measure it where you deploy:

  1. Start the container on the machine and platform you deploy to.
  2. Measure from the moment the container starts to the moment the program reports ready.
  3. Measure the first model answer separately: it belongs to the model service, not to the image.
  4. Repeat the measurement and record the platform, the image and the workload with every result.

Step 6: put it into service

A new image reaches your deployment through a reviewed plan:

ael deploy plan
ael deploy apply --plan <plan>

The plan stages the new image beside the running one, checks it for readiness and then switches it on, and rolling back returns to the previous compatible version. Deployment and rollback describes plans in full.

Honest limits

  • This page states no start-up time, size or memory figure: measure your own, as step 5 describes.
  • A minimal image is not a sandbox for running untrusted code.
  • A hard per-agent limit needs that agent in its own process group; see Desktop and server.
  • A program that is ready may still wait for a model's first answer.