Skip to content

Commit

Permalink
Merge branch 'release/1.23.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
tnation14 committed Jun 12, 2018
2 parents 92fde70 + 0261037 commit 94075eb
Show file tree
Hide file tree
Showing 131 changed files with 4,672 additions and 690 deletions.
8 changes: 6 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
}.merge(VAGRANT_NETWORK_OPTIONS)

services.vm.provider "virtualbox" do |v|
v.memory = 1024
v.customize ["guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 10000 ]
v.memory = 2048
end

services.vm.provision "ansible" do |ansible|
Expand Down Expand Up @@ -108,7 +109,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
}.merge(VAGRANT_NETWORK_OPTIONS)

worker.vm.provider "virtualbox" do |v|
v.customize ["guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 10000 ]
v.memory = 2048
v.cpus = 2
end

worker.vm.provision "ansible" do |ansible|
Expand Down Expand Up @@ -150,7 +153,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
app.ssh.forward_x11 = true

app.vm.provider "virtualbox" do |v|
v.memory = 1024
v.customize ["guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 10000 ]
v.memory = 2048
end

app.vm.provision "ansible" do |ansible|
Expand Down
8 changes: 4 additions & 4 deletions deployment/ansible/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ postgresql_database: mmw
postgresql_version: "9.4"
postgresql_package_version: "9.4.*.pgdg14.04+1"
postgresql_support_repository_channel: "main"
postgresql_support_libpq_version: "10.3-*.pgdg14.04+1"
postgresql_support_libpq_version: "10.4-*.pgdg14.04+1"
postgresql_support_psycopg2_version: "2.7"
postgis_version: "2.1"
postgis_package_version: "2.1.*.pgdg14.04+1"
Expand All @@ -36,8 +36,8 @@ nodejs_npm_version: 2.1.17

apache_version: "2.4.7-*"

java_version: "7u151-*"
java_major_version: "7"
java_version: "8u*"
java_major_version: "8"
java_flavor: "openjdk"

graphite_carbon_version: "0.9.13-pre1"
Expand All @@ -51,7 +51,7 @@ docker_options: "--storage-driver=aufs"
geop_host: "localhost"
geop_port: 8090

geop_version: "3.1.0"
geop_version: "4.0.1"
geop_cache_enabled: 1

nginx_cache_dir: "/var/cache/nginx"
Expand Down
4 changes: 2 additions & 2 deletions deployment/ansible/roles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@
- src: azavea.beaver
version: 1.0.1
- src: azavea.java
version: 0.6.1
version: 0.6.2
- src: azavea.docker
version: 1.0.2
version: 2.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
dest="{{ envdir_home }}/{{ item.key }}"
owner=root
group=mmw
mode=0750
mode=0440
with_dict: "{{ app_config }}"
notify:
- Restart mmw-app
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=5*" state=present
apt: pkg="firefox=6*" 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 @@ -2,19 +2,18 @@ import multiprocessing

bind = "127.0.0.1:8000"
workers = (2 * multiprocessing.cpu_count()) + 1
timeout = 60

{% if ['development', 'test'] | some_are_in(group_names) -%}
accesslog = "-"
errorlog = "-"
loglevel = 'debug'
preload_app = False
reload = True
timeout = 1800
{% else %}
accesslog = None
errorlog = "{{ app_gunicorn_log }}"
loglevel = 'info'
preload_app = True
reload = False
timeout = 60
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
file: path="{{ envdir_home }}"
owner=root
group=mmw
mode=0750
mode=0550
state=directory

- name: Configure base settings
copy: content="{{ item.value }}"
dest="{{ envdir_home }}/{{ item.key }}"
owner=root
group=mmw
mode=0750
mode=0440
with_dict: "{{ envdir_config }}"
notify:
- Restart mmw-app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
dest="{{ envdir_home }}/{{ item.key }}"
owner=root
group=mmw
mode=0750
mode=0440
with_dict: "{{ app_config }}"
notify:
- Restart Celery
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
- name: Install Celery
pip: name="{{ item.name }}" version={{ item.version }} state=present
with_items:
- { name: "kombu", version: "4.1.0" }
- { name: "celery[redis]", version: "{{ celery_version }}" }
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
---
dependencies:
- {
role: "azavea.java",
java_major_version: "8",
java_version: "8u141*"
}
- { role: "azavea.java" }
- { role: "model-my-watershed.base" }
- { role: "model-my-watershed.nginx" }
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
dest="{{ envdir_home }}/{{ item.key }}"
owner=root
group=mmw
mode=0750
mode=0440
with_dict: "{{ app_config }}"
notify:
- Restart Celery
48 changes: 2 additions & 46 deletions deployment/cfn/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
Base64,
Join,
Equals,
cloudwatch as cw,
ec2,
elasticloadbalancing as elb,
autoscaling as asg
Expand Down Expand Up @@ -83,7 +82,7 @@ class Application(StackNode):
'StackType': 'Staging',
'StackColor': 'Green',
'KeyName': 'mmw-stg',
'AppServerInstanceType': 't2.micro',
'AppServerInstanceType': 't2.small',
'AppServerInstanceProfile': 'AppServerInstanceProfile',
'AppServerAutoScalingDesired': '1',
'AppServerAutoScalingMin': '1',
Expand Down Expand Up @@ -128,7 +127,7 @@ def set_up_stack(self):
), 'RDSPassword')

