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

[prefect-docker] add cached docker build and push steps #13286

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

zzstoatzz
Copy link
Contributor

@zzstoatzz zzstoatzz commented May 8, 2024

this will cache the results of the existing build and push steps in memory so that if the same build or push is requested during a build step more than once, it will no-op and the result will be fetched from the cache

this is an alternative way to address #9921

i could see the argument that we should simply add caching to the existing step, but it felt like I needed a layer to handle the list / dict (non-hashable) inputs and avoid any potential weirdness associated with changing the canonical step

usage

build:
    - prefect_docker.deployments.steps.cached_build_docker_image:
        id: build-image
        requires: prefect-docker
        image_name: repo-name/image-name
        tag: dev

push:
    - prefect_docker.deployments.steps.cached_push_docker_image:
        requires: prefect-docker
        image_name: repo-name/image-name
        tag: dev
        credentials: "{{ prefect.blocks.docker-registry-credentials.dev-registry }}"

@zzstoatzz zzstoatzz added the integrations Related to integrations with other services label May 8, 2024
@zzstoatzz zzstoatzz self-assigned this May 8, 2024
Copy link

netlify bot commented May 8, 2024

Deploy Preview for prefect-docs-preview ready!

Name Link
🔨 Latest commit 9deeab1
🔍 Latest deploy log https://app.netlify.com/sites/prefect-docs-preview/deploys/663bd80398502500085e270f
😎 Deploy Preview https://deploy-preview-13286--prefect-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@zzstoatzz zzstoatzz marked this pull request as ready for review May 8, 2024 19:21
@zzstoatzz zzstoatzz requested a review from desertaxle as a code owner May 8, 2024 19:21
@zzstoatzz zzstoatzz requested a review from serinamarie May 8, 2024 19:33
Copy link
Collaborator

@chrisguidry chrisguidry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is rad! Alex and I were talking with a user yesterday about this exact issue

@desertaxle
Copy link
Member

@zzstoatzz What do you think about incorporating this behavior into the existing steps? That way users get caching with no changes needed. We could have the caching behavior be opt-out with a ignore_cache kwarg.

@zzstoatzz
Copy link
Contributor Author

@zzstoatzz What do you think about incorporating this behavior into the existing steps? That way users get caching with no changes needed. We could have the caching behavior be opt-out with a ignore_cache kwarg.

I was debating on whether to do that - yeah I can incorporate that into the existing steps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrations Related to integrations with other services
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants