Remove unused SDK volumes#457
Merged
Merged
Conversation
4f8bccd to
d1e9907
Compare
d3c62a1 to
dbf6261
Compare
3a5bf03 to
efd2882
Compare
f53bd42 to
22570d0
Compare
This commit extends the fakebackend to support multiple mount points for a single SDK volume.
a0900e6 to
ee5dce8
Compare
ee5dce8 to
a9c06dc
Compare
a9c06dc to
2cf375d
Compare
ffb0d11 to
4d2d1b2
Compare
a22e45a to
803a764
Compare
jonathan-conder
approved these changes
Aug 19, 2025
803a764 to
11a81ee
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR implements tracking and removal of unused SDK volumes through a cooldown-based cleanup mechanism. The implementation uses cleanup handlers for install-sdk and unregister-sdk tasks to identify unused volumes after workshop removal, SDK detachment, or launch failures, with a 1-hour cooldown period before deletion.
- Adds volume usage tracking by mapping volumes to workshops/projects
- Implements cleanup handlers that delete unused SDK volumes after cooldown period
- Refactors volume data structures to separate setup information from usage tracking
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/workshop/workshop.go | Removes unused WorkshopName function |
| internal/workshop/lxd/tests/integration/workshop_test.go | Updates tests for new volume structure and adds volume usage tracking tests |
| internal/workshop/lxd/tests/helper/helper.go | Renames parameter for clarity in MockSdkTarball |
| internal/workshop/lxd/lxd_backend_volume.go | Implements volume usage tracking and parsing workshop/project info from URLs |
| internal/workshop/lxd/lxd_backend_project.go | Uses relocated workshopName function |
| internal/workshop/lxd/lxd_backend.go | Adds helper functions for workshop name parsing |
| internal/workshop/fakebackend/backend.go | Updates fake backend to support new volume tracking structure |
| internal/workshop/backend.go | Splits VolumeInfo into VolumeSetup and adds workshop tracking |
| internal/overlord/workshopstate/request.go | Updates for new volume structure |
| internal/overlord/workshopstate/handlers.go | Updates for new volume structure |
| internal/overlord/sdkstate/manager.go | Adds cleanup handlers for SDK volume management |
| internal/overlord/sdkstate/handlers_test.go | Adds comprehensive tests for volume cleanup behavior |
| internal/overlord/sdkstate/handlers.go | Implements the core cleanup logic with cooldown tracking |
| internal/overlord/ifacestate/ifacemgr_test.go | Updates test for new volume structure |
| internal/overlord/hookstate/handlers_test.go | Updates tests for new volume structure |
| internal/daemon/api_workshops_test.go | Adds volume cleanup verification to integration tests |
| internal/daemon/api_workshops.go | Sets error status on failed workshop operations |
| .github/workflows/cover.yaml | Removes unused branchname parameter |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
TICS Quality Gate✔️ PassedworkshopAll conditions passedSee the results in the TICS Viewer The following files have been checked for this project
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Implement tracking and removing unused SDK volumes. The implementation uses a clean up handler for the tasks of
install-sdkorunregister-sdktype. Once a change with such a task is complete, it may indicate that an SDK volume became unused due to:If an SDK volume is found to be unused for longer than the
cool down time(1 hr), it will be removed from the system. This is done to preventworkshopdto remove volumes that have a high chance to be immediately reused on a following refresh or launch.Self-review quick check
Docs
Or: