Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make streaming Docker build progress to terminal when using flow.deploy() either default or clearer opt-in #12310

Open
3 tasks done
kevingrismore opened this issue Mar 14, 2024 · 3 comments
Labels
enhancement An improvement of an existing feature

Comments

@kevingrismore
Copy link
Contributor

kevingrismore commented Mar 14, 2024

First check

  • I added a descriptive title to this issue.
  • I used the GitHub search to find a similar request and didn't find it.
  • I searched the Prefect documentation for this feature.

Prefect Version

2.x

Describe the current behavior

Building an image with .deploy() does not stream build progress to the terminal by default, and to figure out how to make this happen I had to dig through a few layers of calls to find that stream_progress_to can be used with DeploymentImage.

from prefect import flow
from prefect.deployments import DeploymentImage

import sys

@flow
def do_nothing_flow():
    pass

if __name__ == "__main__":
    do_nothing_flow.deploy(
        name="example-deployment",
        image=DeploymentImage(name="my-image", tag="latest", stream_progress_to=sys.stdout),
        work_pool_name="k8s-demo",
    )

When using the docker build step with prefect.yaml build progress is streamed to the terminal by default.

Describe the proposed behavior

Either change the default behavior to .deploy() to match building images with prefect.yaml with an opt out, or surface a flag to stream build progress at the .deploy() level or more explicitly in the DeploymentImage class.

Example Use

No response

Additional context

No response

@kevingrismore kevingrismore added enhancement An improvement of an existing feature needs:triage labels Mar 14, 2024
@johnkangw
Copy link

@kevingrismore Thanks for posting up this issue. Would really appreciate seeing this as it is the default behavior for the prefect.yaml as Kevin mentioned. It is very helpful to the see the progress of the docker build. If not, we are left wondering what is going on with the deployment.

@serinamarie
Copy link
Contributor

Thanks for the issue! We could probably add a more first-class way to enable users to stream the output, or stream it by default as was mentioned. We've added this to our backlog :)

@hainenber
Copy link
Contributor

Hello there, I have a draft PR addressing this one. Hopefully it's not duplicate work for someone in Prefect 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An improvement of an existing feature
Projects
None yet
4 participants