Permalink
Browse files

Add a mgmt proxy for services

git shortlog 106ad12..HEAD

Andrew Liu and Scott Calvert (1):
      add default cc_api_version to provisioner spec

David Stevenson (2):
      Merge pull request #30 from felixhoo/monit_user
      Merge pull request #32 from felixhoo/mgmt_proxy

David Stevenson and Ryan Tang (3):
      Jenkins build setup
      Updated mysql user info for CI
      Update mysql port for CI

Jesse Zhang and Scott Calvert (1):
      Integration tests fail if there are local changes to ccng and ENV['NO_CHECKOUT'] is undefined.

Matt Royal and Phan Le (4):
      Fix the test
      Run echo build on travis
      Add marketplace, service_broker and mysql builds back
      Integration tests don't clear changes in CCNG

Phan Le (1):
      Revert previous inadvertent commit

Phan Le and Ryan Tang (1):
      Supporting only mysql 5.5 on ng and should always be running in wardenized mode

Phan Le and Scott Calvert (1):
      Fixing our last attempt at making integration tests fail when uncommitted changes would be clobbered

felixhoo (2):
      Create monitoring user on provision
      Add a proxy to delegate traffic to service native UI
  • Loading branch information...
1 parent 3bb2d0f commit 8e65f85da4cb51dbdca3dae914a50799aac97542 felixhoo committed with David Stevenson Mar 26, 2013
View
@@ -0,0 +1,11 @@
+check process servicesmgmt
+ with pidfile /var/vcap/sys/run/servicesmgmt/servicesmgmt.pid
+ start program "/var/vcap/jobs/servicesmgmt/bin/servicesmgmt_ctl start"
+ stop program "/var/vcap/jobs/servicesmgmt/bin/servicesmgmt_ctl stop"
+ group vcap
+
+check process vcap_registrar
+ with pidfile /var/vcap/sys/run/vcap_registrar/vcap_registrar.pid
+ start program "/var/vcap/jobs/servicesmgmt/bin/vcap_registrar_ctl start"
+ stop program "/var/vcap/jobs/servicesmgmt/bin/vcap_registrar_ctl stop"
+ group vcap
View
@@ -0,0 +1,16 @@
+---
+name: servicesmgmt
+templates:
+ servicesmgmt_ctl.erb: bin/servicesmgmt_ctl
+ vcap_registrar_ctl: bin/vcap_registrar_ctl
+
+ vcap_registrar.config.yml.erb: config/vcap_registrar/config.yml
+ servicesmgmt.yml.erb: config/servicesmgmt.yml
+ varz.yml.erb: config/varz.yml
+ syslog_forwarder.conf.erb: config/syslog_forwarder.conf
+
+packages:
+ - common
+ - ruby
+ - syslog_aggregator
+ - servicesmgmt
@@ -0,0 +1,13 @@
+---
+id: servicesmgmt
+secret: <%= p("uaa.clients.servicesmgmt.secret") %>
+token_server: http://uaa.<%= properties.domain %>
+auth_server: http://login.<%= properties.domain %>
+index: <%= spec.index %>
+cloud_controller_uri: <%= properties.cc.srv_api_uri %>
+logging:
+ level: debug
+ file: /var/vcap/sys/log/servicesmgmt/servicesmgmt.log
+ <% if properties.syslog_aggregator %>
+ syslog: vcap.servicesmgmt
+ <% end %>
@@ -0,0 +1,47 @@
+#!/bin/bash
+export PATH=/var/vcap/packages/ruby/bin:$PATH
+
+RUN_DIR=/var/vcap/sys/run/servicesmgmt
+LOG_DIR=/var/vcap/sys/log/servicesmgmt
+PIDFILE=$RUN_DIR/servicesmgmt.pid
+JOB_DIR=/var/vcap/jobs/servicesmgmt
+
+source /var/vcap/packages/common/utils.sh
+
+case $1 in
+
+ start)
+ pid_guard $PIDFILE "Services Mgmt"
+
+ mkdir -p $RUN_DIR
+ mkdir -p $LOG_DIR
+
+ # Generate a random usernames and passwords
+ username=$RANDOM-$RANDOM-$RANDOM-$RANDOM
+ password=$RANDOM-$RANDOM-$RANDOM-$RANDOM
+
+ sed -i "s/_random_username_replaced_by_a_script_/${username}/g" $JOB_DIR/config/varz.yml
+ sed -i "s/_random_password_replaced_by_a_script_/${password}/g" $JOB_DIR/config/varz.yml
+
+ export CLOUD_FOUNDRY_CONFIG_PATH=$JOB_DIR/config/
+ export PIDFILE=$PIDFILE
+ export CONFIG_FILE=$JOB_DIR/config/servicesmgmt.yml
+
+ cd /var/vcap/packages/servicesmgmt/services/tools/servicesmgmt/
+ bundle exec rackup -D -p <%= p("servicesmgmt.port", "80") %> -P $PIDFILE \
+ >>$LOG_DIR/servicesmgmt.stdout.log \
+ 2>>$LOG_DIR/servicesmgmt.stderr.log
+
+ ;;
+
+ stop)
+ kill_and_wait $PIDFILE
+
+ ;;
+
+ *)
+ echo "Usage: servicesmgmt_ctl {start|stop}"
+
+ ;;
+
+esac
@@ -0,0 +1,29 @@
+<% if properties.syslog_aggregator %>
+$ModLoad imuxsock # local message reception (rsyslog uses a datagram socket)
+$MaxMessageSize 4k # default is 2k
+
+$ModLoad imudp # the java log4j appender only works with udp
+$UDPServerRun 514
+
+$WorkDirectory /var/vcap/sys/rsyslog/buffered # where messages should be buffered on disk
+
+# Forward vcap messages to the aggregator
+#
+$ActionResumeRetryCount -1 # Try until the server becomes available
+$ActionQueueType LinkedList # Allocate on-demand
+$ActionQueueFileName agg_backlog # Spill to disk if queue is full
+$ActionQueueMaxDiskSpace 32m # Max size for disk queue
+$ActionQueueLowWaterMark 2000 # Num messages. Assuming avg size of 512B, this is 1MiB.
+$ActionQueueHighWaterMark 8000 # Num messages. Assuming avg size of 512B, this is 4MiB. (If this is reached, messages will spill to disk until the low watermark is reached).
+$ActionQueueTimeoutEnqueue 0 # Discard messages if the queue + disk is full
+$ActionQueueSaveOnShutdown on # Save in-memory data to disk if rsyslog shuts down
+:programname, startswith, "vcap." @@<%= properties.syslog_aggregator.address %>:<%= properties.syslog_aggregator.port %>
+
+# Log vcap messages locally, too
+#$template VcapComponentLogFile, "/var/log/%programname:6:$%/%programname:6:$%.log"
+#$template VcapComponentLogFormat, "%timegenerated% %syslogseverity-text% -- %msg%\n"
+#:programname, startswith, "vcap." -?VcapComponentLogFile;VcapComponentLogFormat
+
+# Prevent them from reaching anywhere else
+:programname, startswith, "vcap." ~
+<% end %>
@@ -0,0 +1,5 @@
+---
+varz:
+ username: _random_username_replaced_by_a_script_
+ password: _random_password_replaced_by_a_script_
+ type: servicesmgmt
@@ -0,0 +1,17 @@
+---
+logging:
+ file: /var/vcap/sys/log/vcap_registrar/vcap_registrar.log
+ <% if properties.syslog_aggregator %>
+ syslog: vcap.servicesmgmt_vcap_registrar
+ <% end %>
+ level: info
+mbus: nats://<%= properties.nats.user %>:<%= properties.nats.password %>@<%= properties.nats.address %>:<%= properties.nats.port %>
+uri:
+ - servicesmgmt.<%= properties.domain %>
+host: <%= spec.networks.send(properties.networks.apps).ip %>
+index: <%= spec.index %>
+port: <%= p("servicesmgmt.port", "80") %>
+tags:
+ component: servicesmgmt
+varz:
+ file: /var/vcap/jobs/servicesmgmt/config/varz.yml
@@ -0,0 +1,41 @@
+#!/bin/bash -e
+
+export PATH=/var/vcap/packages/ruby/bin:$PATH
+RUN_DIR=/var/vcap/sys/run/vcap_registrar
+LOG_DIR=/var/vcap/sys/log/vcap_registrar
+PIDFILE=$RUN_DIR/vcap_registrar.pid
+
+source /var/vcap/packages/common/utils.sh
+
+case $1 in
+
+ start)
+ pid_guard $PIDFILE "VCAP registrar"
+
+ mkdir -p $RUN_DIR
+ mkdir -p $LOG_DIR
+
+ echo $$ > $PIDFILE
+
+ export CONFIG_FILE=/var/vcap/jobs/servicesmgmt/config/vcap_registrar/config.yml
+
+ cd /var/vcap/packages/servicesmgmt/tools/vcap_registrar
+ exec /var/vcap/packages/ruby/bin/ruby \
+ /var/vcap/packages/servicesmgmt/tools/vcap_registrar/bin/vcap_registrar \
+ --register_with_router \
+ --register_varz_credentials \
+ >>$LOG_DIR/vcap_registrar.stdout.log \
+ 2>>$LOG_DIR/vcap_registrar.stderr.log
+
+ ;;
+
+ stop)
+ kill_and_wait $PIDFILE
+
+ ;;
+
+ *)
+ echo "Usage: vcap_registrar_ctl {start|stop}" ;;
+
+esac
+exit 0
@@ -0,0 +1,14 @@
+# abort script on any command that exit with a non zero value
+set -e
+
+cp -a * ${BOSH_INSTALL_TARGET}
+
+(
+ bundle_cmd=/var/vcap/packages/ruby/bin/bundle
+
+ cd ${BOSH_INSTALL_TARGET}/services/tools/servicesmgmt
+ $bundle_cmd install --local --deployment
+
+ cd ${BOSH_INSTALL_TARGET}/tools/vcap_registrar
+ $bundle_cmd install --local --deployment --without=development test
+)
@@ -0,0 +1,6 @@
+# abort script on any command that exit with a non zero value
+set -e
+
+cd ${BUILD_DIR}
+
+pkg_utils/vendor.sh services/tools/servicesmgmt
@@ -0,0 +1,9 @@
+---
+name: servicesmgmt
+dependencies:
+- ruby
+files:
+- services/tools/servicesmgmt/**/*
+- pkg_utils/*
+- common/services/utils.sh
+- tools/vcap_registrar/**/*

0 comments on commit 8e65f85

Please sign in to comment.