User Tools

Site Tools


juju

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
juju [2014/04/23 16:39]
gsamfira
juju [2015/08/17 11:37] (current)
Line 1: Line 1:
-====== Working with Juju and MaaS ======+======= Working with Juju and MaaS ======
 + 
 +:!: WARNING: reboot support is not yet merged. If you need to reboot please use old binaries :!:
  
 :!: For the sake of this example, we will assume that your MaaS IP is **192.168.200.1** :!: :!: For the sake of this example, we will assume that your MaaS IP is **192.168.200.1** :!:
Line 5: Line 7:
   * Install Go   * Install Go
  
-  sudo apt-get -y install golang-go git mercurial bzr+  sudo apt-get -y install golang-go git mercurial bzr mongodb
  
   * Set up your Go environment   * Set up your Go environment
  
-  echo "GOPATH=$HOME/golang>> ~/.bashrc +  echo 'export GOPATH=$HOME/golang>> ~/.bashrc 
-  echo "PATH=$PATH:$GOPATH/bin>> ~/.bashrc+  echo 'export PATH=$PATH:$GOPATH/bin>> ~/.bashrc
   . ~/.bashrc   . ~/.bashrc
   mkdir -p $GOPATH   mkdir -p $GOPATH
Line 18: Line 20:
   * Get a copy of juju-core from launchpad. This will pull in all other dependencies:   * Get a copy of juju-core from launchpad. This will pull in all other dependencies:
  
-  go get launchpad.net/juju-core/...+  go get -v github.com/juju/juju/...
  
-  * Get our patched version from git. This contains the windows support:+  * Get correct dependencies
  
-  rm -rf $GOPATH/src/launchpad.net/juju-core +  go get -launchpad.net/godeps 
-  git clone https://github.com/cloudbase/juju-core.git $GOPATH/src/launchpad.net/juju-core +  cd $GOPATH/src/github.com/juju/juju 
-  cd $GOPATH/src/launchpad.net/juju-core && git checkout rebase-1.19+  godeps --u dependencies.tsv
  
-  * Because of the way Go works, you will always get the latest revisions of dependencies. This might sometimes break the build of juju. The checkout from 19 April needs the following hack:+  * build juju
  
-  cd $GOPATH/src/code.google.com/p/go.crypto/ssh && hg update -r 191:2990fc550b9f # hack for this particular checkout of juju +  go install -v github.com/juju/juju/...
- +
-  * Build juju-core on Linux +
- +
-  go install -v launchpad.net/juju-core/...+
  
 Binaries will be in $GOPATH/bin Binaries will be in $GOPATH/bin
Line 38: Line 36:
  :!: Instructions for the Windows version can be found [[juju-windows|HERE]] :!:  :!: Instructions for the Windows version can be found [[juju-windows|HERE]] :!:
  
-==== Setting up your Juju environment ====+===== Setting up your Juju environment =====
  
  
Line 48: Line 46:
   * Set up juju to work with MaaS   * Set up juju to work with MaaS
  
-Go to your MaaS web interface under: 
- 
-  http://192.168.200.1:5240/account/prefs/ 
-   
-Where you will find: 
- 
-  MAAS keys 
- 
-  * Generate a new key for Juju and copy it to your clipboard. On the node where you have juju installed, edit the file that was generated by juju init: 
- 
-  sed -i 's/^default:.*/default: maas/g' ~/.juju/environments.yaml 
-  sed -i 's|maas-server: .*|maas-server: "http://192.168.200.1:5240/"|' ~/.juju/environments.yaml 
-  sed -i 's|maas-oauth: .*|maas-oauth: "<KEY FROM MAAS WEB UI>"|' ~/.juju/environments.yaml 
  
 +===== Generating local tools =====
  
   * Uploading juju tools to MaaS   * Uploading juju tools to MaaS
Line 69: Line 55:
   mkdir -p ~/.juju/tools/releases   mkdir -p ~/.juju/tools/releases
   cd ~/.juju/tools/releases   cd ~/.juju/tools/releases
-  cp ~/golang/bin/jujud . +  cp ~/golang/bin/jujud
-  tar -czf juju-1.19.1-trusty-amd64.tgz jujud+  tar -czf juju-1.21.1-trusty-amd64.tgz jujud
   rm jujud   rm jujud
      
-Do this for every version of ubuntu that you want to have tools for. Precise and Trusty should be enough for development. While its good practice to build the binary on each platform to make sure no breakage will happen, I have found that the same binary works great on all versions.+Do this for every version of ubuntu that you want to have tools for. Trusty should be enough for development.
  
-For windows machines you will need the JujuService.exe service wrapper. It must be bundeled with the tools. You may download it from {{:juju-service.tar.gz|Here}}:+For windows machines:
  
   cd ~/.juju/tools/releases   cd ~/.juju/tools/releases
-  wget http://wiki.cloudbase.it/_media/juju-service.tar.gz +  cp /location/to/jujud.exe . # this will have to be copied over from your Windows machine (see above) 
-  tar -xzf juju-service.tar.gz +  tar -czf juju-1.21.1-win2012hvr2-amd64.tgz jujud.exe
-  cp /location/to/jujud.exe .# this will have to be copied over from your Windows machine (see above) +
-  tar -czf juju-1.19.1-win2012r2-amd64.tgz *.exe+
   rm *.exe   rm *.exe
      
Line 91: Line 75:
      
 This will generate all metadata from the tools found in ~/.juju/tools/releases. The metadata files can be found in: This will generate all metadata from the tools found in ~/.juju/tools/releases. The metadata files can be found in:
- 
  
   ls -l /home/ubuntu/.juju/tools/streams/v1   ls -l /home/ubuntu/.juju/tools/streams/v1
  
 +
 +===== Setting up your configuration =====
 +
 +Go to your MaaS web interface under:
 +
 +  http://192.168.200.1/MAAS/account/prefs/
 +  
 +Where you will find:
 +
 +  MAAS keys
 +
 +  * Generate a new key for Juju and copy it to your clipboard. On the node where you have juju installed, edit the file that was generated by juju init:
 +
 +  sed -i 's/^default:.*/default: maas/g' ~/.juju/environments.yaml
 +  sed -i 's|maas-server: .*|maas-server: "http://192.168.200.1:5240/"|' ~/.juju/environments.yaml
 +  sed -i 's|maas-oauth: .*|maas-oauth: "<KEY FROM MAAS WEB UI>"|' ~/.juju/environments.yaml
  
   * Upload tools to MaaS:   * Upload tools to MaaS:
Line 109: Line 108:
      
 This will take a while. If your network is slow, the first time you try to bootstrap will fail. Juju has a timeout of 10 minutes. Don't panic, just run it again. MaaS caches your debs and the next time you try it will get from local cache. This will take a while. If your network is slow, the first time you try to bootstrap will fail. Juju has a timeout of 10 minutes. Don't panic, just run it again. MaaS caches your debs and the next time you try it will get from local cache.
 +
 +  * Set your nameserver to the MaaS IP address in resolv.conf (or equivalent)
 +
 +  echo 'nameserver 192.168.200.1' > /etc/resolv.conf # this will replace you nameservers
  
   * Check that the state machine has been bootstrapped:   * Check that the state machine has been bootstrapped:
juju.1398260397.txt.gz · Last modified: 2014/04/23 16:39 (external edit)