← Back to issue list

add `charmcraft purge` or `charmcraft cleanall` command to clean all instances

View original Github issue

Metadata

Project
charmcraft
Number
#1042
Type
issue
State
open
Author
sed-i
Labels
—
Created
Updated
Closed
—

Current evaluation

Proposed `charmcraft purge` to reclaim disk space by clearing provider caches and build instances; the design is taking shape, but implementation is absent and the former blocker is resolved.

Suggested action: keep open

Reason: Maintainers acknowledged the feature and proposed concrete `purge` modes, but the current codebase has no purge command; the old unused clean implementation was later removed in #1571. The explicit blocker, craft-providers#639, is now closed after instance-listing support was implemented in craft-providers#930, so this valid feature can proceed after a final design decision.

Evaluated by: mr-cal-bot

Impact: 58 Quick Win: 13 Complexity: 68 Confidence: 93 Actionability: 71

Issue body

I ran out of space because `/var/snap/lxd/common/lxd/storage-pools/default/containers/charmcraft*` had a lot of stuff in it. ``` $ sudo ls /var/snap/lxd/common/lxd/storage-pools/default/containers charmcraft_base-instance-charmcraft-buildd-base-v00-36b64d8a932634714eb2 charmcraft_charmcraft-grafana-agent-22-0-0-amd64 charmcraft_charmcraft-prometheus-k8s-36-0-0-amd64 charmcraft_base-instance-charmcraft-buildd-base-v00-f36807e72ea445fd8492 charmcraft_charmcraft-grafana-agent-k8s-2-0-0-amd64 charmcraft_charmcraft-pusher-54-0-0-amd64 charmcraft_charmcraft-alertmanager-k8s-5-0-0-amd64 charmcraft_charmcraft-grafana-agent-k8s-22-0-0-amd64 juju-0728c2-2 charmcraft_charmcraft-application-307288-0-0-amd64 charmcraft_charmcraft-kafka-292835-0-0-amd64 juju-0728c2-4 charmcraft_charmcraft-avalanche-k8s-8-0-0-amd64 charmcraft_charmcraft-mimir-k8s-28-0-0-amd64 juju-541575-0 ``` I wonder if it makes sense to add a `--all` flag to `clean` so it will run the equivalent of: ``` sudo bash -c "rm -rf /var/snap/lxd/common/lxd/storage-pools/default/containers/charmcraft*" ``` More precisely, ```bash for instance in $(lxc list --project=charmcraft --format json | jq -r '.[] | select(.name | startswith("charmcraft-")) | .name'); do lxc --project=charmcraft delete $instance done ``` Or, in nushell, ``` (lxc list --project=charmcraft --format json | from json | get name | where { |it| $it | str starts-with 'charmcraft-' } | each { |it| lxc --project=charmcraft delete $it } ) ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 58
Quick Win: 13
Complexity: 68
Confidence: 93
Actionability: 71
keep open Proposed `charmcraft purge` to reclaim disk space by clearing provider caches and build instances; the design is taking shape, but implementation is absent and the former blocker is resolved.
qwen/qwen3.6-35b-a3b
Impact: 40
Quick Win: 12
Complexity: 50
Confidence: 80
Actionability: 60
keep open Feature request to add a charmcraft purge command to clean build containers, pip cache, and base images. Actively discussed by maintainers but currently blocked by craft-providers#639.
qwen/qwen3.8-27b
Impact: 55
Quick Win: 19
Staleness: 40
Complexity: 65
Confidence: 72
Support Request: 10
keep open Feature request to add a `charmcraft purge` command to clean all LXD build containers and pip caches. Design discussion is active with multiple flag options proposed. Blocked by craft-providers#639.
qwen/qwen3.6-35b-a3b
Staleness: 50
Complexity: 70
Confidence: 90
Support Request: 5
keep open Request to add a charmcraft purge command to clean LXD containers, pip cache, and base images. Currently under discussion with maintainers and blocked by an upstream dependency.
qwen3.6-35b-a3b-mtp-q6
Staleness: 45
Complexity: 65
Confidence: 85
Support Request: 10
keep open Feature request to add a charmcraft purge command to clean LXD containers, pip cache, and base images. Maintainers have proposed a detailed flag structure but the issue is currently blocked by an upstream dependency.
qwen3.6-35b-a3b-mtp-q6
Staleness: 65
Complexity: 60
Confidence: 85
Support Request: 10
keep open Feature request to add a charmcraft purge command for cleaning LXD containers, pip cache, and base images. Scope defined by maintainers, currently blocked by an upstream dependency.

Update history

No update history recorded yet.

Related work

  • Blocked By: canonical/craft-providers#639 (confidence 100%)

    Explicitly identified as the blocker; it is now closed, with the required instance listing implemented by craft-providers#930.

Related issues

No related issues found above the similarity threshold.