Skip to content

Commit

Permalink
Add crash reporter service
Browse files Browse the repository at this point in the history
  • Loading branch information
paulrouget committed Aug 11, 2020
1 parent 3a751de commit d6bc531
Show file tree
Hide file tree
Showing 6 changed files with 76 additions and 0 deletions.
1 change: 1 addition & 0 deletions crash-reporter/files/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"port": 5004, "crash_dir": "./crashes/", "secret": "{{ pillar['crash-reporter']['secret'] }}"}
13 changes: 13 additions & 0 deletions crash-reporter/files/crashreporter.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=Job that runs crash-reporter
Requires=network-online.target

[Service]
ExecStart={{ common.servo_home }}/crash-reporter/_venv/bin/crash_reporter
Environment=HOME={{ common.servo_home }}
User=servo
Group=servo
WorkingDirectory={{ common.servo_home }}/crash-reporter

[Install]
WantedBy=multi-user.target
53 changes: 53 additions & 0 deletions crash-reporter/init.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{% from 'common/map.jinja' import common %}
{% from tpldir ~ '/map.jinja' import crashreporter %}
include:
- common
- python
crash-reporter:
virtualenv.managed:
- name: /home/servo/crash-reporter/_venv
- venv_bin: virtualenv-3.5
- python: python3
- system_site_packages: False
- require:
- pkg: python3
- pip: virtualenv
pip.installed:
- pkgs:
- git+https://github.com/servo/crash-reporter@{{ crashreporter.rev }}
- bin_env: /home/servo/crash-reporter/_venv
- upgrade: True
- require:
- virtualenv: crash-reporter
service.running:
- enable: True
- name: crashreporter
- require:
- pip: crash-reporter
- watch:
- file: /home/servo/crash-reporter/config.json
- file: /lib/systemd/system/crashreporter.service
- pip: crash-reporter
/home/servo/crash-reporter/config.json:
file.managed:
- source: salt://{{ tpldir }}/files/config.json
- template: jinja
- user: servo
- group: servo
- mode: 644
/lib/systemd/system/crashreporter.service:
file.managed:
- source: salt://{{ tpldir }}/files/crashreporter.service
- template: jinja
- user: root
- group: root
- mode: 644
- context:
common: {{ common }}
- require:
- pip: crash-reporter
- file: /home/servo/crash-reporter/config.json
5 changes: 5 additions & 0 deletions crash-reporter/map.jinja
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{%
set crashreporter = {
'rev': 'FIXME'
}
%}
3 changes: 3 additions & 0 deletions nginx/default
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,8 @@ server {
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Script-Name /standups;
}
location /crash-reporter/ {
proxy_pass http://localhost:5004/;
}
}

1 change: 1 addition & 0 deletions top.sls
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ base:
- nginx
- salt.master
- standups
- crash-reporter

0 comments on commit d6bc531

Please sign in to comment.