aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/compass_conf/progress_calculator/progress_calculator.conf
blob: f4f991e44a4a3cafafa427c75a2b6ae2c37c6b7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
OS_INSTALLER_CONFIGURATIONS = {
    'cobbler': {
        'Ubuntu': AdapterItemMatcher(
            file_matchers=[
                FileMatcher(
                    filename='syslog',
                    min_progress=0.0,
                    max_progress=1.0,
                    line_matchers={
                        'start': LineMatcher(
                            pattern=r'.*',
                            progress=.05,
                            message_template='start installing',
                            unmatch_nextline_next_matcher_name='start',
                            match_nextline_next_matcher_name='ethdetect'
                        ),
                        'ethdetect': LineMatcher(
                            pattern=r'Menu.*item.*\'ethdetect\'.*selected',
                            progress=.1,
                            message_template='ethdetect selected',
                            unmatch_nextline_next_matcher_name='ethdetect',
                            match_nextline_next_matcher_name='netcfg'
                        ),
                        'netcfg': LineMatcher(
                            pattern=r'Menu.*item.*\'netcfg\'.*selected',
                            progress=.12,
                            message_template='netcfg selected',
                            unmatch_nextline_next_matcher_name='netcfg',
                            match_nextline_next_matcher_name='network-preseed'
                        ),
                        'network-preseed': LineMatcher(
                            pattern=(
                                r'Menu.*item.*\'network-preseed\'.*selected'
                            ),
                            progress=.15,
                            message_template='network-preseed selected',
                            unmatch_nextline_next_matcher_name=(
                                'network-preseed'
                            ),
                            match_nextline_next_matcher_name='localechooser'
                        ),
                        'localechooser': LineMatcher(
                            pattern=r'Menu.*item.*\'localechooser\'.*selected',
                            progress=.18,
                            message_template='localechooser selected',
                            unmatch_nextline_next_matcher_name='localechooser',
                            match_nextline_next_matcher_name=(
                                'download-installer'
                            )
                        ),
                        'download-installer': LineMatcher(
                            pattern=(
                                r'Menu.*item.*\'download-installer\'.*selected'
                            ),
                            progress=.2,
                            message_template='download installer selected',
                            unmatch_nextline_next_matcher_name=(
                                'download-installer'),
                            match_nextline_next_matcher_name='clock-setup'
                        ),
                        'clock-setup': LineMatcher(
                            pattern=r'Menu.*item.*\'clock-setup\'.*selected',
                            progress=.3,
                            message_template='clock-setup selected',
                            unmatch_nextline_next_matcher_name='clock-setup',
                            match_nextline_next_matcher_name='disk-detect'
                        ),
                        'disk-detect': LineMatcher(
                            pattern=r'Menu.*item.*\'disk-detect\'.*selected',
                            progress=.32,
                            message_template='disk-detect selected',
                            unmatch_nextline_next_matcher_name='disk-detect',
                            match_nextline_next_matcher_name='partman-base'
                        ),
                        'partman-base': LineMatcher(
                            pattern=(
                                r'Menu.*item.*\'partman-base\'.*selected'
                            ),
                            progress=.35,
                            message_template='partman-base selected',
                            unmatch_nextline_next_matcher_name='partman-base',
                            match_nextline_next_matcher_name='apt-setup-udeb'
                        ),
                        'apt-setup-udeb': LineMatcher(
                            pattern=(
                                r'Menu.*item.*\'apt-setup-udeb\'.*selected'
                            ),
                            progress=.45,
                            message_template='apt-setup-udeb selected',
                            unmatch_nextline_next_matcher_name=(
                                'apt-setup-udeb'
                            ),
                            match_nextline_next_matcher_name='pkgsel'
                        ),
                        'pkgsel': LineMatcher(
                            pattern=r'Menu.*item.*\'pkgsel\'.*selected',
                            progress=.5,
                            message_template='pkgsel selected',
                            unmatch_nextline_next_matcher_name='pkgsel',
                            match_nextline_next_matcher_name='grub-installer'
                        ),
                        'grub-installer': LineMatcher(
                            pattern=(
                                r'Menu.*item.*\'grub-installer\'.*selected'
                            ),
                            progress=.9,
                            message_template='grub-installer selected',
                            unmatch_nextline_next_matcher_name=(
                                'grub-installer'
                            ),
                            match_nextline_next_matcher_name='finish-install'
                        ),
                        'finish-install': LineMatcher(
                            pattern=(
                                r'Menu.*item.*\'finish-install\'.*selected'
                            ),
                            progress=.95,
                            message_template='finish-install selected',
                            unmatch_nextline_next_matcher_name=(
                                'finish-install'
                            ),
                            match_nextline_next_matcher_name=(
                                'finish-install-done'
                            )
                        ),
                        'finish-install-done': LineMatcher(
                            pattern=(
                                r'Running.*finish-install.d/.*save-logs'
                            ),
                            progress=1.0,
                            message_template='finish-install is done',
                            unmatch_nextline_next_matcher_name=(
                                'finish-install-done'
                            ),
                            match_nextline_next_matcher_name='exit'
                        ),
                    }
                ),
                FileMatcher(
                    filename='status',
                    min_progress=.2,
                    max_progress=.3,
                    line_matchers={
                        'start': LineMatcher(
                            pattern=r'Package: (?P<package>.*)',
                            progress=IncrementalProgress(0.0, 0.99, 0.05),
                            message_template='Installing udeb %(package)s',
                            unmatch_nextline_next_matcher_name='start',
                            match_nextline_next_matcher_name='start'
                        )
                    }
                ),
                FileMatcher(
                    filename='initial-status',
                    min_progress=.5,
                    max_progress=.9,
                    line_matchers={
                        'start': LineMatcher(
                            pattern=r'Package: (?P<package>.*)',
                            progress=IncrementalProgress(0.0, 0.99, 0.01),
                            message_template='Installing deb %(package)s',
                            unmatch_nextline_next_matcher_name='start',
                            match_nextline_next_matcher_name='start'
                        )
                    }
                ),
            ]
        ),
        'CentOS6': AdapterItemMatcher(
            file_matchers=[
                FileMatcher(
                    filename='sys.log',
                    min_progress=0.0,
                    max_progress=0.1,
                    line_matchers={
                        'start': LineMatcher(
                            pattern=r'NOTICE (?P<message>.*)',
                            progress=IncrementalProgress(.1, .9, .1),
                            message_template='%(message)s',
                            unmatch_nextline_next_matcher_name='start',
                            match_nextline_next_matcher_name='exit'
                        ),
                    }
                ),
                FileMatcher(
                    filename='anaconda.log',
                    min_progress=0.1,
                    max_progress=1.0,
                    line_matchers={
                        'start': LineMatcher(
                            pattern=r'setting.*up.*kickstart',
                            progress=.1,
                            message_template=(
                                'Setting up kickstart configurations'),
                            unmatch_nextline_next_matcher_name='start',
                            match_nextline_next_matcher_name='STEP_STAGE2'
                        ),
                        'STEP_STAGE2': LineMatcher(
                            pattern=r'starting.*STEP_STAGE2',
                            progress=.15,
                            message_template=(
                                'Downloading installation '
                                'images from server'),
                            unmatch_nextline_next_matcher_name='STEP_STAGE2',
                            match_nextline_next_matcher_name='start_anaconda'
                        ),
                        'start_anaconda': LineMatcher(
                            pattern=r'Running.*anaconda.*script',
                            progress=.2,
                            unmatch_nextline_next_matcher_name=(
                                'start_anaconda'),
                            match_nextline_next_matcher_name=(
                                'start_kickstart_pre')
                        ),
                        'start_kickstart_pre': LineMatcher(
                            pattern=r'Running.*kickstart.*pre.*script',
                            progress=.25,
                            unmatch_nextline_next_matcher_name=(
                                'start_kickstart_pre'),
                            match_nextline_next_matcher_name=(
                                'kickstart_pre_done')
                        ),
                        'kickstart_pre_done': LineMatcher(
                            pattern=(
                                r'All.*kickstart.*pre'
                                '.*script.*have.*been.*run'
                            ),
                            progress=.3,
                            unmatch_nextline_next_matcher_name=(
                                'kickstart_pre_done'),
                            match_nextline_next_matcher_name=(
                                'start_enablefilesystem')
                        ),
                        'start_enablefilesystem': LineMatcher(
                            pattern=(
                                r'moving.*step.*enablefilesystems'
                            ),
                            progress=0.3,
                            message_template=(
                                'Performing hard-disk partitioning and '
                                'enabling filesystems'
                            ),
                            unmatch_nextline_next_matcher_name=(
                                'start_enablefilesystem'),
                            match_nextline_next_matcher_name=(
                                'enablefilesystem_done')
                        ),
                        'enablefilesystem_done': LineMatcher(
                            pattern=(
                                r'leaving.*step.*enablefilesystems'
                            ),
                            progress=.35,
                            message_template='Filesystems are enabled',
                            unmatch_nextline_next_matcher_name=(
                                'enablefilesystem_done'),
                            match_nextline_next_matcher_name=(
                                'setup_repositories')
                        ),
                        'setup_repositories': LineMatcher(
                            pattern=r'moving.*step.*reposetup',
                            progress=0.35,
                            message_template=(
                                'Setting up Customized Repositories'
                            ),
                            unmatch_nextline_next_matcher_name=(
                                'setup_repositories'),
                            match_nextline_next_matcher_name=(
                                'repositories_ready')
                        ),
                        'repositories_ready': LineMatcher(
                            pattern=r'leaving.*step.*reposetup',
                            progress=0.4,
                            message_template=(
                                'Customized Repositories setting up are done'
                            ),
                            unmatch_nextline_next_matcher_name=(
                                'repositories_ready'),
                            match_nextline_next_matcher_name='checking_dud'
                        ),
                        'checking_dud': LineMatcher(
                            pattern=r'moving.*step.*postselection',
                            progress=0.4,
                            message_template='Checking DUD modules',
                            unmatch_nextline_next_matcher_name='checking_dud',
                            match_nextline_next_matcher_name='dud_checked'
                        ),
                        'dud_checked': LineMatcher(
                            pattern=r'leaving.*step.*postselection',
                            progress=0.5,
                            message_template='Checking DUD modules are done',
                            unmatch_nextline_next_matcher_name='dud_checked',
                            match_nextline_next_matcher_name=(
                                'installing_packages'
                            )
                        ),
                        'installing_packages': LineMatcher(
                            pattern=r'moving.*step.*installpackages',
                            progress=0.5,
                            message_template='Installing packages',
                            unmatch_nextline_next_matcher_name=(
                                'installing_packages'),
                            match_nextline_next_matcher_name=(
                                'packages_installed')
                        ),
                        'packages_installed': LineMatcher(
                            pattern=r'leaving.*step.*installpackages',
                            progress=0.8,
                            message_template='Packages are installed',
                            unmatch_nextline_next_matcher_name=(
                                'packages_installed'),
                            match_nextline_next_matcher_name=(
                                'installing_bootloader')
                        ),
                        'installing_bootloader': LineMatcher(
                            pattern=r'moving.*step.*instbootloader',
                            progress=0.9,
                            message_template='Installing bootloaders',
                            unmatch_nextline_next_matcher_name=(
                                'installing_bootloader'),
                            match_nextline_next_matcher_name=(
                                'bootloader_installed'),
                        ),
                        'bootloader_installed': LineMatcher(
                            pattern=r'leaving.*step.*instbootloader',
                            progress=1.0,
                            message_template='bootloaders is installed',
                            unmatch_nextline_next_matcher_name=(
                                'bootloader_installed'),
                            match_nextline_next_matcher_name='exit'
                        ),
                    }
                ),
                FileMatcher(
                    filename='install.log',
                    min_progress=0.56,
                    max_progress=0.80,
                    line_matchers={
                        'start': LineMatcher(
                            pattern=r'Installing (?P<package>.*)',
                            progress=IncrementalProgress(0.0, 0.99, 0.005),
                            message_template='Installing %(package)s',
                            unmatch_sameline_next_matcher_name=(
                                'package_complete'
                            ),
                            unmatch_nextline_next_matcher_name='start',
                            match_nextline_next_matcher_name='start'
                        ),
                        'package_complete': LineMatcher(
                            pattern='FINISHED.*INSTALLING.*PACKAGES',
                            progress=1.0,
                            message_template='installing packages finished',
                            unmatch_nextline_next_matcher_name='start',
                            match_nextline_next_matcher_name='exit'
                        ),
                    }
                ),
            ]
        ),
        'CentOS7': AdapterItemMatcher(
            file_matchers=[
                FileMatcher(
                    filename='syslog',
                    min_progress=0.0,
                    max_progress=0.1,
                    line_matchers={
                        'start': LineMatcher(
                            pattern=r'NOTICE (?P<message>.*)',
                            progress=IncrementalProgress(.1, .9, .1),
                            message_template='%(message)s',
                            unmatch_nextline_next_matcher_name='start',
                            match_nextline_next_matcher_name='exit'
                        ),
                    }
                ),
                FileMatcher(
                    filename='anaconda.log',
                    min_progress=0.1,
                    max_progress=1.0,
                    line_matchers={
                        'start': LineMatcher(
                            pattern=r'Running.*kickstart.*pre.*script',
                            progress=.15,
                            unmatch_nextline_next_matcher_name=(
                                'start'),
                            match_nextline_next_matcher_name=(
                                'kickstart_pre_done')
                        ),
                        'kickstart_pre_done': LineMatcher(
                            pattern=(
                                r'All.*kickstart.*pre'
                                '.*script.*have.*been.*run'
                            ),
                            progress=.2,
                            unmatch_nextline_next_matcher_name=(
                                'kickstart_pre_done'),
                            match_nextline_next_matcher_name=(
                                'geolocation_lookup')
                        ),
                        'geolocation_lookup': LineMatcher(
                            pattern=r'Starting.*geolocation.*lookup',
                            progress=0.3,
                            message_template=(
                                'Setting up Customized Repositories'
                            ),
                            unmatch_nextline_next_matcher_name=(
                                'geolocation_lookup'),
                            match_nextline_next_matcher_name=(
                                'geolocation_done')
                        ),
                        'geolocation_done': LineMatcher(
                            pattern=r'Geolocation.*lookup.*finished',
                            progress=0.4,
                            message_template=(
                                'Geolocation lookup are done'
                            ),
                            unmatch_nextline_next_matcher_name=(
                                'geolocation_done'),
                            match_nextline_next_matcher_name='setup_environment'
                        ),
                        'setup_environment': LineMatcher(
                            pattern=r'Setting.*installation.*environment',
                            progress=0.5,
                            message_template='Setting up installation environment',
                            unmatch_nextline_next_matcher_name='setup_environment',
                            match_nextline_next_matcher_name='installing_packages'
                        ),
                        'installing_packages': LineMatcher(
                            pattern=(
                                r'Creating.*biosboot.*on'
                            ),
                            progress=.5,
                            message_template=(
                                'Installing packages'
                            ),
                            unmatch_nextline_next_matcher_name=(
                                'installing_packages'),
                            match_nextline_next_matcher_name=(
                                'packages_installed')
                        ),
                        'packages_installed': LineMatcher(
                            pattern=(
                                r'bootloader.*args'
                            ),
                            progress=.8,
                            message_template='Packages are installed',
                            unmatch_nextline_next_matcher_name=(
                                'packages_installed'),
                            match_nextline_next_matcher_name=(
                                'installing_bootloader')
                        ),
                        'installing_bootloader': LineMatcher(
                            pattern=r'setting.*installation.*environment',
                            progress=0.9,
                            message_template='Setup installation environment',
                            unmatch_nextline_next_matcher_name=(
                                'installing_bootloader'),
                            match_nextline_next_matcher_name=(
                                'post_installation'),
                        ),
                        'post_installation': LineMatcher(
                            pattern=r'Running.*post-installation.*scripts',
                            progress=1.0,
                            message_template='Ran post-nstallation scripts',
                            unmatch_nextline_next_matcher_name=(
                                'post_installation'),
                            match_nextline_next_matcher_name='exit'
                        ),
                    }
                ),
                FileMatcher(
                    filename='packaging.log',
                    min_progress=0.56,
                    max_progress=0.80,
                    line_matchers={
                        'start': LineMatcher(
                            pattern=r'Installing (?P<package>.*)',
                            progress=IncrementalProgress(0.0, 0.99, 0.005),
                            message_template='Installing %(package)s',
                            unmatch_sameline_next_matcher_name=(
                                'package_complete'
                            ),
                            unmatch_nextline_next_matcher_name='start',
                            match_nextline_next_matcher_name='start'
                        ),
                        'package_complete': LineMatcher(
                            pattern='end.*rpm.*scriptlet',
                            progress=1.0,
                            message_template='installing packages finished',
                            unmatch_nextline_next_matcher_name='start',
                            match_nextline_next_matcher_name='exit'
                        ),
                    }
                ),
            ]
        ),
    }
}

