Cross-compiling agent binaries
Andrew Wilkins
andrew.wilkins at canonical.com
Fri Nov 6 10:28:42 UTC 2015
Hi everyone,
In https://lists.ubuntu.com/archives/juju-dev/2015-November/004831.html, if
you look closely at my pastebin you'll see a foreign-looking "juju tools
upload" command. While I was working on the Windows support for Azure, I
needed a way to have tools for the Windows machines when provisioning.
It's possible to create a tools metadata repository, but I wanted something
a less cumbersome, so I wrote a plugin to build and upload tools to a
running Juju controller:
https://github.com/axw/juju-tools
DISCLAIMER: this is intended for Juju developers only, and is not a
supported means of managing tools. Don't come crying to me when your
environment blows up.
There are two sub-commands:
juju tools build
juju tools upload
"build" will create a tools tarball given a binary version string. If you
don't specify a version, it'll sniff the host's arch, series and use
version.Current as the number. Assuming you're on Go 1.5, you can specify
an architecture or series/OS other than what your host is running, because
Go 1.5 supports cross compiling out of the box.
I'm on Ubuntu 15.04, amd64, and I can do:
juju tools build juju tools build 1.26-alpha2-win2012-amd64
juju tools build juju tools build 1.26-alpha2-precise-armhf
etc.
There are some flags, e.g. "-d" for the output directory; "-o" for the
output filename; "-s" to set the series and use the current host's arch and
version.Number.
"upload" will upload a tools archive to Juju over its HTTP API, and store
it in Mongo. Just specify the path to the archive, and it'll be uploaded to
your current environment.
Cheers,
Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20151106/c84332d7/attachment.html>
More information about the Juju-dev
mailing list