Virgo is a project for building on-host agents. Virgo's goal is to provide shared infrastructure for various types of agents while maintaining a small footprint.
Virgo provides:
- A high level scripting language in Lua using Luvit (an event driven framework).
- The ability to perform self updating.
- Crash capturing and reporting through Google's Breakpad.
- Packages, Installers and related goodies.
- Automatic .zip bundle generation from a directory (ie, easy deployment).
- Automatic versioning from .git introspection of both virgo and the bundle.
The first agent to use this infrastructure is the Rackspace Cloud Monitoring agent. Join in and build your agent with us.
virgo is distributed under the Apache License 2.0.
Virgo only understand Lua files in the context of a zipped bundle. It will automatically require the root level init.lua file as the entry point. Bundle files can be automatically generated by specifing the bundle directory at precompile time with the flag --bundle=path_to_lua_stuffs. Otherwise, Virgo will bundle the included example directory.
Virgo obeys the following rules when generating bundles:
- Only Lua files are included ...
- except the files in the root level "static" directory (ie, you can ship fixtures for testing if you want).
- Lua files and folders found under the root lua_modules dir are globally accessible and are not lazily loaded.
This bundles will take the name of the final directory that was specified to configure plus the suffic "-bundle.zip".
The agent is versioned with a three digit dot seperated "semantic version" with the template being x.y.z. An example being e.g. 1.4.2. The rough meaning of each of these parts are:
-
major version numbers will change when we make a backwards incompatible change to the bundle format. Binaries can only run bundles with identical major version numbers. e.g. a binary of version 2.3.1 can only run bundles starting with 2.
-
minor version numbers will change when we make backwards compatible changes to the bundle format. Binaries can only run bundles with minor versions that are greater than or equal to the bundle version. e.g. a binary of version 2.3.1 can run a 2.3.4 bundle but not a 2.2.1 bundle.
-
patch version numbers will change everytime a new bundle is released. It has no semantic meaning to the versioning.
The zip file bundle and the binary shipped in an rpm/deb/msi will be identical. If the binary is 1.4.2 then the bundle will be 1.4.2.
./configure --bundle=some_dir
make
make test
Rackspace customers: Virgo is the open source project for the Rackspace Cloud Monitoring agent. Feel free to build your own copy from this source.
But! Please don't contact Rackspace Support about issues you encounter with your custom build. We can't support every change people may make and master might not be fully tested.
Add the EPEL repo and install dependencies
# rpm -ivh http://mirror.hiwaay.net/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
# yum update
# yum groupinstall 'Development Tools'
# yum install git python26 gcc44 gcc44-c++
Default to python2.6:
# ln -s /usr/bin/python2.6 /usr/local/bin/python
# export PATH=/usr/local/bin:$PATH
Clone the repository:
# git clone https://github.com/racker/virgo.git
Configure and Build:
# ./configure
# CC=gcc44 CXX=g++44 make
# CC=gcc44 CXX=g++44 make install
Install the following:
- Windows .NET 4 Framework (Full Framework, not client): http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=17851
- Python 2.7: http://www.python.org/download/releases/2.7.3/
- MSYS Git: http://code.google.com/p/msysgit/downloads/list?q=full+installer+official+git (does not work with cygwin git)
- Windows 7 SDK: https://www.microsoft.com/download/en/details.aspx?id=8279
- VS 2010 C++ Express: http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express
- VS 2010 SP1: https://www.microsoft.com/download/en/details.aspx?id=23691
Once the dependencies are installed:
python configure --bundle=some_dir
Now you can open monitoring-agent.sln
from Visual Studio.
If you wish to compile from the command line, run:
python tools/build.py build
See also: http://www.chromium.org/developers/how-tos/build-instructions-windows
# pkg_add -r git
# pkg_add -r gcc46
# git clone https://github.com/racker/virgo
# cd virgo
# git submodule update --init --recursive
# ./configure
# setenv CC gcc46
# gmake -C out
# gmake install
# cp base/pkg/freebsd/rackspace-monitoring-agent.init /etc/rc.d/rackspace-monitoring-agent
# chmod 755 /etc/rc.d/rackspace-monitoring-agent
Edit /etc/rc.conf and append:
rackspace-monitoring-agent_enable="YES"
yum install rpm-build
make rpm
Find the rpms in out/rpmbuild/RPMS/
apt-get install devscripts
make deb
Find the deb in out/debbuild/