Merge pull request #552 from pierotofy/bughunt

Bug Fixes, Diagnostic Plugin
pull/570/head v0.6.2
Piero Toffanin 2018-11-03 18:39:58 -04:00 zatwierdzone przez GitHub
commit ecfbb066d5
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
10 zmienionych plików z 223 dodań i 13 usunięć

Wyświetl plik

@ -38,7 +38,7 @@ class Gcp{
}
let extra = extracols.length > 0 ? ' ' + extracols.join(' ') : '';
output += `${x} ${y} ${z} ${px.toFixed(2)} ${py.toFixed(2)} ${imagename}${extra}\n`;
output += `${x} ${y} ${z} ${px.toFixed(8)} ${py.toFixed(8)} ${imagename}${extra}\n`;
}else{
if (!muteWarnings) console.warn(`Invalid GCP format at line ${i}: ${line}`);
output += line + '\n';

Wyświetl plik

@ -70,7 +70,10 @@ class TaskListItem extends React.Component {
}
unloadTimer(){
if (this.processingTimeInterval) clearInterval(this.processingTimeInterval);
if (this.processingTimeInterval){
clearInterval(this.processingTimeInterval);
this.processingTimeInterval = null;
}
if (this.state.task.processing_time) this.setState({time: this.state.task.processing_time});
}
@ -235,7 +238,8 @@ class TaskListItem extends React.Component {
line.indexOf("loky.process_executor.TerminatedWorkerError:") !== -1 ||
line.indexOf("Failed to allocate memory") !== -1){
this.setState({memoryError: true});
}else if (line.indexOf("SVD did not converge") !== -1){
}else if (line.indexOf("SVD did not converge") !== -1 ||
line.indexOf("0 partial reconstructions in total") !== -1){
this.setState({friendlyTaskError: `It looks like the images might have one of the following problems:
<ul>
<li>Not enough images</li>
@ -502,13 +506,16 @@ class TaskListItem extends React.Component {
ref={domNode => this.console = domNode}
onAddLines={this.checkForCommonErrors}
/>
<a href="javascript:void(0);" onClick={this.downloadTaskOutput} class="btn btn-sm btn-primary pull-right" title="Download task output">
<i class="fa fa-download"></i>
</a>
<a href="javascript:void(0);" onClick={this.copyTaskOutput} class="btn btn-sm btn-primary pull-right" title="Copy task output">
<i class="fa fa-clipboard"></i>
</a>
<div class="clearfix"></div>
<div className="console-buttons">
<a href="javascript:void(0);" onClick={this.downloadTaskOutput} className="btn btn-sm btn-primary" title="Download Task Output">
<i className="fa fa-download"></i>
</a>
<a href="javascript:void(0);" onClick={this.copyTaskOutput} className="btn btn-sm btn-primary" title="Copy Task Output">
<i className="fa fa-clipboard"></i>
</a>
</div>
{showMemoryErrorWarning ?
<div className="task-warning"><i className="fa fa-support"></i> <span>It looks like your processing node ran out of memory. If you are using docker, make sure that your docker environment has <a href={memoryErrorLink} target="_blank">enough RAM allocated</a>. Alternatively, make sure you have enough physical RAM, reduce the number of images, make your images smaller, or reduce the max-concurrency parameter from the task's <a href="javascript:void(0);" onClick={this.startEditing}>options</a>.</span></div> : ""}
@ -528,7 +535,7 @@ class TaskListItem extends React.Component {
: ""}
</div>
</div>
<div className="row">
<div className="row clearfix">
<ErrorMessage bind={[this, 'actionError']} />
{actionButtons}
</div>

Wyświetl plik

@ -96,4 +96,14 @@
.inline{
display: inline;
}
.console-buttons{
margin-left: 16px;
margin-bottom: 16px;
float: right;
text-align: right;
a{
margin-left: 4px;
}
}
}

Wyświetl plik

@ -1,6 +1,6 @@
{
"name": "WebODM",
"version": "0.6.1",
"version": "0.6.2",
"description": "Open Source Drone Image Processing",
"main": "index.js",
"scripts": {

Wyświetl plik

@ -0,0 +1 @@
from .plugin import *

Wyświetl plik

@ -0,0 +1,13 @@
{
"name": "Diagnostic",
"webodmMinVersion": "0.6.2",
"description": "description",
"version": "0.1.0",
"author": "Piero Toffanin",
"email": "pt@masseranolabs.com",
"repository": "https://github.com/OpenDroneMap/WebODM",
"tags": ["diagnostic"],
"homepage": "https://github.com/OpenDroneMap/WebODM",
"experimental": false,
"deprecated": false
}

Wyświetl plik

@ -0,0 +1,69 @@
from app.plugins import PluginBase, Menu, MountPoint
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
import json, shutil
def get_memory_stats():
"""
Get node total memory and memory usage (Linux only)
https://stackoverflow.com/questions/17718449/determine-free-ram-in-python
"""
try:
with open('/proc/meminfo', 'r') as mem:
ret = {}
tmp = 0
for i in mem:
sline = i.split()
if str(sline[0]) == 'MemTotal:':
ret['total'] = int(sline[1])
elif str(sline[0]) in ('MemFree:', 'Buffers:', 'Cached:'):
tmp += int(sline[1])
ret['free'] = tmp
ret['used'] = int(ret['total']) - int(ret['free'])
ret['total'] *= 1024
ret['free'] *= 1024
ret['used'] *= 1024
return ret
except:
return {}
class Plugin(PluginBase):
def main_menu(self):
return [Menu("Diagnostic", self.public_url(""), "fa fa-pie-chart fa-fw")]
def app_mount_points(self):
@login_required
def diagnostic(request):
# Load version number
with open('./package.json') as f:
package = json.load(f)
version = package['version']
# Disk space
total_disk_space, used_disk_space, free_disk_space = shutil.disk_usage('./')
template_args = {
'title': 'Diagnostic',
'version': version,
'total_disk_space': total_disk_space,
'used_disk_space': used_disk_space,
'free_disk_space': free_disk_space
}
# Memory (Linux only)
memory_stats = get_memory_stats()
if 'free' in memory_stats:
template_args['free_memory'] = memory_stats['free']
template_args['used_memory'] = memory_stats['used']
template_args['total_memory'] = memory_stats['total']
return render(request, self.template_path("diagnostic.html"), template_args)
return [
MountPoint('$', diagnostic)
]

File diff suppressed because one or more lines are too long

Wyświetl plik

@ -0,0 +1,100 @@
{% extends "app/plugins/templates/base.html" %}
{% block content %}
<script src="./Chart.min.js"></script>
<h2>Diagnostic Information</h2>
<p><b>App Version:</b> {{ version }}</p>
<div class="row text-center">
<div class="col-md-4 col-sm-12">
<h4>Storage Space</h4>
<div style="width: 80%; margin-left: 10%;">
<canvas id="diskChart" width="200" height="200" style="margin-bottom: 12px;"></canvas>
</div>
<p><b>Free:</b> {{ free_disk_space|filesizeformat }} |
<b>Used:</b> {{ used_disk_space|filesizeformat }} |
<b>Total:</b> {{ total_disk_space|filesizeformat }}</p>
</div>
<div class="col-md-4 col-sm-12">
{% if total_memory %}
<h4>Memory</h4>
<div style="width: 80%; margin-left: 10%;">
<canvas id="memoryChart" width="200" height="200" style="margin-bottom: 12px;"></canvas>
</div>
<p><b>Free:</b> {{ free_memory|filesizeformat }} |
<b>Used:</b> {{ used_memory|filesizeformat }} |
<b>Total:</b> {{ total_memory|filesizeformat }}</p>
{% endif %}
</div>
</div>
<hr/>
<div style="margin-top: 20px;"><strong>Note!</strong> These values might be relative to the virtualization environment in which the application is running, not necessarely the values of the your machine. See instructions for <a href="http://stackoverflow.com/a/39720010">MacOS</a> and <a href="https://docs.docker.com/docker-for-windows/#advanced">Windows</a> for changing these values in a docker setup.</div>
<script>
(function(){
var ctx = document.getElementById('diskChart').getContext('2d');
var labels = {
'Used': '{{ used_disk_space|filesizeformat }}',
'Free': '{{ free_disk_space|filesizeformat }}'
};
var chart = new Chart(ctx, {
type: 'doughnut',
data: {
labels: ["Used", "Free"],
datasets: [{
label: "Disk Space",
backgroundColor:[
"rgb(255, 99, 132)",
"rgb(54, 162, 235)"
],
data: [ {{ used_disk_space }}, {{ free_disk_space }} ],
}]
},
options: {
tooltips: {
callbacks: {
label: function(tooltipItem, data) {
return labels[data.labels[tooltipItem.index]];
}
}
}
}
});
})();
{% if total_memory %}
(function(){
var ctx = document.getElementById('memoryChart').getContext('2d');
var labels = {
'Used': '{{ used_memory|filesizeformat }}',
'Free': '{{ free_memory|filesizeformat }}'
};
var chart = new Chart(ctx, {
type: 'doughnut',
data: {
labels: ["Used", "Free"],
datasets: [{
label: "Disk Space",
backgroundColor:[
"rgb(255, 99, 132)",
"rgb(54, 162, 235)"
],
data: [ {{ used_memory }}, {{ free_memory }} ],
}]
},
options: {
tooltips: {
callbacks: {
label: function(tooltipItem, data) {
return labels[data.labels[tooltipItem.index]];
}
}
}
}
});
})();
{% endif %}
</script>
{% endblock %}

Wyświetl plik

@ -9,7 +9,7 @@ User=odm
Group=odm
PIDFile=/run/webodm-celerybeat.pid
WorkingDirectory=/webodm
ExecStart=/webodm/python3-venv/bin/celery -A worker beat
ExecStart=/webodm/python3-venv/bin/celery -A worker beat --pidfile=
ExecStop=/bin/kill -s QUIT $MAINPID
Restart=on-failure