Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use HTTP bosh agent client.

Change-Id: Ieaf76b6968c0d3faa60fed4b60cba43887ee23fa
  • Loading branch information...
commit f380b0a26bbbd393ef5238d615986acd3c3a480a 1 parent de1e042
@mmb mmb authored
Showing with 35 additions and 26 deletions.
  1. +18 −8 micro/Gemfile
  2. +17 −18 micro/lib/micro/agent.rb
View
26 micro/Gemfile
@@ -1,16 +1,26 @@
source :rubygems
-gem 'highline'
-gem 'rest-client'
-gem "blobstore_client", "~> 0.3"
-gem "yajl-ruby", :require => "yajl"
+gem "highline"
gem "monit_api"
-gem "statemachine"
-gem "progressbar"
-
-gem "uuidtools"
+gem "nats", "=0.4.22"
gem "netaddr"
+gem "blobstore_client", "~> 0.3.13"
gem "posix-spawn"
+gem "rake"
+gem "rack-test"
+gem "ruby-atmos-pure"
+gem "sigar", ">=0.7.2"
+gem "bosh_encryption", ">=0.0.3"
+gem "sinatra"
+gem "thin"
+gem "uuidtools"
+gem "yajl-ruby", :require => "yajl"
+gem 'agent_client'
+gem 'bosh_common'
+
+gem 'rest-client'
+gem "statemachine"
+gem "progressbar"
gem 'vmc'
View
35 micro/lib/micro/agent.rb
@@ -5,6 +5,7 @@
require 'ostruct'
require 'posix-spawn'
require 'monit_api'
+require 'agent_client'
module Bosh
module Agent
@@ -12,20 +13,7 @@ module Agent
end
end
-require 'agent/ext'
-require 'agent/util'
-require 'agent/config'
-require 'agent/errors'
-require 'agent/version'
-require 'agent/message/base'
-require 'agent/message/apply'
-require 'agent/platform'
-require 'agent/monit'
-require 'agent/state'
-require 'agent/template'
-require 'agent/platform'
-require 'agent/platform/ubuntu'
-require 'agent/platform/ubuntu/logrotate'
+require 'agent'
module VCAP
@@ -33,6 +21,10 @@ module Micro
class Agent
APPLY_SPEC = '/var/vcap/micro/apply_spec.yml'
+ AGENT_CLIENT_URI = 'http://localhost:6969/'
+ AGENT_CLIENT_USER = 'vcap'
+ AGENT_CLIENT_PASSWORD = 'vcap'
+
def self.apply(identity)
agent = self.new(identity)
agent.setup
@@ -55,9 +47,12 @@ def self.config
},
"agent_id" => "micro",
"base_dir" => "/var/vcap",
- "platform_name" => "ubuntu",
- "blobstore_options" => { "blobstore_path" => "/var/vcap/data/cache" },
- "blobstore_provider" => "local"
+ "platform_name" => "microcloud",
+ "blobstore_options" => {
+ "blobstore_path" => "/var/vcap/micro_bosh/data/cache"
+ },
+ "blobstore_provider" => "local",
+ "infrastructure_name" => "vsphere"
}
logdir = File.dirname(settings['logging']['file'])
FileUtils.mkdir_p(logdir) unless Dir.exist?(logdir)
@@ -74,6 +69,9 @@ def self.randomize_passwords
def initialize(identity)
@identity = identity
+ @agent_client = Bosh::Agent::Client.create(AGENT_CLIENT_URI,
+ 'user' => AGENT_CLIENT_USER,
+ 'password' => AGENT_CLIENT_PASSWORD)
end
def setup
@@ -124,7 +122,8 @@ def update_spec
end
def apply
- Bosh::Agent::Message::Apply.process([@spec])
+ @agent_client.run_task(:apply, @spec)
+
monitor_start
end
Please sign in to comment.
Something went wrong with that request. Please try again.