Thread
#prefect-community
    d

    Daniel Saxton

    4 months ago
    any suggestions / best practices for triggering Prefect jobs within a CI/CD pipeline? suppose we're building a Docker image within the pipeline and pushing it to a container registry, and want to execute a flow using that container image, guaranteeing that we're always using the latest (can we do this with a Docker agent?)
    emre

    emre

    4 months ago
    Once you register a version of a flow, that flow versions
    docker tag
    is fixed and cannot be changed. To have your flow use a recently built docker image, you have two options:1. Re-register your flow with the
    docker tag
    of your newly built image 2. Maintain a
    docker tag
    like
    latest
    , that always points to the most recently built image, and register your prefect flow with the tag
    latest
    . This way you ensure that the docker agent looks for the most recent image version, without modifying your flow versions at all. I never needed such a use case, but I would prefer option 2. That way docker image versions and flow versions stay decoupled.
    d

    Daniel Saxton

    4 months ago
    thanks, and the Docker image would be set in the
    run_config
    of the flow: https://docs.prefect.io/orchestration/flow_config/run_configs.html#dockerrun, right?
    Anna Geller

    Anna Geller

    4 months ago
    yup exactly, you can set custom image and tag using DockerRun or KubernetesRun, depending on which agent you use