HI, I am trying to setup Juju test environment on my (M1) MacBook Pro. I have some LXD machines, MAAS server, LXD’s are registered in MAAS. But when I try to bootstrap juju agent on MAAS (or LXD), I am receiving following error:
ERROR failed to bootstrap model: cannot use agent built for "focal" using a machine running "OSX"
It looks like juju agent (controller) doesn’t support Apple Silicon (yet). How can I build and provide the agent to the local juju binary, so it will pick up and install on target cloud?
Can you clarify the version of the juju client you are using? Did you snap install it?
The error message you are seeing implies that no suitable published agent binaries can be found for the controller so juju is attempting to use the jujud agent from the snap instead. The error is unfortunate because the fact that the client is macos and the agent binary from the snap was compiled for focal should not matter if the controller is being created on a focal server.
Can you raise a bug for this with the details of your setup.
If the juju client is version 2.9.28 or earlier, I would have expected this to work as there would have been a suitable published jujud to use.
Developing juju on anything other than ubuntu is a challenge as the correct agent binaries are not built for bootstrap. As a juju developer using a Mac I’ve tried to get this working at various points. The sticking point for me was that I couldn’t get juju to cross compile for ubuntu while on osx correctly. There were compile issues with LXD.
You can bootstrap a released version of juju from the Mac. E.G. juju bootstrap aws --agent-version 2.9.28.
@wallyworld the Mac client we release is done via brew and not snap. We should look at what gets installed with it, which jujud.
@jas02, normally this would have worked. I think you got caught by an issue with our streams file in the 2.9.28 release process which has since been resolved. If you’d bootstrapped with aws, you wouldn’t have seen the issue.
juju was building an agent because it couldn’t find the correct ones in the streams.
I am trying to bootstrap with aws and this happens as well
Creating Juju controller "test2" on aws/us-east-1
Looking for packaged Juju agent version 2.9.32 for arm64
ERROR failed to bootstrap model: cannot use agent built for "focal" using a machine running "OSX"
Hi, @dash3. You should be able to bootstrap by passing a constraint:
juju bootstrap aws --constraints arch=amd64
This is because Juju, for legacy reasons, assumes that your client and controller are using the same architecture. When there is a mismatch in arch, you need to specify that arch you want to use on the controller.
Multipass works beautifully on my own M1, so that’s definitely a great alternative!
One caution: I have run into issues building charms with charmcraft on ARM boxen, regardless of OS, because there are not yet ARM builds of the charmcraft multipass images. You can work around this by running charmcraft with the --destructive flag. It’s a great idea to be in the safe little cocoon of a vm already when you do this, so that you don’t pollute the host system’s libraries