Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/axsh/wakame-os

Cluster Level Infrastructure Operating System
https://github.com/axsh/wakame-os

Last synced: about 2 months ago
JSON representation

Cluster Level Infrastructure Operating System

Awesome Lists containing this project

README

        

h1{color:green}. Wakame-os

Wakame-os is the Cluster Level Infrastructure Operating System. It is designed to be very simple to handle resources of cluster beyond the different cloud infrastructures. (Amazon EC2, Wakame-vdc, and etc in the future)

h2. Example: Running a remote code



require 'wakame'
process = Wakame::Process.setup(:credential => {:user => 'your_name'})

process.fork {
print "Running code on the remote!\n"
}

h2. Example: Launch a new instance



require 'wakame'
credential = {:user => 'your_name'}

instance = Wakame::SyncRpc('instance')
instance.create_instances(credential)

h2. Example: Configure instances & launch

You can build "the Hybrid-cloud," and use it in your code.
Difinition of specification have a logical name.

h3. config/cloud_catalog.rb



...(snip)...

cc.credential 'amazon_account' do |c|
c.access_key = 'YOUR_ACCESS_KEY'
c.secret_access_key = 'YOUR_SECRET_ACCESS_KEY'
end

...(snip)...

cc.spec 'aws_fedora_core_8' do |s|
s.credential = 'amazon_account'
s.driver = 'aws'
s.requirement do |r|
r.image_id = 'ami-84db39ed'
end
end

...(snip)...

h3. fork_sample.rb

You can use the logical name of specification in your code.



require 'wakame'
process = Wakame::Process.setup(:credential => {:user => 'your_name'},
:spec_name => 'aws_fedora_core_8')

process.fork {
print "Running code on the remote fedora core 8!\n"
}

h3. instance_sample.rb



require 'wakame'
credential = {:user => 'your_name'}

instance = Wakame::SyncRpc('instance')
instance.create_instances(credential, 'aws_fedora_core_8')

h2. Example: PI calc



require 'rubygems'
require 'wakame'
require 'rational'

credential = { :user => 'yam' }

process = Wakame::Process.setup( :credential => credential,
:spec_name => 'unknown'
)

queue = Wakame::Queue.setup

# How many compute?
dist = 30
challange = 1000000

dist.times { |no|
process.fork(no, challange, queue) { |no, challange, queue|
hit = 0

challange.times {
x = rand
y = rand
hit += 1 if x*x+y*y<1.0
}
queue.push [no, Rational(hit, challange)]
}
}

print "Process were distributed. Waiting results...\n"

rat = 0
dist.times { |i|
data = queue.pop
print "Arrival result #{i+1}/#{dist} from node number. #{data[0]} -> #{data[1]}\n"
rat += data[1]
}
print "Final result. PI = #{(rat * Rational(4, dist)).to_f}\n"