canonical / multipass-blueprints

Blueprint definitions for [`multipass launch`](https://multipass.run)
GNU General Public License v3.0
67 stars 42 forks source link

add "juju-dev" image to list of available images #4

Closed sed-i closed 2 years ago

sed-i commented 2 years ago

What are you trying to do? It would be nice to be able to launch (disposable) instances of juju and related tools needed for charm development. Launching an instance and installing all the tools takes quite some time.

What's your proposed solution? Have an official "juju-dev" image with microk8s and charmcraft. MicroK8s should ideally be set up per https://juju.is/docs/sdk/dev-setup

Additional context NTA.

Saviq commented 2 years ago

Hi @sed-i, this sounds like a candidate for a Workflow, care to take a stab at it?

https://github.com/canonical/multipass-workflows

sed-i commented 2 years ago

@Saviq, launching a workflow would re-run the commands every time, correct? Is there a way to take the result of a workflow and turn it into an image? Just to save time on snap install etc.

Saviq commented 2 years ago

@sed-i currently we don't support custom images, but that's something we wanted to fix as well. What needs to be taken into account, though, is refreshing the image from time to time - and who will be responsible for that.

FWIW I've documented how to make Multipass-compatible images here:

https://discourse.ubuntu.com/t/building-multipass-images-with-packer/12361

sed-i commented 2 years ago

@Saviq How can I test locally my draft #5 ?

Saviq commented 2 years ago

@sed-i you can override the systemd service like so:

# /etc/systemd/system/snap.multipass.multipassd.service.d/override.conf
[Service]
Environment="MULTIPASS_WORKFLOWS_URL=https://github.com/sed-i/multipass-workflows/archive/refs/heads/charm-dev.zip"
sed-i commented 2 years ago

Is there a way to see stdout/stderr of the commands in the runcmd section? I am using multipass launch -vvvv and all I see is "Waiting for initialization to complete".

Saviq commented 2 years ago

Is there a way to see stdout/stderr of the commands in the runcmd section?

When you see "Waiting...", you can interrupt that and multipass shell …, and inside see /var/log/cloud-init*.