Jump to: navigation, search

Difference between revisions of "Reddwarf-dev-env"

Line 28: Line 28:
 
### When you set up the guest ubuntu, either create is with the 'ubuntu' user or add it: <pre>$ adduser ubuntu
 
### When you set up the guest ubuntu, either create is with the 'ubuntu' user or add it: <pre>$ adduser ubuntu
 
$ visudo</pre>
 
$ visudo</pre>
#### Add this line to the file below the root user <pre>$ ubuntu  ALL=(ALL:ALL) ALL</pre>
+
#### Add this line to the file below the root user <pre>$ ubuntu  ALL=(ALL:ALL) ALL</pre> <pre>**OR use this if you dont want to type your password to sudo a command**</pre> <pre>$ ubuntu  ALL=(ALL:NOPASSWD) ALL</pre>
<pre>**OR use this if you dont want to type your password to sudo a command**</pre>
 
<pre>$ ubuntu  ALL=(ALL:NOPASSWD) ALL</pre>
 
 
### Install ssh server on the guest: <pre>$ sudo apt-get install ssh (or openssh)</pre>
 
### Install ssh server on the guest: <pre>$ sudo apt-get install ssh (or openssh)</pre>
 
### Now, you can run ifconfig on the guest and get it's IP. Use that to ssh (as ubuntu) to it from your mac and continue working from there, it's easier ...
 
### Now, you can run ifconfig on the guest and get it's IP. Use that to ssh (as ubuntu) to it from your mac and continue working from there, it's easier ...

Revision as of 11:12, 7 April 2013

Reddwarf API and Redstack Dev Environment Set Up on Mac OS X

Intro

This article describes how to point a local running Reddwarf instance to a Devstack/Redstack deployment in a VM or Cloud instance. You should be able to debug and test your changes without having to deploy.

Prerequisites

Installing VMWare Fusion and Reddwarf services

VM

  1. In order to run reddwarf/redstack in a local VM, you need to start by installing a guest with Ubuntu 12.04 server. Download an image file from Ubuntu's web site (http://www.ubuntu.com/download/server) and create a new guest from it in your preferred virtualization solution (VMWare fusion, VirtualBox, Parallels, etc.)
    1. Recommended version ubuntu-12.04.1-server-amd64.iso
    2. Recommended RAM size is 2GB, but could probably work with 1GB if needed
    3. It seems no special network settings are needed in order to be able to access the guest from the host, the defaults work just fine
    4. It seems there is no need for the VMWare tools. They don't solve the copy/paste (or make working with the terminal any easier...) and we simply recommend using ssh instead. see details below.
    5. For better performance, make sure you go to the VM Settings -> Processors & Memory -> Advanced Options and check the "Enable hypervisor applications in this virtual machine" (see more about this at the bottom of this page: https://github.com/stackforge/reddwarf-integration)
    6. The full description of installing Redstack is described here: https://github.com/stackforge/reddwarf-integration/blob/master/README.md but we recommend you follow this path:
      1. When you set up the guest ubuntu, either create is with the 'ubuntu' user or add it:
        $ adduser ubuntu
$ visudo
        1. Add this line to the file below the root user
          $ ubuntu  ALL=(ALL:ALL) ALL
          **OR use this if you dont want to type your password to sudo a command**
          $ ubuntu  ALL=(ALL:NOPASSWD) ALL
      1. Install ssh server on the guest:
        $ sudo apt-get install ssh (or openssh)
      2. Now, you can run ifconfig on the guest and get it's IP. Use that to ssh (as ubuntu) to it from your mac and continue working from there, it's easier ...
      3. Get git:
        $ apt-get update
$ apt-get install git-core -y
      1. This is a good point to take a snapshot of this guest
      2. Clone this repo:
        $ git clone https://github.com/stackforge/reddwarf-integration.git
      3. Go into the scripts directory:
        $ cd reddwarf-integration/scripts/
        1. Install all the dependencies and then install reddwarf via devstack (this Brings up reddwarf (rd-api rd-tmgr) and initializes the reddwarf database)
          $ ./redstack install
      4. Since latest merges of Redstack in to Devstack, i'm not sure what is the exact state of the system at this point, since the screen session is already showing reddwarf-api and reddwarf-taskmanager as running in two of the screens. In any case you can "initialize" reddwarf by:
        1. running this, which encapsulate several calls:
$ ./redstack kick-start mysql
        1. or running the steps manually:
$ ./redstack build
$ ./redstack test-init (used to be "initialize"?)
$ ./redstack build-image mysql (or "percona")
        1. And starting it:
$ ./redstack start
      1. For more information and usage see here: https://github.com/stackforge/reddwarf-integration/blob/master/README.md
    1. There used to be an issue with precise getting jammed. We're not sure if this is still the case, but if you get into such issues, please check the workaround described here:
      1. Installing Ubuntu Precise on VMWare Fusion http://wiki.openstack.org/vmware-fusion-precise (just use defaults)
  1. VMWare Tweaks https://github.com/stackforge/reddwarf-integration/blob/master/README.md
  2. $ sudo apt-get install ssh (or openssh)
  3. Installing Devstack or Redstack on VMWare Fusion https://github.com/stackforge/reddwarf-integration

Local Dev

  1. On your local Mac: $ git clone https://github.com/stackforge/reddwarf.git
  2. Installing homebrew https://github.com/mxcl/homebrew/wiki/Installation
  3. $ brew install mysql
  4. Run reddwarf/reddwarf/tools/install_venv.py
  5. $ source ./venv/bin/activate
  6. Install python-swiftclient (maybe already installed)
  7. Install mysql-python (pip install mysql-python)
  8. Down the openssl tar ball from http://www.openssl.org/related/binaries.html
  9. Installing openssl on Mac OS X with cms enabled http://stackoverflow.com/questions/9275786/updating-openssl-version-on-osx
    1. as an alternative you can run
      brew install openssl
      and then back up and replace
      sudo cp /usr/bin/openssl /usr/bin/openssl_old; sudo cp /usr/local/Cellar/openssl/1.0.1e/bin/openssl /usr/bin/openssl; sudo chown root:wheel /usr/bin/openssl; sudo chmod 755 /usr/bin/openssl

Configuring local reddwarf files

  1. Update the host entries in reddwarf.conf.sample & reddwarf-taskmanager.conf.sample to point to the Devstack/Redstack host (i.e. nova_compute_url, nova_volume_url, notifier_queue_hostname)
  2. Update the reddwarf-guestagent.conf.sample as well if you are going to be running this locally.
  3. Update the host entries in api-paste.ini to point to the Devstack/Redstack host (i.e. keystone)

Configure python virtualenv for reddwarf project

  1. $ cd reddwarf/tools
  2. $ ./install_venv
  3. In your IDE set up the reddwarf project to use the projects .venv as the interpreter

Running the reddwarf services locally

Reddwarf scripts currently expect to be run from the project root folder. Configure your IDE to do this.

  1. $ bin/reddwarf-api --config-file=etc/reddwarf/reddwarf.conf.sample (web service)
  2. $ bin/reddwarf-taskmanager --config-file=etc/reddwarf-taskmanager.conf.sample (task manager)
  3. $ bin/reddwarf-guestagent --config-file=etc/reddwarf-guestagent.conf.sample (guest agent)

Notes

  • If the services are not run in the project root the reddwarf/extensions will not be loaded.
  • If you are developing guest agent code you will probably still have to copy files to the VM Devstack/Redstack