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

Clean up on PR close #62

Open
zsusswein opened this issue Oct 3, 2024 · 3 comments · May be fixed by #125
Open

Clean up on PR close #62

zsusswein opened this issue Oct 3, 2024 · 3 comments · May be fixed by #125

Comments

@zsusswein
Copy link
Collaborator

zsusswein commented Oct 3, 2024

PRs create tagged images in ACR and pools in Azure Batch. It would be good to clean up all linked pools and tagged images when closing the PR, to prevent hogging resources from the rest of CFA.

@gvegayon proposed doing this as a post-PR action. Jon proposed doing this via a schedule. George can you give Jon any more context he might need on your suggestion to weigh the tradeoffs?

@gvegayon
Copy link
Member

gvegayon commented Oct 3, 2024

If you do it on schedule, you may close/delete images too soon before the PR is merged; that would be my main argument.

@zsusswein
Copy link
Collaborator Author

The az cli has functionality to do this

@gvegayon
Copy link
Member

gvegayon commented Oct 8, 2024

To update the image container, we do this:

az batch pool update \
    --pool-id <your_pool_id> \
    --virtual-machine-configuration image-reference.virtual-machine-image-id <new_container_image_url>

zsusswein added a commit that referenced this issue Dec 16, 2024
This workflow _should_ clean up the associated Batch pool when closing
the PR.

It doesn't clean up the associated tagged image in ACR (that's harder)
or jobs that were run on the pool. It would be nice to auto-delete any
linked jobs, but it seems tricker than I'd want? I'll plan to revisit
that when moving this into a dedicated action outside this repo.

Closes #62
@zsusswein zsusswein linked a pull request Dec 16, 2024 that will close this issue
zsusswein added a commit that referenced this issue Dec 17, 2024
This workflow _should_ clean up the associated Batch pool when closing
the PR.

It doesn't clean up the associated tagged image in ACR (that's harder)
or jobs that were run on the pool. It would be nice to auto-delete any
linked jobs, but it seems tricker than I'd want? I'll plan to revisit
that when moving this into a dedicated action outside this repo.

Closes #62
zsusswein added a commit that referenced this issue Dec 18, 2024
This workflow _should_ clean up the associated Batch pool when closing
the PR.

It doesn't clean up the associated tagged image in ACR (that's harder)
or jobs that were run on the pool. It would be nice to auto-delete any
linked jobs, but it seems tricker than I'd want? I'll plan to revisit
that when moving this into a dedicated action outside this repo.

Closes #62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants