Quantcast
Channel: Planet Ubuntu
Viewing all articles
Browse latest Browse all 12025

Ben Howard: BETA: Local Juju deployments on your Linux/OSX/Windows machine the same way you deploy in the cloud

$
0
0

Quickly Getting Started with Juju

A few weeks ago, my peers accosted me and informed me that we really need something to help with people getting started on Juju. While Juju is a really awesome, people just want to start using and playing with it. What they wanted was a Juju image that could enable someone to run Juju on their MacOS X, Windows or Ubuntu installation without much effort.

The result of that conversation is the Juju Vagrant images. The initial image is based on the Ubuntu Cloud Images. Juju is configured to use the local LXC provider and is preseeded with the latest 12.04 LTS release so deployments should be relatively fast.

The image gives you a couple of things:
  1. A Vagrant development environment for developing your charms
  2. the Juju GUI accessible locally through your browser
  3. A functional, self-contained Juju environment

Dependencies

Ubuntu (and other Linux's), Windows and MacOS are all target platforms. The following instructions will help you get setup.

Ubuntu:

  • sudo apt-get update
  • sudo apt-get -y install virtualbox vagrant
  • (optional): sudo apt-get -y install sshuttle

MacOS

  • Fetch and install VirtualBox from https://www.virtualbox.org/
  • Install Vagrant from http://downloads.vagrantup.com/tags/v1.3.3
  • (optional) Install Sshuttle:
    • via homebrew: brew install sshuttle

Windows

  • Fetch and install VirtualBox from https://www.virtualbox.org/
  • Install Vagrant from http://downloads.vagrantup.com/tags/v1.3.3
  • (optional) Install Sshuttle:
    • Requires nodejs is installed
    • Run: "npm install sshuttle"

Chose the box

Vagrant uses "boxes," as a way of distributing the virtual machine images. We have put all our boxes on the Ubuntu Cloud Images site. The quick links are:

Fire it up!

Vagrant makes getting started really easy. The easy steps are:
  1. Choose a directory to work in. This directory will be shared with the guest, and contain the vagrant configuration for the machine.
  2. Run: "vagrant box add JujuQuickStart <URL>", 
  • for example: "vagrant box add JujuQuickStart http://cloud-images.ubuntu.com/vagrant/saucy/current/precise-server-cloudimg-amd64-juju-vagrant-disk1.box"
  • This will download the box from the URL you chose above. 
  • The box will be given the name of "JujuQuickStart"
  • Initialize the environment by running: "vagrant init JujuQuickstart"
  • Start the box: "vagrant up"
    1. The box will start and configure Juju for you
    2. In order to access the GUI, go to "http://127.0.0.1:6080"
    3. While the Juju GUI is deployed, you will see a status page
    4. Once the GUI is deployed, it will display the password on the login page
    5. The GUI is only accessible from your local host
  • Use Juju
    1. From this GUI you can deploy any charm from the store, and it will be launched inside an LXC container in the Vagrant image - no other configuration required!
    2. If you “vagrant ssh” into the image, you can run the Juju CLI tool if you prefer to use that.
    3. For development, “/vagrant” is shared with the host, this means you can hack on your charm/application locally without having to spend money in a cloud. We recommend 12.04 images for this.
    4. Mess up? “vagrant destroy” and “vagrant up” on the host will create a pristine environment for you to work with, all while preserving “/vagrant” within the Vagrant Box.
  • Vagrant lifecylce
    1. to shut down the machine run "vagrant halt"
    2. to destroy it, run "vagrant destroy"
    3. to ssh in, run "vagrant ssh"
    4. to remove a box, run "vagrant box remove JujuQuickStart virtualbox"

    (optional) SSHuttle

    If you  want to use this for developing Juju Charms, you can do so with the aid of SSHuttle. SSHuttle is a slick tool for using SSH as a VPN. When used with the Juju Quickstart images, it means that you can have a completely disposable development environment, you can use your preferred editor, and access your charms locally.

    The Juju Quickstart uses 10.0.3.0/24 as the LXC network. To grant local access to that group, run:
    • sshuttle -e 'ssh -o UserKnownHostsFile=/dev/null vagrant@localhost:2222' 10.0.3.0/24
    • Use the password of "vagrant"

    BETA Warning

    While these images are based on the Ubuntu Cloud Images, they should be treated as beta quality images. I suspect that after people kick the tires that feature requests will come my way. Should you encounter a problem, please pop into #juju on Freenode and ask me (utlemming) -- or the Juju community -- questions. Obviously, as this is a beta image, please be patient if the image fails to work for you. As always, feedback, comments, and heckling is appreciated.



    Viewing all articles
    Browse latest Browse all 12025

    Trending Articles