canonical / canonical/webteam-devops

Reduce pack time for rockcraft and charmcraft

Open
#10 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
HCL
Stars
3
Forks
0
Avg merge
6h 53m
Merged PRs (30d)
8

Description

Currently charmcraft pack takes around 10 minutes and rockcraft pack takes around 5 minutes, of course the time increase with more build scripts.

Things that can improve with this:

### Rockcraft pack optimization

- Skip LXD installation for Rockraft pack
- Use option `--destructive-mode` during `rockcraft pack` this will use the CI environment directly for packing the project
- Examples with this setup: https://github.com/canonical/assets.ubuntu.com/blob/main/.github/workflows/deploy.yaml#L89
- Considerations: this will requires running ubuntu version of the steps based on the rockcraft.yaml based image: either `22.04` or `24.04 (latest)`

### Rockcraft pack optimizations

1. Using destructive mode same as above with rockcraft
2. Adding a cache layer, this will keep the previous `.charm` artifact as a GitHub cache valid for 7 days with expiration refresh on each cache consumption
- The Charm folder rarely changes so it makes sense to skip pack if there are no changes
- Examples with this setup: https://github.com/canonical/assets.ubuntu.com/blob/main/.github/workflows/deploy.yaml#L121-L126

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.