Skip to content

Commit

Permalink
Merge branch 'release/1.17.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Taylor Nation committed Dec 7, 2016
2 parents 0a6d1df + 1114772 commit dede7e5
Show file tree
Hide file tree
Showing 56 changed files with 510 additions and 113 deletions.
2 changes: 1 addition & 1 deletion deployment/ansible/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ nodejs_npm_version: 2.1.17

apache_version: "2.4.7-*"

java_version: "7u111-*"
java_version: "7u121-*"

graphite_carbon_version: "0.9.13-pre1"
graphite_whisper_version: "0.9.13-pre1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
- name: Install Firefox for UI tests
apt: pkg="firefox=4*" state=present
apt: pkg="firefox=5*" state=present

- name: Install Xvfb for JavaScript tests
apt: pkg="xvfb=2:1.15.1*" state=present
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ server {
location /static/ {
{% if ['packer'] | is_in(group_names) -%}
etag on;
expires max;
expires 1h;
{% endif %}

alias {{ app_static_root }};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
rwd_data_path: "/opt/rwd-data"
rwd_host: "localhost"
rwd_port: 5000
rwd_docker_image: "quay.io/wikiwatershed/rwd:1.0.1"
rwd_docker_image: "quay.io/wikiwatershed/rwd:1.1.1"
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description "Rapid Watershed Delineation"
{% if ['development', 'test'] | some_are_in(group_names) -%}
start on (vagrant-mounted and started docker)
{% else %}
start on (filesystem and started docker)
start on (filesystem and local-filesystems and started docker)
{% endif %}
stop on stopping docker

Expand Down
84 changes: 82 additions & 2 deletions deployment/cfn/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ class Application(StackNode):
'AppServerAutoScalingDesired': ['global:AppServerAutoScalingDesired'],
'AppServerAutoScalingMin': ['global:AppServerAutoScalingMin'],
'AppServerAutoScalingMax': ['global:AppServerAutoScalingMax'],
'AppServerAutoScalingScheduleStartCapacity': ['global:AppServerAutoScalingScheduleStartCapacity'], # NOQA
'AppServerAutoScalingScheduleStartRecurrence': ['global:AppServerAutoScalingScheduleStartRecurrence'], # NOQA
'AppServerAutoScalingScheduleEndCapacity': ['global:AppServerAutoScalingScheduleEndCapacity'], # NOQA
'AppServerAutoScalingScheduleEndRecurrence': ['global:AppServerAutoScalingScheduleEndRecurrence'], # NOQA
'SSLCertificateARN': ['global:SSLCertificateARN'],
'BackwardCompatSSLCertificateARN':
['global:BackwardCompatSSLCertificateARN'],
Expand Down Expand Up @@ -152,6 +156,34 @@ def set_up_stack(self):
Description='Application server AutoScalingGroup maximum'
), 'AppServerAutoScalingMax')

self.app_server_auto_scaling_schedule_start_recurrence = self.add_parameter( # NOQA
Parameter(
'AppServerAutoScalingScheduleStartRecurrence', Type='String',
Default='0 13 * * 1-5',
Description='Application server ASG schedule start recurrence'
), 'AppServerAutoScalingScheduleStartRecurrence')

self.app_server_auto_scaling_schedule_start_capacity = self.add_parameter( # NOQA
Parameter(
'AppServerAutoScalingScheduleStartCapacity', Type='String',
Default='1',
Description='Application server ASG schedule start capacity'
), 'AppServerAutoScalingScheduleStartCapacity')

self.app_server_auto_scaling_schedule_end_recurrence = self.add_parameter( # NOQA
Parameter(
'AppServerAutoScalingScheduleEndRecurrence', Type='String',
Default='0 23 * * *',
Description='Application server ASG schedule end recurrence'
), 'AppServerAutoScalingScheduleEndRecurrence')

self.app_server_auto_scaling_schedule_end_capacity = self.add_parameter( # NOQA
Parameter(
'AppServerAutoScalingScheduleEndCapacity', Type='String',
Default='1',
Description='Application server ASG schedule end capacity'
), 'AppServerAutoScalingScheduleEndCapacity')

