Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Commit

Permalink
Merge branch 'side-by-side-poc' into ccng-side-by-side
Browse files Browse the repository at this point in the history
Change-Id: I16221a169f1c3688bf7e8cd22d460ab81e9ea5f7
  • Loading branch information
pbozeman committed Sep 1, 2012
2 parents 053118a + f14cac4 commit 91ac546
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 67 deletions.
99 changes: 53 additions & 46 deletions jobs/cloud_controller/templates/cloud_controller.yml.erb
@@ -1,34 +1,39 @@
---
<% db = properties.ccdb.databases.find { |db| db.tag == "cc" } %>
<% db_role = properties.ccdb.roles.find { |role| role.tag == "admin" } %>
<% cc_props_name = properties.cc_props || 'cc' %>
<% cc_props = properties.send(cc_props_name) %>
external_uri: api.<%= properties.domain %>
<% ccdb_prop_name = properties.db || 'ccdb' %>
<% ccdb = properties.send(ccdb_prop_name) %>
<% db_name = ccdb.databases.find { |db| db.tag == "cc" }.name %>
<% db_role = ccdb.roles.find { |role| role.tag == "admin" } %>

external_uri: <%= cc_props.external_uri || "api." + properties.domain %>
description: <%= properties.description || "VMware's Cloud Application Platform" %>
support_address: <%= properties.support_address || "http://support.cloudfoundry.com" %>
local_route: <%= spec.networks.send(properties.networks.apps).ip %>
<% if properties.cc.allow_registration || properties.cc.allow_registration == nil %>
<% if cc_props.allow_registration || cc_props.allow_registration == nil %>
allow_registration: true
<% else %>
allow_registration: false
<% end %>
external_port: 9022 #public CC port

<% if properties.cc.max_droplet_size %>
max_droplet_size: <%= properties.cc.max_droplet_size %>
<% if cc_props.max_droplet_size %>
max_droplet_size: <%= cc_props.max_droplet_size %>
<% end %>

bulk_api:
auth:
user: bulk_api
password: <%= properties.cc.password %>
password: <%= cc_props.password %>

nginx:
use_nginx: <%= properties.cc.use_nginx %> #nginx proxy in front of CC?
use_nginx: <%= cc_props.use_nginx %> #nginx proxy in front of CC?
instance_socket: /var/vcap/sys/run/cloud_controller/cloud_controller.sock
#insecure_instance_port: 9025 #NOT SECURE -- DEBUG ONLY!!!!

index: <%= spec.index %>
index_page: <%= properties.cc.index_page %>
index_page: <%= cc_props.index_page %>
info_file: /var/vcap/packages/cloud_controller/config/cloud_controller-info.json

# Legacy (FIXME REMOVE)
Expand All @@ -52,52 +57,54 @@ logging:
<% if properties.syslog_aggregator %>
syslog: vcap.cloud_controller
<% end %>
level: <%= properties.cc.logging_level || "info" %>
level: <%= cc_props.logging_level || "info" %>

rails_logging:
file: /var/vcap/sys/log/cloud_controller/rails.log
level: <%= properties.cc.rails_logging_level || "info" %>
level: <%= cc_props.rails_logging_level || "info" %>

event_logging:
file: /var/vcap/sys/log/cloud_controller/events.log

keys:
password: <%= properties.cc.password %>
token: <%= properties.cc.token %>
password: <%= cc_props.password %>
token: <%= cc_props.token %>

pid: /var/vcap/sys/run/cloud_controller/cloud_controller.pid

mbus: nats://<%= properties.nats.user %>:<%= properties.nats.password %>@<%= properties.nats.address %>:<%= properties.nats.port %>

rails_environment: production

<% if properties.cc.new_initial_placement && spec.index.to_i == 0 %>
<% if cc_props.new_initial_placement && spec.index.to_i == 0 %>
new_initial_placement: true
<% else %>
new_initial_placement: false
<% end %>

cc_partition: <%= cc_props.cc_partition || "default" %>

database_environment:
production:
database: <%= db.name %>
host: <%= properties.ccdb.address %>
port: <%= properties.ccdb.port %>
database: <%= db_name %>
host: <%= ccdb.address %>
port: <%= ccdb.port %>
encoding: utf8
username: <%= db_role.name %>
password: <%= db_role.password %>
pool: <%= properties.ccdb.pool_size %>
pool: <%= ccdb.pool_size %>
timeout: 2000
template: template0 # Required for utf8 encoding
adapter: postgresql

<% if properties.cc.uaa && properties.uaa.cc %>
<% if cc_props.uaa && properties.uaa.cc %>
uaa:
enabled: <%= properties.cc.uaa.enabled %>
enabled: <%= cc_props.uaa.enabled %>
url: https://uaa.<%= properties.domain %>
resource_id: <%= properties.cc.uaa.resource_id %>
resource_id: <%= cc_props.uaa.resource_id %>
token_secret: <%= properties.uaa.cc.token_secret %>
client_secret: <%= properties.uaa.cc.client_secret %>
token_creation_email_filter: <%= properties.cc.uaa.token_creation_email_filter %>
token_creation_email_filter: <%= cc_props.uaa.token_creation_email_filter %>
<% else %>
uaa:
enabled: false
Expand All @@ -117,46 +124,46 @@ redis:
<% end %>