OS_LOG_CONFIGURATIONS = [{
    'os_installer_name': 'cobbler',
    'os_pattern': 'CentOS-6.*',
    'item_matcher': OS_INSTALLER_CONFIGURATIONS['cobbler']['CentOS6'],
    'logdir': setting.INSTALLATION_LOGDIR['CobblerInstaller']
}, {
    'os_installer_name': 'cobbler',
    'os_pattern': 'CentOS-7.*',
    'item_matcher': OS_INSTALLER_CONFIGURATIONS['cobbler']['CentOS7'],
    'logdir': setting.INSTALLATION_LOGDIR['CobblerInstaller']
}, {
    'os_installer_name': 'cobbler',
    'os_pattern': 'Ubuntu.*',
    'item_matcher': OS_INSTALLER_CONFIGURATIONS['cobbler']['Ubuntu'],
    'logdir': setting.INSTALLATION_LOGDIR['CobblerInstaller']
}]

PACKAGE_INSTALLER_CONFIGURATIONS = {
    'chef_installer': {
        'default': AdapterItemMatcher(
            file_matchers=[
                FileMatcher(
                    filename='chef-client.log',
                    min_progress=0.1,
                    max_progress=1.0,
                    line_matchers={
                        'start': LineMatcher(
                            pattern=(
                                r'Processing\s*(?P<install_type>.*)'
                                r'\[(?P<package>.*)\].*'),
                            progress=IncrementalProgress(0.0, .90, 0.005),
                            message_template=(
                                'Processing %(install_type)s %(package)s'),
                            unmatch_sameline_next_matcher_name=(
                                'chef_complete'),
                            unmatch_nextline_next_matcher_name='start',
                            match_nextline_next_matcher_name='start'
                        ),
                        'chef_complete': LineMatcher(
                            pattern=r'Chef.*Run.*complete',
                            progress=1.0,
                            message_template='Chef run complete',
                            unmatch_nextline_next_matcher_name='start',
                            match_nextline_next_matcher_name='exit'
                        ),
                    }
                ),
            ]
        ),
    }
}

ADAPTER_LOG_CONFIGURATIONS = [{
    'package_installer_name': 'chef_installer',
    'adapter_pattern': '.*',
    'item_matcher': PACKAGE_INSTALLER_CONFIGURATIONS['chef_installer']['default'],
    'logdir': setting.INSTALLATION_LOGDIR['ChefInstaller']
}]