Skip to content

Conversation

taeold
Copy link
Contributor

@taeold taeold commented Feb 27, 2025

Add command functions:artifacts:setpolicy.

This new command leverages Artifact Registry's cleanup policies feature. Cleanup policies are a managed service feature that automatically removes container images based on configurable rules, providing a more robust and transparent solution.

The command simplifies the process of configuring these policies for Cloud Run functions repositories. By default, the command sets up a policy that deletes images older than 3 days. Users can easily adjust this retention period using the --days option.

The command handles checking if the user already has a cleanup policy set up. The cli command will check if a clean up policy exists, and if so, will prompt the user if they wish to proceed.

@taeold taeold changed the title Add new command to setup a cleanup policy for functions artifacts Add a new command to setup a cleanup policy for functions artifacts Mar 10, 2025
@taeold taeold marked this pull request as ready for review March 12, 2025 22:13
@taeold taeold requested review from blidd-google and inlined March 12, 2025 22:13
Copy link
Member

@inlined inlined left a comment

Choose a reason for hiding this comment

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

LGTM. I assume this can go in as reverse compatible and in the vNext branch you're going to take a swing at checking the policy on deployment and removing the ArtifactCleaner (and its related experiments)?

@taeold
Copy link
Contributor Author

taeold commented Mar 14, 2025

@inlined yep that's the plan. Added that work in go/firebase-tools-14, and will work on it soon.

@taeold taeold enabled auto-merge (squash) March 14, 2025 17:13
@taeold taeold merged commit 3bb75a0 into master Mar 14, 2025
53 of 55 checks passed
@taeold taeold deleted the dl-artifacts-cleanup-policy branch March 14, 2025 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants