Stream logs if possible and remove size limit
[?]
Jul 8, 2015, 5:04 PM
KI423DCQYAHL7IRSLKYU6BR5VMEGETWSKUANU4EKZEDWC2S2XSHACDependencies
- [2]
KLSDJV75Serve raw uncompressed logs directly - [3]
CNEQ7L4GDon't show logs bigger than 64 MB - [4]
WXV6M6XNAdd a convenient way to get logs of a path/drv. Requested by phreedom. - [5]
MMDLWWZ2automatic reload of tail log when build is running - [6]
J5UVLXOK* Start of a basic Catalyst web interface. - [7]
SAIUFDP3hydra: make sure viewing logs works when logs are bz2'd - [8]
6F4UNDTC* Provide access to the raw, non-pretty-printed logfiles. - [9]
Q24QXGSM* Don't do pretty printing for large logs, because the XSLT processing - [10]
X6RB5HQ6Put a 5-second CPU time limit on the log processing pipeline. - [11]
ZH6B56XRTry harder to find build logs - [12]
RBHHV7P7* Read logs using logContents function in stead of handling it everywhere separately. - [13]
HRAFVVOEmake logo configurable via HYDRA_LOGO env var - [14]
Y6AHH4THRemove the logfile and logSize columns from the database - [15]
KZ55DLPHFix UTF-8 handling of log files - [*]
LBNVQXUB* Build the /build stuff in a separate controller. - [*]
D5QIOJGP* Move everything up one directory.
Change contents
- replacement in src/lib/Hydra/Controller/Build.pm at line 139
my $size = stat($logPath)->size;error($c, "This build log is too big to display ($size bytes).")if $size >= 64 * 1024 * 1024;# Don't send logs that we can't stream.my $size = stat($logPath)->size; # FIXME: not so meaningful for compressed logserror($c, "This build log is too big to display ($size bytes).") unless$mode eq "raw"|| (($mode eq "tail" || $mode eq "tail-reload") && $logPath !~ /\.bz2$/)|| $size < 64 * 1024 * 1024; - replacement in src/lib/Hydra/Controller/Build.pm at line 156
if ($logPath !~ /.bz2$/) {$c->serve_static_file($logPath);} else {$c->stash->{'plain'} = { data => (scalar logContents($logPath)) || " " };$c->forward('Hydra::View::Plain');}$c->stash->{logPath} = $logPath;$c->forward('Hydra::View::NixLog');return; - replacement in src/lib/Hydra/Controller/Root.pm at line 355
$c->stash->{'plain'} = { data => (scalar logContents($logPath)) || " " };$c->forward('Hydra::View::Plain');$c->stash->{logPath} = $logPath;$c->forward('Hydra::View::NixLog'); - file addition: NixLog.pm[18.1193]
package Hydra::View::NixLog;use strict;use base qw/Catalyst::View/;use Hydra::Helper::CatalystUtils;sub process {my ($self, $c) = @_;my $logPath = $c->stash->{logPath};$c->response->content_type('text/plain');my $fh = new IO::Handle;if ($logPath =~ /\.bz2$/) {open $fh, "bzip2 -dc < '$logPath' |" or die;} else {open $fh, "<$logPath" or die;}binmode($fh);setCacheHeaders($c, 365 * 24 * 60 * 60);$c->response->body($fh);return 1;}1;