Permalink
Browse files

mvstore->cf (first rev) + merged-in post-r7 master + disabled mvstore…

… by default

Change-Id: I23950a9022c52b5d9d928aaa9df985a8478f0645
  • Loading branch information...
1 parent 0450a42 commit 06807163405264cb9f68b67968dd72fe9462cfd3 @mwindisch mwindisch committed Dec 12, 2011
View
4 bin/services/mvstore_gateway
@@ -0,0 +1,4 @@
+#!/usr/bin/env ruby
+# Copyright (c) 2009-2011 VMware, Inc.
+
+exec(File.expand_path("../../../services/mvstore/bin/mvstore_gateway", __FILE__), *ARGV)
View
3 bin/services/mvstore_node
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+
+exec(File.expand_path("../../../services/mvstore/bin/mvstore_node", __FILE__), *ARGV)
View
4 bin/vcap
@@ -356,6 +356,8 @@ module Run
puts
kill_service_instances('mongodb', /mongod/)
puts
+ kill_service_instances('mvstore', /mvstore/)
+ puts
kill_service_instances('neo4j', /neo4j/ )
puts
@@ -439,7 +441,7 @@ module Run
end
def self.services
- %w(redis mysql mongodb neo4j)
+ %w(redis mysql mongodb mvstore neo4j)
end
def self.alias_args(args)
View
2 cloud_controller/app/models/service.rb
@@ -99,6 +99,8 @@ def synthesize_service_type
'database'
when /postgresql/
'database'
+ when /mvstore/
+ 'database'
when /redis/
'key-value'
when /mongodb/
View
2 cloud_controller/config/cloud_controller.yml
@@ -133,6 +133,8 @@ builtin_services:
token: "0xdeadbeef"
atmos:
token: "0xdeadbeef"
+ mvstore:
+ token: "0xdeadbeef"
# Service broker
service_broker:
View
5 dev_setup/bin/vcap
@@ -15,6 +15,7 @@
# - redis
# - mysql
# - mongo
+# - mvstore
#
require 'yaml'
@@ -311,6 +312,8 @@ module Run
puts
kill_service_instances('mongodb', /mongod/)
puts
+ kill_service_instances('mvstore', /mongod/)
+ puts
kill_service_instances('neo4j', /neo4j/ )
puts
@@ -394,7 +397,7 @@ module Run
end
def self.services
- %w(redis mysql mongodb)
+ %w(redis mysql mongodb) # other options: mvstore
end
def self.alias_args(args)
View
3 dev_setup/cookbooks/cloud_controller/attributes/default.rb
@@ -19,9 +19,10 @@
default[:cloud_controller][:staging][:php] = "php.yml"
# Default builtin services
-default[:cloud_controller][:builtin_services] = ["redis", "mongodb", "mysql", "neo4j"]
+default[:cloud_controller][:builtin_services] = ["redis", "mongodb", "mysql", "neo4j", "mvstore"]
# Default capacity
default[:capacity][:max_uris] = 4
default[:capacity][:max_services] = 16
default[:capacity][:max_apps] = 20
+
View
3 dev_setup/cookbooks/cloud_controller/templates/default/sinatra.yml.erb
@@ -33,3 +33,6 @@ staged_services:
"version": "*"
- "name": "redis"
"version": "2"
+ - "name": "mvstore"
+ "version": "1"
+
View
8 dev_setup/cookbooks/mvstore/README.rdoc
@@ -0,0 +1,8 @@
+= DESCRIPTION:
+
+= REQUIREMENTS:
+
+= ATTRIBUTES:
+
+= USAGE:
+
View
9 dev_setup/cookbooks/mvstore/attributes/default.rb
@@ -0,0 +1,9 @@
+include_attribute "deployment"
+default[:mvstore][:version] = "1.0"
+default[:mvstore][:source] = "lib/mvStore-linux-64.tgz"
+default[:mvstore][:path] = File.join(node[:deployment][:home], "deploy", "mvstore")
+
+default[:mvstore_node][:index] = "0"
+default[:mvstore_node][:available_memory] = "4096"
+default[:mvstore_node][:max_memory] = "128"
+default[:mvstore_node][:token] = "changemvstoretoken"
View
6 dev_setup/cookbooks/mvstore/metadata.rb
@@ -0,0 +1,6 @@
+maintainer "VMware"
+maintainer_email "support@vmware.com"
+license "Apache 2.0"
+description "Installs/Configures MVStore"
+long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
+version "0.0.1"
View
28 dev_setup/cookbooks/mvstore/recipes/default.rb
@@ -0,0 +1,28 @@
+#
+# Cookbook Name:: mvstore
+# Recipe:: default
+#
+# Copyright 2011, VMware
+#
+#
+
+directory File.join(node[:mvstore][:path], "bin") do
+ owner node[:deployment][:user]
+ group node[:deployment][:group]
+ mode "0755"
+ recursive true
+ action :create
+end
+
+bash "Install MVStore" do
+ cwd File.join("", "tmp")
+ user node[:deployment][:user]
+ code <<-EOH
+ cp #{File.join(node[:cloudfoundry][:path], "dev_setup", "lib", "mvStore-linux-64.tgz")} #{File.join(node[:mvstore][:path], "bin")}
+ cd #{File.join(node[:mvstore][:path], "bin")}
+ tar xvzf mvStore-linux-64.tgz
+ EOH
+ not_if do
+ ::File.exists?(File.join(node[:mvstore][:path], "bin", "mvStore"))
+ end
+end
View
10 dev_setup/cookbooks/mvstore/recipes/gateway.rb
@@ -0,0 +1,10 @@
+#
+# Cookbook Name:: gateway
+# Recipe:: default
+#
+# Copyright 2011, VMware
+#
+
+cloudfoundry_service "mvstore" do
+ components ["mvstore_gateway"]
+end
View
10 dev_setup/cookbooks/mvstore/recipes/node.rb
@@ -0,0 +1,10 @@
+#
+# Cookbook Name:: node
+# Recipe:: default
+#
+# Copyright 2011, VMware
+#
+
+cloudfoundry_service "mvstore" do
+ components ["mvstore_node"]
+end
View
16 dev_setup/cookbooks/mvstore/templates/default/mvstore_gateway.yml.erb
@@ -0,0 +1,16 @@
+---
+cloud_controller_uri: <%= node[:cloud_controller][:service_api_uri] %>
+service:
+ name: mvstore
+ version: "1.0"
+ description: 'MVStore database'
+ plans: ['free']
+ tags: ['mvstore', 'nosql']
+host: localhost
+index: 0
+token: <%= node[:mvstore_node][:token] %>
+mbus: nats://<%= node[:nats_server][:user] %>:<%= node[:nats_server][:password] %>@<%= node[:nats_server][:host] %>:<%= node[:nats_server][:port] %>/
+pid: /var/vcap/sys/run/mvstore_service.pid
+logging:
+ level: debug
+# allow_over_provisioning: false
View
18 dev_setup/cookbooks/mvstore/templates/default/mvstore_node.yml.erb
@@ -0,0 +1,18 @@
+---
+local_db: sqlite3:/var/vcap/services/mvstore/mvstore_node.db
+mbus: nats://<%= node[:nats_server][:user] %>:<%= node[:nats_server][:password] %>@<%= node[:nats_server][:host] %>:<%= node[:nats_server][:port] %>/
+base_dir: /var/vcap/services/mvstore/instances
+mvstore_log_dir: /var/vcap/services/mvstore/logs
+pid: /var/vcap/sys/run/mvstore_node.pid
+index: <%= node[:mvstore_node][:index] %>
+available_memory: <%= node[:mvstore_node][:available_memory] %>
+max_memory: <%= node[:mvstore_node][:max_memory] %>
+node_id: <%= "mvstore_node_#{node[:mvstore_node][:index]}" %>
+mvstore_path: <%= File.join(node[:mvstore][:path], "bin", "mvStore", "server", "bin", "mvstored") %>
+mvstore_restore_path: mvstore_restore
+port_range:
+ first: 25001
+ last: 45000
+migration_nfs: /mnt/migration
+logging:
+ level: debug
View
4 dev_setup/lib/job_manager.rb
@@ -16,7 +16,7 @@ class JobManager
HM = "health_manager"
DEA = "dea"
- SERVICES = ["redis", "mysql", "mongodb", "neo4j"]
+ SERVICES = ["redis", "mysql", "mongodb", "mvstore", "neo4j"]
SERVICES_NODE = SERVICES.map do |service|
"#{service}_node"
end
@@ -35,7 +35,7 @@ class JobManager
# List of the required properties for jobs
INSTALLED_JOB_PROPERTIES = {NATS => ["host"], CC => ["service_api_uri", "builtin_services"],
CCDB => ["host"]}
- INSTALL_JOB_PROPERTIES = {CC => ["builtin_services"], MYSQL_NODE => ["index"], MONGODB_NODE => ["index"], REDIS_NODE => ["index"], NEO4J_NODE => ["index"]}
+ INSTALL_JOB_PROPERTIES = {CC => ["builtin_services"], MYSQL_NODE => ["index"], MONGODB_NODE => ["index"], REDIS_NODE => ["index"], NEO4J_NODE => ["index"], MVSTORE_NODE => ["index"]}
# Dependency between JOBS and components that are consumed by "vcap_dev" when cf is started or
# stopped
View
BIN dev_setup/lib/mvStore-linux-64.tgz
Binary file not shown.
View
11 dev_setup/roles/mvstore_gateway.json
@@ -0,0 +1,11 @@
+{
+ "name": "mvstore_gateway",
+ "override_attributes": {},
+ "json_class": "Chef::Role",
+ "description": "MVStore services gateway",
+ "chef_type": "role",
+ "run_list" : ["recipe[deployment]",
+ "recipe[essentials]",
+ "recipe[ruby]",
+ "recipe[mvstore::gateway]"]
+}
View
12 dev_setup/roles/mvstore_node.json
@@ -0,0 +1,12 @@
+{
+ "name": "mvstore",
+ "override_attributes": {},
+ "json_class": "Chef::Role",
+ "description": "MVStore",
+ "chef_type": "role",
+ "run_list" : ["recipe[deployment]",
+ "recipe[essentials]",
+ "recipe[ruby]",
+ "recipe[mvstore]",
+ "recipe[mvstore::node]"]
+}
View
2 rakelib/core_components.rake
@@ -9,7 +9,7 @@ module CoreComponents
end
def components
- %w[cloud_controller dea health_manager router stager services/redis services/mysql services/mongodb services/postgresql services/neo4j]
+ %w[cloud_controller dea health_manager router stager services/redis services/mysql services/mongodb services/mvstore services/postgresql services/neo4j]
end
def dirs

0 comments on commit 0680716

Please sign in to comment.