self.app_server_instance_type = self.add_parameter(Parameter(
'AppServerInstanceType', Type='String', Default='t2.micro',
'AppServerInstanceType', Type='String', Default='t2.small',
Description='Application server EC2 instance type',
AllowedValues=EC2_INSTANCE_TYPES,
ConstraintDescription='must be a valid EC2 instance type.'
Expand Down Expand Up @@ -280,8 +279,6 @@ def set_up_stack(self):
app_server_lb,
backward_compat_app_server_lb)

self.create_cloud_watch_resources(app_server_lb)

self.add_output(Output('AppServerLoadBalancerEndpoint',
Value=GetAtt(app_server_lb, 'DNSName')))
self.add_output(Output('AppServerLoadBalancerHostedZoneNameID',
Expand Down Expand Up @@ -634,47 +631,6 @@ def get_cloud_config(self, tile_distribution_endpoint):
' owner: root:mmw\n',
' content: ', Ref(self.client_app_user_password)]

def create_cloud_watch_resources(self, app_server_lb):
self.add_resource(cw.Alarm(
'alarmAppServerBackend4XX',
AlarmDescription='Application server backend 4XXs',
AlarmActions=[Ref(self.notification_topic_arn)],
Statistic='Sum',
Period=300,
Threshold='20',
EvaluationPeriods=1,
ComparisonOperator='GreaterThanThreshold',
MetricName='HTTPCode_Backend_4XX',
Namespace='AWS/ELB',
Dimensions=[
cw.MetricDimension(
'metricLoadBalancerName',
Name='LoadBalancerName',
Value=Ref(app_server_lb)
)
],
))

self.add_resource(cw.Alarm(
'alarmAppServerBackend5XX',
AlarmDescription='Application server backend 5XXs',
AlarmActions=[Ref(self.notification_topic_arn)],
Statistic='Sum',
Period=60,
Threshold='0',
EvaluationPeriods=1,
ComparisonOperator='GreaterThanThreshold',
MetricName='HTTPCode_Backend_5XX',
Namespace='AWS/ELB',
Dimensions=[
cw.MetricDimension(
'metricLoadBalancerName',
Name='LoadBalancerName',
Value=Ref(app_server_lb)
)
],
))

def get_tags(self, **kwargs):
"""Helper method to return Troposphere tags + default tags
Expand Down
101 changes: 0 additions & 101 deletions deployment/cfn/tile_delivery_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
GetAtt,
Join,
cloudfront as cf,
cloudwatch as cw,
route53 as r53,
s3
)
Expand Down Expand Up @@ -107,56 +106,6 @@ def create_cloudfront_distributions(self):
)
))

self.add_resource(cw.Alarm(
'alarmTileDistributionBlueOrigin4XX',
AlarmDescription='Tile distribution origin 4XXs',
AlarmActions=[Ref(self.notification_topic_arn)],
Statistic='Average',
Period=300,
Threshold='20',
EvaluationPeriods=1,
ComparisonOperator='GreaterThanThreshold',
MetricName='4xxErrorRate',
Namespace='AWS/CloudFront',
Dimensions=[
cw.MetricDimension(
'metricDistributionId',
Name='DistributionId',
Value=Ref(blue_tile_distribution)
),
cw.MetricDimension(
'metricRegion',
Name='Region',
Value='Global'
)
]
))

self.add_resource(cw.Alarm(
'alarmTileDistributionBlueOrigin5XX',
AlarmDescription='Tile distribution origin 5XXs',
AlarmActions=[Ref(self.notification_topic_arn)],
Statistic='Average',
Period=60,
Threshold='0',
EvaluationPeriods=1,
ComparisonOperator='GreaterThanThreshold',
MetricName='5xxErrorRate',
Namespace='AWS/CloudFront',
Dimensions=[
cw.MetricDimension(
'metricDistributionId',
Name='DistributionId',
Value=Ref(blue_tile_distribution)
),
cw.MetricDimension(
'metricRegion',
Name='Region',
Value='Global'
)
]
))

green_tile_distribution = self.add_resource(cf.Distribution(
'tileDistributionGreen',
DistributionConfig=cf.DistributionConfig(
Expand All @@ -180,56 +129,6 @@ def create_cloudfront_distributions(self):
)
))

self.add_resource(cw.Alarm(
'alarmTileDistributionGreenOrigin4XX',
AlarmDescription='Tile distribution origin 4XXs',
AlarmActions=[Ref(self.notification_topic_arn)],
Statistic='Average',
Period=300,
Threshold='20',
EvaluationPeriods=1,
ComparisonOperator='GreaterThanThreshold',
MetricName='4xxErrorRate',
Namespace='AWS/CloudFront',
Dimensions=[
cw.MetricDimension(
'metricDistributionId',
Name='DistributionId',
Value=Ref(green_tile_distribution)
),
cw.MetricDimension(
'metricRegion',
Name='Region',
Value='Global'
)
]
))

self.add_resource(cw.Alarm(
'alarmTileDistributionGreenOrigin5XX',
AlarmDescription='Tile distribution origin 5XXs',
AlarmActions=[Ref(self.notification_topic_arn)],
Statistic='Average',
Period=60,
Threshold='0',
EvaluationPeriods=1,
ComparisonOperator='GreaterThanThreshold',
MetricName='5xxErrorRate',
Namespace='AWS/CloudFront',
Dimensions=[
cw.MetricDimension(
'metricDistributionId',
Name='DistributionId',
Value=Ref(green_tile_distribution)
),
cw.MetricDimension(
'metricRegion',
Name='Region',
Value='Global'
)
]
))

return blue_tile_distribution, green_tile_distribution

def create_s3_resources(self):
Expand Down
Loading

0 comments on commit 94075eb

Please sign in to comment.