<@ULVA73B9P> - are there any example docs or repos...
# ask-marvin
k
@Marvin - are there any example docs or repos that show how to define a deployment using the terraform provider that uses a docker image as the flow storage?
m
To define a deployment using the Terraform provider with a Docker image as flow storage, you'll find some useful guidance in the Prefect documentation. For Prefect 2.x, you can look at this Guide on Deployment and Storage Guide. Although these don't provide a direct example with Terraform, they offer insights into utilizing Docker images and other storage options. Similarly, Prefect 3.x provides concepts around storing flow code with Docker images. You can explore the Docker Infrastructure Examples and Deployment Concepts, which detail how custom Docker images can be integrated into Prefect deployments. There may also be additional resources or examples in GitHub or forums, but I encountered an issue accessing specific GitHub searches at the moment. Remember, instructions might feel like they're written in some ancient script if you're not accustomed to Prefect's syntax, so do lean on those examples for clarity!
I'm a bit like a lost spaceship with those searches. Let me try that again in a slightly different way. Let me search the relevant documentation with more specific queries and find some helpful information for you. Just a moment! I found some useful information in the Prefect documentation related to your query about defining a deployment using a Docker image as the flow storage. Here are some relevant links: 1. Docker Image and Flow Code Storage: This resource provides guidance on using Docker images for flow storage in Prefect deployments. It describes how to bake your flow code into a Docker image and the necessary steps if you choose to use a custom Docker image. The concept of cloud-provider storage using AWS S3, Azure Blob Storage, or GCP GCS is also discussed as an alternative. Check it out here: Deploy with Docker in Prefect. 2. Static Infrastructure Examples with Docker: This document includes examples of building and running containers with Docker, specific to deploying flows in Prefect. It guides you through building the image with Docker, pushing it to a registry, and running the container, which is a key part in integrating Docker with Prefect. Take a peek here: Static Infrastructure Docker. Sadly, my attempt to search GitHub issues hit a tiny snag (I seem to have tripped over a wire there), but these documentation links should give you a solid starting point. If you have further questions feel free to ask!
k
@Marvin I think my biggest question is why there is no way to configure
build
and
push
options for the deployment in terraform. I have them in my prefect.yaml, but I see no way to specify them here: https://registry.terraform.io/providers/PrefectHQ/prefect/latest/docs/resources/deployment
m
It seems I stumbled into a bit of trouble trying to fetch relevant GitHub issues directly due to an authorization snag. However, let me provide some input based on available knowledge and documentation: The current Terraform provider for Prefect may not yet support specifying the
build
and
push
configurations directly within its resources and configurations like you can in a
prefect.yaml
file. This might be because Terraform's provisioning overlaps with Prefect's own configurations in separate environments, and some configuration options are narrowly scoped within their specific environments. As a workaround, you might consider a dual approach: use Terraform for managing infrastructure-level details, such as storage, network, or computing resources, and then utilize Prefect's native configuration methods (e.g., CLI, Prefect YAML) for deployment specifics that include
build
and
push
settings. You can also keep an eye on Prefect's Terraform provider documentation and PrefectHQ/prefect GitHub for any updates. If this feature is essential, you might consider contributing a feature request or checking with the Prefect community for any emerging workarounds or upcoming releases that might address this gap. If there’s anything else I can dive into, just let me know!
m
hey Kyle, thanks for reaching out I'm relatively new to the Prefect team so I'm still learning the nitty gritty details, but at first glance here: there isn't a way yet to specify any
build
or
push
settings on Deployments yet. We recently added support for
pull
steps - looks like this is a gap on our end that we'll need to investigate. I just created https://github.com/PrefectHQ/terraform-provider-prefect/issues/342 to track this, feel free to chime in there with any other details and/or let me know if I misunderstood any parts of your request
prefect rocket 1