|
1 =head1 INSTALLATION |
|
2 |
|
3 =head2 Compile breakpad and stackwalker from Socorro |
|
4 |
|
5 Install system packages: |
|
6 |
|
7 apt install build-essential libjsoncpp-dev libcurl4-openssl-dev git wget python pkg-config |
|
8 |
|
9 Get and build breakpad: |
|
10 L<https://chromium.googlesource.com/breakpad/breakpad> |
|
11 |
|
12 Get and build the json minidump-stackwalk from soccoro: |
|
13 L<https://github.com/mozilla/socorro/tree/master/minidump-stackwalk/> |
|
14 |
|
15 Full compilation instructions: |
|
16 |
|
17 mkdir breakpad-stackwalker && cd breakpad-stackwalker |
|
18 git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git |
|
19 export PATH="$PWD/depot_tools:$PATH" |
|
20 fetch breakpad |
|
21 mkdir obj-breakpad && cd obj-breakpad |
|
22 ../src/configure |
|
23 make |
|
24 cd ../ |
|
25 mkdir minidump-stackwalk && cd minidump-stackwalk |
|
26 wget https://github.com/mozilla/socorro/raw/master/minidump-stackwalk/{Makefile,stackwalker.cc,http_symbol_supplier.cc,http_symbol_supplier.h,common.h} |
|
27 make stackwalker \ |
|
28 BREAKPAD_SRCDIR=../src/src \ |
|
29 BREAKPAD_LIBS="../obj-breakpad/src/libbreakpad.a ../obj-breakpad/src/third_party/libdisasm/libdisasm.a" \ |
|
30 JSON_INCLUDEDIR=/usr/include/jsoncpp \ |
|
31 stackwalker_OBJS="/usr/lib/libjsoncpp.so" |
|
32 |
|
33 |
|
34 Note: the paths above are for the system-installed libjsoncpp on debian. Get |
|
35 jsoncpp from socorro repository, or adjust the paths for you system if you |
|
36 use another distribution. |
|
37 |
|
38 =head2 Web Interface installation |
|
39 |
|
40 =head3 Install system packages (Debian) |
|
41 |
|
42 Install direct dependencies: |
|
43 |
|
44 apt install libjs-jquery libuuid-perl libdata-page-perl libdatetime-format-pg-perl \ |
|
45 libsearch-queryparser-perl libdbi-perl libdbd-pg-perl libpq-dev |
|
46 |
|
47 and indirect dependencies: |
|
48 |
|
49 apt install cpanminus libextutils-installpaths-perl libfile-sharedir-perl libfile-sharedir-install-perl \ |
|
50 libextutils-helpers-perl libmodule-build-cleaninstall-perl \ |
|
51 libmojolicious-plugin-i18n-perl libdata-dump-perl |
|
52 |
|
53 If your system is recent enough (Debian jessie is too old), also install: |
|
54 |
|
55 apt install libmojolicious-perl libminion-perl libmojo-pg-perl |
|
56 |
|
57 Or use carton (Bundler for perl), if you prefer to bundle dependencies: |
|
58 |
|
59 apt install carton uuid-dev |
|
60 |
|
61 =head3 Install the web interface |
|
62 |
|
63 tar -xf CrashTest-$VERSION.tar.gz |
|
64 cd CrashTest-$VERSION |
|
65 |
|
66 use cpanm to install missing perl dependencies: |
|
67 |
|
68 cpanm Minion@4.0 . |
|
69 |
|
70 or carton to vendorize half of CPAN: |
|
71 |
|
72 carton install |
|
73 |
|
74 =head3 Database |
|
75 |
|
76 Install PostgreSQL (PostgreSQL E<gt>= 9.4 is required): |
|
77 |
|
78 apt install postgresql postgresql-contrib postgresql-9.4-debversion |
|
79 |
|
80 Create the user and database: |
|
81 |
|
82 su postgres |
|
83 psql |
|
84 CREATE USER crashtest LOGIN; |
|
85 CREATE DATABASE crashtest OWNER crashtest; |
|
86 |
|
87 Add PostgreSQL extensions to the database: |
|
88 |
|
89 \c crashtest |
|
90 CREATE EXTENSION pg_trgm; |
|
91 CREATE EXTENSION debversion; |
|
92 |
|
93 debversion is not required, but is really useful to sort and filter on product versions |
|
94 |
|
95 =head2 Configuration |
|
96 |
|
97 Copy the example crash_test.conf from F<extras/> and edit: |
|
98 |
|
99 cp extras/crash_test.conf . |
|
100 vim crash_test.conf |
|
101 |
|
102 It's a perl file, so you can check the syntax with: |
|
103 |
|
104 perl -c crash_test.conf |
|
105 |
|
106 Some things to change: |
|
107 |
|
108 =over |
|
109 |
|
110 =item Database |
|
111 |
|
112 Adjust your database connection string in C<Processor/JobQueue/Backend/Minion> and C<Storage/Sql/db>. |
|
113 The database can be shared by the JobQueue and Storage. |
|
114 |
|
115 =item stackwalker path |
|
116 |
|
117 If you did not install stackwalker in your $PATH, adjust C<Processor/CrashProcessor/Breakpad/JSONStackwalker> |
|
118 |
|
119 =item Breakpad symbols directories |
|
120 |
|
121 Set the paths where you store you breakpad symbols in C<Processor/CrashProcessor/Breakpad/SymbolsPath>. |
|
122 |
|
123 SECURITY WARNING: this will be shell-expanded using C<system()>, don't use wildcards if you do not trust |
|
124 the users that have write permissions on these directories. |
|
125 |
|
126 =item Storage directory |
|
127 |
|
128 Adjust C<Storage/File> or comment the section if you don't want to store the raw minidumps. |
|
129 Processed crashs are also stored in the database. |
|
130 |
|
131 =item Web links |
|
132 |
|
133 You can link to your source code browser (this require post-processing of the symbol files), |
|
134 see C<WebInterface/ScmLinks>. |
|
135 |
|
136 It's a C<Mojo::Template> with the 3 variables C<$scmpath>, C<$rev> and C<$line> defined. |
|
137 |
|
138 You can also add links to your bugtracker (C<WebInterface/BugTrackerLinks>), but there is no interface |
|
139 to edit them yet. |
|
140 |
|
141 =back |
|
142 |
|
143 =head2 Create database structure |
|
144 |
|
145 Run: |
|
146 |
|
147 CrashTest db create |
|
148 |
|
149 or with carton: |
|
150 |
|
151 carton exec CrashTest db create |
|
152 |
|
153 If you have installed the debversion PostgreSQL extension, use it: |
|
154 |
|
155 psql |
|
156 ALTER TABLE products ALTER version TYPE debversion; |
|
157 |
|
158 |
|
159 =head1 RUNNING |
|
160 |
|
161 =head2 Manually (for testing) |
|
162 |
|
163 Start the background workers |
|
164 |
|
165 CrashTest minion worker |
|
166 |
|
167 Start the web interface |
|
168 |
|
169 CrashTest daemon |
|
170 |
|
171 =head2 Production (services) |
|
172 |
|
173 In the F<extras/> directory, you will find: |
|
174 |
|
175 =over |
|
176 |
|
177 =item F<crash_test.production.conf> |
|
178 |
|
179 A config file with production settings for hypnotoad. |
|
180 Copy to the same location as F<crash_test.conf>, F</etc/crashtest/> for a system-wide install. |
|
181 |
|
182 =item F<crashtest.nginx.conf> |
|
183 |
|
184 Config file for nginx. Usually in F</etc/nginx/sites-enabled/>. |
|
185 |
|
186 =item F<systemd/*.service> |
|
187 |
|
188 Systemd services for the workers and the web interface. Usually in F</etc/systemd/system/>. |
|
189 |
|
190 =back |