self.ssl_certificate_arn = self.add_parameter(Parameter(
'SSLCertificateARN', Type='String',
Description='ARN for a SSL certificate stored in IAM'
Expand Down Expand Up @@ -395,7 +427,7 @@ def create_auto_scaling_resources(self, app_server_security_group,
self.blue_tile_distribution_endpoint)))
))

self.add_resource(
blue_app_server_asg = self.add_resource(
asg.AutoScalingGroup(
'asgAppServerBlue',
AvailabilityZones=Ref(self.availability_zones),
Expand Down Expand Up @@ -424,6 +456,30 @@ def create_auto_scaling_resources(self, app_server_security_group,
Tags=[asg.Tag('Name', 'AppServer', True)])
)

self.add_resource(
asg.ScheduledAction(
'schedTileServerAutoScalingStartBlue',
AutoScalingGroupName=Ref(blue_app_server_asg),
Condition='BlueCondition',
DesiredCapacity=Ref(
self.app_server_auto_scaling_schedule_start_capacity),
Recurrence=Ref(
self.app_server_auto_scaling_schedule_start_recurrence)
)
)

self.add_resource(
asg.ScheduledAction(
'schedTileServerAutoScalingEndBlue',
AutoScalingGroupName=Ref(blue_app_server_asg),
Condition='BlueCondition',
DesiredCapacity=Ref(
self.app_server_auto_scaling_schedule_end_capacity),
Recurrence=Ref(
self.app_server_auto_scaling_schedule_end_recurrence)
)
)

green_app_server_launch_config = self.add_resource(
asg.LaunchConfiguration(
'lcAppServerGreen',
Expand All @@ -438,7 +494,7 @@ def create_auto_scaling_resources(self, app_server_security_group,
self.green_tile_distribution_endpoint)))
))

