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#

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

GYOZA_SERVER_URL

Base URL of the gyoza server (e.g. http://gyoza-server:5555).

GYOZA_API_KEY

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:-}"
name

Required. Unique identifier for your op. This becomes the OpDefinition ID on the server, clients use it to submit runs.

version

Required. 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.

image

Required. Full Docker image tag including the registry prefix (e.g. myregistry/classify-op). This is the image that gyoza deploy builds, pushes to the registry, and registers on the server for workers to pull.

constraints

Required. Hardware requirements for execution. Workers that don’t satisfy these constraints will skip the run. Set vram_mb: 0 for CPU-only ops. If omitted, the op will be executed on any worker any time.

retry_policy

Optional. 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_delivery

Optional. 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})

deploy

Optional. Tells gyoza where to register the OpDefinition. If omitted, gyoza reads the server URL and token from the GYOZA_SERVER_URL and GYOZA_API_KEY environment 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#