Skip to content

Commit

Permalink
Merge pull request #2118 from WikiWatershed/ki/use-akka-http-service
Browse files Browse the repository at this point in the history
Replace SJS with Akka HTTP server

Connects #2101 
Connects #2103
  • Loading branch information
kellyi committed Aug 7, 2017
2 parents d92a909 + 0d7f2db commit f292f5b
Show file tree
Hide file tree
Showing 18 changed files with 56 additions and 164 deletions.
7 changes: 3 additions & 4 deletions deployment/ansible/group_vars/all
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ docker_version: "1.9.*"
docker_py_version: "1.2.3"
docker_options: "--storage-driver=aufs"

sjs_host: "localhost"
sjs_port: 8090
sjs_container_image: "quay.io/azavea/spark-jobserver:0.6.1"
geop_host: "localhost"
geop_port: 8090

geop_version: "2.1.0"
geop_version: "3.0.0-alpha"
geop_cache_enabled: 1

nginx_cache_dir: "/var/cache/nginx"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ envdir_config:
MMW_CACHE_PORT: "{{ redis_port }}"
MMW_TILER_HOST: "{{ tiler_host }}"
MMW_GEOPROCESSING_CACHE: "{{ geop_cache_enabled }}"
MMW_GEOPROCESSING_HOST: "{{ sjs_host }}"
MMW_GEOPROCESSING_PORT: "{{ sjs_port }}"
MMW_GEOPROCESSING_HOST: "{{ geop_host }}"
MMW_GEOPROCESSING_PORT: "{{ geop_port }}"
MMW_GEOPROCESSING_VERSION: "{{ geop_version }}"
MMW_ITSI_CLIENT_ID: "{{ itsi_client_id }}"
MMW_ITSI_SECRET_KEY: "{{ itsi_secret_key }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
- celery
- django
- docker
- geoprocessing
- gunicorn
- nginx
- spark-jobserver
- windshaft
notify:
- Restart Beaver
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-[/var/log/upstart/geoprocessing.log]
-multiline_regex_before = ^\s+
-type: geoprocessing
-tags: geoprocessing,beaver

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
geop_home: "/opt/geoprocessing"
geop_jar_url: "https://github.com/WikiWatershed/mmw-geoprocessing/releases/download/{{ geop_version }}/mmw-geoprocessing-assembly-{{ geop_version }}.jar"
geop_jar_url: "https://github.com/WikiWatershed/mmw-geoprocessing/releases/download/{{ geop_version }}/api-assembly-{{ geop_version }}.jar"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
- name: Restart geoprocessing service
service: name=geoprocessing state=restarted
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
dependencies:
- { role: "model-my-watershed.spark-jobserver" }
- {
role: "azavea.java",
java_major_version: "8",
java_version: "8u141*"
}
- { role: "model-my-watershed.base" }
- { role: "model-my-watershed.nginx" }
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,28 @@
file: path="{{ geop_home }}"
state=directory

- name: Download Spark Job Server geoprocessing JAR
- name: Download mmw-geoprocessing JAR
get_url: url="{{ geop_jar_url }}"
dest="{{ geop_home }}/mmw-geoprocessing-{{ geop_version }}.jar"

- name: Configure Nginx site
template: src=nginx-geoprocessing.conf.j2
dest=/etc/nginx/sites-available/geoprocessing.conf
notify:
- Restart Nginx

- name: Enable Nginx site
file: src=/etc/nginx/sites-available/geoprocessing.conf
dest=/etc/nginx/sites-enabled/geoprocessing
state=link
notify:
- Restart Nginx

- name: Configure geoprocessing service definition
template: src=upstart-geoprocessing.conf.j2
dest=/etc/init/geoprocessing.conf
notify:
- Restart geoprocessing service

- name: Ensure geoprocessing service is running
service: name=geoprocessing state=started
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ server {
listen *:80;
server_name _;

access_log /var/log/nginx/spark-jobserver.access.log logstash_json;
access_log /var/log/nginx/geoprocessing.access.log logstash_json;

{% if ['packer'] | is_in(group_names) -%}
location /version.txt {
Expand All @@ -15,6 +15,6 @@ server {
proxy_set_header Host $http_host;
proxy_redirect off;

proxy_pass http://127.0.0.1:8090/healthz;
proxy_pass http://127.0.0.1:8090/ping;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
description "Geoprocessing service"

{% if ['development', 'test'] | some_are_in(group_names) -%}
start on (vagrant-mounted)
{% else %}
start on (local-filesystems and net-device-up IFACE!=lo)
{% endif %}

stop on shutdown

respawn
setuid mmw
chdir {{ geop_home }}

exec java -jar mmw-geoprocessing-{{ geop_version }}.jar

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit f292f5b

Please sign in to comment.