Moved ProcessingNode to nodeodm module

pull/17/head
Piero Toffanin 2016-09-21 16:04:47 -04:00
rodzic b5a0619df5
commit 6a4f02fc27
6 zmienionych plików z 23 dodań i 20 usunięć

Wyświetl plik

@ -12,5 +12,8 @@ WORKDIR /webodm
ADD requirements.txt /webodm/
RUN pip install -r requirements.txt
# swagger_spec_validator is not up to date, fetch directly from github
RUN pip install --upgrade git+git://github.com/Yelp/swagger_spec_validator
# Add repository files
ADD . /webodm/

Wyświetl plik

@ -1,7 +1 @@
from django.contrib import admin
from .models import ProcessingNode
class ProcessingNodeAdmin(admin.ModelAdmin):
fields = ('hostname', 'port')
admin.site.register(ProcessingNode, ProcessingNodeAdmin)

Wyświetl plik

@ -1,7 +1,10 @@
from __future__ import unicode_literals
from django.db import models
from django.utils import timezone
from django.contrib.auth.models import User
from django.contrib.postgres import fields
from nodeodm.models import ProcessingNode
def assets_directory_path(taskId, projectId, filename):
# files will be uploaded to MEDIA_ROOT/project_<id>/task_<id>/<filename>
@ -18,17 +21,6 @@ class Project(models.Model):
return self.name
class ProcessingNode(models.Model):
hostname = models.CharField(max_length=255, help_text="Hostname where the node is located (can be an internal hostname as well)")
port = models.PositiveIntegerField(help_text="Port that connects to the node's API")
api_version = models.CharField(max_length=32, help_text="API version used by the node")
last_refreshed = models.DateTimeField(null=True, help_text="When was the information about this node last retrieved?")
queue_count = models.PositiveIntegerField(default=0, help_text="Number of tasks currently being processed by this node (as reported by the node itself)")
available_options = fields.JSONField(default=dict(), help_text="Description of the options that can be used for processing")
def __str__(self):
return '{}:{}'.format(self.hostname, self.port)
def gcp_directory_path(task, filename):
return assets_directory_path(task.id, task.project.id, filename)

Wyświetl plik

@ -3,7 +3,7 @@ from django.test import TestCase
from django.contrib.auth.models import User, Group
from django.test import Client
from .models import Project,Task
from .models import Project, Task
# Create your tests here.

Wyświetl plik

@ -1,3 +1,8 @@
from django.contrib import admin
# Register your models here.
from .models import ProcessingNode
class ProcessingNodeAdmin(admin.ModelAdmin):
fields = ('hostname', 'port')
admin.site.register(ProcessingNode, ProcessingNodeAdmin)

Wyświetl plik

@ -1,5 +1,14 @@
from __future__ import unicode_literals
from django.db import models
from django.contrib.postgres import fields
# Create your models here.
class ProcessingNode(models.Model):
hostname = models.CharField(max_length=255, help_text="Hostname where the node is located (can be an internal hostname as well)")
port = models.PositiveIntegerField(help_text="Port that connects to the node's API")
api_version = models.CharField(max_length=32, help_text="API version used by the node")
last_refreshed = models.DateTimeField(null=True, help_text="When was the information about this node last retrieved?")
queue_count = models.PositiveIntegerField(default=0, help_text="Number of tasks currently being processed by this node (as reported by the node itself)")
available_options = fields.JSONField(default=dict(), help_text="Description of the options that can be used for processing")
def __str__(self):
return '{}:{}'.format(self.hostname, self.port)