Installing Apache Wave on Openstack

What is Apache Wave

You probably wouldn’t be here if you didn’t already know that Apache Wave is the port of Google’s defunct Wave protocol.

From the Wave incubator project page:
Wave is a distributed, near-real-time, rich collaboration platform that allows users to work together in new and exciting ways. Wave allows for flexible modes of communication, blending chat, email and collaborative document editing in to one seamless environment. Wave provides a lively and responsive environment that promotes more fluid and dynamic collaboration between users. The addition of Robots and [Gadgets] allow the Wave platform to provide intelligence, integration, and customizability to the users experience.

About this installation

There aren’t any reliable binaries for Apache Wave right now, so any running server binary has to be compiled from source. The source code is changing frequently, so ymmv on how often you’d like to recompile to get the latest updates.

For this installation, I’ll be using a CentOS 6.3 (x86_64) VM running on Openstack. My VM has 4GB RAM and 8GB root partition.  Because you’ll be compiling source code, I wouldn’t recommend less than 2GB RAM for the machine.

Preparation

You’ll need either access to the root user, or sudo permissions to run as root for package management tasks.
You’ll also need a user that manages the wave code — this user should NOT be root nor have sudo privileges.

Install dependencies

Using yum for package management, the basic command structure is:
$> sudo yum install -y [package1[,package2,...,packageN]]
The list of dependency packages is:

  • subversion
  • java-1.6.0-openjdk
  • java-1.6.0-openjdk-devel
  • mongodb
  • ant
  • git
  • ant-trax (used during test execution)
  • ant-junit (used during test execution)

Compile the Source

As your non-sudo wave user, fetch the source code using the link from the project’s source code page:
svn co https://svn.apache.org/repos/asf/incubator/wave/trunk

This will make a ./trunk subfolder from whatever folder you ran the command in. Enter the folder and execute the build commands to get started:
ant get-third-party; ant
The ant get-third-party initial command fetches a few packages needed by the build-common.xml. Mostly likely you’ll see emma and junit in this list; I haven’t seen any other dependencies yet. But, the build will quickly fail without these additional packages.

Depending on your machine, the build might take 10 minutes and it might take an hour (more power = faster) so grab a cup of coffee.

Configure and Startup

You need to provide a server configuration before starting up the wave server. You can do this as simply as:
ant -f server-config.xml to use all default values and generate a basic configuration file pointed to localhost:9898.
This works for some, but with Openstack this probably doesn’t get you the needed results. Assuming that you’re using both a fixed_ip and a floating_ip for your VM, you’ll get “unable to bind” exceptions if you try to start up the server configured to bind the floating_ip as the application’s public IP address. But, because Openstack already NATs the fixed and floating IPs, you can give this config file the VM’s fixed IP address and “it’ll work”.

Instead, you can use a few extra parameters to set additional values:
ant -f server-config.xml -Dwave_server_domain=(domain) -Dhttp_frontend_address=(VM's fixed private IP):9898 -Dhttp_websocket_presented_address=(VM's floating IP):9898

Once that is done, you’re ready to fire it up! In the trunk directory:
$> ./run-server.sh &
will start the server. I like to include the & to run it as a background process. You should be able to navigate to the VM floating_ip:9898 and get a login page.

Final Thoughts

There are additional fields in server.config that you’ll want to set. Minimally, you want to configure the admin_user field, and then register that user for an account. If you’re feeling adventurous, you can convert the data storage from files to mongodb.

Hope this has been helpful.