Pages

Sunday, February 24, 2013

Deploy Trac on OpenShift in under 5 minutes

If you have't played with Openshift yet, you should.  PaaS is going to change custom application development cycles and deployment processes in a much needed way.

One of the best things about PaaS is being able to fire up applications very quickly, and get straight to writing code.  But you still need to tools to support the process... like defect tracking.

I didn't see development tool for defect tracking on OpenShift so I decided to create a Trac quickstart.  This quickstart will have you running Trac in under 5 minutes.

The GitHub URL for my quickstart is here:

Here is how you deploy it:
  • If you haven't already, register for a free account at http://openshift.redhat.com.
  • Create a new application.
  • "Choose type of application" -> scroll to bottom and select 'do it yourself'.
  • For public URL, name the application name what you would want your Trac repo to be named, i.e. ProjectX
  • Click Create application

The following steps...
  • Clone the GitHub repository
  • cd into the git dir
  • Add your openshift application git repo as a remote git repository
  • Overwrite your openshift repo with the openshift-diy-trac one
git clone https://github.com/brianwcook/openshift-diy-trac.git
cd openshift-diy-trac
git remote add openshift [your openshift git REPO URL here]
git push -f openshift


Let me know how this goes for you in the comments.  I'm interested in feedback on this quickstart or others that you would like to see.



Friday, February 22, 2013

Installing Openstack Folsom on Red Hat Enterprise Linux 6.4


These are quick directions to get a test instance of Openstack up on RHEL 6.4 using the Red Hat Openstack Folsom bits.

If you need access to the Openstack bits from Red Hat, go here and register for the preview:

http://www.redhat.com/openstack/

Build a RHEL 6.4 box with 2 network interfaces.  It helps to install the desktop so you can use firefox on horizon.

Ensure that the hostname is set properly in /etc/sysconfig/network and /etc/hosts.

subscription-manager attach --pool=[use your RHEL pool ID]

subscription-manager list --available
#[find pool ID for openstack subscriptions]

subscription-manager subscribe --pool=[use your openstack pool id]
subscription-manager list --consumed  #just to check everything is subscribed right
ssh-keygen
yum -y install yum-utils yum-plugin-priorities
yum-config-manager --disable rhel-server-ost-6-preview-rpms
yum-config-manager --enable rhel-server-ost-6-folsom-rpms --setopt="rhel-server-ost-6-folsom-rpms.priority=1"
yum repolist # just to check you have the folsom repository enabled correctly
yum update -y
reboot
yum install -y openstack-packstack
packstack

# Point to root's ssh key when asked, and take all the defaults EXCEPT don't install Cinder!
Packstack saves the environment variables you need to get things working in ~/keystonerc_admin. Source the file to setup your environment:
source ~/keystonerc_admin

At this point you need to register an image.  You can use a kvm image, I copied a virtualbox VDI image using shared folders and converted it using qemu-img convert.  You can download an f18 image here.
glance  image-create --name="name-of-your-image" --is-public=true --disk-format=qcow2 --container-format=bare < /path/to/your/img.qcow2

If this doesn't work your environment variables are probably wrong.  Check to see if the variables above are set right.
If you are building openstack in a VM, edit /etc/nova/nova.conf and change libvirt_type from kvm to qemu.
Then:
service openstack-nova-compute restart

open firefox and go to 127.0.0.1, login to horizon as [admin / password]

Check images, yours should show up.

Go to project -> instances -> launch instance.

And now you have a working all in one Openstack box!

Serving NFS to guests using VirtualBox on OS X

The other day, I was trying to setup a NFS share on my Mac that VirtualBox guests could mount.

It didn't work for a while, and then I found a server option which cleared things up.

Funny enough, the OS X manual says that there is a 'false belief that this requirement increases security', yet they left the default as 1.  Fix with the following:
# /etc/nfs.conf
nfs.server.mount.require_resv_port = 0
You'll have to create this file, it doesn't exist by default.

Then just run:
nfsd update
Then you should be able to export to your VM's like this:
# /etc/exports
/Users/brian/share -mapall=501:20 -alldirs 127.0.0.1
This works well because it shares only to the loopback which gives all your NAT'd VMs access, but no one else. Also it maps all operations to your user ID and group ID so permissions in the share folder stay sane. Your user ID and GID will usually be 501 and 20 on a Mac, but if you want to check, do it like this:
bcook-air:~ brian$ id 
uid=501(brian) gid=20(staff) groups=20(staff),12(everyone),33(_appstore),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),100(_lpoperator),204(_developer),401(com.apple.access_screensharing)
The first two things there are what you are looking for. Don't forget to run nfsd update again after making changes to the exports file.