staging:
max_concurrent_stagers: <%= properties.cc.max_concurrent_stagers || 20 %>
max_staging_runtime: <%= properties.cc.max_staging_runtime || 120 %>
max_concurrent_stagers: <%= cc_props.max_concurrent_stagers || 20 %>
max_staging_runtime: <%= cc_props.max_staging_runtime || 120 %>
secure: true
<% if properties.cc.new_stager_percent %>
new_stager_percent: <%= properties.cc.new_stager_percent %>
<% if cc_props.new_stager_percent %>
new_stager_percent: <%= cc_props.new_stager_percent %>
<% end %>
<% if properties.cc.new_stager_email_regexp %>
new_stager_email_regexp: <%= properties.cc.new_stager_email_regexp %>
<% if cc_props.new_stager_email_regexp %>
new_stager_email_regexp: <%= cc_props.new_stager_email_regexp %>
<% end %>
auth:
user: <%= properties.cc.staging_upload_user %>
password: <%= properties.cc.staging_upload_password %>
user: <%= cc_props.staging_upload_user %>
password: <%= cc_props.staging_upload_password %>

allow_debug: <%= properties.cc.allow_debug || false %>
allow_debug: <%= cc_props.allow_debug || false %>

admins: [ "<%= properties.cc.admins.join('", "') %>" ]
admins: [ "<%= cc_props.admins.join('", "') %>" ]

https_required: <%= properties.cc.https_required || false %>
https_required_for_admins: <%= properties.cc.https_required_for_admins || false %>
https_required: <%= cc_props.https_required || false %>
https_required_for_admins: <%= cc_props.https_required_for_admins || false %>
<% if properties.cc.admin_account_capacity %>
<% if cc_props.admin_account_capacity %>
admin_account_capacity:
memory: <%= properties.cc.admin_account_capacity.memory || 32 * 1024 %>
app_uris: <%= properties.cc.admin_account_capacity.app_uris || 16 %>
services: <%= properties.cc.admin_account_capacity.services || 32 %>
apps: <%= properties.cc.admin_account_capacity.apps || 200 %>
memory: <%= cc_props.admin_account_capacity.memory || 32 * 1024 %>
app_uris: <%= cc_props.admin_account_capacity.app_uris || 16 %>
services: <%= cc_props.admin_account_capacity.services || 32 %>
apps: <%= cc_props.admin_account_capacity.apps || 200 %>
<% end %>

# Normal users limited to 512M, 4 Services, and 4 URIs per App
default_account_capacity:
<% unless properties.cc.default_account_capacity %>
<% unless cc_props.default_account_capacity %>
memory: 2048
app_uris: 4
services: 16
apps: 20
<% else %>
memory: <%= properties.cc.default_account_capacity.memory || 2048 %>
app_uris: <%= properties.cc.default_account_capacity.app_uris || 4 %>
services: <%= properties.cc.default_account_capacity.services || 16 %>
apps: <%= properties.cc.default_account_capacity.apps || 16 %>
memory: <%= cc_props.default_account_capacity.memory || 2048 %>
app_uris: <%= cc_props.default_account_capacity.app_uris || 4 %>
services: <%= cc_props.default_account_capacity.services || 16 %>
apps: <%= cc_props.default_account_capacity.apps || 16 %>
<% end %>

builtin_services:
Expand Down Expand Up @@ -186,8 +193,8 @@ service_broker:
<% end %>
<%
if properties.cc.service_extension && properties.cc.service_extension.service_lifecycle
max_upload_size = properties.cc.service_extension.service_lifecycle.max_upload_size || 1
if cc_props.service_extension && cc_props.service_extension.service_lifecycle
max_upload_size = cc_props.service_extension.service_lifecycle.max_upload_size || 1
if properties.service_lifecycle
if properties.service_lifecycle.serialization_max_download_size
max_download_size = properties.service_lifecycle.serialization_max_download_size
Expand Down
23 changes: 15 additions & 8 deletions jobs/health_manager/templates/health_manager.yml.erb
@@ -1,6 +1,12 @@
---
<% db = properties.ccdb.databases.find { |db| db.tag == "cc" } %>
<% db_role = properties.ccdb.roles.find { |role| role.tag == "admin" } %>
<% hm_props_name = properties.hm_props || 'health_manager' %>
<% hm_props = properties.send(hm_props_name) || OpenStruct.new %>
<% ccdb_prop_name = properties.db || 'ccdb' %>
<% ccdb = properties.send(ccdb_prop_name) %>
<% db_name = ccdb.databases.find { |db| db.tag == "cc" }.name %>
<% db_role = ccdb.roles.find { |role| role.tag == "admin" } %>
<% network = spec.networks.send(properties.networks.apps) %>
<% nats = properties.nats %>

