diff options
| author | Matthew Hicks <mhicks@mhicks-host.usersys.redhat.com> | 2008-06-24 10:50:35 -0400 |
|---|---|---|
| committer | Matthew Hicks <mhicks@mhicks-host.usersys.redhat.com> | 2008-06-24 10:50:35 -0400 |
| commit | 3f4e31f648eb7f744cf385cfc5e333eaa3378738 (patch) | |
| tree | fc6b95dce2193c390f712accd4f20fd9c4d15c53 /cloudmasterd/extra | |
| parent | 4ec70ff34acf9ef7733cf6dc606a147a9c3ca9bd (diff) | |
| download | tools-3f4e31f648eb7f744cf385cfc5e333eaa3378738.tar.gz tools-3f4e31f648eb7f744cf385cfc5e333eaa3378738.tar.xz tools-3f4e31f648eb7f744cf385cfc5e333eaa3378738.zip | |
Cloud master cleanup
Diffstat (limited to 'cloudmasterd/extra')
| -rw-r--r-- | cloudmasterd/extra/cloudmasterd.apache (renamed from cloudmasterd/extra/cloudmasterd.conf) | 0 | ||||
| -rw-r--r--[-rwxr-xr-x] | cloudmasterd/extra/cloudmasterd.init (renamed from cloudmasterd/extra/cloudmasterd.redhat) | 0 | ||||
| -rw-r--r-- | cloudmasterd/extra/cloudmasterd.spec | 32 | ||||
| -rw-r--r-- | cloudmasterd/extra/config.yml | 88 | ||||
| -rwxr-xr-x | cloudmasterd/extra/prime-example-db.rb | 35 |
5 files changed, 141 insertions, 14 deletions
diff --git a/cloudmasterd/extra/cloudmasterd.conf b/cloudmasterd/extra/cloudmasterd.apache index eee8b37..eee8b37 100644 --- a/cloudmasterd/extra/cloudmasterd.conf +++ b/cloudmasterd/extra/cloudmasterd.apache diff --git a/cloudmasterd/extra/cloudmasterd.redhat b/cloudmasterd/extra/cloudmasterd.init index 0021f44..0021f44 100755..100644 --- a/cloudmasterd/extra/cloudmasterd.redhat +++ b/cloudmasterd/extra/cloudmasterd.init diff --git a/cloudmasterd/extra/cloudmasterd.spec b/cloudmasterd/extra/cloudmasterd.spec index 7d77ac8..47bdeae 100644 --- a/cloudmasterd/extra/cloudmasterd.spec +++ b/cloudmasterd/extra/cloudmasterd.spec @@ -1,16 +1,15 @@ -# Generated from cloudmasterd-0.1.0.gem by gem2rpm -*- rpm-spec -*- %define ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']") %define gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null) %define gemname cloudmasterd %define geminstdir %{gemdir}/gems/%{gemname}-%{version} -Summary: daemon for machine configuration +Summary: Everest library and web application for managing cloud machines Name: rubygem-%{gemname} Version: 1.0.0 Release: 1%{?dist} Group: Development/Languages License: GPLv2 -URL: http://cloudmasterd.rubyforge.org +URL: https://fedorahosted.org/everest Source0: %{gemname}-%{version}.gem BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: httpd @@ -30,8 +29,17 @@ BuildArch: noarch Provides: rubygem(%{gemname}) = %{version} %description -daemon for machine configuration +The cloudmasterd daemon runs by default on port 8107 that is proxy passed by +apache from the root context. This daemon provides a REST style interface to +both create new machine instances and manage the existing machine instances. +It also provides a view of the cloud instances available and the amount of +free memory that is available. A cloud consists of multiple cloud instances +(e.g. cloud1.example.org, cloud2.example.org) which in turn host multiple +machine instances (e.g. jboss1.example.org, jboss2.example.org). +Func (https://fedorahosted.org/func) is used to aggregate all the information +from the individual cloud instances to store in a sqlite database on the +cloud master. %prep @@ -44,14 +52,13 @@ gem install --local --install-dir %{buildroot}%{gemdir} \ --force --rdoc %{SOURCE0} mkdir -p %{buildroot}/%{_bindir} mv %{buildroot}%{gemdir}/bin/* %{buildroot}/%{_bindir} -mv %{buildroot}%{geminstdir}/extra/cloudmasterd.redhat %{buildroot}/etc/init.d/cloudmasterd -mv %{buildroot}%{geminstdir}/config.example.yml %{buildroot}/etc/cloudmasterd/config.yml -rmdir %{buildroot}%{gemdir}/bin +mv %{buildroot}%{geminstdir}/extra/cloudmasterd.init %{buildroot}/etc/init.d/cloudmasterd +mv %{buildroot}%{geminstdir}/extra/config.yml %{buildroot}/etc/cloudmasterd/config.yml find %{buildroot}%{geminstdir}/bin -type f | xargs chmod a+x # Put in the apache rules mkdir -p %{buildroot}/etc/httpd/conf.d -mv %{buildroot}%{geminstdir}/extra/cloudmasterd.conf %{buildroot}/etc/httpd/conf.d +mv %{buildroot}%{geminstdir}/extra/cloudmasterd.apache %{buildroot}/etc/httpd/conf.d/cloudmasterd.conf %clean rm -rf %{buildroot} @@ -62,11 +69,8 @@ rm -rf %{buildroot} %{_bindir}/cloudmasterd-sync %{gemdir}/gems/%{gemname}-%{version}/ %doc %{gemdir}/doc/%{gemname}-%{version} -%doc %{geminstdir}/History.txt -%doc %{geminstdir}/License.txt -%doc %{geminstdir}/Manifest.txt -%doc %{geminstdir}/README.txt -%doc %{geminstdir}/website/index.txt +%doc %{geminstdir}/LICENSE +%doc %{geminstdir}/README %{gemdir}/cache/%{gemname}-%{version}.gem %{gemdir}/specifications/%{gemname}-%{version}.gemspec %config /etc/cloudmasterd/config.yml @@ -76,5 +80,5 @@ rm -rf %{buildroot} /etc/init.d/cloudmasterd %changelog -* Thu Apr 24 2008 <bleanhar@bleanhar-jboss-dev.usersys.redhat.com> - 0.1.0-1 +* Tue Jun 24 2008 <mhicks@redhat.com> - 1.0.0-1 - Initial package diff --git a/cloudmasterd/extra/config.yml b/cloudmasterd/extra/config.yml new file mode 100644 index 0000000..3343821 --- /dev/null +++ b/cloudmasterd/extra/config.yml @@ -0,0 +1,88 @@ +# AN IMPORTANT NOTE ABOUT YAML CONFIGURATION FILES: +# !!! Be sure to use spaces instead of tabs for indentation, as YAML is very +# !!! sensitive to white-space inconsistencies! + +##### HTTP SERVER ##################################################################### + +# Under what HTTP environment are you running the Cloudmasterd server? The following methods +# are currently supported: +# +# webrick -- simple stand-alone HTTP server; this is the default method +# mongrel -- fast stand-alone HTTP server; much faster than webrick, but +# you'll have to first install the mongrel gem +# + +### webrick example + +server: webrick +port: 8107 + +### webrick SSL example + +#server: webrick +#port: 443 +#ssl_cert: /path/to/your/ssl.pem + +# if the private key is separate from cert: +#ssl_key: /path/to/your/private_key.pem + + +### mongrel example + +#server: mongrel +#port: 8106 + +# It is possible to run mongrel over SSL, but you will need to use a reverse proxy +# (try Pound or Apache). + + +##### DATABASE ######################################################################## + +# The Blog needs a database to store its records. +# +# By default, we use MySQL, since it is widely used and does not require any additional +# ruby libraries besides ActiveRecord. +# +# With MySQL, your config would be something like the following: +# (be sure to create the blog database in MySQL beforehand, +# i.e. `mysqladmin -u root create blog`) + +#database: +# adapter: mysql +# database: blog +# username: root +# password: +# host: localhost + + +# Instead of MySQL you can use SQLite3, PostgreSQL, MSSQL, or anything else supported +# by ActiveRecord. +# +# If you do not have a database server available, you can try using the SQLite3 +# back-end. SQLite3 does not require it's own server. Instead all data is stored +# in local files. For SQLite3, your configuration would look something like the +# following (don't forget to install the 'sqlite3-ruby' gem first!): +# +#database: +# adapter: sqlite3 +# dbfile: /var/lib/blog.db + +##### EVERESTD ######################################################################## + + +##### LOGGING ######################################################################### + +# This log is where you'll want to look in case of problems. +# +# By default, we will try to create a log file named 'blog.log' in the current +# directory (the directory where you're running the blog from). A better place to put +# the log is in /var/log, but you will have to run blog as root or otherwise give +# it permissions. +# +# Set the level to DEBUG if you want more detailed logging. Other options are +# INFO, WARN, and ERROR (DEBUG is most verbose, ERROR is least). + +log: + level: DEBUG + file: /var/log/cloudmasterd.log +# level: INFO diff --git a/cloudmasterd/extra/prime-example-db.rb b/cloudmasterd/extra/prime-example-db.rb new file mode 100755 index 0000000..0788c8f --- /dev/null +++ b/cloudmasterd/extra/prime-example-db.rb @@ -0,0 +1,35 @@ +#!/usr/bin/env ruby + +require 'rubygems' +require 'sqlite3' +require 'active_record' + +# This is an example of how you can prime the cloudmaster database with +# values to allow for testing without actually having func running +ActiveRecord::Base.logger = Logger.new(STDOUT) +ActiveRecord::Base.colorize_logging = true + +ActiveRecord::Base.establish_connection( + :adapter => "sqlite3", + :dbfile => "/var/lib/cloudmaster.db" +) + +class Machine < ActiveRecord::Base + set_table_name "cloudmasterd_machine" +end + +class Cloud < ActiveRecord::Base + set_table_name "cloudmasterd_cloud" +end + +# Create the cloud instances +Cloud.create :name => "cloud1.example.org", :memory => 1024 +Cloud.create :name => "cloud2.example.org", :memory => 512 +Cloud.create :name => "cloud3.example.org", :memory => 16125 + +# Create the corresponding machines +Machine.create :name => "system1.example.org", :email => "user1@example.org", :cloud => "cloud1.example.org", :state => "Installing" +Machine.create :name => "system2.example.org", :email => "user1@example.org", :cloud => "cloud1.example.org", :state => "Installing" +Machine.create :name => "system3.example.org", :email => "user1@example.org", :cloud => "cloud2.example.org", :state => "Installing" +Machine.create :name => "system4.example.org", :email => "user2@example.org", :cloud => "cloud3.example.org", :state => "Installing" +Machine.create :name => "system5.example.org", :email => "user2@example.org", :cloud => "cloud2.example.org", :state => "Installing" |
