charm-dev as a justfile

The comfort level of multipass launch charm-dev is quite high, but it has some problems:

  • Different people want different things in their dev-env.
  • Cannot reuse: the setup script needs to be duplicated to lxd profile, github action, concierge, …
  • Multipass blueprints are being deprecated.

One way to address all the issues above is by using a justfile (I prefer just over make for this purpose).

They way you’d use it in a fresh multipass vm could be:

# Launch and shell into a vm
multipass launch noble --name charm-dev --memory 16G --cpus 8 --disk 100G
multipass shell charm-dev

# Now run these from within the vm
# 1. Obtain deps
sudo snap install --classic just
curl https://raw.githubusercontent.com/sed-i/reusable-justfiles/refs/heads/main/charm-dev/ubuntu-24.04.just

# 2. Set up dev-env
sudo just -f charm-dev_ubuntu-24.04.just charm-dev

Under the hood, the charm-dev recipe depends on several other recipes:

charm-dev: update init utils microk8s juju starcraft default-models && _banner

One thing I am very curious to find out is, to what extent could a repo of reusable justfiles be a replacement for github actions.

External links

2 Likes

I think you have a typo in the curl with the _ instead of a slash /

curl https://raw.githubusercontent.com/sed-i/reusable-justfiles/refs/heads/main/charm-dev/ubuntu-24.04.just

Also, is it expected that your just file just looks as just a tidy bash script? (asking for a friend :smiley: )

Thanks @sinanawad, fixed, I reorg-ed the repo after posting this and the link broke.

Haha yes, and so is a cloud-init script! And so are many github workflows!