self.add_resource(
green_app_server_asg = self.add_resource(
asg.AutoScalingGroup(
'asgAppServerGreen',
AvailabilityZones=Ref(self.availability_zones),
Expand Down Expand Up @@ -467,6 +523,30 @@ def create_auto_scaling_resources(self, app_server_security_group,
Tags=[asg.Tag('Name', 'AppServer', True)])
)

self.add_resource(
asg.ScheduledAction(
'schedTileServerAutoScalingStartGreen',
AutoScalingGroupName=Ref(green_app_server_asg),
Condition='GreenCondition',
DesiredCapacity=Ref(
self.app_server_auto_scaling_schedule_start_capacity),
Recurrence=Ref(
self.app_server_auto_scaling_schedule_start_recurrence)
)
)

self.add_resource(
asg.ScheduledAction(
'schedTileServerAutoScalingEndGreen',
AutoScalingGroupName=Ref(green_app_server_asg),
Condition='GreenCondition',
DesiredCapacity=Ref(
self.app_server_auto_scaling_schedule_end_capacity),
Recurrence=Ref(
self.app_server_auto_scaling_schedule_end_recurrence)
)
)

def get_cloud_config(self, tile_distribution_endpoint):
return ['#cloud-config\n',
'\n',
Expand Down
56 changes: 55 additions & 1 deletion deployment/cfn/tiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ class Tiler(StackNode):
'TileServerAutoScalingDesired': ['global:TileServerAutoScalingDesired'], # NOQA
'TileServerAutoScalingMin': ['global:TileServerAutoScalingMin'],
'TileServerAutoScalingMax': ['global:TileServerAutoScalingMax'],
'TileServerAutoScalingScheduleStartCapacity': ['global:TileServerAutoScalingScheduleStartCapacity'], # NOQA
'TileServerAutoScalingScheduleStartRecurrence': ['global:TileServerAutoScalingScheduleStartRecurrence'], # NOQA
'TileServerAutoScalingScheduleEndCapacity': ['global:TileServerAutoScalingScheduleEndCapacity'], # NOQA
'TileServerAutoScalingScheduleEndRecurrence': ['global:TileServerAutoScalingScheduleEndRecurrence'], # NOQA
'SSLCertificateARN': ['global:SSLCertificateARN'],
'PublicSubnets': ['global:PublicSubnets', 'VPC:PublicSubnets'],
'PrivateSubnets': ['global:PrivateSubnets', 'VPC:PrivateSubnets'],
Expand Down Expand Up @@ -143,6 +147,34 @@ def set_up_stack(self):
Description='Tile server AutoScalingGroup maximum'
), 'TileServerAutoScalingMax')

self.tile_server_auto_scaling_schedule_start_recurrence = self.add_parameter( # NOQA
Parameter(
'TileServerAutoScalingScheduleStartRecurrence', Type='String',
Default='0 13 * * 1-5',
Description='Tile server ASG schedule start recurrence'
), 'TileServerAutoScalingScheduleStartRecurrence')

self.tile_server_auto_scaling_schedule_start_capacity = self.add_parameter( # NOQA
Parameter(
'TileServerAutoScalingScheduleStartCapacity', Type='String',
Default='1',
Description='Tile server ASG schedule start capacity'
), 'TileServerAutoScalingScheduleStartCapacity')

self.tile_server_auto_scaling_schedule_end_recurrence = self.add_parameter( # NOQA
Parameter(
'TileServerAutoScalingScheduleEndRecurrence', Type='String',
Default='0 23 * * *',
Description='Tile server ASG schedule end recurrence'
), 'TileServerAutoScalingScheduleEndRecurrence')

self.tile_server_auto_scaling_schedule_end_capacity = self.add_parameter( # NOQA
Parameter(
'TileServerAutoScalingScheduleEndCapacity', Type='String',
Default='1',
Description='Tile server ASG schedule end capacity'
), 'TileServerAutoScalingScheduleEndCapacity')

self.ssl_certificate_arn = self.add_parameter(Parameter(
'SSLCertificateARN', Type='String',
Description='ARN for a SSL certificate stored in IAM'
Expand Down Expand Up @@ -318,7 +350,7 @@ def create_auto_scaling_resources(self, tile_server_security_group,

tile_server_auto_scaling_group_name = 'asgTileServer'

self.add_resource(
tile_server_asg = self.add_resource(
asg.AutoScalingGroup(
tile_server_auto_scaling_group_name,
AvailabilityZones=Ref(self.availability_zones),
Expand Down Expand Up @@ -346,6 +378,28 @@ def create_auto_scaling_resources(self, tile_server_security_group,
)
)

self.add_resource(
asg.ScheduledAction(
'schedTileServerAutoScalingStart',
AutoScalingGroupName=Ref(tile_server_asg),
DesiredCapacity=Ref(
self.tile_server_auto_scaling_schedule_start_capacity),
Recurrence=Ref(
self.tile_server_auto_scaling_schedule_start_recurrence)
)
)

self.add_resource(
asg.ScheduledAction(
'schedTileServerAutoScalingEnd',
AutoScalingGroupName=Ref(tile_server_asg),
DesiredCapacity=Ref(
self.tile_server_auto_scaling_schedule_end_capacity),
Recurrence=Ref(
self.tile_server_auto_scaling_schedule_end_recurrence)
)
)

def get_cloud_config(self):
return ['#cloud-config\n',
'\n',
Expand Down
64 changes: 60 additions & 4 deletions deployment/cfn/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ class Worker(StackNode):
'WorkerAutoScalingDesired': ['global:WorkerAutoScalingDesired'], # NOQA
'WorkerAutoScalingMin': ['global:WorkerAutoScalingMin'],
'WorkerAutoScalingMax': ['global:WorkerAutoScalingMax'],
'WorkerAutoScalingScheduleStartCapacity': ['global:WorkerAutoScalingScheduleStartCapacity'], # NOQA
'WorkerAutoScalingScheduleStartRecurrence': ['global:WorkerAutoScalingScheduleStartRecurrence'], # NOQA
'WorkerAutoScalingScheduleEndCapacity': ['global:WorkerAutoScalingScheduleEndCapacity'], # NOQA
'WorkerAutoScalingScheduleEndRecurrence': ['global:WorkerAutoScalingScheduleEndRecurrence'], # NOQA
'PublicSubnets': ['global:PublicSubnets', 'VPC:PublicSubnets'],
'PrivateSubnets': ['global:PrivateSubnets', 'VPC:PrivateSubnets'],
'PublicHostedZoneName': ['global:PublicHostedZoneName'],
Expand Down Expand Up @@ -135,20 +139,48 @@ def set_up_stack(self):
), 'WorkerInstanceProfile')

self.worker_auto_scaling_desired = self.add_parameter(Parameter(
'WorkerAutoScalingDesired', Type='String', Default='1',
'WorkerAutoScalingDesired', Type='String', Default='2',
Description='Worker AutoScalingGroup desired'
), 'WorkerAutoScalingDesired')

self.worker_auto_scaling_min = self.add_parameter(Parameter(
'WorkerAutoScalingMin', Type='String', Default='1',
'WorkerAutoScalingMin', Type='String', Default='0',
Description='Worker AutoScalingGroup minimum'
), 'WorkerAutoScalingMin')

self.worker_auto_scaling_max = self.add_parameter(Parameter(
'WorkerAutoScalingMax', Type='String', Default='1',
'WorkerAutoScalingMax', Type='String', Default='2',
Description='Worker AutoScalingGroup maximum'
), 'WorkerAutoScalingMax')

self.worker_auto_scaling_schedule_start_recurrence = self.add_parameter( # NOQA
Parameter(
'WorkerAutoScalingScheduleStartRecurrence', Type='String',
Default='0 13 * * 1-5',
Description='Worker ASG schedule start recurrence'
), 'WorkerAutoScalingScheduleStartRecurrence')

self.worker_auto_scaling_schedule_start_capacity = self.add_parameter( # NOQA
Parameter(
'WorkerAutoScalingScheduleStartCapacity', Type='String',
Default='2',
Description='Worker ASG schedule start capacity'
), 'WorkerAutoScalingScheduleStartCapacity')

self.worker_auto_scaling_schedule_end_recurrence = self.add_parameter( # NOQA
Parameter(
'WorkerAutoScalingScheduleEndRecurrence', Type='String',
Default='0 23 * * *',
Description='Worker ASG schedule end recurrence'
), 'WorkerAutoScalingScheduleEndRecurrence')

self.worker_auto_scaling_schedule_end_capacity = self.add_parameter( # NOQA
Parameter(
'WorkerAutoScalingScheduleEndCapacity', Type='String',
Default='0',
Description='Worker ASG schedule end capacity'
), 'WorkerAutoScalingScheduleEndCapacity')

self.public_subnets = self.add_parameter(Parameter(
'PublicSubnets', Type='CommaDelimitedList',
Description='A list of public subnets'
Expand Down Expand Up @@ -310,7 +342,7 @@ def create_auto_scaling_resources(self, worker_security_group, worker_lb):

worker_auto_scaling_group_name = 'asgWorker'

return self.add_resource(
worker_asg = self.add_resource(
asg.AutoScalingGroup(
worker_auto_scaling_group_name,
AvailabilityZones=Ref(self.availability_zones),
Expand Down Expand Up @@ -338,6 +370,30 @@ def create_auto_scaling_resources(self, worker_security_group, worker_lb):
)
)

self.add_resource(
asg.ScheduledAction(
'schedWorkerAutoScalingStart',
AutoScalingGroupName=Ref(worker_asg),
DesiredCapacity=Ref(
self.worker_auto_scaling_schedule_start_capacity),
Recurrence=Ref(
self.worker_auto_scaling_schedule_start_recurrence)
)
)

self.add_resource(
asg.ScheduledAction(
'schedWorkerAutoScalingEnd',
AutoScalingGroupName=Ref(worker_asg),
DesiredCapacity=Ref(
self.worker_auto_scaling_schedule_end_capacity),
Recurrence=Ref(
self.worker_auto_scaling_schedule_end_recurrence)
)
)

return worker_asg

def get_cloud_config(self):
return ['#cloud-config\n',
'\n',
Expand Down
Loading

0 comments on commit dede7e5

Please sign in to comment.