Source code for gyoza.worker.execution_pipeline.steps.pull_latest_image

"""Pull latest image step - ensures the latest version of the image is available."""

import docker
from gyoza.worker.execution_pipeline.types import ExecutionContext


[docs] def pull_latest_image(ctx: ExecutionContext) -> ExecutionContext: """Pull the latest version of the Docker image before execution. Parameters ---------- ctx : ExecutionContext Execution context with image name configured. Returns ------- ExecutionContext Unchanged context after pulling the image. """ client = docker.from_env() client.images.pull(ctx.image) return ctx