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

Merged
merged 11 commits into from
Jun 19, 2024

Conversation

zzstoatzz
Copy link
Collaborator

@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

opt out with ignore_cache: true

this is an alternative way to address #9921

usage

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

push:
    - prefect_docker.deployments.steps.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
Collaborator 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

Copy link
Contributor

github-actions bot commented Jun 3, 2024

This pull request is stale because it has been open 14 days with no activity. To keep this pull request open remove stale label or comment.

Copy link
Contributor

This pull request was closed because it has been stale for 14 days with no activity. If this pull request is important or you have more to add feel free to re-open it.

@github-actions github-actions bot closed this Jun 17, 2024
@zzstoatzz zzstoatzz reopened this Jun 17, 2024
Copy link
Member

@desertaxle desertaxle left a comment

Choose a reason for hiding this comment

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

Few small nits on logging, but otherwise LGTM!

@zzstoatzz zzstoatzz merged commit 09a459f into main Jun 19, 2024
12 checks passed
@zzstoatzz zzstoatzz deleted the cached-docker-build-and-push branch June 19, 2024 18:20
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.

3 participants