Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type make

```bash
export TAG=`date +"%Y%m%d.%H%M"`
docker build --force-rm --no-cache --rm -t mgrast/v3-web:${TAG} https://raw.githubusercontent.com/MG-RAST/MG-RAST/develop/dockerfiles/web/Dockerfile
docker build --force-rm --no-cache --rm -t mgrast/v3-web:${TAG} https://raw.githubusercontent.com/MG-RAST/MG-RAST/master/dockerfiles/web/Dockerfile
skycore push mgrast/v3-web:${TAG}
```

Expand Down
23 changes: 21 additions & 2 deletions src/MGRAST/lib/WebPage/Home.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use strict;
use warnings;

use Conf;
use Cache::Memcached;
use Number::Format;

1;
Expand Down Expand Up @@ -123,8 +124,26 @@ function forward_to_search (e) {
$content .= "<div class='clear'></div>";

my $formater = new Number::Format(-thousands_sep => ',');
my $bpcount = $formater->format_number(($self->app->data_handle('MGRAST')->Job->count_total_bp() / 1000000000000), 2);
my $seqcount = $formater->format_number(($self->app->data_handle('MGRAST')->Job->count_total_sequences() / 1000000000), 2);
my $memd = new Cache::Memcached {'servers' => $Conf::web_memcache, 'debug' => 0, 'compress_threshold' => 10_000, };
my $cache_key = "bpcount";
my $cdata = $memd->get("bpcount");
my $bpcount = 0;
if($cdata) {
$bpcount = $cdata;
} else {
$bpcount = $formater->format_number(($self->app->data_handle('MGRAST')->Job->count_total_bp() / 1000000000000), 2);
$memd->set("bpcount", $bpcount, 7200);
}
my $seqcount = 0;
$cdata = $memd->get("seqcount");
if($cdata) {
$seqcount = $cdata;
} else {
$seqcount = $formater->format_number(($self->app->data_handle('MGRAST')->Job->count_total_sequences() / 1000000000), 2);
$memd->set("seqcount", $seqcount, 7200);
}
$memd->disconnect_all;

my $jobcount = $formater->format_number($self->app->data_handle('MGRAST')->Job->count_all());
my $publiccount = $formater->format_number($self->app->data_handle('MGRAST')->Job->count_public());

Expand Down
10 changes: 6 additions & 4 deletions src/MGRAST/lib/resources/resource.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1220,10 +1220,12 @@ sub get_task_report {
my $rfile = "awe_".$type.".txt";

# check shock if missing
if ((! $rtext) && exists($task->{outputs}) && exists($task->{outputs}{$rfile})) {
my $rnode = $task->{outputs}{$rfile}{node};
if ($rnode && ($rnode ne "-")) {
($rtext, undef) = $self->get_shock_file($rnode, undef, $auth, undef, $authPrefix);
if ((! $rtext) && exists($task->{outputs})) {
foreach my $out (@{$task->{outputs}}) {
if (($out->{filename} eq $rfile) && $out->{node} && ($out->{node} ne "-")) {
($rtext, undef) = $self->get_shock_file($out->{node}, undef, $auth, undef, $authPrefix);
last;
}
}
}
return $rtext || "";
Expand Down
11 changes: 7 additions & 4 deletions src/MGRAST/lib/resources/submission.pm
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ sub status {
foreach my $task (@{$submit->{tasks}}) {
my $summery = {
stage => $task->{cmd}{description},
inputs => [ keys %{$task->{inputs}} ],
inputs => [ map { $_->{filename} } @{$task->{inputs}} ],
status => $task->{state}
};
if ($task->{state} eq 'suspend') {
Expand Down Expand Up @@ -757,10 +757,13 @@ sub submission_jobs {
sub get_param_node {
my ($self, $job) = @_;
if ($job->{tasks} && (@{$job->{tasks}} > 0)) {
return $job->{tasks}[-1]{inputs}{$self->{param_file}}{node};
} else {
return undef;
foreach my $out (@{$job->{tasks}[-1]{inputs}}) {
if ($out->{filename} eq $self->{param_file}) {
return $out->{node};
}
}
}
return undef;
}

sub parse_submit_output {
Expand Down