abcxyz / jvs

Apache License 2.0
8 stars 0 forks source link

Add clean up workflow to remove cloud run revisions. #348

Closed sailorlqh closed 6 months ago

sailorlqh commented 10 months ago

The current CI workflow will create a revision for integration test, but it can't remove that revision because it's not allowed to remove the newest revision.

Therefore, a work around would be creating a cleanup workflow that is scheduled to run every day (or on other frequency) that automatically remove all the revisions that are older then a certain period e.g 12 hours.

sqin2019 commented 10 months ago

Do we need to cleanup gar as well, or images will expire themselves?

sailorlqh commented 10 months ago

Yes, but that would be a different workflow other than this one to clean up revisions, because the image clean up only need to be run once to setup the auto clean up policy. And we already have that in PMAP: https://github.com/abcxyz/pmap/blob/main/.github/workflows/update-ci-ar-cleanup-policy.yml

sqin2019 commented 10 months ago

We can configure that in infra when creating the gar right?

sailorlqh commented 10 months ago

It's AR auto cleanup policy is not supported by terraform yet. We can either manually run the gcloud command with our own account, or we can do as what PMAP does.

sqin2019 commented 6 months ago

@sailorlqh believe this is also done, closing, feel free to reopen