ucrcsedept / galah

An automated grading system geared towards processing computer programming assignments.
Apache License 2.0
42 stars 8 forks source link

Create workflow to bring up Dev VM w/ CentOS 6, Redis, MongoDB, OpenVZ, and Galah. #396

Closed itsjohncs closed 10 years ago

itsjohncs commented 10 years ago

This is a subtask of #389. In order to begin meaningful development on the core module, I need a machine with Redis and MongoDB installed. I don't want to install those on my laptop and I also want an easy way to start over, therefore I want to set up Vagrant.

The VM should be running the CentOS 6 image we got from UCR's sysadmin team. It should be installed with Redis and MongoDB running a minimal-footprint configuration (no persistence for Redis and small data files without preallocation for MongoDB). OpenVZ should be properly installed. Galah should be cloned from git and no further installation steps should occur.

This will be the first Vagrantfile I create so I will document useful articles and documentation I find here.

itsjohncs commented 10 years ago

Something very unfortunate is that the Redis package that exists in EPEL does not use Lua scripting which is a feature I was planning on using heavily.

itsjohncs commented 10 years ago

I can use transactions instead and add in Lua scripting later that only enables itself when an appropriate Redis version is detected.

itsjohncs commented 10 years ago

MongoDB exists in EPEL which I wasn't aware of under the package name mongodb (who woulda thunk it). Version 2.4.6. This is awesome because we should be able to get away with only adding EPEL as an additional repo which UCR's sysadmins will love.

itsjohncs commented 10 years ago

So it looks like adding a new Yum repo via Ansible can be done a few different ways, and none of them are exactly ideal. I think the way I will prefer is by using the ini_file module.

I can do a little sanity check with yum repolist to check if EPEL is already installed, but I don't know if that'll be worth it. Probably not for now anyways since the parsing is going to be super annoying there.

itsjohncs commented 10 years ago

An interesting bug report in EPEL I noticed: https://bugzilla.redhat.com/show_bug.cgi?id=702764

itsjohncs commented 10 years ago

Thought of something as I was falling asleep. Not exactly the right thread for this but w/e.

The entries for the different components in Redis can have a TTL set that is reset by the component at certain intervals. This will allow a heartbeat that doesn't require an overseer component for cleanup.

Sleep time now.

itsjohncs commented 10 years ago

OpenVZ is also needed here. Updating issue description.

itsjohncs commented 10 years ago

I think the MongoDB packages on EPEL 6 are broken :cry:.

[vagrant@localhost ~]$ mongod
mongod --help for help and startup options
mongod: symbol lookup error: mongod: undefined symbol: _ZN7pcrecpp2RE4InitEPKcPKNS_10RE_OptionsE

I did poke at the configuration file so I'll try a clean install, but it looks like we might need to get the package from 10gen's repos since this will be super annoying to fix.

itsjohncs commented 10 years ago

Destroying the Vagrant machine with whatever I've come up with running on it is taking a very, very long time. Not sure why yet.

itsjohncs commented 10 years ago

I this happens again, the recommended action seems to just kill the VirtualBox process running the VM, which is equivalent to unplugging a physical machine.

itsjohncs commented 10 years ago

So the EPEL RPM for MongoDB is unusable. The Redis version is also ancient. To fix each of these problems we'll get MongoDB from 10-gen's servers, and we'll host our own RPM's of Redis alongside Galah (easily created via fpm). For now we can just install Redis from source from Ansible for the dev environments.

itsjohncs commented 10 years ago

Bringing up a Vagrant box with just Redis and MongoDB on it takes a very long time, OpenVZ will take a massively large time in comparison. After I get this working I'll definitely want to plug it into Packer so we can just boot into a prepared machine. Fortunately that looks like a wonderfully straightforward process.

itsjohncs commented 10 years ago

Added OpenVZ provisioning in b9aa407979d14cdf6d65defa6d74c7ac184c2f4c. Now I just want to organize things a little better, probably split off some general playbooks (installation without configuration maybe) from the vagrant stuff. I should also make an actual inventory file.

Looking good though. I'll also want to add in cloning Galah because I haven't done that yet.

itsjohncs commented 10 years ago

Also, it takes about 4 minutes to bring up a clean machine. Not terrible but Packer will definitely be welcome. Probably want to leave it until later though since it's not really a priority. Hopefully I won't have to scrap these machines very often.

itsjohncs commented 10 years ago

I should also host the base image somewhere and have the URL in the vagrant file to make this easier.

itsjohncs commented 10 years ago

The git repo doesn't need to be installed because of how Vagrant is set up. It mounts the files in the git repo to /vagrant on the virtual machine. I think I have to tell it that the root of the git repo is a ways above it though.

itsjohncs commented 10 years ago

This has been finished in 970b61de7d7ca546316207d81617022ad42cf94e.