Deploy a Gyoza Op#
You have built and tested your op.
Now it is time to deploy it ! Build the Docker image, push it to a
container registry, and register the OpDefinition on the gyoza server so
workers can pick it up and execute it, you can do all of this with the gyoza deploy command.
Prerequisites#
gyoza installed (see Installation).
A valid Gyoza Op project like the one in Build a Gyoza Op.
A running gyoza server (see Deploy the Gyoza Server).
Environment variables#
Before deploying, make sure the following environment variables are set in your shell. The deployment pipeline will use them to direct the deployment to the correct server and registry.
Variable |
Description |
|---|---|
|
Base URL of the gyoza server (e.g. |
|
Authentication token for the gyoza server API. Leave empty if authentication is disabled. |
You can set them in your .env, .bashrc, or export them directly:
export GYOZA_SERVER_URL="http://gyoza-server:5555"
export GYOZA_API_KEY="my-secret-token"
Configure gyoza.yml for deployment#
In Build a Gyoza Op we covered the build field. For deployment you
need to make sure all the other fields are configured correctly, since they
define how your op is identified, where the image is pushed, and how
workers will execute it.
Here is a complete gyoza.yml ready for deployment:
name: classify-op
version: "1.0.0"
image: myregistry/classify-op:1.0.0
constraints:
cpu: 4
ram_mb: 1024
vram_mb: 0
build:
context: .
dockerfile: Dockerfile
args:
GITHUB_TOKEN: "${GITHUB_TOKEN}"
retry_policy: # OPTIONAL
max_attempts: 3
backoff_ms: 5000
event_delivery: # OPTIONAL
topic: "my-topic"
attributes:
key: value
deploy: # OPTIONAL
gyoza_server_base_url: "${GYOZA_SERVER_URL:-http://localhost:5555}"
gyoza_server_auth_token: "${GYOZA_API_KEY:-}"
nameRequired. Unique identifier for your op. This becomes the OpDefinition ID on the server, clients use it to submit runs.
versionRequired. Semantic version string (e.g.
"1.0.0"). Registered alongside the OpDefinition so the server knows which version of the op is deployed. If an already existing OpDefinition with the same name and version is found, it will be overwritten.imageRequired. Full Docker image tag including the registry prefix (e.g.
myregistry/classify-op). This is the image thatgyoza deploybuilds, pushes to the registry, and registers on the server for workers to pull.constraintsRequired. Hardware requirements for execution. Workers that don’t satisfy these constraints will skip the run. Set
vram_mb: 0for CPU-only ops. If omitted, the op will be executed on any worker any time.retry_policyOptional. Controls what happens when a run fails. If omitted, the op will runs once with no retries, if you set the max attempts to a value greater than 1, the op will be retried up to the max attempts, with a backoff of the specified milliseconds between each retry.
event_deliveryOptional. When set, the server publishes events to the given topic (e.g runs.my-topic) when any event happens with the active op run. You can add extra attributes to the event to add more context to the event. (e.g {“needs_manual_revision”: true})
deployOptional. Tells gyoza where to register the OpDefinition. If omitted, gyoza reads the server URL and token from the
GYOZA_SERVER_URLandGYOZA_API_KEYenvironment variables.
See also
Full field reference with all defaults: gyoza.yml Reference.
Deploy#
With the environment variables set and gyoza.yml configured, deploy
the op with:
gyoza deploy ./my-op
You should see output like:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
🥟 GYOZA DEPLOY
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
...
🎉 Deploy completed!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✨ Done!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Verify the deployment#
List all registered OpDefinitions on the server:
gyoza server list definitions
You should see a definition with your op name and version (in our example, classify-op) with a very recent updated-at timestamp.
ID VERSION IMAGE CREATED UPDATED
----------- ------- ---------------------------- ---------------- ----------------
classify-op 1.0.0 myregistry/classify-op:1.0.0 2026-03-02 20:42 2026-03-02 20:42
Update an existing op#
The deployment is essentially a upsert operation, so for deploying a new version of an op, you just need to run the gyoza deploy command again. The server will upsert the definition and the new version will be available for new runs. If you don’t change the name or version of the op, the server will overwrite the existing definition with the new one, so if you want to update the op and keep its older versions available for new runs, you need to change the version of the op and docker image to a different value from the previous one.
Next steps#
Generate an OpRun: Submit a run for your deployed op and monitor its progress.