Expand All @@ -15,20 +21,21 @@ logging:
pid: /var/vcap/sys/run/health_manager/health_manager.pid
rails_environment: production
index: <%= spec.index %>
cc_partition: <%= hm_props.cc_partition || "default" %>
database_environment:
production:
database: <%= db.name %>
host: <%= properties.ccdb.address %>
port: <%= properties.ccdb.port %>
database: <%= db_name %>
host: <%= ccdb.address %>
port: <%= ccdb.port %>
encoding: utf8
username: <%= db_role.name %>
password: <%= db_role.password %>
pool: <%= properties.ccdb.pool_size %>
pool: <%= ccdb.pool_size %>
timeout: 2000
template: template0 # Required for utf8 encoding
adapter: postgresql
intervals:
<% intervals = properties.health_manager && properties.health_manager.intervals || OpenStruct.new %>
<% intervals = hm_props.intervals || OpenStruct.new %>
database_scan: <%= intervals.database_scan || 60 %>
droplet_lost: <%= intervals.droplet_lost || 30 %>
droplets_analysis: <%= intervals.droplets_analysis || 20 %>
Expand All @@ -42,4 +49,4 @@ intervals:
max_db_reconnect_wait: <%= intervals.max_db_reconnect_wait || 300 %>
inactivity_period_for_spindown: <%= intervals.inactivity_period_for_spindown || -1 %>

dequeueing_rate: <%= properties.health_manager && properties.health_manager.dequeueing_rate || 50 %>
dequeueing_rate: <%= hm_props.dequeueing_rate || 50 %>
16 changes: 12 additions & 4 deletions jobs/health_manager_next/templates/health_manager_next.yml.erb
@@ -1,4 +1,10 @@
---
<% cc_props_name = properties.cc_props || 'cc' %>
<% cc_props = properties.send(cc_props_name) %>
<% hm_props_name = properties.hm_props || 'health_manager' %>
<% hm_props = properties.send(hm_props_name) || OpenStruct.new %>

local_route: <%= spec.networks.send(properties.networks.apps).ip %>
mbus: nats://<%= properties.nats.user %>:<%= properties.nats.password %>@<%= properties.nats.address %>:<%= properties.nats.port %>
logging:
Expand All @@ -10,12 +16,14 @@ logging:
pid: /var/vcap/sys/run/health_manager_next/health_manager_next.pid
index: <%= spec.index %>
bulk_api:
host: <%= properties.cc.srv_api_uri %>
host: <%= cc_props.srv_api_uri %>

cc_partition: <%= hm_props.cc_partition || "default" %>

shadow_mode: <%= properties.health_manager_next && properties.health_manager_next.shadow_mode || 'enable' %>
shadow_mode: <%= hm_props.shadow_mode || "enable" %>

intervals:
<% intervals = properties.health_manager && properties.health_manager.intervals || OpenStruct.new %>
<% intervals = hm_props.intervals || OpenStruct.new %>
database_scan: <%= intervals.database_scan || 60 %>
droplet_lost: <%= intervals.droplet_lost || 30 %>
droplets_analysis: <%= intervals.droplets_analysis || 20 %>
Expand All @@ -26,4 +34,4 @@ intervals:
max_restart_delay: <%= intervals.max_restart_delay || 480 %>
giveup_crash_number: <%= intervals.giveup_crash_number || 4 %>
stable_state: <%= intervals.stable_state || 60 %>
dequeueing_rate: <%= properties.health_manager && properties.health_manager.dequeueing_rate || 50 %>
dequeueing_rate: <%= hm_props.dequeueing_rate || 50 %>
9 changes: 0 additions & 9 deletions jobs/uaa/templates/uaa.yml.erb
Expand Up @@ -2,9 +2,6 @@
<% uaa_db = properties.uaadb.databases.find { |db| db.tag == "uaa" } %>
<% uaa_role = properties.uaadb.roles.find { |role| role.tag == "admin" } %>

<% cc_db = properties.ccdb.databases.find { |db| db.tag == "cc" } %>
<% cc_role = properties.ccdb.roles.find { |role| role.tag == "admin" } %>

pid: /var/vcap/sys/run/uaa.pid
# nats message bus uri
mbus: nats://<%= properties.nats.user %>:<%= properties.nats.password %>@<%= properties.nats.address %>:<%= properties.nats.port %>/
Expand All @@ -20,12 +17,6 @@ database:
jvm_args: -Xmx512m
spring_profiles: postgresql

cloud_controller:
database:
url: jdbc:postgresql://<%= properties.ccdb.address %>:<%= properties.ccdb.port %>/<%= cc_db.name %>
username: <%= cc_role.name %>
password: <%= cc_role.password %>

logging:
config: /var/vcap/jobs/uaa/config/log4j.properties

Expand Down

0 comments on commit 91ac546

Please sign in to comment.