Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/axsh/wakame-os
- Owner: axsh
- Created: 2010-08-30T14:32:21.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2010-09-24T14:32:46.000Z (over 14 years ago)
- Last Synced: 2023-04-18T20:26:48.573Z (over 1 year ago)
- Language: Ruby
- Homepage:
- Size: 160 KB
- Stars: 10
- Watchers: 17
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.textile
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"