diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..ae831a8b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +name: Django CI + +on: + push: + branches: [ develop ] + pull_request: + branches: [ develop ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: ["3.9", "3.10", "3.11"] + + services: + postgres: + image: postgres:12 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: djangodb_test + ports: + - 5432:5432 + options: --health-cmd pg_isready --health-interval 1s --health-timeout 5s --health-retries 5 + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + - name: Install Dependencies + run: | + python -m pip install --upgrade pip==24.0 + pip install -r test_requirements.txt + - name: Run Tests + run: | + coverage run --source='.' manage.py test --timing + - uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.gitignore b/.gitignore index adb37fb1..25368b38 100644 --- a/.gitignore +++ b/.gitignore @@ -72,3 +72,6 @@ target/ # Idea editors .idea +static/ +workflows/ +workflow_templates/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..61babf36 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM python:3.10-slim-buster +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PYTHONUNBUFFERED=1 +COPY . /app +WORKDIR /app + +# RUN apt-get update && apt-get install -y \ +# kubectl && \ +# rm -rf /var/lib/apt/lists/* +# RUN wget https://amazon-eks.s3.us-west-2.amazonaws.com/1.18.9/2020-11-02/bin/linux/amd64/aws-iam-authenticator + +RUN pip install -r requirements.txt +# RUN pip install awscli diff --git a/README.md b/README.md index 12f2f212..4483da61 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Delft3D Geological Tool web application server ## Install Make sure to have postgres 12 container up and running: ```bash -docker run -e "POSTGRES_DB=djangodb" -e "POSTGRES_HOST_AUTH_METHOD=trust" -e "POSTGRES_USER=django" postgres:12 +docker run -e "POSTGRES_DB=djangodb_test" -e "POSTGRES_HOST_AUTH_METHOD=trust" -e "POSTGRES_USER=postgres" -p5432:5432 postgres:12 ``` Install delft3d-gt-ui next to this repo and do diff --git a/delft3dcontainermanager/__init__.py b/delft3dcontainermanager/__init__.py index 8446c6a2..ccfb676b 100644 --- a/delft3dcontainermanager/__init__.py +++ b/delft3dcontainermanager/__init__.py @@ -1,5 +1,5 @@ # This will make sure the app is always imported when # Django starts so that shared_task will use this app. -from celery import app as celery_app # noqa +from .celery import app as celery_app # noqa __all__ = ["celery_app"] diff --git a/delft3dcontainermanager/celery.py b/delft3dcontainermanager/celery.py index b0e877ea..9b26543c 100644 --- a/delft3dcontainermanager/celery.py +++ b/delft3dcontainermanager/celery.py @@ -1,12 +1,7 @@ -from __future__ import absolute_import, print_function - import os -from ddtrace import patch_all - -patch_all() from celery import Celery -from django.conf import settings # noqa +from django.conf import settings # set the default Django settings module for the 'celery' program. os.environ.setdefault("DJANGO_SETTINGS_MODULE", "delft3dcontainermanager.settings") diff --git a/delft3dcontainermanager/settings.py b/delft3dcontainermanager/settings.py index ca3d47eb..c2f5e060 100644 --- a/delft3dcontainermanager/settings.py +++ b/delft3dcontainermanager/settings.py @@ -17,8 +17,6 @@ import sys from os import environ -from kubernetes import config - DEBUG = False SECRET_KEY = "notneeded" @@ -43,7 +41,6 @@ USE_I18N = True -USE_L10N = True USE_TZ = True @@ -75,7 +72,8 @@ # import provisioned settings try: - from .provisionedsettings import * + AWS_IAM_PATH = "" + from .provisionedsettings import * # noqa environ["PATH"] += ":{}".format(AWS_IAM_PATH) except ImportError: diff --git a/delft3dcontainermanager/tasks.py b/delft3dcontainermanager/tasks.py index 45db954a..70bbce95 100644 --- a/delft3dcontainermanager/tasks.py +++ b/delft3dcontainermanager/tasks.py @@ -1,18 +1,14 @@ from __future__ import absolute_import -import logging from json import dumps -from shutil import rmtree from celery import shared_task from celery.utils.log import get_task_logger from celery_once import QueueOnce -from django.conf import settings from django.core.management import call_command from kubernetes import client, config from kubernetes.client.rest import ApiException from requests.exceptions import HTTPError -from six.moves import configparser logger = get_task_logger(__name__) @@ -131,6 +127,6 @@ def do_argo_remove(self, workflow_id): crd = client.CustomObjectsApi(client_api) status = crd.delete_namespaced_custom_object( "argoproj.io", "v1alpha1", "default", "workflows", workflow_id - ) + ) return {"do_argo_remove": status} diff --git a/delft3dcontainermanager/test_tasks.py b/delft3dcontainermanager/test_tasks.py index d46d5534..01ec98f9 100644 --- a/delft3dcontainermanager/test_tasks.py +++ b/delft3dcontainermanager/test_tasks.py @@ -1,12 +1,10 @@ from __future__ import absolute_import -import os -import sys from time import time from django.test import TestCase from fakeredis import FakeStrictRedis -from mock import MagicMock, Mock, patch +from mock import Mock, patch from delft3dcontainermanager.tasks import ( delft3dgt_kube_pulse, diff --git a/delft3dgtfrontend/admin.py b/delft3dgtfrontend/admin.py index f0e7170f..5fe4e97d 100644 --- a/delft3dgtfrontend/admin.py +++ b/delft3dgtfrontend/admin.py @@ -1,5 +1,3 @@ from __future__ import absolute_import -from django.contrib import admin - # Register your models here. diff --git a/delft3dgtfrontend/models.py b/delft3dgtfrontend/models.py index a936b76a..22e2cd7f 100644 --- a/delft3dgtfrontend/models.py +++ b/delft3dgtfrontend/models.py @@ -1,5 +1,3 @@ from __future__ import absolute_import, unicode_literals -from django.db import models - # Create your models here. diff --git a/delft3dgtfrontend/tests.py b/delft3dgtfrontend/tests.py index 811314d2..2282209b 100644 --- a/delft3dgtfrontend/tests.py +++ b/delft3dgtfrontend/tests.py @@ -1,5 +1,3 @@ from __future__ import absolute_import -from django.test import TestCase - # Create your tests here. diff --git a/delft3dgtfrontend/urls.py b/delft3dgtfrontend/urls.py index 0a33183f..835b77d9 100644 --- a/delft3dgtfrontend/urls.py +++ b/delft3dgtfrontend/urls.py @@ -1,7 +1,6 @@ from __future__ import absolute_import from django.conf import settings # noqa -from django.conf.urls import url # noqa from django.contrib.auth.decorators import login_required from django.contrib.auth.views import ( LoginView, @@ -11,43 +10,45 @@ PasswordResetDoneView, PasswordResetView, ) +from django.urls import re_path # noqa +from django.urls import path from django.views.static import serve urlpatterns = ( # Login - url(r"^login/$", LoginView.as_view(template_name="login.html"), name="login"), + path("login/", LoginView.as_view(template_name="login.html"), name="login"), # Logout - url(r"^logout/$", LogoutView.as_view(template_name="login.html"), name="logout"), + path("logout/", LogoutView.as_view(template_name="login.html"), name="logout"), # Password Reset - url( - r"^forgot/$", + path( + "forgot/", PasswordResetView.as_view(template_name="forgot.html"), name="password_reset", ), # Password Reset Done - url( - r"^done/$", + path( + "done/", PasswordResetDoneView.as_view(template_name="done.html"), name="password_reset_done", ), # Password Reset Done - url( + re_path( r"^reset/(?P[0-9A-Za-z]+)-(?P.+)/$", PasswordResetConfirmView.as_view(template_name="confirm.html"), name="password_reset_confirm", ), # Password Reset Complete - url( - r"^complete/$", + path( + "complete/", PasswordResetCompleteView.as_view(template_name="complete.html"), name="password_reset_complete", ), # Index - url( - r"^$", + path( + "", login_required(serve), {"document_root": settings.STATIC_ROOT, "path": "index.html"}, ), # static files/ - url(r"^(?P.*)$", serve, {"document_root": settings.STATIC_ROOT}), + re_path(r"^(?P.*)$", serve, {"document_root": settings.STATIC_ROOT}), ) diff --git a/delft3dgtmain/__init__.py b/delft3dgtmain/__init__.py index d13e9513..5568b6d7 100644 --- a/delft3dgtmain/__init__.py +++ b/delft3dgtmain/__init__.py @@ -1,5 +1,5 @@ -from __future__ import absolute_import - # This will make sure the app is always imported when # Django starts so that shared_task will use this app. -from .celery import app as celery_app # noqa +from .celery import app as celery_app + +__all__ = ("celery_app",) diff --git a/delft3dgtmain/celery.py b/delft3dgtmain/celery.py index c6794260..c63e242a 100644 --- a/delft3dgtmain/celery.py +++ b/delft3dgtmain/celery.py @@ -2,11 +2,11 @@ import os +from celery import Celery from ddtrace import patch_all +from django.conf import settings # noqa patch_all() -from celery import Celery -from django.conf import settings # noqa # set the default Django settings module for the 'celery' program. os.environ.setdefault("DJANGO_SETTINGS_MODULE", "delft3dgtmain.settings") diff --git a/delft3dgtmain/provisionedsettings.sample.py b/delft3dgtmain/provisionedsettings.sample.py index a814c999..2e60892c 100644 --- a/delft3dgtmain/provisionedsettings.sample.py +++ b/delft3dgtmain/provisionedsettings.sample.py @@ -68,5 +68,5 @@ OIDC_OP_TOKEN_ENDPOINT = "" OIDC_OP_USER_ENDPOINT = "" OIDC_OP_JWKS_ENDPOINT = "" -LOGIN_REDIRECT_URL = "" -LOGOUT_REDIRECT_URL = "" +LOGIN_REDIRECT_URL = "/" +LOGOUT_REDIRECT_URL = "/" diff --git a/delft3dgtmain/settings.py b/delft3dgtmain/settings.py index 3e8d6eb9..ab971115 100644 --- a/delft3dgtmain/settings.py +++ b/delft3dgtmain/settings.py @@ -13,6 +13,7 @@ import os import sys from datetime import timedelta + from ddtrace import config # Build paths inside the project like this: os.path.join(BASE_DIR, ...) @@ -123,13 +124,11 @@ USE_I18N = True -USE_L10N = True USE_TZ = True # Login LOGIN_URL = "/login/" -LOGIN_REDIRECT_URL = "/" # Max form size for large scenarios with logs DATA_UPLOAD_MAX_MEMORY_SIZE = 20971520 # 20MB @@ -199,7 +198,7 @@ # import provisioned settings try: - from .provisionedsettings import * + from .provisionedsettings import * # noqa except ImportError: print("Failed to import provisioned settings!") SECRET_KEY = "test" @@ -222,25 +221,24 @@ # TESTING if "test" in sys.argv: - import logging from .celery import Celery logging.disable(logging.CRITICAL) - if "TRAVIS" in os.environ: - DATABASES = { - "default": { - "ENGINE": "django.db.backends.postgresql_psycopg2", - "NAME": "travis_ci_test", - "USER": "postgres", - "HOST": "localhost", - "PORT": "5432", - } + STATICFILES_DIRS = [] + + DATABASES = { + "default": { + "ENGINE": "django.db.backends.postgresql", + "NAME": "djangodb_test", + "USER": "postgres", + "PASSWORD": "postgres", + "HOST": "localhost", + "PORT": "5432", } - else: - DATABASES["default"].update({"NAME": "djangodb_test"}) + } PASSWORD_HASHERS = [ "django.contrib.auth.hashers.MD5PasswordHasher", @@ -300,3 +298,14 @@ # Docker URL this setting is from the delf3dcontainermanger app DOCKER_URL = "unix:///var/run/docker.sock" + + # OIDC + OIDC_RP_CLIENT_ID = "" + OIDC_RP_CLIENT_SECRET = "" + OIDC_RP_SIGN_ALGO = "" + OIDC_OP_AUTHORIZATION_ENDPOINT = "" + OIDC_OP_TOKEN_ENDPOINT = "" + OIDC_OP_USER_ENDPOINT = "" + OIDC_OP_JWKS_ENDPOINT = "" + LOGIN_REDIRECT_URL = "/" + LOGOUT_REDIRECT_URL = "/" diff --git a/delft3dgtmain/urls.py b/delft3dgtmain/urls.py index 07d0fe37..cc81a4f5 100644 --- a/delft3dgtmain/urls.py +++ b/delft3dgtmain/urls.py @@ -14,17 +14,17 @@ 2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls')) """ from django.conf import settings -from django.conf.urls import include, url from django.conf.urls.static import static from django.contrib import admin +from django.urls import include, path, re_path urlpatterns = [ # Django Admin - url(r"^admin/", admin.site.urls), + re_path(r"^admin/", admin.site.urls), # Delft3D-GT Worker API - url(r"^", include("delft3dworker.urls")), + path("", include("delft3dworker.urls")), # Delft3D-GT Protected Services - url(r"^", include("delft3dgtprotectedservices.urls")), + path("", include("delft3dgtprotectedservices.urls")), # Delft3D-GT Frontend - url(r"^", include("delft3dgtfrontend.urls")), + path("", include("delft3dgtfrontend.urls")), ] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) diff --git a/delft3dgtmain/wsgi.py b/delft3dgtmain/wsgi.py index 7e4882de..c171b021 100644 --- a/delft3dgtmain/wsgi.py +++ b/delft3dgtmain/wsgi.py @@ -4,13 +4,13 @@ It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see -https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/ +https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/ """ import os -os.environ["DJANGO_SETTINGS_MODULE"] = "delft3dgtmain.settings" - from django.core.wsgi import get_wsgi_application +os.environ["DJANGO_SETTINGS_MODULE"] = "delft3dgtmain.settings" + application = get_wsgi_application() diff --git a/delft3dgtprotectedservices/admin.py b/delft3dgtprotectedservices/admin.py index f0e7170f..5fe4e97d 100644 --- a/delft3dgtprotectedservices/admin.py +++ b/delft3dgtprotectedservices/admin.py @@ -1,5 +1,3 @@ from __future__ import absolute_import -from django.contrib import admin - # Register your models here. diff --git a/delft3dgtprotectedservices/models.py b/delft3dgtprotectedservices/models.py index dbe627f0..e1a070df 100644 --- a/delft3dgtprotectedservices/models.py +++ b/delft3dgtprotectedservices/models.py @@ -1,5 +1,3 @@ from __future__ import absolute_import -from django.db import models - # Create your models here. diff --git a/delft3dgtprotectedservices/test_views.py b/delft3dgtprotectedservices/test_views.py index b37bca98..73c20c47 100644 --- a/delft3dgtprotectedservices/test_views.py +++ b/delft3dgtprotectedservices/test_views.py @@ -1,9 +1,10 @@ from __future__ import absolute_import -from django.contrib.auth.models import Permission, User +from django.contrib.auth.models import User from django.test import TestCase from django.test.client import Client from guardian.shortcuts import assign_perm + from delft3dworker.models import Scene diff --git a/delft3dgtprotectedservices/tests.py b/delft3dgtprotectedservices/tests.py index 811314d2..2282209b 100644 --- a/delft3dgtprotectedservices/tests.py +++ b/delft3dgtprotectedservices/tests.py @@ -1,5 +1,3 @@ from __future__ import absolute_import -from django.test import TestCase - # Create your tests here. diff --git a/delft3dgtprotectedservices/urls.py b/delft3dgtprotectedservices/urls.py index 4cfdc7e9..9519a1af 100644 --- a/delft3dgtprotectedservices/urls.py +++ b/delft3dgtprotectedservices/urls.py @@ -1,16 +1,16 @@ from __future__ import absolute_import -from django.conf.urls import url # noqa +from django.urls import re_path # noqa from delft3dgtprotectedservices import views urlpatterns = ( - url(r"^files/(?P[^/]*)/(?P.*)", views.files), - url(r"^thredds/catalog.html", views.thredds_catalog), - url(r"^thredds/catalog/files/catalog.html", views.thredds_catalog), - url( + re_path(r"^files/(?P[^/]*)/(?P.*)", views.files), + re_path(r"^thredds/catalog.html", views.thredds_catalog), + re_path(r"^thredds/catalog/files/catalog.html", views.thredds_catalog), + re_path( r"^thredds/(?P[^/]*)/files/(?P[^/]*)/(?P.*)", views.thredds, ), - url(r"^thredds/(?P.*)", views.thredds_static), + re_path(r"^thredds/(?P.*)", views.thredds_static), ) diff --git a/delft3dgtprotectedservices/views.py b/delft3dgtprotectedservices/views.py index c42565d0..cf527958 100644 --- a/delft3dgtprotectedservices/views.py +++ b/delft3dgtprotectedservices/views.py @@ -6,7 +6,6 @@ from django.contrib.auth import authenticate, login from django.contrib.auth.decorators import login_required -from django.contrib.auth.models import AnonymousUser from django.http import HttpResponse from django.shortcuts import get_object_or_404 @@ -15,7 +14,6 @@ @login_required def files(request, simulation_uuid, loc): - # try UUID or 404 try: uuid = UUID(simulation_uuid) @@ -48,7 +46,6 @@ def files(request, simulation_uuid, loc): @login_required def thredds_catalog(request): - if not request.user.is_superuser: return HttpResponse(status=403) @@ -60,7 +57,6 @@ def thredds_catalog(request): def thredds(request, folder, simulation_uuid, loc): - # try UUID or 404 try: uuid = UUID(simulation_uuid) @@ -71,8 +67,8 @@ def thredds(request, folder, simulation_uuid, loc): scene = get_object_or_404(Scene, suid=uuid) # Check for basic auth info and log user in - if "HTTP_AUTHORIZATION" in request.META: - auth = request.META["HTTP_AUTHORIZATION"].split() + if "authorization" in request.headers: + auth = request.headers["authorization"].split() if len(auth) == 2: if auth[0].lower() == "basic": decoded_auth = base64.b64decode(auth[1]) @@ -85,7 +81,6 @@ def thredds(request, folder, simulation_uuid, loc): # return 403 if not allowed if request.user.has_perm("extended_view_scene", scene): - # redirect to nginx thredds response = HttpResponse() response["X-Accel-Redirect"] = ( @@ -98,10 +93,9 @@ def thredds(request, folder, simulation_uuid, loc): def thredds_static(request, loc): - # Check for basic auth info and log user in - if "HTTP_AUTHORIZATION" in request.META: - auth = request.META["HTTP_AUTHORIZATION"].split() + if "authorization" in request.headers: + auth = request.headers["authorization"].split() if len(auth) == 2: if auth[0].lower() == "basic": uname, passwd = base64.b64decode(auth[1]).split(":") diff --git a/delft3dworker/admin.py b/delft3dworker/admin.py index f945245f..a75e02d9 100644 --- a/delft3dworker/admin.py +++ b/delft3dworker/admin.py @@ -5,7 +5,7 @@ from django.core.mail import send_mail from django.db.models import Count, DurationField, ExpressionWrapper, F, Sum from guardian.admin import GuardedModelAdmin -from rangefilter.filter import DateRangeFilter, DateTimeRangeFilter +from rangefilter.filter import DateRangeFilter from .models import ( GroupUsageSummary, @@ -118,7 +118,7 @@ def changelist_view(self, request, extra_context=None): # Exclude Groups with world access as they will be counted twice in totals qs = qs.exclude(name="access:world").order_by("name") - except (AttributeError, KeyError) as e: + except (AttributeError, KeyError): return response # Summarize by group values values = ["name", "id"] @@ -164,7 +164,7 @@ def changelist_view(self, request, extra_context=None): qs = response.context_data["cl"].queryset qs = qs.order_by("username") - except (AttributeError, KeyError) as e: + except (AttributeError, KeyError): return response # Summarize by user values values = ["username"] diff --git a/delft3dworker/fixtures/default_template.json b/delft3dworker/fixtures/default_template.json index 3b01f615..f0307be9 100644 --- a/delft3dworker/fixtures/default_template.json +++ b/delft3dworker/fixtures/default_template.json @@ -3,7 +3,7 @@ "fields": { "templates": [ { - "name": "River dominated delta", + "name": "River dominated delta (deprecated)", "id": 53 } ], @@ -156,14 +156,14 @@ { "fields": { "meta": { - "description": "A template for a river dominated basin fill scenario.", + "description": "A template for a river dominated basin fill scenario. Note this template is deprecated. Use the new template instead.", "creator": "Liang.Li@tudelft.nl" }, "sections": [ { "variables": [ { - "default": "River dominated basin fill", + "default": "River dominated basin fill (deprecated)", "type": "text", "id": "name", "name": "Name", @@ -208,14 +208,14 @@ "variables": [ { "name": "Basin slope", - "default": 0.1, + "default": 0.04, "validators": { "max": 0.3, "required": true, "min": 0.01 }, "factor": true, - "units": "deg", + "units": "°", "type": "numeric", "id": "basinslope" }, @@ -239,7 +239,7 @@ "variables": [ { "name": "River discharge", - "default": 1000, + "default": 2000, "validators": { "max": 2000, "required": true, @@ -252,7 +252,7 @@ }, { "name": "Tidal amplitude", - "default": 1, + "default": 2, "validators": { "max": 3, "required": true, @@ -265,7 +265,7 @@ }, { "name": "Wave height", - "default": 0.0, + "default": 0.5, "validators": { "max": 2, "required": true, @@ -298,7 +298,7 @@ "variables": [ { "description": "Read more about the sediment composition clasess.", - "default": "fine-sand", + "default": "coarse-sand", "id": "composition", "validators": { "required": true @@ -333,69 +333,1829 @@ "description": "Sediment can consist of a mixture of different classes. Read more about the sediment composition clasess." } ], - "name": "River dominated delta", + "name": "River dominated delta (deprecated)", "shortname": "gt", - "yaml_template": "workflow_templates/delft3dgt-main.yaml", + "yaml_template": "workflow_templates/delft3dgt-main-2022.yaml", "info": { + "logfile": { + "files": [], + "filetype": "log", + "location": "simulation/", + "extensions": [ + ".log" + ] + }, + "postprocess_output": { + "files": {}, + "filetype": "json", + "location": "postprocess/", + "extensions": [ + ".json" + ] + }, "delta_fringe_images": { - "filetype": "images", - "extensions": [".png", ".jpg", ".gif"], - "files": [], - "location": "process/" + "files": [], + "filetype": "images", + "pattern": "delta_fringe", + "location": "process/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Delta fringe", + "text": "This graph shows the position of the delta plain fringe superimposed on the graph of the water depth. This is an indicator for the large-scale plan-view morphology of a delta, which is a function of the dominant forcing processes (waves, rivers, tides) and grain size of transported sediments.\nA good characterization of the plan-view morphology of the delta allows better predictions on grain size distribution and heterogeneity in the delta geo-body. The delta fringe is calculated based on a cutoff value of water depth and on local slope." + }, + "subenvironment_images": { + "files": [], + "filetype": "images", + "pattern": "subenvironment", + "location": "postprocess/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Sub-environment", + "text": "Delta top: Deposits above delta brink point.\nDelta front: Deposits below delta brink point and above wave base.\nProdelta: Deposits below wave base.\nLow activity: Deposition smaller than 5mm." }, "channel_network_images": { - "filetype": "images", - "extensions": [".png", ".jpg", ".gif"], - "files": [], - "location": "process/" + "files": [], + "filetype": "images", + "pattern": "channel_network", + "location": "process/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Channel network", + "text": "These graphs display the properties, the architecture and the evolution of the channel network. Fluvial deposits are targets for hydrocarbon and groundwater exploration as they are typically permeable and continuous, and consequently a potential reservoir or aquifer.\nThe size and the quality of a fluvial reservoir in a delta depends on the size of the network, the connection between the different branches, and the relation of the channel network with the substrate, the mouth bars, and the prodelta. Therefore, a good characterization of the properties and the architecture of the channel network allows a better estimation of the reservoir properties in the subsurface. The most important parameters of the channel network are extracted and processed from the Delft3D output." }, "sediment_fraction_images": { - "filetype": "images", - "extensions": [".png", ".jpg", ".gif"], - "files": [], - "location": "process/" + "files": [], + "filetype": "images", + "pattern": "sediment_fraction", + "location": "process/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Sediment fraction", + "text": "In this cross-shore section the sand fraction of the accumulated sediments and the stratigraphic build-up of the delta are displayed. These are direct outputs from Delft3D. Thanks to these image it is possible to describe the grain size trends (proximal to distal in this case) and the geometry of sediment bodies within the delta, such as shoreface sand wedges and clay drapes. These are are important factors controlling the size and the heterogeneity of a reservoir." + } + }, + "export_options": { + "export_d3dinput": { + "extensions": [ + ".bcc", + ".bch", + ".bct", + ".bnd", + ".dep", + ".enc", + ".fil", + ".grd", + ".ini", + ".mdf", + ".mdw", + ".mor", + ".obs", + ".sed", + ".sh", + ".url", + ".xml", + ".tr1", + ".tr2", + ".tr3", + ".tr4", + ".tr5", + ".sdu", + ".thk", + ".wave" + ], + "location": "simulation" }, - "subenvironment_images": { - "filetype": "images", - "extensions": [".png", ".jpg", ".gif"], - "files": [], - "location": "postprocess/" + "export_images": { + "extensions": [ + ".png", + ".jpg", + ".gif" + ] + }, + "export_movie": { + "extensions": [ + ".mp4" + ] }, + "export_thirdparty": { + "extensions": [ + ".gz" + ], + "location": "export" + } + } + }, + "model": "delft3dworker.template", + "pk": 53 + }, + { + "model": "delft3dworker.template", + "pk": 57, + "fields": { + "name": "River dominated delta", + "shortname": "river", + "meta": { + "description": "Template for a generic river dominated delta system. Has a straight coastline and a slightly v-shaped initial river valley that is 5 km long. Uses the Engelund-Hansen (1967) sediment transport formulation for non-cohesive sediment and the formulation by Partheniades (1965) for cohesive sediment." + }, + "info": { "logfile": { - "filetype": "log", - "extensions": [".log"], - "files": [], - "location": "simulation/" + "files": [], + "filetype": "log", + "location": "simulation/", + "extensions": [ + ".log" + ] }, "postprocess_output": { - "filetype": "json", - "extensions": [".json"], - "files": {}, - "location": "postprocess/" + "files": {}, + "filetype": "json", + "location": "postprocess/", + "extensions": [ + ".json" + ] + }, + "bathymetry_and_architecture_images": { + "files": [], + "filetype": "images", + "pattern": "map_bottomdepth_archels", + "location": "postprocess/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Bathymetry & architecture", + "text": "Bathymetry (in m relative to mean sea level; left) and architectural elements (DT = Delta top; AC = Active channel; MB = Mouth bar; DF = Delta front; PD = Prodelta; right)" + }, + "bathymetry_and_deposition_rate_images": { + "files": [], + "filetype": "images", + "pattern": "map_bottomdepth_deposition", + "location": "process/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Bathymetry & deposition rate", + "text": "Bathymetry (in m relative to mean sea level; left) and deposition rate (in m/day)" + }, + "cross_section_architecture_images": { + "files": [], + "filetype": "images", + "pattern": "xsect_archels", + "location": "postprocess/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Cross section architecture", + "text": "Bathymetry (in m relative to mean sea level; left) and architectural elements (DT = Delta top; AC = Active channel; MB = Mouth bar; DF = Delta front; PD = Prodelta; right) along a central cross-section through the delta." + }, + "cross_section_grain_sizes_images": { + "pattern": "xsect_diameter", + "files": [], + "filetype": "images", + "location": "process/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Cross section grain sizes", + "text": "Bathymetry (in m relative to mean sea level; left) and grain size distribution (D50 in mm; right) along a central cross-section through the delta." + }, + "cross_section_deposition_age_images": { + "pattern": "xsect_depositionage", + "files": [], + "filetype": "images", + "location": "postprocess/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Cross section deposition age", + "text": "Bathymetry (in m relative to mean sea level; left) and deposition age (in hydrodynamic simulation days; right) along a central cross-section through the delta" + }, + "histograms_images": { + "pattern": "archel_summary", + "files": [], + "filetype": "images", + "location": "postprocess/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Histograms", + "text": "Volume distribution and average grain size (D50 in mm) distribution per preserved architectural element" } }, + "sections": [ + { + "name": "Scenario", + "variables": [ + { + "id": "name", + "name": "Name", + "type": "text", + "default": "River dominated basin fill", + "validators": { + "required": true + } + } + ] + }, + { + "name": "Simulation settings", + "variables": [ + { + "id": "simstoptime", + "name": "Simulation time", + "type": "numeric", + "units": "days", + "default": 320.5, + "showValidatorInName": true, + "validators": { + "max": 320.5, + "min": 80, + "required": true + }, + "description": "This is the total hydrodynamic simulation time of a model run." + }, + { + "id": "outputinterval", + "name": "Output interval", + "type": "numeric", + "units": "days", + "default": 1, + "validators": { + "required": true, + "allowedValues": [ + 0.5, + 1 + ] + }, + "description": "This is the output interval used for the map output (2D and 3D), observation point output and the profile output." + } + ] + }, + { + "name": "Geometry", + "variables": [ + { + "id": "basinslope", + "name": "Basin slope", + "type": "numeric", + "units": "°", + "factor": true, + "default": 0.04, + "showValidatorInName": true, + "validators": { + "max": 0.3, + "min": 0.01, + "required": true + }, + "description": "This is the bed level slope between the coastline and the offshore model boundary." + }, + { + "id": "channelwidth", + "name": "Channel width", + "type": "numeric", + "units": "m", + "factor": true, + "default": 500, + "validators": { + "required": true, + "allowedValues": [ + 500, + 1000, + 1500 + ] + }, + "description": "This is the width of the river channel excluding the floodplains (not availalbe for the Roda and Sobrarbe templates)." + }, + { + "id": "riverlength", + "name": "River length", + "type": "numeric", + "units": "cells", + "factor": true, + "default": 100, + "disabled": true, + "validators": { + "required": true, + "allowedValues": [ + 100 + ] + }, + "description": "This is the number of cells between the landward model boundary and the coastline. This parameter is only for the use of the preprocessing scripts but is not editable." + } + ] + }, + { + "name": "Forcing", + "variables": [ + { + "id": "riverdischargeini", + "name": "Initial river discharge per channel", + "type": "numeric", + "units": "m³/s", + "factor": true, + "default": 2000, + "showValidatorInName": true, + "validators": { + "max": 2000, + "min": 0, + "required": true + }, + "description": "This is the initial river discharge per channel (one channel in the case of River dominated delta, Gule Horn/Neslen and Roda; four channels in the case of Sobrarbe). If this value coincides with the value chosen for the final river discharge, a constant discharge is applied during the entire simulation. If the values differ, a time varying river discharge is applied based on a linear interpolation between the values for the initial and the final river discharges." + }, + { + "id": "riverdischargefin", + "name": "Final river discharge per channel", + "type": "numeric", + "units": "m³/s", + "factor": true, + "default": 2000, + "showValidatorInName": true, + "validators": { + "max": 2000, + "min": 0, + "required": true + }, + "description": "This is the final river discharge per channel (one channel in the case of River dominated delta, Gule Horn/Neslen and Roda; four channels in the case of Sobrarbe). If this value coincides with the value chosen for the initial river discharge, a constant discharge is applied during the entire simulation. If the values differ, a time varying river discharge is applied based on a linear interpolation between the values for the initial and the final river discharges." + }, + { + "id": "tidalamplitude", + "name": "Tidal amplitude", + "type": "numeric", + "units": "m", + "factor": true, + "default": 2, + "showValidatorInName": true, + "validators": { + "max": 3, + "min": 0, + "required": true + }, + "description": "This is the tidal amplitude at the offshore model boundary." + }, + { + "id": "waveheightini", + "name": "Initial significant wave height", + "type": "numeric", + "units": "m", + "factor": true, + "default": 0.5, + "showValidatorInName": true, + "validators": { + "max": 2, + "min": 0.11, + "required": true + }, + "description": "This is the initial significant wave height applied to the model. If this value coincides with the value chosen for the final significant wave height, a constant wave height is applied during the entire simulation. If the values differ, a time varying wave height is applied based on a linear interpolation between the values for the initial and the final wave heights." + }, + { + "id": "waveheightfin", + "name": "Final significant wave height", + "type": "numeric", + "units": "m", + "factor": true, + "default": 0.5, + "showValidatorInName": true, + "validators": { + "max": 2, + "min": 0.11, + "required": true + }, + "description": "This is the final significant wave height applied to the model. If this value coincides with the value chosen for the initial significant wave height, a constant wave height is applied during the entire simulation. If the values differ, a time varying wave height is applied based on a linear interpolation between the values for the initial and the final wave heights." + }, + { + "id": "wavedirection", + "name": "Mean wave direction relative to North", + "type": "numeric", + "units": "°", + "factor": true, + "default": 0, + "showValidatorInName": true, + "validators": { + "max": 45, + "min": -45, + "required": true + }, + "description": "This is the mean wave direction according to the nautical convention (0 degrees = waves from the North/orthogonal to the coast)." + }, + { + "id": "subsidenceland", + "name": "Subsidence between landward model boundary and coastline", + "type": "numeric", + "units": "m", + "factor": true, + "default": 10, + "showValidatorInName": true, + "validators": { + "max": 15, + "min": 0, + "required": true + }, + "description": "This is the amount by which the bed level between the landward model boundary and the coastline will be subsided by the end of the simulation (constant subsidence rate between 0 m and the chosen value). If this value coincides with the value chosen for the seaward model boundary, a uniform subsidence for the whole model domain is applied. If the values differ, a spatially varying subsidence is applied based on a linear interpolation between both values." + }, + { + "id": "subsidencesea", + "name": "Subsidence at seaward model boundary", + "type": "numeric", + "units": "m", + "factor": true, + "default": 10, + "showValidatorInName": true, + "validators": { + "max": 15, + "min": 0, + "required": true + }, + "description": "This is the amount by which the bed level at the seaward model boundary will be subsided by the end of the simulation (constant subsidence rate between 0 m and the chosen value). If this value coincides with the value chosen for the area between the landward model boundary and the coastline, a uniform subsidence for the whole model domain is applied. If the values differ, a spatially varying subsidence is applied based on a linear interpolation between both values." + } + ] + }, + { + "name": "Sediment composition", + "variables": [ + { + "id": "composition", + "name": "Sediment classes", + "type": "select", + "default": "coarse-sand", + "options": [ + { + "text": "coarse sand", + "value": "coarse-sand" + }, + { + "text": "medium sand", + "value": "medium-sand" + }, + { + "text": "fine sand", + "value": "fine-sand" + }, + { + "text": "very fine sand", + "value": "veryfine-sand" + }, + { + "text": "coarse silt", + "value": "coarse-silt" + } + ], + "validators": { + "required": true + }, + "description": "This is the grain size distribution (vol-%) of the fluvial sediment input and the initial bed composition. Coarse sand: 10% vc, 10% c, 15% m, 35% f, 20% vf, 10% mud; Medium sand: 5% vc, 5% c, 10% m, 35% f, 35% vf, 10% mud; Fine sand: 2% vc, 3% c, 5% m, 30% f, 45% vf, 15% mud; Very fine sand: 2% vc, 3% c, 5% m, 25% f, 35% vf, 30% mud; Coarse silt: 5% c, 5% m, 25% f, 35% vf, 15% mud A, 15% mud B." + } + ], + "description": "Sediment can consist of a mixture of different classes. Read more about the sediment composition clasess." + } + ], + "visualisation": {}, "export_options": { - "export_d3dinput": { - "extensions": [".bcc", ".bch", ".bct", ".bnd", ".dep", ".enc", - ".fil", ".grd", ".ini", ".mdf", ".mdw", ".mor", - ".obs", ".sed", ".sh", ".url", ".xml", ".tr1", - ".tr2", ".tr3", ".tr4", ".tr5"], - "location": "simulation" - }, - "export_images": { - "extensions": [".png", ".jpg", ".gif"] - }, - "export_movie": { - "extensions": [".mp4"] - }, - "export_thirdparty": { - "extensions": [".gz"], - "location": "export" - } - } - }, + "export_movie": { + "extensions": [ + ".mp4" + ] + }, + "export_images": { + "extensions": [ + ".png", + ".jpg", + ".gif" + ] + }, + "export_d3dinput": { + "location": "simulation", + "extensions": [ + ".bcc", + ".bch", + ".bct", + ".bnd", + ".dep", + ".enc", + ".fil", + ".grd", + ".ini", + ".mdf", + ".mdw", + ".mor", + ".obs", + ".sed", + ".sh", + ".url", + ".xml", + ".tr1", + ".tr2", + ".tr3", + ".tr4", + ".tr5", + ".sdu", + ".thk", + ".wave" + ] + }, + "export_thirdparty": { + "location": "export", + "extensions": [ + ".gz" + ] + } + }, + "yaml_template": "workflow_templates/delft3dgt-main-2024.yaml" + } + }, + { "model": "delft3dworker.template", - "pk": 53 + "pk": 54, + "fields": { + "name": "Sobrarbe", + "shortname": "sobrarbe", + "meta": { + "description": "Template for the Sobrarbe formation and comparable deltaic systems. Has a straight coastline and a 1 km long river valley. The river valley is subdivided into four channels that are separated from each other by cone-shaped non-erodible obstacles, reflecting a wide braided floodplain entering a sedimentary basin. Uses the van Rijn (1993) sediment transport formulation for non-cohesive sediment and the formulation by Partheniades (1965) for cohesive sediment.." + }, + "info": { + "logfile": { + "files": [], + "filetype": "log", + "location": "simulation/", + "extensions": [ + ".log" + ] + }, + "postprocess_output": { + "files": {}, + "filetype": "json", + "location": "postprocess/", + "extensions": [ + ".json" + ] + }, + "bathymetry_and_architecture_images": { + "files": [], + "filetype": "images", + "pattern": "map_bottomdepth_archels", + "location": "postprocess/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Bathymetry & architecture", + "text": "Bathymetry (in m relative to mean sea level; left) and architectural elements (DT = Delta top; AC = Active channel; MB = Mouth bar; DF = Delta front; PD = Prodelta; right)" + }, + "bathymetry_and_deposition_rate_images": { + "files": [], + "filetype": "images", + "pattern": "map_bottomdepth_deposition", + "location": "process/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Bathymetry & deposition rate", + "text": "Bathymetry (in m relative to mean sea level; left) and deposition rate (in m/day)" + }, + "cross_section_architecture_images": { + "files": [], + "filetype": "images", + "pattern": "xsect_archels", + "location": "postprocess/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Cross section architecture", + "text": "Bathymetry (in m relative to mean sea level; left) and architectural elements (DT = Delta top; AC = Active channel; MB = Mouth bar; DF = Delta front; PD = Prodelta; right) along a central cross-section through the delta" + }, + "cross_section_grain_sizes_images": { + "pattern": "xsect_diameter", + "files": [], + "filetype": "images", + "location": "process/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Cross section grain sizes", + "text": "Bathymetry (in m relative to mean sea level; left) and grain size distribution (D50 in mm; right) along a central cross-section through the delta" + }, + "cross_section_deposition_age_images": { + "pattern": "xsect_depositionage", + "files": [], + "filetype": "images", + "location": "postprocess/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Cross section deposition age", + "text": "Bathymetry (in m relative to mean sea level; left) and deposition age (in hydrodynamic simulation days; right) along a central cross-section through the delta" + }, + "histograms_images": { + "pattern": "archel_summary", + "files": [], + "filetype": "images", + "location": "postprocess/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Histograms", + "text": "Volume distribution and average grain size (D50 in mm) distribution per preserved architectural element" + } + }, + "sections": [ + { + "name": "Scenario", + "variables": [ + { + "id": "name", + "name": "Name", + "type": "text", + "default": "Sobrarbe", + "validators": { + "required": true + } + } + ] + }, + { + "name": "Simulation settings", + "variables": [ + { + "id": "simstoptime", + "name": "Simulation time", + "type": "numeric", + "units": "days", + "default": 320.5, + "showValidatorInName": true, + "validators": { + "max": 320.5, + "min": 80, + "required": true + }, + "description": "This is the total hydrodynamic simulation time of a model run." + }, + { + "id": "outputinterval", + "name": "Output interval", + "type": "numeric", + "units": "days", + "default": 1, + "validators": { + "required": true, + "allowedValues": [ + 0.5, + 1 + ] + }, + "description": "This is the output interval used for the map output (2D and 3D), observation point output and the profile output." + } + ] + }, + { + "name": "Geometry", + "variables": [ + { + "id": "basinslope", + "name": "Basin slope", + "type": "numeric", + "units": "°", + "factor": true, + "default": 0.04, + "showValidatorInName": true, + "validators": { + "max": 0.3, + "min": 0.01, + "required": true + }, + "description": "This is the bed level slope between the coastline and the offshore model boundary." + }, + { + "id": "channelwidth", + "name": "Channel width", + "type": "numeric", + "units": "m", + "factor": true, + "default": 1000, + "disabled": true, + "validators": { + "required": true, + "allowedValues": [ + 1000 + ] + }, + "description": "This is the width of the river channel excluding the floodplains (not availalbe for the Roda and Sobrarbe templates)." + }, + { + "id": "riverlength", + "name": "River length", + "type": "numeric", + "units": "cells", + "factor": true, + "default": 20, + "disabled": true, + "validators": { + "required": true, + "allowedValues": [ + 20 + ] + }, + "description": "This is the number of cells between the landward model boundary and the coastline. This parameter is only for the use of the preprocessing scripts but is not editable." + } + ] + }, + { + "name": "Forcing", + "variables": [ + { + "id": "riverdischargeini", + "name": "Initial river discharge per channel", + "type": "numeric", + "units": "m³/s", + "factor": true, + "default": 375, + "showValidatorInName": true, + "validators": { + "max": 2000, + "min": 0, + "required": true + }, + "description": "This is the initial river discharge per channel (one channel in the case of River dominated delta, Gule Horn/Neslen and Roda; four channels in the case of Sobrarbe). If this value coincides with the value chosen for the final river discharge, a constant discharge is applied during the entire simulation. If the values differ, a time varying river discharge is applied based on a linear interpolation between the values for the initial and the final river discharges." + }, + { + "id": "riverdischargefin", + "name": "Final river discharge per channel", + "type": "numeric", + "units": "m³/s", + "factor": true, + "default": 375, + "showValidatorInName": true, + "validators": { + "max": 2000, + "min": 0, + "required": true + }, + "description": "This is the final river discharge per channel (one channel in the case of River dominated delta, Gule Horn/Neslen and Roda; four channels in the case of Sobrarbe). If this value coincides with the value chosen for the initial river discharge, a constant discharge is applied during the entire simulation. If the values differ, a time varying river discharge is applied based on a linear interpolation between the values for the initial and the final river discharges." + }, + { + "id": "tidalamplitude", + "name": "Tidal amplitude", + "type": "numeric", + "units": "m", + "factor": true, + "default": 1, + "showValidatorInName": true, + "validators": { + "max": 3, + "min": 0, + "required": true + }, + "description": "This is the tidal amplitude at the offshore model boundary." + }, + { + "id": "waveheightini", + "name": "Initial significant wave height", + "type": "numeric", + "units": "m", + "factor": true, + "default": 0.5, + "showValidatorInName": true, + "validators": { + "max": 2, + "min": 0.11, + "required": true + }, + "description": "This is the initial significant wave height applied to the model. If this value coincides with the value chosen for the final significant wave height, a constant wave height is applied during the entire simulation. If the values differ, a time varying wave height is applied based on a linear interpolation between the values for the initial and the final wave heights." + }, + { + "id": "waveheightfin", + "name": "Final significant wave height", + "type": "numeric", + "units": "m", + "factor": true, + "default": 0.5, + "showValidatorInName": true, + "validators": { + "max": 2, + "min": 0.11, + "required": true + }, + "description": "This is the final significant wave height applied to the model. If this value coincides with the value chosen for the initial significant wave height, a constant wave height is applied during the entire simulation. If the values differ, a time varying wave height is applied based on a linear interpolation between the values for the initial and the final wave heights." + }, + { + "id": "wavedirection", + "name": "Mean wave direction relative to North", + "type": "numeric", + "units": "°", + "factor": true, + "default": 0, + "showValidatorInName": true, + "validators": { + "max": 45, + "min": -45, + "required": true + }, + "description": "This is the mean wave direction according to the nautical convention (0 degrees = waves from the North/orthogonal to the coast)." + }, + { + "id": "subsidenceland", + "name": "Subsidence between landward model boundary and coastline", + "type": "numeric", + "units": "m", + "factor": true, + "default": 5, + "showValidatorInName": true, + "validators": { + "max": 15, + "min": 0, + "required": true + }, + "description": "This is the amount by which the bed level between the landward model boundary and the coastline will be subsided by the end of the simulation (constant subsidence rate between 0 m and the chosen value). If this value coincides with the value chosen for the seaward model boundary, a uniform subsidence for the whole model domain is applied. If the values differ, a spatially varying subsidence is applied based on a linear interpolation between both values." + }, + { + "id": "subsidencesea", + "name": "Subsidence at seaward model boundary", + "type": "numeric", + "units": "m", + "factor": true, + "default": 5, + "showValidatorInName": true, + "validators": { + "max": 15, + "min": 0, + "required": true + }, + "description": "This is the amount by which the bed level at the seaward model boundary will be subsided by the end of the simulation (constant subsidence rate between 0 m and the chosen value). If this value coincides with the value chosen for the area between the landward model boundary and the coastline, a uniform subsidence for the whole model domain is applied. If the values differ, a spatially varying subsidence is applied based on a linear interpolation between both values." + } + ] + }, + { + "name": "Sediment composition", + "variables": [ + { + "id": "composition", + "name": "Sediment classes", + "type": "select", + "default": "coarse-sand", + "options": [ + { + "text": "coarse sand", + "value": "coarse-sand" + }, + { + "text": "medium sand", + "value": "medium-sand" + }, + { + "text": "fine sand", + "value": "fine-sand" + }, + { + "text": "very fine sand", + "value": "veryfine-sand" + }, + { + "text": "coarse silt", + "value": "coarse-silt" + } + ], + "validators": { + "required": true + }, + "description": "This is the grain size distribution (vol-%) of the fluvial sediment input and the initial bed composition. Coarse sand: 10% vc, 10% c, 15% m, 35% f, 20% vf, 10% mud; Medium sand: 5% vc, 5% c, 10% m, 35% f, 35% vf, 10% mud; Fine sand: 2% vc, 3% c, 5% m, 30% f, 45% vf, 15% mud; Very fine sand: 2% vc, 3% c, 5% m, 25% f, 35% vf, 30% mud; Coarse silt: 5% c, 5% m, 25% f, 35% vf, 15% mud A, 15% mud B." + } + ], + "description": "Sediment can consist of a mixture of different classes. Read more about the sediment composition clasess." + } + ], + "visualisation": {}, + "export_options": { + "export_movie": { + "extensions": [ + ".mp4" + ] + }, + "export_images": { + "extensions": [ + ".png", + ".jpg", + ".gif" + ] + }, + "export_d3dinput": { + "location": "simulation", + "extensions": [ + ".bcc", + ".bch", + ".bct", + ".bnd", + ".dep", + ".enc", + ".fil", + ".grd", + ".ini", + ".mdf", + ".mdw", + ".mor", + ".obs", + ".sed", + ".sh", + ".url", + ".xml", + ".tr1", + ".tr2", + ".tr3", + ".tr4", + ".tr5", + ".sdu", + ".thk", + ".wave" + ] + }, + "export_thirdparty": { + "location": "export", + "extensions": [ + ".gz" + ] + } + }, + "yaml_template": "workflow_templates/delft3dgt-main-2024.yaml" + } + }, + { + "model": "delft3dworker.template", + "pk": 55, + "fields": { + "name": "Roda", + "shortname": "roda", + "meta": { + "description": "Template for the Roda formation and comparable deltaic systems. Has a straight but funnel-shaped coastline and a rectangular shaped initial river valley that is 5 km long and 500 m wide. Uses the van Rijn (1993) sediment transport formulation for non-cohesive sediment and the formulation by Partheniades (1965) for cohesive sediment." + }, + "info": { + "logfile": { + "files": [], + "filetype": "log", + "location": "simulation/", + "extensions": [ + ".log" + ] + }, + "postprocess_output": { + "files": {}, + "filetype": "json", + "location": "postprocess/", + "extensions": [ + ".json" + ] + }, + "bathymetry_and_architecture_images": { + "files": [], + "filetype": "images", + "pattern": "map_bottomdepth_archels", + "location": "postprocess/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Bathymetry & architecture", + "text": "Bathymetry (in m relative to mean sea level; left) and architectural elements (DT = Delta top; AC = Active channel; MB = Mouth bar; DF = Delta front; PD = Prodelta; right)" + }, + "bathymetry_and_deposition_rate_images": { + "files": [], + "filetype": "images", + "pattern": "map_bottomdepth_deposition", + "location": "process/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Bathymetry & deposition rate", + "text": "Bathymetry (in m relative to mean sea level; left) and deposition rate (in m/day)" + }, + "cross_section_architecture_images": { + "files": [], + "filetype": "images", + "pattern": "xsect_archels", + "location": "postprocess/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Cross section architecture", + "text": "Bathymetry (in m relative to mean sea level; left) and architectural elements (DT = Delta top; AC = Active channel; MB = Mouth bar; DF = Delta front; PD = Prodelta; right) along a central cross-section through the delta" + }, + "cross_section_grain_sizes_images": { + "pattern": "xsect_diameter", + "files": [], + "filetype": "images", + "location": "process/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Cross section grain sizes", + "text": "Bathymetry (in m relative to mean sea level; left) and grain size distribution (D50 in mm; right) along a central cross-section through the delta" + }, + "cross_section_deposition_age_images": { + "pattern": "xsect_depositionage", + "files": [], + "filetype": "images", + "location": "postprocess/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Cross section deposition age", + "text": "Bathymetry (in m relative to mean sea level; left) and deposition age (in hydrodynamic simulation days; right) along a central cross-section through the delta" + }, + "histograms_images": { + "pattern": "archel_summary", + "files": [], + "filetype": "images", + "location": "postprocess/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Histograms", + "text": "Volume distribution and average grain size (D50 in mm) distribution per preserved architectural element" + } + }, + "sections": [ + { + "name": "Scenario", + "variables": [ + { + "id": "name", + "name": "Name", + "type": "text", + "default": "Roda", + "validators": { + "required": true + } + } + ] + }, + { + "name": "Simulation settings", + "variables": [ + { + "id": "simstoptime", + "name": "Simulation time", + "type": "numeric", + "units": "days", + "default": 320.5, + "showValidatorInName": true, + "validators": { + "max": 320.5, + "min": 80, + "required": true + }, + "description": "This is the total hydrodynamic simulation time of a model run." + }, + { + "id": "outputinterval", + "name": "Output interval", + "type": "numeric", + "units": "days", + "default": 1, + "validators": { + "required": true, + "allowedValues": [ + 0.5, + 1 + ] + }, + "description": "This is the output interval used for the map output (2D and 3D), observation point output and the profile output." + } + ] + }, + { + "name": "Geometry", + "variables": [ + { + "id": "basinslope", + "name": "Basin slope", + "type": "numeric", + "units": "°", + "factor": true, + "default": 0.1, + "showValidatorInName": true, + "validators": { + "max": 0.3, + "min": 0.01, + "required": true + }, + "description": "This is the bed level slope between the coastline and the offshore model boundary." + }, + { + "id": "channelwidth", + "name": "Channel width", + "type": "numeric", + "units": "m", + "factor": true, + "default": 500, + "disabled": true, + "validators": { + "required": true, + "allowedValues": [ + 500 + ] + }, + "description": "This is the width of the river channel excluding the floodplains (not availalbe for the Roda and Sobrarbe templates)." + }, + { + "id": "riverlength", + "name": "River length", + "type": "numeric", + "units": "cells", + "factor": true, + "default": 100, + "disabled": true, + "validators": { + "required": true, + "allowedValues": [ + 100 + ] + }, + "description": "This is the number of cells between the landward model boundary and the coastline. This parameter is only for the use of the preprocessing scripts but is not editable." + } + ] + }, + { + "name": "Forcing", + "variables": [ + { + "id": "riverdischargeini", + "name": "Initial river discharge per channel", + "type": "numeric", + "units": "m³/s", + "factor": true, + "default": 1100, + "showValidatorInName": true, + "validators": { + "max": 2000, + "min": 0, + "required": true + }, + "description": "This is the initial river discharge per channel (one channel in the case of River dominated delta, Gule Horn/Neslen and Roda; four channels in the case of Sobrarbe). If this value coincides with the value chosen for the final river discharge, a constant discharge is applied during the entire simulation. If the values differ, a time varying river discharge is applied based on a linear interpolation between the values for the initial and the final river discharges." + }, + { + "id": "riverdischargefin", + "name": "Final river discharge per channel", + "type": "numeric", + "units": "m³/s", + "factor": true, + "default": 250, + "showValidatorInName": true, + "validators": { + "max": 2000, + "min": 0, + "required": true + }, + "description": "This is the final river discharge per channel (one channel in the case of River dominated delta, Gule Horn/Neslen and Roda; four channels in the case of Sobrarbe). If this value coincides with the value chosen for the initial river discharge, a constant discharge is applied during the entire simulation. If the values differ, a time varying river discharge is applied based on a linear interpolation between the values for the initial and the final river discharges." + }, + { + "id": "tidalamplitude", + "name": "Tidal amplitude", + "type": "numeric", + "units": "m", + "factor": true, + "default": 2, + "showValidatorInName": true, + "validators": { + "max": 3, + "min": 0, + "required": true + }, + "description": "This is the tidal amplitude at the offshore model boundary." + }, + { + "id": "waveheightini", + "name": "Initial significant wave height", + "type": "numeric", + "units": "m", + "factor": true, + "default": 0.11, + "showValidatorInName": true, + "validators": { + "max": 2, + "min": 0.11, + "required": true + }, + "description": "This is the initial significant wave height applied to the model. If this value coincides with the value chosen for the final significant wave height, a constant wave height is applied during the entire simulation. If the values differ, a time varying wave height is applied based on a linear interpolation between the values for the initial and the final wave heights." + }, + { + "id": "waveheightfin", + "name": "Final significant wave height", + "type": "numeric", + "units": "m", + "factor": true, + "default": 0.3, + "showValidatorInName": true, + "validators": { + "max": 2, + "min": 0.11, + "required": true + }, + "description": "This is the final significant wave height applied to the model. If this value coincides with the value chosen for the initial significant wave height, a constant wave height is applied during the entire simulation. If the values differ, a time varying wave height is applied based on a linear interpolation between the values for the initial and the final wave heights." + }, + { + "id": "wavedirection", + "name": "Mean wave direction relative to North", + "type": "numeric", + "units": "°", + "factor": true, + "default": 0, + "showValidatorInName": true, + "validators": { + "max": 45, + "min": -45, + "required": true + }, + "description": "This is the mean wave direction according to the nautical convention (0 degrees = waves from the North/orthogonal to the coast)." + }, + { + "id": "subsidenceland", + "name": "Subsidence between landward model boundary and coastline", + "type": "numeric", + "units": "m", + "factor": true, + "default": 0, + "showValidatorInName": true, + "validators": { + "max": 15, + "min": 0, + "required": true + }, + "description": "This is the amount by which the bed level between the landward model boundary and the coastline will be subsided by the end of the simulation (constant subsidence rate between 0 m and the chosen value). If this value coincides with the value chosen for the seaward model boundary, a uniform subsidence for the whole model domain is applied. If the values differ, a spatially varying subsidence is applied based on a linear interpolation between both values." + }, + { + "id": "subsidencesea", + "name": "Subsidence at seaward model boundary", + "type": "numeric", + "units": "m", + "factor": true, + "default": 12, + "showValidatorInName": true, + "validators": { + "max": 15, + "min": 0, + "required": true + }, + "description": "This is the amount by which the bed level at the seaward model boundary will be subsided by the end of the simulation (constant subsidence rate between 0 m and the chosen value). If this value coincides with the value chosen for the area between the landward model boundary and the coastline, a uniform subsidence for the whole model domain is applied. If the values differ, a spatially varying subsidence is applied based on a linear interpolation between both values." + } + ] + }, + { + "name": "Sediment composition", + "variables": [ + { + "id": "composition", + "name": "Sediment classes", + "type": "select", + "default": "coarse-sand", + "options": [ + { + "text": "coarse sand", + "value": "coarse-sand" + }, + { + "text": "medium sand", + "value": "medium-sand" + }, + { + "text": "fine sand", + "value": "fine-sand" + }, + { + "text": "very fine sand", + "value": "veryfine-sand" + }, + { + "text": "coarse silt", + "value": "coarse-silt" + } + ], + "validators": { + "required": true + }, + "description": "This is the grain size distribution (vol-%) of the fluvial sediment input and the initial bed composition. Coarse sand: 10% vc, 10% c, 15% m, 35% f, 20% vf, 10% mud; Medium sand: 5% vc, 5% c, 10% m, 35% f, 35% vf, 10% mud; Fine sand: 2% vc, 3% c, 5% m, 30% f, 45% vf, 15% mud; Very fine sand: 2% vc, 3% c, 5% m, 25% f, 35% vf, 30% mud; Coarse silt: 5% c, 5% m, 25% f, 35% vf, 15% mud A, 15% mud B." + } + ], + "description": "Sediment can consist of a mixture of different classes. Read more about the sediment composition clasess." + } + ], + "visualisation": {}, + "export_options": { + "export_movie": { + "extensions": [ + ".mp4" + ] + }, + "export_images": { + "extensions": [ + ".png", + ".jpg", + ".gif" + ] + }, + "export_d3dinput": { + "location": "simulation", + "extensions": [ + ".bcc", + ".bch", + ".bct", + ".bnd", + ".dep", + ".enc", + ".fil", + ".grd", + ".ini", + ".mdf", + ".mdw", + ".mor", + ".obs", + ".sed", + ".sh", + ".url", + ".xml", + ".tr1", + ".tr2", + ".tr3", + ".tr4", + ".tr5", + ".sdu", + ".thk", + ".wave" + ] + }, + "export_thirdparty": { + "location": "export", + "extensions": [ + ".gz" + ] + } + }, + "yaml_template": "workflow_templates/delft3dgt-main-2024.yaml" + } + }, + { + "model": "delft3dworker.template", + "pk": 56, + "fields": { + "name": "GuleHorn/Neslen", + "shortname": "gulehorn", + "meta": { + "description": "Template for the Gule Horn and Neslen formations and comparable deltaic systems. Has a straight coastline and a rectangular shaped initial river valley that is 5 km long. Uses the Engelund-Hansen (1967) sediment transport formulation for non-cohesive sediment and the formulation by Partheniades (1965) for cohesive sediment." + }, + "info": { + "logfile": { + "files": [], + "filetype": "log", + "location": "simulation/", + "extensions": [ + ".log" + ] + }, + "postprocess_output": { + "files": {}, + "filetype": "json", + "location": "postprocess/", + "extensions": [ + ".json" + ] + }, + "bathymetry_and_architecture_images": { + "files": [], + "filetype": "images", + "pattern": "map_bottomdepth_archels", + "location": "postprocess/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Bathymetry & architecture", + "text": "Bathymetry (in m relative to mean sea level; left) and architectural elements (DT = Delta top; AC = Active channel; MB = Mouth bar; DF = Delta front; PD = Prodelta; right)" + }, + "bathymetry_and_deposition_rate_images": { + "files": [], + "filetype": "images", + "pattern": "map_bottomdepth_deposition", + "location": "process/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Bathymetry & deposition rate", + "text": "Bathymetry (in m relative to mean sea level; left) and deposition rate (in m/day)" + }, + "cross_section_architecture_images": { + "files": [], + "filetype": "images", + "pattern": "xsect_archels", + "location": "postprocess/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Cross section architecture", + "text": "Bathymetry (in m relative to mean sea level; left) and architectural elements (DT = Delta top; AC = Active channel; MB = Mouth bar; DF = Delta front; PD = Prodelta; right) along a central cross-section through the delta" + }, + "cross_section_grain_sizes_images": { + "pattern": "xsect_diameter", + "files": [], + "filetype": "images", + "location": "process/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Cross section grain sizes", + "text": "Bathymetry (in m relative to mean sea level; left) and grain size distribution (D50 in mm; right) along a central cross-section through the delta" + }, + "cross_section_deposition_age_images": { + "pattern": "xsect_depositionage", + "files": [], + "filetype": "images", + "location": "postprocess/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Cross section deposition age", + "text": "Bathymetry (in m relative to mean sea level; left) and deposition age (in hydrodynamic simulation days; right) along a central cross-section through the delta" + }, + "histograms_images": { + "pattern": "archel_summary", + "files": [], + "filetype": "images", + "location": "postprocess/", + "extensions": [ + ".png", + ".jpg", + ".gif" + ], + "name": "Histograms", + "text": "Volume distribution and average grain size (D50 in mm) distribution per preserved architectural element" + } + }, + "sections": [ + { + "name": "Scenario", + "variables": [ + { + "id": "name", + "name": "Name", + "type": "text", + "default": "GuleHorn/Neslen", + "validators": { + "required": true + } + } + ] + }, + { + "name": "Simulation settings", + "variables": [ + { + "id": "simstoptime", + "name": "Simulation time", + "type": "numeric", + "units": "days", + "default": 320.5, + "showValidatorInName": true, + "validators": { + "max": 320.5, + "min": 80, + "required": true + }, + "description": "This is the total hydrodynamic simulation time of a model run." + }, + { + "id": "outputinterval", + "name": "Output interval", + "type": "numeric", + "units": "days", + "default": 1, + "validators": { + "required": true, + "allowedValues": [ + 0.5, + 1 + ] + }, + "description": "This is the output interval used for the map output (2D and 3D), observation point output and the profile output." + } + ] + }, + { + "name": "Geometry", + "variables": [ + { + "id": "basinslope", + "name": "Basin slope", + "type": "numeric", + "units": "°", + "factor": true, + "default": 0.04, + "showValidatorInName": true, + "validators": { + "max": 0.3, + "min": 0.01, + "required": true + }, + "description": "This is the bed level slope between the coastline and the offshore model boundary." + }, + { + "id": "channelwidth", + "name": "Channel width", + "type": "numeric", + "units": "m", + "factor": true, + "default": 500, + "validators": { + "required": true, + "allowedValues": [ + 500, + 1000, + 1500 + ] + }, + "description": "This is the width of the river channel excluding the floodplains (not availalbe for the Roda and Sobrarbe templates)." + }, + { + "id": "riverlength", + "name": "River length", + "type": "numeric", + "units": "cells", + "factor": true, + "default": 100, + "disabled": true, + "validators": { + "required": true, + "allowedValues": [ + 100 + ] + }, + "description": "This is the number of cells between the landward model boundary and the coastline. This parameter is only for the use of the preprocessing scripts but is not editable." + } + ] + }, + { + "name": "Forcing", + "variables": [ + { + "id": "riverdischargeini", + "name": "Initial river discharge per channel", + "type": "numeric", + "units": "m³/s", + "factor": true, + "default": 2000, + "showValidatorInName": true, + "validators": { + "max": 2000, + "min": 0, + "required": true + }, + "description": "This is the initial river discharge per channel (one channel in the case of River dominated delta, Gule Horn/Neslen and Roda; four channels in the case of Sobrarbe). If this value coincides with the value chosen for the final river discharge, a constant discharge is applied during the entire simulation. If the values differ, a time varying river discharge is applied based on a linear interpolation between the values for the initial and the final river discharges." + }, + { + "id": "riverdischargefin", + "name": "Final river discharge per channel", + "type": "numeric", + "units": "m³/s", + "factor": true, + "default": 2000, + "showValidatorInName": true, + "validators": { + "max": 2000, + "min": 0, + "required": true + }, + "description": "This is the final river discharge per channel (one channel in the case of River dominated delta, Gule Horn/Neslen and Roda; four channels in the case of Sobrarbe). If this value coincides with the value chosen for the initial river discharge, a constant discharge is applied during the entire simulation. If the values differ, a time varying river discharge is applied based on a linear interpolation between the values for the initial and the final river discharges." + }, + { + "id": "tidalamplitude", + "name": "Tidal amplitude", + "type": "numeric", + "units": "m", + "factor": true, + "default": 2, + "showValidatorInName": true, + "validators": { + "max": 3, + "min": 0, + "required": true + }, + "description": "This is the tidal amplitude at the offshore model boundary." + }, + { + "id": "waveheightini", + "name": "Initial significant wave height", + "type": "numeric", + "units": "m", + "factor": true, + "default": 0.5, + "showValidatorInName": true, + "validators": { + "max": 2, + "min": 0.11, + "required": true + }, + "description": "This is the initial significant wave height applied to the model. If this value coincides with the value chosen for the final significant wave height, a constant wave height is applied during the entire simulation. If the values differ, a time varying wave height is applied based on a linear interpolation between the values for the initial and the final wave heights." + }, + { + "id": "waveheightfin", + "name": "Final significant wave height", + "type": "numeric", + "units": "m", + "factor": true, + "default": 0.5, + "showValidatorInName": true, + "validators": { + "max": 2, + "min": 0.11, + "required": true + }, + "description": "This is the final significant wave height applied to the model. If this value coincides with the value chosen for the initial significant wave height, a constant wave height is applied during the entire simulation. If the values differ, a time varying wave height is applied based on a linear interpolation between the values for the initial and the final wave heights." + }, + { + "id": "wavedirection", + "name": "Mean wave direction relative to North", + "type": "numeric", + "units": "°", + "factor": true, + "default": 0, + "showValidatorInName": true, + "validators": { + "max": 45, + "min": -45, + "required": true + }, + "description": "This is the mean wave direction according to the nautical convention (0 degrees = waves from the North/orthogonal to the coast)." + }, + { + "id": "subsidenceland", + "name": "Subsidence between landward model boundary and coastline", + "type": "numeric", + "units": "m", + "factor": true, + "default": 10, + "showValidatorInName": true, + "validators": { + "max": 15, + "min": 0, + "required": true + }, + "description": "This is the amount by which the bed level between the landward model boundary and the coastline will be subsided by the end of the simulation (constant subsidence rate between 0 m and the chosen value). If this value coincides with the value chosen for the seaward model boundary, a uniform subsidence for the whole model domain is applied. If the values differ, a spatially varying subsidence is applied based on a linear interpolation between both values." + }, + { + "id": "subsidencesea", + "name": "Subsidence at seaward model boundary", + "type": "numeric", + "units": "m", + "factor": true, + "default": 10, + "showValidatorInName": true, + "validators": { + "max": 15, + "min": 0, + "required": true + }, + "description": "This is the amount by which the bed level at the seaward model boundary will be subsided by the end of the simulation (constant subsidence rate between 0 m and the chosen value). If this value coincides with the value chosen for the area between the landward model boundary and the coastline, a uniform subsidence for the whole model domain is applied. If the values differ, a spatially varying subsidence is applied based on a linear interpolation between both values." + } + ] + }, + { + "name": "Sediment composition", + "variables": [ + { + "id": "composition", + "name": "Sediment classes", + "type": "select", + "default": "coarse-sand", + "options": [ + { + "text": "coarse sand", + "value": "coarse-sand" + }, + { + "text": "medium sand", + "value": "medium-sand" + }, + { + "text": "fine sand", + "value": "fine-sand" + }, + { + "text": "very fine sand", + "value": "veryfine-sand" + }, + { + "text": "coarse silt", + "value": "coarse-silt" + } + ], + "validators": { + "required": true + }, + "description": "This is the grain size distribution (vol-%) of the fluvial sediment input and the initial bed composition. Coarse sand: 10% vc, 10% c, 15% m, 35% f, 20% vf, 10% mud; Medium sand: 5% vc, 5% c, 10% m, 35% f, 35% vf, 10% mud; Fine sand: 2% vc, 3% c, 5% m, 30% f, 45% vf, 15% mud; Very fine sand: 2% vc, 3% c, 5% m, 25% f, 35% vf, 30% mud; Coarse silt: 5% c, 5% m, 25% f, 35% vf, 15% mud A, 15% mud B." + } + ], + "description": "Sediment can consist of a mixture of different classes. Read more about the sediment composition clasess." + } + ], + "visualisation": {}, + "export_options": { + "export_movie": { + "extensions": [ + ".mp4" + ] + }, + "export_images": { + "extensions": [ + ".png", + ".jpg", + ".gif" + ] + }, + "export_d3dinput": { + "location": "simulation", + "extensions": [ + ".bcc", + ".bch", + ".bct", + ".bnd", + ".dep", + ".enc", + ".fil", + ".grd", + ".ini", + ".mdf", + ".mdw", + ".mor", + ".obs", + ".sed", + ".sh", + ".url", + ".xml", + ".tr1", + ".tr2", + ".tr3", + ".tr4", + ".tr5", + ".sdu", + ".thk", + ".wave" + ] + }, + "export_thirdparty": { + "location": "export", + "extensions": [ + ".gz" + ] + } + }, + "yaml_template": "workflow_templates/delft3dgt-main-2024.yaml" + } } -] - +] \ No newline at end of file diff --git a/delft3dworker/management/commands/cleanup.py b/delft3dworker/management/commands/cleanup.py index 718c24b3..274bcda3 100644 --- a/delft3dworker/management/commands/cleanup.py +++ b/delft3dworker/management/commands/cleanup.py @@ -1,9 +1,9 @@ -from os import listdir, walk -from os.path import dirname, join, split +from os import walk +from os.path import join from shutil import rmtree -from django.conf import settings # noqa -from django.core.management.base import BaseCommand, CommandError +from django.conf import settings +from django.core.management.base import BaseCommand from delft3dworker.models import Scene @@ -33,8 +33,6 @@ def handle(self, *args, **options): for directory in unlinked: try: rmtree(directory) - self.stdout.write( - "Successfully deleted unlinked folder {}".format(directory) - ) - except: - self.stdout.write("Couldn't delete folder {}".format(directory)) + self.stdout.write(f"Successfully deleted unlinked folder {directory}") + except Exception as e: + self.stdout.write(f"Couldn't delete folder {directory}: {e}") diff --git a/delft3dworker/management/commands/compress.py b/delft3dworker/management/commands/compress.py index 9509d637..b2ffc51f 100644 --- a/delft3dworker/management/commands/compress.py +++ b/delft3dworker/management/commands/compress.py @@ -1,18 +1,15 @@ from os import remove, rename, stat, walk -from os.path import basename, join, split +from os.path import basename, join from subprocess import call from django.conf import settings # noqa -from django.core.management.base import BaseCommand, CommandError - -from delft3dworker.models import Scene +from django.core.management.base import BaseCommand class Command(BaseCommand): help = "Compresses netcdf output of finished Delft3D models" def handle(self, *args, **options): - netcdf = "trim-a.nc" netcdf_compressed = "trim-a-compressed.nc" diff --git a/delft3dworker/management/commands/containersync_sceneupdate.py b/delft3dworker/management/commands/containersync_sceneupdate.py index 7ae0faed..a3280d2f 100644 --- a/delft3dworker/management/commands/containersync_sceneupdate.py +++ b/delft3dworker/management/commands/containersync_sceneupdate.py @@ -1,7 +1,6 @@ import logging from time import sleep -from celery.result import AsyncResult from django.core.management import BaseCommand from delft3dcontainermanager.tasks import do_docker_remove, get_docker_ps @@ -21,7 +20,6 @@ class Command(BaseCommand): help = "sync containers with container and scene model" def handle(self, *args, **options): - # STEP I : Loop over non empty celery_task_ids in containers # Sets task_uuid to None except for when a task is queued # Queued for log, no start? expire gebruiken @@ -29,7 +27,6 @@ def handle(self, *args, **options): # STEP II : Get latest container statuses if self._get_latest_docker_status(): - # STEP III : Update Scenes and their Phases # Controls container desired states self._update_scene_phases() @@ -133,7 +130,5 @@ def _update_scene_phases(self): scene.update_and_phase_shift() def _fix_container_state_mismatches_or_log(self): - for container in Container.objects.all(): - container.fix_mismatch_or_log() diff --git a/delft3dworker/management/commands/get_latest_svn_releases.py b/delft3dworker/management/commands/get_latest_svn_releases.py index 03c07680..f5f0f70f 100644 --- a/delft3dworker/management/commands/get_latest_svn_releases.py +++ b/delft3dworker/management/commands/get_latest_svn_releases.py @@ -14,7 +14,6 @@ class Command(BaseCommand): VERSION_SVN models based on the available tags.""" def handle(self, *args, **options): - # Handle svn credentials user = os.environ.get("SVN_USER") password = os.environ.get("SVN_PASS") diff --git a/delft3dworker/management/commands/migrate_legacy_scenes.py b/delft3dworker/management/commands/migrate_legacy_scenes.py index 3569b496..b7e22999 100644 --- a/delft3dworker/management/commands/migrate_legacy_scenes.py +++ b/delft3dworker/management/commands/migrate_legacy_scenes.py @@ -25,13 +25,11 @@ class Command(BaseCommand): help = "Scan for old Scenes and update them to the new ET architecture." def handle(self, *args, **options): - # STEP I : Find scenes without a workflow legacy_scenes = Scene.objects.filter(workflow=None) # STEP II : Call local scan for scene in legacy_scenes: - if scene.scenario.first() is None: logging.warning("Scene {} has no scenario!".format(scene.id)) continue diff --git a/delft3dworker/management/commands/scanbucket.py b/delft3dworker/management/commands/scanbucket.py index 4f237236..870d5b1b 100644 --- a/delft3dworker/management/commands/scanbucket.py +++ b/delft3dworker/management/commands/scanbucket.py @@ -19,7 +19,6 @@ class Command(BaseCommand): help = "scan local files for finished models and update models" def handle(self, *args, **options): - # STEP I : Find finished models fin_scenes = Scene.objects.filter(phase=Scene.phases.fin) diff --git a/delft3dworker/management/commands/sync_cluster_state.py b/delft3dworker/management/commands/sync_cluster_state.py index 7587b546..a200dfeb 100644 --- a/delft3dworker/management/commands/sync_cluster_state.py +++ b/delft3dworker/management/commands/sync_cluster_state.py @@ -1,8 +1,6 @@ -import logging from json import loads from time import sleep -from celery.result import AsyncResult from django.core.management import BaseCommand from delft3dcontainermanager.tasks import do_argo_remove, get_argo_workflows @@ -22,7 +20,6 @@ class Command(BaseCommand): help = "Sync cluster workflows with workflow and scene models." def handle(self, *args, **options): - # STEP I : Parse finished Celery tasks for Workflow models # Sets task_uuid to None except for when a task is queued self._update_workflow_tasks() @@ -30,7 +27,6 @@ def handle(self, *args, **options): # STEP II : Get current workflows on cluster and sync with # Djang workflows models if self._get_latest_workflows_status(): - # STEP III : Update Scenes and their Phases # Controls workflow desired states self._update_scene_phases() diff --git a/delft3dworker/management/commands/synchronize_data_sources.py b/delft3dworker/management/commands/synchronize_data_sources.py index c5317d37..1c885b83 100644 --- a/delft3dworker/management/commands/synchronize_data_sources.py +++ b/delft3dworker/management/commands/synchronize_data_sources.py @@ -1,12 +1,12 @@ from __future__ import print_function import datetime -from os import listdir, walk -from os.path import dirname, join, split +from os import walk +from os.path import join from shutil import rmtree from django.conf import settings # noqa -from django.core.management.base import BaseCommand, CommandError +from django.core.management.base import BaseCommand from delft3dworker.models import Scene @@ -19,9 +19,7 @@ class Command(BaseCommand): """ def handle(self, *args, **options): - with open("synchronize_data_sources.log", "a") as file: - file.write( "==================== Data Sync started -- {}\n".format( str(datetime.datetime.now()) @@ -67,7 +65,6 @@ def handle(self, *args, **options): # ######################################### get input on what to do next: if len(unlinked) > 0: - self.stdout.write("") self.stdout.write( "================================================================================" @@ -87,13 +84,11 @@ def handle(self, *args, **options): self.stdout.write("") resp = "" - while not resp in ["y", "n"]: + while resp not in ["y", "n"]: self.stdout.write( "## You can now enter a procedure which allows you to remove these directories." ) - resp = ( - raw_input("## Do you want to proceed? [y/N]: ").lower() or "n" - ) + resp = input("## Do you want to proceed? [y/N]: ").lower() or "n" removedirs = True if resp == "y" else False @@ -103,15 +98,13 @@ def handle(self, *args, **options): self.stdout.ending = "" if removedirs: - rem = "s" for directory in unlinked: - try: if not rem == "a": rem = ( - raw_input( + input( "{}: skip (default), delete, all? [S/d/a]: ".format( directory ) @@ -129,7 +122,7 @@ def handle(self, *args, **options): else: self.stdout.write("-- Skipping {}\n".format(directory)) - except KeyboardInterrupt as e: + except KeyboardInterrupt: self.stdout.write("\n") exit(1) @@ -145,14 +138,12 @@ def handle(self, *args, **options): self.stdout.ending = "\n" else: - self.stdout.write("") self.stdout.write('No "orphaned" simulation results found on disk.') # ######################################### get input on what to do next: if len(unstored) > 0: - self.stdout.write("") self.stdout.write( "================================================================================" @@ -176,13 +167,11 @@ def handle(self, *args, **options): ) resp = "" - while not resp in ["y", "n"]: + while resp not in ["y", "n"]: self.stdout.write( "\n## You can now enter a procedure which allows you to reset these simulations." ) - resp = ( - raw_input("## Do you want to proceed? [y/N]: ").lower() or "n" - ) + resp = input("## Do you want to proceed? [y/N]: ").lower() or "n" resetsims = True if resp == "y" else False @@ -192,16 +181,14 @@ def handle(self, *args, **options): self.stdout.ending = "" if resetsims: - rem = "s" for sim in unstored: - try: scene = Scene.objects.get(workingdir=directory + "/") rem = ( - raw_input( + input( "{}: skip (default), reset, delete? [S/r/d]: ".format( scene ) @@ -210,7 +197,6 @@ def handle(self, *args, **options): ) if rem in ["r"]: - if scene.phase == scene.phases.fin: self.stdout.write( '-- Resetting Scene "{}"... '.format(scene) @@ -226,7 +212,6 @@ def handle(self, *args, **options): ) elif rem in ["d"]: - self.stdout.write( '-- Deleting Scene "{}"... '.format(scene) ) @@ -235,10 +220,9 @@ def handle(self, *args, **options): self.stdout.write("done\n") else: - self.stdout.write('-- Skipping "{}"\n'.format(scene)) - except KeyboardInterrupt as e: + except KeyboardInterrupt: self.stdout.write("\n") exit(1) @@ -254,7 +238,6 @@ def handle(self, *args, **options): self.stdout.write("-- Skipping reset simulations procedure...\n") else: - self.stdout.write("") self.stdout.write('No "orphaned" simulation entries found in database.') @@ -267,7 +250,7 @@ def handle(self, *args, **options): self.stdout.write(" SYNCHRONIZATION PROCEDURE DONE") self.stdout.write("") self.stdout.write( - " A log is written to file: synchronize_data_sources.log".format(file) + " A log is written to file: synchronize_data_sources.log".format() ) self.stdout.write("") self.stdout.write( diff --git a/delft3dworker/migrations/0001_initial.py b/delft3dworker/migrations/0001_initial.py index 3b83868b..f745e51a 100644 --- a/delft3dworker/migrations/0001_initial.py +++ b/delft3dworker/migrations/0001_initial.py @@ -1,30 +1,155 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.1 on 2016-01-28 09:22 -from __future__ import unicode_literals +# Generated by Django 3.2.25 on 2024-07-05 13:14 +import delft3dworker.models +import delft3dworker.utils +from django.conf import settings +import django.contrib.auth.models from django.db import migrations, models +import django.db.models.deletion +import uuid class Migration(migrations.Migration): initial = True - dependencies = [] + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ('auth', '0012_alter_user_first_name_max_length'), + ] operations = [ migrations.CreateModel( - name="WorkerTask", + name='Scenario', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=256)), + ('scenes_parameters', delft3dworker.models.JSONFieldTransition(blank=True, default=dict)), + ('parameters', delft3dworker.models.JSONFieldTransition(blank=True, default=dict)), + ('state', models.CharField(default='CREATED', max_length=64)), + ('progress', models.IntegerField(default=0)), + ('owner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ], + ), + migrations.CreateModel( + name='Scene', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=256)), + ('suid', models.UUIDField(default=uuid.uuid4, editable=False)), + ('date_created', models.DateTimeField(blank=True, default=delft3dworker.utils.tz_now)), + ('date_started', models.DateTimeField(blank=True, null=True)), + ('fileurl', models.CharField(max_length=256)), + ('info', delft3dworker.models.JSONFieldTransition(blank=True, default=dict)), + ('parameters', delft3dworker.models.JSONFieldTransition(blank=True, default=dict)), + ('state', models.CharField(default='CREATED', max_length=256)), + ('progress', models.IntegerField(default=0)), + ('task_id', models.CharField(blank=True, max_length=256)), + ('workingdir', models.CharField(max_length=256)), + ('parameters_hash', models.CharField(blank=True, max_length=64)), + ('shared', models.CharField(choices=[('p', 'private'), ('c', 'company'), ('w', 'world')], max_length=1)), + ('phase', models.PositiveSmallIntegerField(choices=[(0, 'New'), (6, 'Idle: waiting for user input'), (11, 'Starting workflow'), (12, 'Running workflow'), (13, 'Removing workflow'), (20, 'Stopping workflow'), (21, 'Removing stopped workflow'), (500, 'Finished'), (501, 'Failed'), (502, 'Stopped')], default=0)), + ('owner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ('scenario', models.ManyToManyField(blank=True, to='delft3dworker.Scenario')), + ], + options={ + 'permissions': [('extended_view_scene', 'Can view scene with actions.')], + }, + ), + migrations.CreateModel( + name='SearchForm', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=256)), + ('templates', delft3dworker.models.JSONFieldTransition(default=list)), + ('sections', delft3dworker.models.JSONFieldTransition(default=list)), + ], + ), + migrations.CreateModel( + name='Template', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=256)), + ('shortname', models.CharField(default=dict, max_length=256)), + ('meta', delft3dworker.models.JSONFieldTransition(blank=True, default=dict)), + ('info', delft3dworker.models.JSONFieldTransition(blank=True, default=dict)), + ('sections', delft3dworker.models.JSONFieldTransition(blank=True, default=dict)), + ('visualisation', delft3dworker.models.JSONFieldTransition(blank=True, default=dict)), + ('export_options', delft3dworker.models.JSONFieldTransition(blank=True, default=dict)), + ('yaml_template', models.FileField(default='', upload_to=delft3dworker.models.parse_argo_workflow)), + ], + ), + migrations.CreateModel( + name='Version_Docker', + fields=[ + ('release', models.CharField(db_index=True, max_length=256)), + ('revision', models.AutoField(primary_key=True, serialize=False)), + ('versions', delft3dworker.models.JSONFieldTransition(default=dict)), + ('changelog', models.CharField(max_length=256)), + ('reviewed', models.BooleanField(default=False)), + ('template', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='versions', to='delft3dworker.template')), + ], + options={ + 'verbose_name': 'Docker version', + 'verbose_name_plural': 'Docker versions', + 'ordering': ['-revision'], + }, + ), + migrations.CreateModel( + name='GroupUsageSummary', + fields=[ + ], + options={ + 'verbose_name': 'Group Usage Summary', + 'verbose_name_plural': 'Group Usage Summary', + 'proxy': True, + 'indexes': [], + 'constraints': [], + }, + bases=('auth.group',), + managers=[ + ('objects', django.contrib.auth.models.GroupManager()), + ], + ), + migrations.CreateModel( + name='UserUsageSummary', + fields=[ + ], + options={ + 'verbose_name': 'User Usage Summary', + 'verbose_name_plural': 'User Usage Summary', + 'proxy': True, + 'indexes': [], + 'constraints': [], + }, + bases=('auth.user',), + managers=[ + ('objects', django.contrib.auth.models.UserManager()), + ], + ), + migrations.CreateModel( + name='Workflow', fields=[ - ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("name", models.CharField(max_length=256)), + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=256, unique=True)), + ('entrypoint', models.CharField(max_length=64, null=True)), + ('starttime', models.DateTimeField(blank=True, default=delft3dworker.utils.tz_now)), + ('stoptime', models.DateTimeField(blank=True, null=True)), + ('yaml', models.FileField(default='', upload_to='workflows/')), + ('task_uuid', models.UUIDField(blank=True, default=None, null=True)), + ('task_starttime', models.DateTimeField(blank=True, default=delft3dworker.utils.tz_now)), + ('desired_state', models.CharField(choices=[('non-existent', 'Non-existent'), ('pending', 'Pending'), ('unknown', 'Unknown'), ('running', 'Running'), ('paused', 'Running (Suspended)'), ('succeeded', 'Succeeded'), ('skipped', 'Skipped'), ('failed', 'Failed'), ('error', 'Error')], default='non-existent', max_length=16)), + ('cluster_state', models.CharField(choices=[('non-existent', 'Non-existent'), ('pending', 'Pending'), ('unknown', 'Unknown'), ('running', 'Running'), ('paused', 'Running (Suspended)'), ('succeeded', 'Succeeded'), ('skipped', 'Skipped'), ('failed', 'Failed'), ('error', 'Error')], default='non-existent', max_length=16)), + ('progress', models.PositiveSmallIntegerField(default=0)), + ('cluster_log', models.TextField(blank=True, default='')), + ('action_log', models.TextField(blank=True, default='')), + ('scene', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='delft3dworker.scene')), + ('version', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='delft3dworker.version_docker')), ], ), + migrations.AddField( + model_name='scenario', + name='template', + field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='delft3dworker.template'), + ), ] diff --git a/delft3dworker/migrations/0002_modelruns.py b/delft3dworker/migrations/0002_modelruns.py deleted file mode 100644 index 943762f3..00000000 --- a/delft3dworker/migrations/0002_modelruns.py +++ /dev/null @@ -1,34 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.1 on 2016-01-28 09:46 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0001_initial"), - ] - - operations = [ - migrations.CreateModel( - name="ModelRuns", - fields=[ - ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("name", models.CharField(max_length=256)), - ("uuid", models.CharField(max_length=256)), - ("status", models.CharField(max_length=256)), - ("progress", models.IntegerField()), - ("timeleft", models.IntegerField()), - ], - ), - ] diff --git a/delft3dworker/migrations/0003_auto_20160128_0349.py b/delft3dworker/migrations/0003_auto_20160128_0349.py deleted file mode 100644 index 7b7e0e62..00000000 --- a/delft3dworker/migrations/0003_auto_20160128_0349.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.1 on 2016-01-28 09:49 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0002_modelruns"), - ] - - operations = [ - migrations.RenameModel( - old_name="ModelRuns", - new_name="ModelRun", - ), - migrations.DeleteModel( - name="WorkerTask", - ), - ] diff --git a/delft3dworker/migrations/0004_auto_20160201_1516.py b/delft3dworker/migrations/0004_auto_20160201_1516.py deleted file mode 100644 index 855cac5e..00000000 --- a/delft3dworker/migrations/0004_auto_20160201_1516.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.1 on 2016-02-01 15:16 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0003_auto_20160128_0349"), - ] - - operations = [ - migrations.RenameModel( - old_name="ModelRun", - new_name="Delft3DWorker", - ), - ] diff --git a/delft3dworker/migrations/0005_delft3dworker_json.py b/delft3dworker/migrations/0005_delft3dworker_json.py deleted file mode 100644 index aee7d90d..00000000 --- a/delft3dworker/migrations/0005_delft3dworker_json.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.1 on 2016-02-01 15:30 -from __future__ import unicode_literals - -import jsonfield.fields -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0004_auto_20160201_1516"), - ] - - operations = [ - migrations.AddField( - model_name="delft3dworker", - name="json", - field=jsonfield.fields.JSONField(default=dict), - ), - ] diff --git a/delft3dworker/migrations/0006_auto_20160202_1341.py b/delft3dworker/migrations/0006_auto_20160202_1341.py deleted file mode 100644 index 06765283..00000000 --- a/delft3dworker/migrations/0006_auto_20160202_1341.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.2 on 2016-02-02 13:41 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0005_delft3dworker_json"), - ] - - operations = [ - migrations.AddField( - model_name="delft3dworker", - name="workingdir", - field=models.CharField(default="", editable=False, max_length=256), - preserve_default=False, - ), - migrations.AlterField( - model_name="delft3dworker", - name="uuid", - field=models.CharField(editable=False, max_length=256), - ), - ] diff --git a/delft3dworker/migrations/0007_delft3dworker_workerid.py b/delft3dworker/migrations/0007_delft3dworker_workerid.py deleted file mode 100644 index 3a547516..00000000 --- a/delft3dworker/migrations/0007_delft3dworker_workerid.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.2 on 2016-02-03 13:30 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0006_auto_20160202_1341"), - ] - - operations = [ - migrations.AddField( - model_name="delft3dworker", - name="workerid", - field=models.CharField(default=0, editable=False, max_length=256), - preserve_default=False, - ), - ] diff --git a/delft3dworker/migrations/0008_delft3dworker_info.py b/delft3dworker/migrations/0008_delft3dworker_info.py deleted file mode 100644 index 4d644f3e..00000000 --- a/delft3dworker/migrations/0008_delft3dworker_info.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.2 on 2016-02-04 10:47 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0007_delft3dworker_workerid"), - ] - - operations = [ - migrations.AddField( - model_name="delft3dworker", - name="info", - field=models.CharField(default="", max_length=256), - preserve_default=False, - ), - ] diff --git a/delft3dworker/migrations/0009_auto_20160205_1206.py b/delft3dworker/migrations/0009_auto_20160205_1206.py deleted file mode 100644 index 11c79466..00000000 --- a/delft3dworker/migrations/0009_auto_20160205_1206.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.2 on 2016-02-05 12:06 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0008_delft3dworker_info"), - ] - - operations = [ - migrations.RemoveField( - model_name="delft3dworker", - name="progress", - ), - migrations.RemoveField( - model_name="delft3dworker", - name="timeleft", - ), - migrations.AddField( - model_name="delft3dworker", - name="fileurl", - field=models.CharField(default="", editable=False, max_length=256), - preserve_default=False, - ), - ] diff --git a/delft3dworker/migrations/0010_celerytask_postprocessingtask_processingtask_scene_simulationtask.py b/delft3dworker/migrations/0010_celerytask_postprocessingtask_processingtask_scene_simulationtask.py deleted file mode 100644 index b80785c6..00000000 --- a/delft3dworker/migrations/0010_celerytask_postprocessingtask_processingtask_scene_simulationtask.py +++ /dev/null @@ -1,122 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import jsonfield.fields -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0009_auto_20160205_1206"), - ] - - operations = [ - migrations.CreateModel( - name="CeleryTask", - fields=[ - ( - "id", - models.AutoField( - verbose_name="ID", - serialize=False, - auto_created=True, - primary_key=True, - ), - ), - ("uuid", models.CharField(max_length=256)), - ("state", models.CharField(max_length=256, blank=True)), - ("state_meta", jsonfield.fields.JSONField(default=dict, blank=True)), - ], - ), - migrations.CreateModel( - name="Scene", - fields=[ - ( - "id", - models.AutoField( - verbose_name="ID", - serialize=False, - auto_created=True, - primary_key=True, - ), - ), - ("suid", models.CharField(max_length=256, editable=False)), - ("workingdir", models.CharField(max_length=256)), - ("fileurl", models.CharField(max_length=256)), - ("name", models.CharField(max_length=256)), - ("state", models.CharField(max_length=256, blank=True)), - ("info", models.CharField(max_length=256, blank=True)), - ("json", jsonfield.fields.JSONField(default=dict)), - ], - ), - migrations.CreateModel( - name="PostprocessingTask", - fields=[ - ( - "celerytask_ptr", - models.OneToOneField( - parent_link=True, - auto_created=True, - primary_key=True, - serialize=False, - to="delft3dworker.CeleryTask", - on_delete=models.CASCADE, - ), - ), - ( - "scene", - models.ForeignKey( - to="delft3dworker.Scene", on_delete=models.CASCADE - ), - ), - ], - bases=("delft3dworker.celerytask",), - ), - migrations.CreateModel( - name="ProcessingTask", - fields=[ - ( - "celerytask_ptr", - models.OneToOneField( - parent_link=True, - auto_created=True, - primary_key=True, - serialize=False, - to="delft3dworker.CeleryTask", - on_delete=models.CASCADE, - ), - ), - ( - "scene", - models.OneToOneField( - to="delft3dworker.Scene", on_delete=models.CASCADE - ), - ), - ], - bases=("delft3dworker.celerytask",), - ), - migrations.CreateModel( - name="SimulationTask", - fields=[ - ( - "celerytask_ptr", - models.OneToOneField( - parent_link=True, - auto_created=True, - primary_key=True, - serialize=False, - to="delft3dworker.CeleryTask", - on_delete=models.CASCADE, - ), - ), - ( - "scene", - models.OneToOneField( - to="delft3dworker.Scene", on_delete=models.CASCADE - ), - ), - ], - bases=("delft3dworker.celerytask",), - ), - ] diff --git a/delft3dworker/migrations/0011_auto_20160317_1116.py b/delft3dworker/migrations/0011_auto_20160317_1116.py deleted file mode 100644 index 6d724556..00000000 --- a/delft3dworker/migrations/0011_auto_20160317_1116.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.9.4 on 2016-03-17 11:16 -from __future__ import unicode_literals - -import jsonfield.fields -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ( - "delft3dworker", - "0010_celerytask_postprocessingtask_processingtask_scene_simulationtask", - ), - ] - - operations = [ - migrations.RemoveField( - model_name="scene", - name="json", - ), - migrations.AlterField( - model_name="scene", - name="info", - field=jsonfield.fields.JSONField(default=dict), - ), - ] diff --git a/delft3dworker/migrations/0012_auto_20160317_1423.py b/delft3dworker/migrations/0012_auto_20160317_1423.py deleted file mode 100644 index 39293ba0..00000000 --- a/delft3dworker/migrations/0012_auto_20160317_1423.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import jsonfield.fields -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0011_auto_20160317_1116"), - ] - - operations = [ - migrations.AlterField( - model_name="scene", - name="info", - field=jsonfield.fields.JSONField(default=dict, blank=True), - ), - ] diff --git a/delft3dworker/migrations/0013_delete_delft3dworker.py b/delft3dworker/migrations/0013_delete_delft3dworker.py deleted file mode 100644 index 13a16ad6..00000000 --- a/delft3dworker/migrations/0013_delete_delft3dworker.py +++ /dev/null @@ -1,17 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0012_auto_20160317_1423"), - ] - - operations = [ - migrations.DeleteModel( - name="Delft3DWorker", - ), - ] diff --git a/delft3dworker/migrations/0014_scenario.py b/delft3dworker/migrations/0014_scenario.py deleted file mode 100644 index 923de0dd..00000000 --- a/delft3dworker/migrations/0014_scenario.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0013_delete_delft3dworker"), - ] - - operations = [ - migrations.CreateModel( - name="Scenario", - fields=[ - ( - "id", - models.AutoField( - verbose_name="ID", - serialize=False, - auto_created=True, - primary_key=True, - ), - ), - ("name", models.CharField(max_length=256)), - ], - ), - ] diff --git a/delft3dworker/migrations/0014_scene_task_id.py b/delft3dworker/migrations/0014_scene_task_id.py deleted file mode 100644 index e90c61f8..00000000 --- a/delft3dworker/migrations/0014_scene_task_id.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0013_delete_delft3dworker"), - ] - - operations = [ - migrations.AddField( - model_name="scene", - name="task_id", - field=models.CharField( - default="default value for backported scene", max_length=256 - ), - preserve_default=False, - ), - ] diff --git a/delft3dworker/migrations/0015_template.py b/delft3dworker/migrations/0015_template.py deleted file mode 100644 index 3243f1fb..00000000 --- a/delft3dworker/migrations/0015_template.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import jsonfield.fields -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0014_scenario"), - ] - - operations = [ - migrations.CreateModel( - name="Template", - fields=[ - ( - "id", - models.AutoField( - verbose_name="ID", - serialize=False, - auto_created=True, - primary_key=True, - ), - ), - ("name", models.CharField(max_length=256)), - ("json", jsonfield.fields.JSONField(default=dict, blank=True)), - ], - ), - ] diff --git a/delft3dworker/migrations/0016_auto_20160318_1719.py b/delft3dworker/migrations/0016_auto_20160318_1719.py deleted file mode 100644 index e0ad1b27..00000000 --- a/delft3dworker/migrations/0016_auto_20160318_1719.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0015_template"), - ] - - operations = [ - migrations.RenameField( - model_name="template", - old_name="name", - new_name="templatename", - ), - migrations.RenameField( - model_name="template", - old_name="json", - new_name="variables", - ), - migrations.AddField( - model_name="template", - name="description", - field=models.CharField(max_length=256, blank=True), - ), - migrations.AddField( - model_name="template", - name="email", - field=models.CharField(max_length=256, blank=True), - ), - migrations.AddField( - model_name="template", - name="label", - field=models.CharField(max_length=256, blank=True), - ), - migrations.AddField( - model_name="template", - name="model", - field=models.CharField(max_length=256, blank=True), - ), - migrations.AddField( - model_name="template", - name="site", - field=models.CharField(max_length=256, blank=True), - ), - migrations.AddField( - model_name="template", - name="version", - field=models.IntegerField(default=1, max_length=256, blank=True), - preserve_default=False, - ), - ] diff --git a/delft3dworker/migrations/0017_template_groups.py b/delft3dworker/migrations/0017_template_groups.py deleted file mode 100644 index 1451b29b..00000000 --- a/delft3dworker/migrations/0017_template_groups.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import jsonfield.fields -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0016_auto_20160318_1719"), - ] - - operations = [ - migrations.AddField( - model_name="template", - name="groups", - field=jsonfield.fields.JSONField(default=dict, blank=True), - ), - ] diff --git a/delft3dworker/migrations/0018_merge.py b/delft3dworker/migrations/0018_merge.py deleted file mode 100644 index 36d84fc1..00000000 --- a/delft3dworker/migrations/0018_merge.py +++ /dev/null @@ -1,14 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0017_template_groups"), - ("delft3dworker", "0014_scene_task_id"), - ] - - operations = [] diff --git a/delft3dworker/migrations/0019_auto_20160421_1319.py b/delft3dworker/migrations/0019_auto_20160421_1319.py deleted file mode 100644 index 8c3a5f7c..00000000 --- a/delft3dworker/migrations/0019_auto_20160421_1319.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import jsonfield.fields -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0018_merge"), - ] - - operations = [ - migrations.AddField( - model_name="scenario", - name="parameters", - field=jsonfield.fields.JSONField(default=dict, blank=True), - ), - migrations.AddField( - model_name="scenario", - name="template", - field=models.OneToOneField( - null=True, to="delft3dworker.Template", on_delete=models.CASCADE - ), - ), - migrations.AddField( - model_name="scene", - name="parameters", - field=jsonfield.fields.JSONField(default=dict, blank=True), - ), - migrations.AddField( - model_name="scene", - name="scenario", - field=models.ForeignKey( - to="delft3dworker.Scenario", null=True, on_delete=models.CASCADE - ), - ), - migrations.AlterField( - model_name="template", - name="version", - field=models.IntegerField(blank=True), - ), - ] diff --git a/delft3dworker/migrations/0020_auto_20160422_2304.py b/delft3dworker/migrations/0020_auto_20160422_2304.py deleted file mode 100644 index 8e609677..00000000 --- a/delft3dworker/migrations/0020_auto_20160422_2304.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0019_auto_20160421_1319"), - ] - - operations = [ - migrations.RemoveField( - model_name="postprocessingtask", - name="celerytask_ptr", - ), - migrations.RemoveField( - model_name="postprocessingtask", - name="scene", - ), - migrations.RemoveField( - model_name="processingtask", - name="celerytask_ptr", - ), - migrations.RemoveField( - model_name="processingtask", - name="scene", - ), - migrations.RemoveField( - model_name="simulationtask", - name="celerytask_ptr", - ), - migrations.RemoveField( - model_name="simulationtask", - name="scene", - ), - migrations.DeleteModel( - name="CeleryTask", - ), - migrations.DeleteModel( - name="PostprocessingTask", - ), - migrations.DeleteModel( - name="ProcessingTask", - ), - migrations.DeleteModel( - name="SimulationTask", - ), - ] diff --git a/delft3dworker/migrations/0021_auto_20160525_1826.py b/delft3dworker/migrations/0021_auto_20160525_1826.py deleted file mode 100644 index 218fee7c..00000000 --- a/delft3dworker/migrations/0021_auto_20160525_1826.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import jsonfield.fields -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0020_auto_20160422_2304"), - ] - - operations = [ - migrations.RenameField( - model_name="scenario", - old_name="parameters", - new_name="input_parameters", - ), - migrations.AddField( - model_name="scenario", - name="scenes_parameters", - field=jsonfield.fields.JSONField(default=dict, blank=True), - ), - ] diff --git a/delft3dworker/migrations/0022_auto_20160525_1906.py b/delft3dworker/migrations/0022_auto_20160525_1906.py deleted file mode 100644 index c07124d1..00000000 --- a/delft3dworker/migrations/0022_auto_20160525_1906.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0021_auto_20160525_1826"), - ] - - operations = [ - migrations.RenameField( - model_name="scenario", - old_name="input_parameters", - new_name="parameters", - ), - ] diff --git a/delft3dworker/migrations/0023_auto_20160531_0851.py b/delft3dworker/migrations/0023_auto_20160531_0851.py deleted file mode 100644 index ac2b1cb1..00000000 --- a/delft3dworker/migrations/0023_auto_20160531_0851.py +++ /dev/null @@ -1,58 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import jsonfield.fields -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0022_auto_20160525_1906"), - ] - - operations = [ - migrations.RenameField( - model_name="template", - old_name="templatename", - new_name="name", - ), - migrations.RenameField( - model_name="template", - old_name="variables", - new_name="sections", - ), - migrations.RemoveField( - model_name="template", - name="description", - ), - migrations.RemoveField( - model_name="template", - name="email", - ), - migrations.RemoveField( - model_name="template", - name="groups", - ), - migrations.RemoveField( - model_name="template", - name="label", - ), - migrations.RemoveField( - model_name="template", - name="model", - ), - migrations.RemoveField( - model_name="template", - name="site", - ), - migrations.RemoveField( - model_name="template", - name="version", - ), - migrations.AddField( - model_name="template", - name="meta", - field=jsonfield.fields.JSONField(default=dict, blank=True), - ), - ] diff --git a/delft3dworker/migrations/0024_auto_20160602_0715.py b/delft3dworker/migrations/0024_auto_20160602_0715.py deleted file mode 100644 index cca956a2..00000000 --- a/delft3dworker/migrations/0024_auto_20160602_0715.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0023_auto_20160531_0851"), - ] - - operations = [ - migrations.AlterField( - model_name="scenario", - name="template", - field=models.ForeignKey( - to="delft3dworker.Template", null=True, on_delete=models.CASCADE - ), - ), - ] diff --git a/delft3dworker/migrations/0025_auto_20160602_0955.py b/delft3dworker/migrations/0025_auto_20160602_0955.py deleted file mode 100644 index 46609ef3..00000000 --- a/delft3dworker/migrations/0025_auto_20160602_0955.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0024_auto_20160602_0715"), - ] - - operations = [ - migrations.RenameField( - model_name="scenario", - old_name="template", - new_name="template_url", - ), - migrations.RenameField( - model_name="scene", - old_name="scenario", - new_name="scenario_url", - ), - ] diff --git a/delft3dworker/migrations/0025_auto_20160602_1100.py b/delft3dworker/migrations/0025_auto_20160602_1100.py deleted file mode 100644 index 90d20935..00000000 --- a/delft3dworker/migrations/0025_auto_20160602_1100.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.conf import settings -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), - ("delft3dworker", "0024_auto_20160602_0715"), - ] - - operations = [ - migrations.AddField( - model_name="scenario", - name="owner_url", - field=models.ForeignKey( - to=settings.AUTH_USER_MODEL, null=True, on_delete=models.CASCADE - ), - ), - migrations.AddField( - model_name="scene", - name="owner_url", - field=models.ForeignKey( - to=settings.AUTH_USER_MODEL, null=True, on_delete=models.CASCADE - ), - ), - ] diff --git a/delft3dworker/migrations/0026_auto_20160602_1334.py b/delft3dworker/migrations/0026_auto_20160602_1334.py deleted file mode 100644 index a3137867..00000000 --- a/delft3dworker/migrations/0026_auto_20160602_1334.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0025_auto_20160602_0955"), - ] - - operations = [ - migrations.RenameField( - model_name="scenario", - old_name="template_url", - new_name="template", - ), - migrations.RenameField( - model_name="scene", - old_name="scenario_url", - new_name="scenario", - ), - ] diff --git a/delft3dworker/migrations/0026_merge.py b/delft3dworker/migrations/0026_merge.py deleted file mode 100644 index 5a844fcb..00000000 --- a/delft3dworker/migrations/0026_merge.py +++ /dev/null @@ -1,14 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0025_auto_20160602_0955"), - ("delft3dworker", "0025_auto_20160602_1100"), - ] - - operations = [] diff --git a/delft3dworker/migrations/0027_auto_20160602_1435.py b/delft3dworker/migrations/0027_auto_20160602_1435.py deleted file mode 100644 index 35025fd0..00000000 --- a/delft3dworker/migrations/0027_auto_20160602_1435.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0026_auto_20160602_1334"), - ] - - operations = [ - migrations.AlterField( - model_name="scenario", - name="template", - field=models.ForeignKey( - blank=True, - to="delft3dworker.Template", - null=True, - on_delete=models.CASCADE, - ), - ), - ] diff --git a/delft3dworker/migrations/0027_merge.py b/delft3dworker/migrations/0027_merge.py deleted file mode 100644 index d1b37573..00000000 --- a/delft3dworker/migrations/0027_merge.py +++ /dev/null @@ -1,14 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0026_merge"), - ("delft3dworker", "0026_auto_20160602_1334"), - ] - - operations = [] diff --git a/delft3dworker/migrations/0028_auto_20160602_1433.py b/delft3dworker/migrations/0028_auto_20160602_1433.py deleted file mode 100644 index 4a085521..00000000 --- a/delft3dworker/migrations/0028_auto_20160602_1433.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0027_merge"), - ] - - operations = [ - migrations.RenameField( - model_name="scenario", - old_name="owner_url", - new_name="owner", - ), - migrations.RenameField( - model_name="scene", - old_name="owner_url", - new_name="owner", - ), - ] diff --git a/delft3dworker/migrations/0029_auto_20160531_0908.py b/delft3dworker/migrations/0029_auto_20160531_0908.py deleted file mode 100644 index ab57c5f3..00000000 --- a/delft3dworker/migrations/0029_auto_20160531_0908.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0028_auto_20160602_1433"), - ] - - operations = [ - migrations.AlterModelOptions( - name="scenario", - options={ - "default_permissions": ("view",), - "permissions": (("view_scenario", "View Scenario"),), - }, - ), - migrations.AlterModelOptions( - name="scene", - options={ - "default_permissions": ("view",), - "permissions": (("view_scene", "View Scene"),), - }, - ), - migrations.AlterModelOptions( - name="template", - options={ - "default_permissions": ("view",), - "permissions": (("view_template", "View Template"),), - }, - ), - ] diff --git a/delft3dworker/migrations/0029_merge.py b/delft3dworker/migrations/0029_merge.py deleted file mode 100644 index 7bd0e0a2..00000000 --- a/delft3dworker/migrations/0029_merge.py +++ /dev/null @@ -1,14 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0028_auto_20160602_1433"), - ("delft3dworker", "0027_auto_20160602_1435"), - ] - - operations = [] diff --git a/delft3dworker/migrations/0030_auto_20160531_0922.py b/delft3dworker/migrations/0030_auto_20160531_0922.py deleted file mode 100644 index 19ba160c..00000000 --- a/delft3dworker/migrations/0030_auto_20160531_0922.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0029_auto_20160531_0908"), - ] - - operations = [ - migrations.AlterModelOptions( - name="scenario", - options={"permissions": (("view_scenario", "View Scenario"),)}, - ), - migrations.AlterModelOptions( - name="scene", - options={"permissions": (("view_scene", "View Scene"),)}, - ), - ] diff --git a/delft3dworker/migrations/0031_auto_20160531_0923.py b/delft3dworker/migrations/0031_auto_20160531_0923.py deleted file mode 100644 index c6558617..00000000 --- a/delft3dworker/migrations/0031_auto_20160531_0923.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0030_auto_20160531_0922"), - ] - - operations = [ - migrations.AlterModelOptions( - name="template", - options={"permissions": (("view_template", "View Template"),)}, - ), - ] diff --git a/delft3dworker/migrations/0032_merge.py b/delft3dworker/migrations/0032_merge.py deleted file mode 100644 index c01608f4..00000000 --- a/delft3dworker/migrations/0032_merge.py +++ /dev/null @@ -1,14 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0027_auto_20160602_1435"), - ("delft3dworker", "0031_auto_20160531_0923"), - ] - - operations = [] diff --git a/delft3dworker/migrations/0033_merge.py b/delft3dworker/migrations/0033_merge.py deleted file mode 100644 index 279bda2d..00000000 --- a/delft3dworker/migrations/0033_merge.py +++ /dev/null @@ -1,14 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0029_merge"), - ("delft3dworker", "0032_merge"), - ] - - operations = [] diff --git a/delft3dworker/migrations/0034_scene_shared.py b/delft3dworker/migrations/0034_scene_shared.py deleted file mode 100644 index 2f7c1487..00000000 --- a/delft3dworker/migrations/0034_scene_shared.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0033_merge"), - ] - - operations = [ - migrations.AddField( - model_name="scene", - name="shared", - field=models.CharField( - default="p", - max_length=1, - choices=[("p", "private"), ("c", "company"), ("w", "world")], - ), - preserve_default=False, - ), - ] diff --git a/delft3dworker/migrations/0035_auto_20160527_1326.py b/delft3dworker/migrations/0035_auto_20160527_1326.py deleted file mode 100644 index e6d54e04..00000000 --- a/delft3dworker/migrations/0035_auto_20160527_1326.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0034_scene_shared"), - ] - - operations = [ - migrations.AddField( - model_name="scene", - name="parameters_hash", - field=models.CharField(unique=True, max_length=64, blank=True), - ), - migrations.RemoveField( - model_name="scene", - name="scenario", - ), - migrations.AddField( - model_name="scene", - name="scenario", - field=models.ManyToManyField(to="delft3dworker.Scenario", null=True), - ), - ] diff --git a/delft3dworker/migrations/0036_auto_20160527_1445.py b/delft3dworker/migrations/0036_auto_20160527_1445.py deleted file mode 100644 index 6243f241..00000000 --- a/delft3dworker/migrations/0036_auto_20160527_1445.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0035_auto_20160527_1326"), - ] - - operations = [ - migrations.AlterField( - model_name="scene", - name="parameters_hash", - field=models.CharField(max_length=64, blank=True), - ), - ] diff --git a/delft3dworker/migrations/0037_auto_20160608_2304.py b/delft3dworker/migrations/0037_auto_20160608_2304.py deleted file mode 100644 index 1a17b718..00000000 --- a/delft3dworker/migrations/0037_auto_20160608_2304.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0036_auto_20160527_1445"), - ] - - operations = [ - migrations.AlterField( - model_name="scene", - name="scenario", - field=models.ManyToManyField(to="delft3dworker.Scenario"), - ), - ] diff --git a/delft3dworker/migrations/0038_searchform.py b/delft3dworker/migrations/0038_searchform.py deleted file mode 100644 index be6977dc..00000000 --- a/delft3dworker/migrations/0038_searchform.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import jsonfield.fields -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0037_auto_20160608_2304"), - ] - - operations = [ - migrations.CreateModel( - name="SearchForm", - fields=[ - ( - "id", - models.AutoField( - verbose_name="ID", - serialize=False, - auto_created=True, - primary_key=True, - ), - ), - ("name", models.CharField(max_length=256)), - ("sections", jsonfield.fields.JSONField(default=dict, blank=True)), - ], - ), - ] diff --git a/delft3dworker/migrations/0039_auto_20160706_1418.py b/delft3dworker/migrations/0039_auto_20160706_1418.py deleted file mode 100644 index d68834c7..00000000 --- a/delft3dworker/migrations/0039_auto_20160706_1418.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import jsonfield.fields -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0038_searchform"), - ] - - operations = [ - migrations.AlterField( - model_name="searchform", - name="sections", - field=jsonfield.fields.JSONField(default=[]), - ), - ] diff --git a/delft3dworker/migrations/0040_searchform_templates.py b/delft3dworker/migrations/0040_searchform_templates.py deleted file mode 100644 index a21b0e77..00000000 --- a/delft3dworker/migrations/0040_searchform_templates.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import jsonfield.fields -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0039_auto_20160706_1418"), - ] - - operations = [ - migrations.AddField( - model_name="searchform", - name="templates", - field=jsonfield.fields.JSONField(default=[]), - ), - ] diff --git a/delft3dworker/migrations/0041_auto_20160708_0918.py b/delft3dworker/migrations/0041_auto_20160708_0918.py deleted file mode 100644 index 054f3fba..00000000 --- a/delft3dworker/migrations/0041_auto_20160708_0918.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0040_searchform_templates"), - ] - - operations = [ - migrations.AlterField( - model_name="scene", - name="scenario", - field=models.ManyToManyField(to="delft3dworker.Scenario", blank=True), - ), - ] diff --git a/delft3dworker/migrations/0042_remove_scene_suid.py b/delft3dworker/migrations/0042_remove_scene_suid.py deleted file mode 100644 index 129bd2aa..00000000 --- a/delft3dworker/migrations/0042_remove_scene_suid.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0041_auto_20160708_0918"), - ] - - operations = [ - migrations.RemoveField( - model_name="scene", - name="suid", - ), - ] diff --git a/delft3dworker/migrations/0043_scene_suid.py b/delft3dworker/migrations/0043_scene_suid.py deleted file mode 100644 index 4a87b4ea..00000000 --- a/delft3dworker/migrations/0043_scene_suid.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import uuid - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0042_remove_scene_suid"), - ] - - operations = [ - migrations.AddField( - model_name="scene", - name="suid", - field=models.UUIDField(default=uuid.uuid4, editable=False), - ), - ] diff --git a/delft3dworker/migrations/0044_auto_20160713_1222.py b/delft3dworker/migrations/0044_auto_20160713_1222.py deleted file mode 100644 index 49d3e1ad..00000000 --- a/delft3dworker/migrations/0044_auto_20160713_1222.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0043_scene_suid"), - ] - - operations = [ - migrations.AddField( - model_name="scenario", - name="progress", - field=models.IntegerField(default=0), - ), - migrations.AddField( - model_name="scenario", - name="state", - field=models.CharField(max_length=64, blank=True), - ), - migrations.AddField( - model_name="scene", - name="progress", - field=models.IntegerField(default=0), - ), - ] diff --git a/delft3dworker/migrations/0045_auto_20160714_0811.py b/delft3dworker/migrations/0045_auto_20160714_0811.py deleted file mode 100644 index d7c1ded1..00000000 --- a/delft3dworker/migrations/0045_auto_20160714_0811.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0044_auto_20160713_1222"), - ] - - operations = [ - migrations.AlterField( - model_name="scenario", - name="state", - field=models.CharField(default="CREATED", max_length=64), - ), - migrations.AlterField( - model_name="scene", - name="state", - field=models.CharField(default="CREATED", max_length=256), - ), - ] diff --git a/delft3dworker/migrations/0046_auto_20160715_1022.py b/delft3dworker/migrations/0046_auto_20160715_1022.py deleted file mode 100644 index be404b57..00000000 --- a/delft3dworker/migrations/0046_auto_20160715_1022.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0045_auto_20160714_0811"), - ] - - operations = [ - migrations.AlterField( - model_name="scene", - name="task_id", - field=models.CharField(max_length=256, blank=True), - ), - ] diff --git a/delft3dworker/migrations/0047_container.py b/delft3dworker/migrations/0047_container.py deleted file mode 100644 index 3d7a2be4..00000000 --- a/delft3dworker/migrations/0047_container.py +++ /dev/null @@ -1,69 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0046_auto_20160715_1022"), - ] - - operations = [ - migrations.CreateModel( - name="Container", - fields=[ - ( - "id", - models.AutoField( - verbose_name="ID", - serialize=False, - auto_created=True, - primary_key=True, - ), - ), - ("docker_id", models.CharField(unique=True, max_length=64, blank=True)), - ( - "container_type", - models.CharField( - blank=True, - max_length=16, - choices=[ - ("preprocess", "preprocess"), - ("delft3d", "delft3d"), - ("process", "process"), - ("postprocess", "postprocess"), - ("export", "export"), - ], - ), - ), - ( - "desired_state", - models.CharField( - blank=True, - max_length=16, - choices=[ - ("non-existent", "non-existent"), - ("created", "created"), - ("running", "running"), - ("exited", "exited"), - ], - ), - ), - ( - "docker_state", - models.CharField( - blank=True, - max_length=16, - choices=[ - ("non-existent", "non-existent"), - ("created", "created"), - ("running", "running"), - ("exited", "exited"), - ], - ), - ), - ], - ), - ] diff --git a/delft3dworker/migrations/0048_container_scene.py b/delft3dworker/migrations/0048_container_scene.py deleted file mode 100644 index 0b6387ce..00000000 --- a/delft3dworker/migrations/0048_container_scene.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0047_container"), - ] - - operations = [ - migrations.AddField( - model_name="container", - name="scene", - field=models.ForeignKey( - default=None, to="delft3dworker.Scene", on_delete=models.CASCADE - ), - preserve_default=False, - ), - ] diff --git a/delft3dworker/migrations/0049_auto_20160825_0932.py b/delft3dworker/migrations/0049_auto_20160825_0932.py deleted file mode 100644 index 443bf579..00000000 --- a/delft3dworker/migrations/0049_auto_20160825_0932.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0048_container_scene"), - ] - - operations = [ - migrations.AlterField( - model_name="container", - name="desired_state", - field=models.CharField( - default="non-existent", - max_length=16, - choices=[ - ("non-existent", "non-existent"), - ("created", "created"), - ("restarting", "restarting"), - ("running", "running"), - ("paused", "paused"), - ("exited", "exited"), - ("dead", "dead"), - ], - ), - ), - migrations.AlterField( - model_name="container", - name="docker_state", - field=models.CharField( - default="non-existent", - max_length=16, - choices=[ - ("non-existent", "non-existent"), - ("created", "created"), - ("restarting", "restarting"), - ("running", "running"), - ("paused", "paused"), - ("exited", "exited"), - ("dead", "dead"), - ], - ), - ), - ] diff --git a/delft3dworker/migrations/0050_auto_20160825_0934.py b/delft3dworker/migrations/0050_auto_20160825_0934.py deleted file mode 100644 index fba00eca..00000000 --- a/delft3dworker/migrations/0050_auto_20160825_0934.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0049_auto_20160825_0932"), - ] - - operations = [ - migrations.AlterField( - model_name="container", - name="docker_id", - field=models.CharField(default="", unique=True, max_length=64), - ), - ] diff --git a/delft3dworker/migrations/0051_auto_20160825_0935.py b/delft3dworker/migrations/0051_auto_20160825_0935.py deleted file mode 100644 index 575753f7..00000000 --- a/delft3dworker/migrations/0051_auto_20160825_0935.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0050_auto_20160825_0934"), - ] - - operations = [ - migrations.AlterField( - model_name="container", - name="docker_id", - field=models.CharField(default="", max_length=64, blank=True), - ), - ] diff --git a/delft3dworker/migrations/0052_auto_20160825_1404.py b/delft3dworker/migrations/0052_auto_20160825_1404.py deleted file mode 100644 index 03035eab..00000000 --- a/delft3dworker/migrations/0052_auto_20160825_1404.py +++ /dev/null @@ -1,57 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import uuid - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0051_auto_20160825_0935"), - ] - - operations = [ - migrations.AddField( - model_name="container", - name="task_uuid", - field=models.UUIDField(default=uuid.uuid4, editable=False, blank=True), - ), - migrations.AlterField( - model_name="container", - name="desired_state", - field=models.CharField( - default="non-existent", - max_length=16, - choices=[ - ("non-existent", "non-existent"), - ("created", "created"), - ("restarting", "restarting"), - ("running", "running"), - ("paused", "paused"), - ("exited", "exited"), - ("dead", "dead"), - ("unknown", "unknown"), - ], - ), - ), - migrations.AlterField( - model_name="container", - name="docker_state", - field=models.CharField( - default="non-existent", - max_length=16, - choices=[ - ("non-existent", "non-existent"), - ("created", "created"), - ("restarting", "restarting"), - ("running", "running"), - ("paused", "paused"), - ("exited", "exited"), - ("dead", "dead"), - ("unknown", "unknown"), - ], - ), - ), - ] diff --git a/delft3dworker/migrations/0053_auto_20160826_0747.py b/delft3dworker/migrations/0053_auto_20160826_0747.py deleted file mode 100644 index 28c1daff..00000000 --- a/delft3dworker/migrations/0053_auto_20160826_0747.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import uuid - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0052_auto_20160825_1404"), - ] - - operations = [ - migrations.AlterField( - model_name="container", - name="task_uuid", - field=models.UUIDField(default=uuid.uuid4, blank=True), - ), - ] diff --git a/delft3dworker/migrations/0054_auto_20160826_0747.py b/delft3dworker/migrations/0054_auto_20160826_0747.py deleted file mode 100644 index 6eb67986..00000000 --- a/delft3dworker/migrations/0054_auto_20160826_0747.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import uuid - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0053_auto_20160826_0747"), - ] - - operations = [ - migrations.AlterField( - model_name="container", - name="task_uuid", - field=models.UUIDField(default=uuid.uuid4, null=True, blank=True), - ), - ] diff --git a/delft3dworker/migrations/0055_container_docker_log.py b/delft3dworker/migrations/0055_container_docker_log.py deleted file mode 100644 index 2eeeafad..00000000 --- a/delft3dworker/migrations/0055_container_docker_log.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0054_auto_20160826_0747"), - ] - - operations = [ - migrations.AddField( - model_name="container", - name="docker_log", - field=models.TextField(default="", blank=True), - ), - ] diff --git a/delft3dworker/migrations/0056_auto_20160825_0548.py b/delft3dworker/migrations/0056_auto_20160825_0548.py deleted file mode 100644 index 1f3f5fec..00000000 --- a/delft3dworker/migrations/0056_auto_20160825_0548.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0055_container_docker_log"), - ] - - operations = [ - migrations.AlterField( - model_name="container", - name="docker_id", - field=models.CharField( - default="", max_length=64, db_index=True, blank=True - ), - ), - migrations.AlterField( - model_name="container", - name="task_uuid", - field=models.UUIDField(default=None, null=True, blank=True), - ), - ] diff --git a/delft3dworker/migrations/0057_auto_20160829_1429.py b/delft3dworker/migrations/0057_auto_20160829_1429.py deleted file mode 100644 index c7cf60f4..00000000 --- a/delft3dworker/migrations/0057_auto_20160829_1429.py +++ /dev/null @@ -1,29 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0056_auto_20160825_0548"), - ] - - operations = [ - migrations.AlterField( - model_name="container", - name="container_type", - field=models.CharField( - default="preprocess", - max_length=16, - choices=[ - ("preprocess", "preprocess"), - ("delft3d", "delft3d"), - ("process", "process"), - ("postprocess", "postprocess"), - ("export", "export"), - ], - ), - ), - ] diff --git a/delft3dworker/migrations/0058_container_task_starttime.py b/delft3dworker/migrations/0058_container_task_starttime.py deleted file mode 100644 index 04ce7dd8..00000000 --- a/delft3dworker/migrations/0058_container_task_starttime.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import datetime - -from django.db import migrations, models -from django.utils.timezone import utc - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0057_auto_20160829_1429"), - ] - - operations = [ - migrations.AddField( - model_name="container", - name="task_starttime", - field=models.DateTimeField( - default=datetime.datetime(2016, 8, 30, 9, 36, 4, 550600, tzinfo=utc), - blank=True, - ), - ), - ] diff --git a/delft3dworker/migrations/0058_scene_phase.py b/delft3dworker/migrations/0058_scene_phase.py deleted file mode 100644 index a40fff4a..00000000 --- a/delft3dworker/migrations/0058_scene_phase.py +++ /dev/null @@ -1,31 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0057_auto_20160829_1429"), - ] - - operations = [ - migrations.AddField( - model_name="scene", - name="phase", - field=models.PositiveSmallIntegerField( - default=0, - choices=[ - (0, "Phase 0"), - (1, "Phase 1"), - (2, "Phase 2"), - (3, "Phase 3"), - (4, "Phase 4"), - (5, "Phase 5"), - (6, "Phase 6"), - (7, "Phase 7"), - ], - ), - ), - ] diff --git a/delft3dworker/migrations/0059_auto_20160830_1042.py b/delft3dworker/migrations/0059_auto_20160830_1042.py deleted file mode 100644 index 4442cb30..00000000 --- a/delft3dworker/migrations/0059_auto_20160830_1042.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import datetime - -from django.db import migrations, models -from django.utils.timezone import utc - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0058_container_task_starttime"), - ] - - operations = [ - migrations.AddField( - model_name="container", - name="container_starttime", - field=models.DateTimeField( - default=datetime.datetime(2016, 8, 30, 10, 42, 12, 820124, tzinfo=utc), - blank=True, - ), - ), - migrations.AddField( - model_name="container", - name="container_stoptime", - field=models.DateTimeField( - default=datetime.datetime(2016, 8, 30, 10, 42, 12, 820153, tzinfo=utc), - blank=True, - ), - ), - migrations.AlterField( - model_name="container", - name="task_starttime", - field=models.DateTimeField( - default=datetime.datetime(2016, 8, 30, 10, 42, 12, 820170, tzinfo=utc), - blank=True, - ), - ), - ] diff --git a/delft3dworker/migrations/0059_auto_20160830_1304.py b/delft3dworker/migrations/0059_auto_20160830_1304.py deleted file mode 100644 index c9dc33f0..00000000 --- a/delft3dworker/migrations/0059_auto_20160830_1304.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import django.utils.timezone -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0058_container_task_starttime"), - ] - - operations = [ - migrations.AlterField( - model_name="container", - name="task_starttime", - field=models.DateTimeField(default=django.utils.timezone.now, blank=True), - ), - ] diff --git a/delft3dworker/migrations/0059_merge.py b/delft3dworker/migrations/0059_merge.py deleted file mode 100644 index d06ad792..00000000 --- a/delft3dworker/migrations/0059_merge.py +++ /dev/null @@ -1,14 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0058_scene_phase"), - ("delft3dworker", "0058_container_task_starttime"), - ] - - operations = [] diff --git a/delft3dworker/migrations/0060_auto_20160830_1258.py b/delft3dworker/migrations/0060_auto_20160830_1258.py deleted file mode 100644 index f7e322ec..00000000 --- a/delft3dworker/migrations/0060_auto_20160830_1258.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import datetime - -from django.db import migrations, models -from django.utils.timezone import utc - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0059_merge"), - ] - - operations = [ - migrations.AlterField( - model_name="container", - name="task_starttime", - field=models.DateTimeField( - default=datetime.datetime(2016, 8, 30, 12, 58, 18, 702032, tzinfo=utc), - blank=True, - ), - ), - migrations.AlterField( - model_name="scene", - name="phase", - field=models.PositiveSmallIntegerField( - default=0, - choices=[ - (0, "New"), - (1, "Creating containers..."), - (2, "Created containers"), - (3, "Starting preprocessing..."), - (4, "Running preprocessing..."), - (5, "Finished preprocessing"), - (6, "Idle"), - (7, "Starting simulation..."), - (8, "Running simulation..."), - (9, "Finished simulation"), - (10, "Starting postprocessing..."), - (11, "Running postprocessing..."), - (12, "Finished postprocessing"), - (13, "Starting container remove..."), - (14, "Removing containers..."), - (15, "Containers removed"), - (1000, "Starting Abort..."), - (1001, "Aborting..."), - (1002, "Finished Abort"), - ], - ), - ), - ] diff --git a/delft3dworker/migrations/0060_merge.py b/delft3dworker/migrations/0060_merge.py deleted file mode 100644 index f89006e8..00000000 --- a/delft3dworker/migrations/0060_merge.py +++ /dev/null @@ -1,14 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0059_auto_20160830_1042"), - ("delft3dworker", "0059_auto_20160830_1304"), - ] - - operations = [] diff --git a/delft3dworker/migrations/0061_auto_20160830_1300.py b/delft3dworker/migrations/0061_auto_20160830_1300.py deleted file mode 100644 index d4d61ca3..00000000 --- a/delft3dworker/migrations/0061_auto_20160830_1300.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import datetime - -from django.db import migrations, models -from django.utils.timezone import utc - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0060_auto_20160830_1258"), - ] - - operations = [ - migrations.AlterField( - model_name="container", - name="task_starttime", - field=models.DateTimeField( - default=datetime.datetime(2016, 8, 30, 13, 0, 33, 231999, tzinfo=utc), - blank=True, - ), - ), - ] diff --git a/delft3dworker/migrations/0061_auto_20160830_1329.py b/delft3dworker/migrations/0061_auto_20160830_1329.py deleted file mode 100644 index 348ae57d..00000000 --- a/delft3dworker/migrations/0061_auto_20160830_1329.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import django.utils.timezone -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0060_merge"), - ] - - operations = [ - migrations.AlterField( - model_name="container", - name="container_starttime", - field=models.DateTimeField(default=django.utils.timezone.now, blank=True), - ), - migrations.AlterField( - model_name="container", - name="container_stoptime", - field=models.DateTimeField(default=django.utils.timezone.now, blank=True), - ), - migrations.AlterField( - model_name="container", - name="task_starttime", - field=models.DateTimeField(default=django.utils.timezone.now, blank=True), - ), - ] diff --git a/delft3dworker/migrations/0062_auto_20160830_1300.py b/delft3dworker/migrations/0062_auto_20160830_1300.py deleted file mode 100644 index 3aa7bc99..00000000 --- a/delft3dworker/migrations/0062_auto_20160830_1300.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import datetime - -from django.db import migrations, models -from django.utils.timezone import utc - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0061_auto_20160830_1300"), - ] - - operations = [ - migrations.AlterField( - model_name="container", - name="task_starttime", - field=models.DateTimeField( - default=datetime.datetime(2016, 8, 30, 13, 0, 42, 990726, tzinfo=utc), - blank=True, - ), - ), - ] diff --git a/delft3dworker/migrations/0063_auto_20160830_1301.py b/delft3dworker/migrations/0063_auto_20160830_1301.py deleted file mode 100644 index 4e0e811b..00000000 --- a/delft3dworker/migrations/0063_auto_20160830_1301.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import django.utils.timezone -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0062_auto_20160830_1300"), - ] - - operations = [ - migrations.AlterField( - model_name="container", - name="task_starttime", - field=models.DateTimeField(default=django.utils.timezone.now, blank=True), - ), - ] diff --git a/delft3dworker/migrations/0064_merge.py b/delft3dworker/migrations/0064_merge.py deleted file mode 100644 index 2c42d566..00000000 --- a/delft3dworker/migrations/0064_merge.py +++ /dev/null @@ -1,14 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0063_auto_20160830_1301"), - ("delft3dworker", "0059_auto_20160830_1304"), - ] - - operations = [] diff --git a/delft3dworker/migrations/0065_auto_20160831_1441.py b/delft3dworker/migrations/0065_auto_20160831_1441.py deleted file mode 100644 index 1959d175..00000000 --- a/delft3dworker/migrations/0065_auto_20160831_1441.py +++ /dev/null @@ -1,42 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0064_merge"), - ] - - operations = [ - migrations.AlterField( - model_name="scene", - name="phase", - field=models.PositiveSmallIntegerField( - default=0, - choices=[ - (0, "New"), - (1, "Creating containers..."), - (2, "Created containers"), - (3, "Starting preprocessing..."), - (4, "Running preprocessing..."), - (5, "Finished preprocessing"), - (6, "Idle: waiting for user input"), - (7, "Starting simulation..."), - (8, "Running simulation..."), - (9, "Finished simulation"), - (10, "Starting postprocessing..."), - (11, "Running postprocessing..."), - (12, "Finished postprocessing"), - (13, "Starting container remove..."), - (14, "Removing containers..."), - (15, "Containers removed"), - (1000, "Starting Abort..."), - (1001, "Aborting..."), - (1002, "Finished Abort"), - ], - ), - ), - ] diff --git a/delft3dworker/migrations/0065_merge.py b/delft3dworker/migrations/0065_merge.py deleted file mode 100644 index fbae6136..00000000 --- a/delft3dworker/migrations/0065_merge.py +++ /dev/null @@ -1,14 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0061_auto_20160830_1329"), - ("delft3dworker", "0064_merge"), - ] - - operations = [] diff --git a/delft3dworker/migrations/0066_auto_20160831_1311.py b/delft3dworker/migrations/0066_auto_20160831_1311.py deleted file mode 100644 index eccefa6d..00000000 --- a/delft3dworker/migrations/0066_auto_20160831_1311.py +++ /dev/null @@ -1,42 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0065_merge"), - ] - - operations = [ - migrations.AlterField( - model_name="scene", - name="phase", - field=models.PositiveSmallIntegerField( - default=0, - choices=[ - (0, "New"), - (1, "Creating containers..."), - (2, "Created containers"), - (3, "Starting preprocessing..."), - (4, "Running preprocessing..."), - (5, "Finished preprocessing"), - (6, "Idle: waiting for user input"), - (7, "Starting simulation..."), - (8, "Running simulation..."), - (9, "Finished simulation"), - (10, "Starting postprocessing..."), - (11, "Running postprocessing..."), - (12, "Finished postprocessing"), - (13, "Starting container remove..."), - (14, "Removing containers..."), - (15, "Containers removed"), - (1000, "Starting Abort..."), - (1001, "Aborting..."), - (1002, "Finished Abort"), - ], - ), - ), - ] diff --git a/delft3dworker/migrations/0067_container_container_exitcode.py b/delft3dworker/migrations/0067_container_container_exitcode.py deleted file mode 100644 index f316cff6..00000000 --- a/delft3dworker/migrations/0067_container_container_exitcode.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0066_auto_20160831_1311"), - ] - - operations = [ - migrations.AddField( - model_name="container", - name="container_exitcode", - field=models.PositiveSmallIntegerField(default=0), - ), - ] diff --git a/delft3dworker/migrations/0068_container_container_progress.py b/delft3dworker/migrations/0068_container_container_progress.py deleted file mode 100644 index 380f5f88..00000000 --- a/delft3dworker/migrations/0068_container_container_progress.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0067_container_container_exitcode"), - ] - - operations = [ - migrations.AddField( - model_name="container", - name="container_progress", - field=models.PositiveSmallIntegerField(default=0), - ), - ] diff --git a/delft3dworker/migrations/0069_merge.py b/delft3dworker/migrations/0069_merge.py deleted file mode 100644 index 0e911dd6..00000000 --- a/delft3dworker/migrations/0069_merge.py +++ /dev/null @@ -1,14 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0065_auto_20160831_1441"), - ("delft3dworker", "0068_container_container_progress"), - ] - - operations = [] diff --git a/delft3dworker/migrations/0070_auto_20160901_0755.py b/delft3dworker/migrations/0070_auto_20160901_0755.py deleted file mode 100644 index 250b636d..00000000 --- a/delft3dworker/migrations/0070_auto_20160901_0755.py +++ /dev/null @@ -1,46 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0069_merge"), - ] - - operations = [ - migrations.AlterField( - model_name="scene", - name="phase", - field=models.PositiveSmallIntegerField( - default=0, - choices=[ - (0, "New"), - (1, "Creating containers..."), - (2, "Created containers"), - (3, "Starting preprocessing..."), - (4, "Running preprocessing..."), - (5, "Finished preprocessing"), - (6, "Idle: waiting for user input"), - (7, "Starting simulation..."), - (8, "Running simulation..."), - (9, "Finished simulation"), - (10, "Stopping simulation..."), - (11, "Starting postprocessing..."), - (12, "Running postprocessing..."), - (13, "Finished postprocessing"), - (14, "Starting export..."), - (15, "Running export..."), - (16, "Finished export"), - (17, "Starting container remove..."), - (18, "Removing containers..."), - (19, "Containers removed"), - (1000, "Starting Abort..."), - (1001, "Aborting..."), - (1002, "Finished Abort"), - ], - ), - ), - ] diff --git a/delft3dworker/migrations/0071_auto_20160830_2301.py b/delft3dworker/migrations/0071_auto_20160830_2301.py deleted file mode 100644 index d935d84a..00000000 --- a/delft3dworker/migrations/0071_auto_20160830_2301.py +++ /dev/null @@ -1,47 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0070_auto_20160901_0755"), - ] - - operations = [ - migrations.AlterField( - model_name="scene", - name="phase", - field=models.PositiveSmallIntegerField( - default=0, - choices=[ - (0, "New"), - (1, "Creating containers..."), - (2, "Created containers"), - (3, "Starting preprocessing..."), - (4, "Running preprocessing..."), - (5, "Finished preprocessing"), - (6, "Idle: waiting for user input"), - (7, "Starting simulation..."), - (8, "Running simulation..."), - (9, "Finished simulation"), - (10, "Stopping simulation..."), - (11, "Starting postprocessing..."), - (12, "Running postprocessing..."), - (13, "Finished postprocessing"), - (14, "Starting export..."), - (15, "Running export..."), - (16, "Finished export"), - (17, "Starting container remove..."), - (18, "Removing containers..."), - (19, "Containers removed"), - (1000, "Starting Abort..."), - (1001, "Aborting..."), - (1002, "Finished Abort"), - (1003, "Queued"), - ], - ), - ), - ] diff --git a/delft3dworker/migrations/0072_auto_20160830_2334.py b/delft3dworker/migrations/0072_auto_20160830_2334.py deleted file mode 100644 index af2ca481..00000000 --- a/delft3dworker/migrations/0072_auto_20160830_2334.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0071_auto_20160830_2301"), - ] - - operations = [ - migrations.AlterField( - model_name="scene", - name="phase", - field=models.PositiveSmallIntegerField( - default=0, - choices=[ - (0, "New"), - (1, "Creating containers..."), - (2, "Created containers"), - (3, "Starting preprocessing..."), - (4, "Running preprocessing..."), - (5, "Finished preprocessing"), - (6, "Idle: waiting for user input"), - (7, "Starting simulation..."), - (8, "Running simulation..."), - (9, "Finished simulation"), - (10, "Stopping simulation..."), - (11, "Starting postprocessing..."), - (12, "Running postprocessing..."), - (13, "Finished postprocessing"), - (14, "Starting export..."), - (15, "Running export..."), - (16, "Finished export"), - (17, "Starting container remove..."), - (18, "Removing containers..."), - (19, "Containers removed"), - (20, "Finished"), - (1000, "Starting Abort..."), - (1001, "Aborting..."), - (1002, "Finished Abort"), - (1003, "Queued"), - ], - ), - ), - ] diff --git a/delft3dworker/migrations/0073_auto_20160907_1301.py b/delft3dworker/migrations/0073_auto_20160907_1301.py deleted file mode 100644 index 40a63c1a..00000000 --- a/delft3dworker/migrations/0073_auto_20160907_1301.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0072_auto_20160830_2334"), - ] - - operations = [ - migrations.AlterField( - model_name="container", - name="container_type", - field=models.CharField( - default="preprocess", - max_length=16, - choices=[ - ("preprocess", "preprocess"), - ("delft3d", "delft3d"), - ("process", "process"), - ("postprocess", "postprocess"), - ("export", "export"), - ("sync_cleanup", "sync_cleanup"), - ], - ), - ), - ] diff --git a/delft3dworker/migrations/0074_auto_20160907_1315.py b/delft3dworker/migrations/0074_auto_20160907_1315.py deleted file mode 100644 index 4cfe3f8c..00000000 --- a/delft3dworker/migrations/0074_auto_20160907_1315.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0073_auto_20160907_1301"), - ] - - operations = [ - migrations.AlterField( - model_name="scene", - name="phase", - field=models.PositiveSmallIntegerField( - default=0, - choices=[ - (0, "New"), - (1, "Creating containers..."), - (2, "Created containers"), - (3, "Starting preprocessing..."), - (4, "Running preprocessing..."), - (5, "Finished preprocessing"), - (6, "Idle: waiting for user input"), - (7, "Starting simulation..."), - (8, "Running simulation..."), - (9, "Finished simulation"), - (10, "Stopping simulation..."), - (11, "Starting postprocessing..."), - (12, "Running postprocessing..."), - (13, "Finished postprocessing"), - (14, "Starting export..."), - (15, "Running export..."), - (16, "Finished export"), - (17, "Starting container remove..."), - (18, "Removing containers..."), - (19, "Containers removed"), - (20, "Started synchronization"), - (21, "Running synchronization"), - (22, "Finished synchronization"), - (30, "Finished"), - (1000, "Starting Abort..."), - (1001, "Aborting..."), - (1002, "Finished Abort"), - (1003, "Queued"), - ], - ), - ), - ] diff --git a/delft3dworker/migrations/0075_auto_20161012_1147.py b/delft3dworker/migrations/0075_auto_20161012_1147.py deleted file mode 100644 index 33ea95ab..00000000 --- a/delft3dworker/migrations/0075_auto_20161012_1147.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0074_auto_20160907_1315"), - ] - - operations = [ - migrations.AlterField( - model_name="scene", - name="phase", - field=models.PositiveSmallIntegerField( - default=0, - choices=[ - (0, "New"), - (1, "Creating containers"), - (2, "Created containers"), - (3, "Starting preprocessing"), - (4, "Running preprocessing"), - (5, "Finished preprocessing"), - (6, "Idle: waiting for user input"), - (7, "Starting simulation"), - (8, "Running simulation"), - (9, "Finished simulation"), - (10, "Stopping simulation"), - (11, "Starting postprocessing"), - (12, "Running postprocessing"), - (13, "Finished postprocessing"), - (14, "Starting export"), - (15, "Running export"), - (16, "Finished export"), - (17, "Starting container remove"), - (18, "Removing containers"), - (19, "Containers removed"), - (20, "Started synchronization"), - (21, "Running synchronization"), - (22, "Finished synchronization"), - (30, "Finished"), - (1000, "Starting Abort"), - (1001, "Aborting"), - (1002, "Finished Abort"), - (1003, "Queued"), - ], - ), - ), - ] diff --git a/delft3dworker/migrations/0076_auto_20161012_1241.py b/delft3dworker/migrations/0076_auto_20161012_1241.py deleted file mode 100644 index 73d32301..00000000 --- a/delft3dworker/migrations/0076_auto_20161012_1241.py +++ /dev/null @@ -1,54 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0075_auto_20161012_1147"), - ] - - operations = [ - migrations.AlterField( - model_name="scene", - name="phase", - field=models.PositiveSmallIntegerField( - default=0, - choices=[ - (0, "New"), - (2, "Creating preprocessing"), - (3, "Starting preprocessing"), - (4, "Running preprocessing"), - (5, "Finished preprocessing"), - (6, "Idle: waiting for user input"), - (10, "Creating simulation"), - (11, "Starting simulation"), - (12, "Running simulation"), - (13, "Finished simulation"), - (14, "Stopping simulation"), - (20, "Creating postprocessing"), - (21, "Starting postprocessing"), - (22, "Running postprocessing"), - (23, "Finished postprocessing"), - (30, "Creating export"), - (31, "Starting export"), - (32, "Running export"), - (33, "Finished export"), - (17, "Starting container remove"), - (18, "Removing containers"), - (19, "Containers removed"), - (40, "Creating synchronization"), - (41, "Started synchronization"), - (42, "Running synchronization"), - (43, "Finished synchronization"), - (50, "Finished"), - (1000, "Starting Abort"), - (1001, "Aborting"), - (1002, "Finished Abort"), - (1003, "Queued"), - ], - ), - ), - ] diff --git a/delft3dworker/migrations/0077_auto_20161018_0925.py b/delft3dworker/migrations/0077_auto_20161018_0925.py deleted file mode 100644 index f1b18d9a..00000000 --- a/delft3dworker/migrations/0077_auto_20161018_0925.py +++ /dev/null @@ -1,59 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0076_auto_20161012_1241"), - ] - - operations = [ - migrations.AddField( - model_name="container", - name="container_log", - field=models.TextField(default="", blank=True), - ), - migrations.AlterField( - model_name="scene", - name="phase", - field=models.PositiveSmallIntegerField( - default=0, - choices=[ - (0, "New"), - (2, "Allocating preprocessing resources"), - (3, "Starting preprocessing"), - (4, "Running preprocessing"), - (5, "Finished preprocessing"), - (6, "Idle: waiting for user input"), - (10, "Allocating simulation resources"), - (11, "Starting simulation"), - (12, "Running simulation"), - (13, "Finished simulation"), - (14, "Stopping simulation"), - (20, "Allocating postprocessing resources"), - (21, "Starting postprocessing"), - (22, "Running postprocessing"), - (23, "Finished postprocessing"), - (30, "Allocating export resources"), - (31, "Starting export"), - (32, "Running export"), - (33, "Finished export"), - (17, "Starting container remove"), - (18, "Removing containers"), - (19, "Containers removed"), - (40, "Allocating synchronization resources"), - (41, "Started synchronization"), - (42, "Running synchronization"), - (43, "Finished synchronization"), - (50, "Finished"), - (1000, "Starting Abort"), - (1001, "Aborting"), - (1002, "Finished Abort"), - (1003, "Queued"), - ], - ), - ), - ] diff --git a/delft3dworker/migrations/0078_auto_20161116_0958.py b/delft3dworker/migrations/0078_auto_20161116_0958.py deleted file mode 100644 index 3376fdaa..00000000 --- a/delft3dworker/migrations/0078_auto_20161116_0958.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import django.utils.timezone -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0077_auto_20161018_0925"), - ] - - operations = [ - migrations.AddField( - model_name="scene", - name="date_created", - field=models.DateTimeField(default=django.utils.timezone.now, blank=True), - ), - migrations.AddField( - model_name="scene", - name="date_started", - field=models.DateTimeField(null=True, blank=True), - ), - ] diff --git a/delft3dworker/migrations/0079_auto_20161118_1341.py b/delft3dworker/migrations/0079_auto_20161118_1341.py deleted file mode 100644 index 3b5c0aec..00000000 --- a/delft3dworker/migrations/0079_auto_20161118_1341.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0078_auto_20161116_0958"), - ] - - operations = [ - migrations.AddField( - model_name="container", - name="delft3d_version", - field=models.CharField( - default="Deltares, FLOW2D3D Version 6.02.07.6118", max_length=128 - ), - ), - migrations.AddField( - model_name="container", - name="svn_repos_url", - field=models.URLField( - default="http://delft3dgt.openearth.eu/repos/tags/v0.7.2" - ), - ), - migrations.AddField( - model_name="container", - name="svn_revision", - field=models.CharField(default="356", max_length=16), - ), - ] diff --git a/delft3dworker/migrations/0080_auto_20161121_1302.py b/delft3dworker/migrations/0080_auto_20161121_1302.py deleted file mode 100644 index 9daa3420..00000000 --- a/delft3dworker/migrations/0080_auto_20161121_1302.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import jsonfield.fields -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0079_auto_20161118_1341"), - ] - - operations = [ - migrations.RemoveField( - model_name="container", - name="delft3d_version", - ), - migrations.RemoveField( - model_name="container", - name="svn_repos_url", - ), - migrations.RemoveField( - model_name="container", - name="svn_revision", - ), - migrations.AddField( - model_name="container", - name="version", - field=jsonfield.fields.JSONField(default={}), - ), - ] diff --git a/delft3dworker/migrations/0081_auto_20161122_1241.py b/delft3dworker/migrations/0081_auto_20161122_1241.py deleted file mode 100644 index 5ea845ae..00000000 --- a/delft3dworker/migrations/0081_auto_20161122_1241.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import jsonfield.fields -from django.db import migrations, models - -import delft3dworker.utils - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0080_auto_20161121_1302"), - ] - - operations = [ - migrations.AlterField( - model_name="container", - name="version", - field=jsonfield.fields.JSONField( - default=delft3dworker.utils.version_default - ), - ), - ] diff --git a/delft3dworker/migrations/0082_auto_20161122_1530.py b/delft3dworker/migrations/0082_auto_20161122_1530.py deleted file mode 100644 index dbc9eff7..00000000 --- a/delft3dworker/migrations/0082_auto_20161122_1530.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0081_auto_20161122_1241"), - ] - - operations = [ - migrations.AlterField( - model_name="scene", - name="phase", - field=models.PositiveSmallIntegerField( - default=0, - choices=[ - (0, "New"), - (2, "Allocating preprocessing resources"), - (3, "Starting preprocessing"), - (4, "Running preprocessing"), - (5, "Finished preprocessing"), - (6, "Idle: waiting for user input"), - (10, "Allocating simulation resources"), - (11, "Starting simulation"), - (12, "Running simulation"), - (15, "Finishing simulation"), - (13, "Finished simulation"), - (14, "Stopping simulation"), - (20, "Allocating postprocessing resources"), - (21, "Starting postprocessing"), - (22, "Running postprocessing"), - (23, "Finished postprocessing"), - (30, "Allocating export resources"), - (31, "Starting export"), - (32, "Running export"), - (33, "Finished export"), - (17, "Starting container remove"), - (18, "Removing containers"), - (19, "Containers removed"), - (40, "Allocating synchronization resources"), - (41, "Started synchronization"), - (42, "Running synchronization"), - (43, "Finished synchronization"), - (50, "Finished"), - (1000, "Starting Abort"), - (1001, "Aborting"), - (1002, "Finished Abort"), - (1003, "Queued"), - ], - ), - ), - ] diff --git a/delft3dworker/migrations/0083_auto_20170412_0907.py b/delft3dworker/migrations/0083_auto_20170412_0907.py deleted file mode 100644 index 372d3c80..00000000 --- a/delft3dworker/migrations/0083_auto_20170412_0907.py +++ /dev/null @@ -1,92 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0082_auto_20161122_1530"), - ] - - operations = [ - migrations.AddField( - model_name="scene", - name="workflow", - field=models.PositiveSmallIntegerField( - default=0, - choices=[ - (0, "main workflow"), - (1, "redo processing workflow"), - (2, "redo postprocessing workflow"), - ], - ), - ), - migrations.AlterField( - model_name="container", - name="container_type", - field=models.CharField( - default="preprocess", - max_length=16, - choices=[ - ("preprocess", "preprocess"), - ("delft3d", "delft3d"), - ("process", "process"), - ("postprocess", "postprocess"), - ("export", "export"), - ("sync_cleanup", "sync_cleanup"), - ("sync_rerun", "sync_rerun"), - ], - ), - ), - migrations.AlterField( - model_name="scene", - name="phase", - field=models.PositiveSmallIntegerField( - default=0, - choices=[ - (0, "New"), - (2, "Allocating preprocessing resources"), - (3, "Starting preprocessing"), - (4, "Running preprocessing"), - (5, "Finished preprocessing"), - (6, "Idle: waiting for user input"), - (10, "Allocating simulation resources"), - (11, "Starting simulation"), - (12, "Running simulation"), - (15, "Finishing simulation"), - (13, "Finished simulation"), - (14, "Stopping simulation"), - (60, "Allocating processing resources"), - (61, "Starting processing"), - (62, "Running processing"), - (63, "Finished processing"), - (20, "Allocating postprocessing resources"), - (21, "Starting postprocessing"), - (22, "Running postprocessing"), - (23, "Finished postprocessing"), - (30, "Allocating export resources"), - (31, "Starting export"), - (32, "Running export"), - (33, "Finished export"), - (17, "Starting container remove"), - (18, "Removing containers"), - (19, "Containers removed"), - (40, "Allocating synchronization resources"), - (41, "Started synchronization"), - (42, "Running synchronization"), - (43, "Finished synchronization"), - (50, "Allocating synchronization resources"), - (51, "Started synchronization"), - (52, "Running synchronization"), - (53, "Finished synchronization"), - (500, "Finished"), - (1000, "Starting Abort"), - (1001, "Aborting"), - (1002, "Finished Abort"), - (1003, "Queued"), - ], - ), - ), - ] diff --git a/delft3dworker/migrations/0084_auto_20170419_1510.py b/delft3dworker/migrations/0084_auto_20170419_1510.py deleted file mode 100644 index c686c0fb..00000000 --- a/delft3dworker/migrations/0084_auto_20170419_1510.py +++ /dev/null @@ -1,63 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -import jsonfield.fields -from django.db import migrations, models - -import delft3dworker.models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0083_auto_20170412_0907"), - ] - - operations = [ - migrations.CreateModel( - name="Version_SVN", - fields=[ - ( - "id", - models.AutoField( - verbose_name="ID", - serialize=False, - auto_created=True, - primary_key=True, - ), - ), - ("release", models.CharField(max_length=256, db_index=True)), - ("revision", models.PositiveSmallIntegerField(db_index=True)), - ("versions", jsonfield.fields.JSONField(default={})), - ("url", models.URLField()), - ("changelog", models.CharField(max_length=256)), - ("reviewed", models.BooleanField(default=False)), - ], - ), - migrations.RemoveField( - model_name="container", - name="version", - ), - migrations.AlterField( - model_name="scene", - name="workflow", - field=models.PositiveSmallIntegerField( - default=0, - choices=[ - (0, "main workflow"), - (1, "redo processing workflow"), - (2, "redo postprocessing workflow"), - (3, "redo processing and postprocessing workflow"), - ], - ), - ), - migrations.AddField( - model_name="scene", - name="version", - field=models.ForeignKey( - default=delft3dworker.models.default_svn_version, - to="delft3dworker.Version_SVN", - on_delete=models.CASCADE, - ), - ), - ] diff --git a/delft3dworker/migrations/0084_migrate_scene_finished_state.py b/delft3dworker/migrations/0084_migrate_scene_finished_state.py deleted file mode 100644 index 2d371a0a..00000000 --- a/delft3dworker/migrations/0084_migrate_scene_finished_state.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0083_auto_20170412_0907"), - ] - - operations = [ - migrations.RunSQL( - [("UPDATE delft3dworker_scene SET phase = 500 WHERE phase = 50;")], - [("UPDATE delft3dworker_scene SET phase = 50 WHERE phase = 500;")], - ) - ] diff --git a/delft3dworker/migrations/0085_merge.py b/delft3dworker/migrations/0085_merge.py deleted file mode 100644 index 024d1efe..00000000 --- a/delft3dworker/migrations/0085_merge.py +++ /dev/null @@ -1,14 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0084_migrate_scene_finished_state"), - ("delft3dworker", "0084_auto_20170419_1510"), - ] - - operations = [] diff --git a/delft3dworker/migrations/0086_auto_20170425_0852.py b/delft3dworker/migrations/0086_auto_20170425_0852.py deleted file mode 100644 index bcc367d8..00000000 --- a/delft3dworker/migrations/0086_auto_20170425_0852.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0085_merge"), - ] - - operations = [ - migrations.AlterModelOptions( - name="version_svn", - options={ - "ordering": ["-revision"], - "verbose_name": "SVN version", - "verbose_name_plural": "SVN versions", - }, - ), - ] diff --git a/delft3dworker/migrations/0087_auto_20180214_1324.py b/delft3dworker/migrations/0087_auto_20180214_1324.py deleted file mode 100644 index 175784db..00000000 --- a/delft3dworker/migrations/0087_auto_20180214_1324.py +++ /dev/null @@ -1,131 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.10 on 2018-02-14 13:24 -from __future__ import unicode_literals - -import django.contrib.postgres.fields.jsonb -from django.db import migrations, models - -import delft3dworker.utils - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0086_auto_20170425_0852"), - ] - - operations = [ - migrations.AlterField( - model_name="container", - name="container_starttime", - field=models.DateTimeField(blank=True, default=delft3dworker.utils.tz_now), - ), - migrations.AlterField( - model_name="container", - name="container_stoptime", - field=models.DateTimeField(blank=True, default=delft3dworker.utils.tz_now), - ), - migrations.AlterField( - model_name="container", - name="task_starttime", - field=models.DateTimeField(blank=True, default=delft3dworker.utils.tz_now), - ), - migrations.AlterField( - model_name="scenario", - name="parameters", - field=django.contrib.postgres.fields.jsonb.JSONField( - blank=True, default={} - ), - ), - migrations.RunSQL( - 'ALTER TABLE delft3dworker_scenario ALTER COLUMN "parameters" TYPE jsonb USING "parameters"::text::jsonb;', - reverse_sql='ALTER TABLE delft3dworker_scenario ALTER COLUMN "parameters" TYPE text USING "parameters"::text;', - ), - migrations.AlterField( - model_name="scenario", - name="scenes_parameters", - field=django.contrib.postgres.fields.jsonb.JSONField( - blank=True, default={} - ), - ), - migrations.RunSQL( - 'ALTER TABLE delft3dworker_scenario ALTER COLUMN "scenes_parameters" TYPE jsonb USING "scenes_parameters"::text::jsonb;', - reverse_sql='ALTER TABLE delft3dworker_scenario ALTER COLUMN "scenes_parameters" TYPE text USING "scenes_parameters"::text;', - ), - migrations.AlterField( - model_name="scene", - name="date_created", - field=models.DateTimeField(blank=True, default=delft3dworker.utils.tz_now), - ), - migrations.AlterField( - model_name="scene", - name="info", - field=django.contrib.postgres.fields.jsonb.JSONField( - blank=True, default={} - ), - ), - migrations.RunSQL( - 'ALTER TABLE delft3dworker_scene ALTER COLUMN "info" TYPE jsonb USING "info"::text::jsonb;', - reverse_sql='ALTER TABLE delft3dworker_scene ALTER COLUMN "info" TYPE text USING "info"::text;', - ), - migrations.AlterField( - model_name="scene", - name="parameters", - field=django.contrib.postgres.fields.jsonb.JSONField( - blank=True, default={} - ), - ), - migrations.RunSQL( - 'ALTER TABLE delft3dworker_scene ALTER COLUMN "parameters" TYPE jsonb USING "parameters"::text::jsonb;', - reverse_sql='ALTER TABLE delft3dworker_scene ALTER COLUMN "parameters" TYPE text USING "parameters"::text;', - ), - migrations.AlterField( - model_name="searchform", - name="sections", - field=django.contrib.postgres.fields.jsonb.JSONField(default=[]), - ), - migrations.RunSQL( - 'ALTER TABLE delft3dworker_searchform ALTER COLUMN "sections" TYPE jsonb USING "sections"::text::jsonb;', - reverse_sql='ALTER TABLE delft3dworker_searchform ALTER COLUMN "sections" TYPE text USING "sections"::text;', - ), - migrations.AlterField( - model_name="searchform", - name="templates", - field=django.contrib.postgres.fields.jsonb.JSONField(default=[]), - ), - migrations.RunSQL( - 'ALTER TABLE delft3dworker_searchform ALTER COLUMN "templates" TYPE jsonb USING "templates"::text::jsonb;', - reverse_sql='ALTER TABLE delft3dworker_searchform ALTER COLUMN "templates" TYPE text USING "templates"::text;', - ), - migrations.AlterField( - model_name="template", - name="meta", - field=django.contrib.postgres.fields.jsonb.JSONField( - blank=True, default={} - ), - ), - migrations.RunSQL( - 'ALTER TABLE delft3dworker_template ALTER COLUMN "meta" TYPE jsonb USING "meta"::text::jsonb;', - reverse_sql='ALTER TABLE delft3dworker_template ALTER COLUMN "meta" TYPE text USING "meta"::text;', - ), - migrations.AlterField( - model_name="template", - name="sections", - field=django.contrib.postgres.fields.jsonb.JSONField( - blank=True, default={} - ), - ), - migrations.RunSQL( - 'ALTER TABLE delft3dworker_template ALTER COLUMN "sections" TYPE jsonb USING "sections"::text::jsonb;', - reverse_sql='ALTER TABLE delft3dworker_template ALTER COLUMN "sections" TYPE text USING "sections"::text;', - ), - migrations.AlterField( - model_name="version_svn", - name="versions", - field=django.contrib.postgres.fields.jsonb.JSONField(default={}), - ), - migrations.RunSQL( - 'ALTER TABLE delft3dworker_version_svn ALTER COLUMN "versions" TYPE jsonb USING "versions"::text::jsonb;', - reverse_sql='ALTER TABLE delft3dworker_version_svn ALTER COLUMN "versions" TYPE text USING "versions"::text;', - ), - ] diff --git a/delft3dworker/migrations/0088_auto_20180529_0942.py b/delft3dworker/migrations/0088_auto_20180529_0942.py deleted file mode 100644 index a1bbd420..00000000 --- a/delft3dworker/migrations/0088_auto_20180529_0942.py +++ /dev/null @@ -1,152 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.10 on 2018-05-29 09:42 -from __future__ import unicode_literals - -import django.contrib.postgres.fields.jsonb -import django.db.models.deletion -from django.db import migrations, models - -import delft3dworker.utils - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0087_auto_20180214_1324"), - ] - - operations = [ - migrations.CreateModel( - name="Workflow", - fields=[ - ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("name", models.CharField(max_length=256, unique=True)), - ( - "starttime", - models.DateTimeField( - blank=True, default=delft3dworker.utils.tz_now - ), - ), - ("task_uuid", models.UUIDField(blank=True, default=None, null=True)), - ( - "task_starttime", - models.DateTimeField( - blank=True, default=delft3dworker.utils.tz_now - ), - ), - ( - "desired_state", - models.CharField( - choices=[ - ("non-existent", "Non-existent"), - ("pending", "Pending"), - ("unknown", "Unknown"), - ("running", "Running"), - ("paused", "Running (Suspended)"), - ("succeeded", "Succeeded"), - ("skipped", "Skipped"), - ("failed", "Failed"), - ("error", "Error"), - ], - default="non-existent", - max_length=16, - ), - ), - ( - "cluster_state", - models.CharField( - choices=[ - ("non-existent", "Non-existent"), - ("pending", "Pending"), - ("unknown", "Unknown"), - ("running", "Running"), - ("paused", "Running (Suspended)"), - ("succeeded", "Succeeded"), - ("skipped", "Skipped"), - ("failed", "Failed"), - ("error", "Error"), - ], - default="non-existent", - max_length=16, - ), - ), - ("progress", models.PositiveSmallIntegerField(default=0)), - ], - ), - migrations.RemoveField( - model_name="scene", - name="workflow", - ), - migrations.AddField( - model_name="scene", - name="entrypoint", - field=models.PositiveSmallIntegerField( - choices=[(0, "main workflow")], default=0 - ), - ), - migrations.AddField( - model_name="template", - name="export_options", - field=django.contrib.postgres.fields.jsonb.JSONField( - blank=True, default={} - ), - ), - migrations.AddField( - model_name="template", - name="info", - field=django.contrib.postgres.fields.jsonb.JSONField( - blank=True, - default={ - "channel_network_images": {"images": [], "location": "process/"}, - "delta_fringe_images": {"images": [], "location": "process/"}, - "logfile": {"file": "", "location": "simulation/"}, - "postprocess_output": {}, - "procruns": 0, - "sediment_fraction_images": {"images": [], "location": "process/"}, - "subenvironment_images": {"images": [], "location": "postprocess/"}, - }, - ), - ), - migrations.AddField( - model_name="template", - name="visualisation", - field=django.contrib.postgres.fields.jsonb.JSONField( - blank=True, default={} - ), - ), - migrations.AddField( - model_name="template", - name="yaml_template", - field=models.FileField(default="", upload_to="workflows/"), - ), - migrations.AlterField( - model_name="scene", - name="phase", - field=models.PositiveSmallIntegerField( - choices=[ - (0, "New"), - (6, "Idle: waiting for user input"), - (11, "Starting workflow"), - (12, "Running workflow"), - (13, "Removing workflow"), - (500, "Finished"), - ], - default=0, - ), - ), - migrations.AddField( - model_name="workflow", - name="scene", - field=models.OneToOneField( - on_delete=django.db.models.deletion.CASCADE, to="delft3dworker.Scene" - ), - ), - ] diff --git a/delft3dworker/migrations/0089_template_shortname.py b/delft3dworker/migrations/0089_template_shortname.py deleted file mode 100644 index 3446924c..00000000 --- a/delft3dworker/migrations/0089_template_shortname.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.10 on 2018-05-29 18:34 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0088_auto_20180529_0942"), - ] - - operations = [ - migrations.AddField( - model_name="template", - name="shortname", - field=models.CharField(default="", max_length=256), - ), - ] diff --git a/delft3dworker/migrations/0090_auto_20180530_0832.py b/delft3dworker/migrations/0090_auto_20180530_0832.py deleted file mode 100644 index baf96832..00000000 --- a/delft3dworker/migrations/0090_auto_20180530_0832.py +++ /dev/null @@ -1,56 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.10 on 2018-05-30 08:32 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0089_template_shortname"), - ] - - operations = [ - migrations.AddField( - model_name="workflow", - name="action_log", - field=models.TextField(blank=True, default=""), - ), - migrations.AddField( - model_name="workflow", - name="cluster_log", - field=models.TextField(blank=True, default=""), - ), - migrations.AddField( - model_name="workflow", - name="yaml", - field=models.FileField(default="", upload_to="workflows/"), - ), - migrations.AlterField( - model_name="scene", - name="phase", - field=models.PositiveSmallIntegerField( - choices=[ - (0, "New"), - (6, "Idle: waiting for user input"), - (11, "Starting workflow"), - (12, "Running workflow"), - (13, "Removing workflow"), - (500, "Finished"), - (501, "Failed"), - ], - default=0, - ), - ), - migrations.AlterField( - model_name="template", - name="shortname", - field=models.CharField(default="gt", max_length=256), - ), - migrations.AlterField( - model_name="template", - name="yaml_template", - field=models.FileField(default="", upload_to="workflow_templates/"), - ), - ] diff --git a/delft3dworker/migrations/0091_auto_20180530_1505.py b/delft3dworker/migrations/0091_auto_20180530_1505.py deleted file mode 100644 index 91b6a96b..00000000 --- a/delft3dworker/migrations/0091_auto_20180530_1505.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.10 on 2018-05-30 15:05 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0090_auto_20180530_0832"), - ] - - operations = [ - migrations.RemoveField( - model_name="scene", - name="version", - ), - migrations.DeleteModel( - name="Version_SVN", - ), - ] diff --git a/delft3dworker/migrations/0092_auto_20180530_1506.py b/delft3dworker/migrations/0092_auto_20180530_1506.py deleted file mode 100644 index d07726b2..00000000 --- a/delft3dworker/migrations/0092_auto_20180530_1506.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.10 on 2018-05-30 15:06 -from __future__ import unicode_literals - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0091_auto_20180530_1505"), - ] - - operations = [ - migrations.RemoveField( - model_name="container", - name="scene", - ), - migrations.DeleteModel( - name="Container", - ), - ] diff --git a/delft3dworker/migrations/0093_auto_20181112_1250.py b/delft3dworker/migrations/0093_auto_20181112_1250.py deleted file mode 100644 index 20519784..00000000 --- a/delft3dworker/migrations/0093_auto_20181112_1250.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.16 on 2018-11-12 12:50 -from __future__ import unicode_literals - -import django.contrib.auth.models -import django.contrib.postgres.fields.jsonb -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("auth", "0008_alter_user_username_max_length"), - ("delft3dworker", "0092_auto_20180530_1506"), - ] - - operations = [ - migrations.CreateModel( - name="GroupUsageSummary", - fields=[], - options={ - "verbose_name": "Group Usage Summary", - "proxy": True, - "verbose_name_plural": "Group Usage Summary", - "indexes": [], - }, - bases=("auth.group",), - managers=[ - ("objects", django.contrib.auth.models.GroupManager()), - ], - ), - migrations.CreateModel( - name="UserUsageSummary", - fields=[], - options={ - "verbose_name": "User Usage Summary", - "proxy": True, - "verbose_name_plural": "User Usage Summary", - "indexes": [], - }, - bases=("auth.user",), - managers=[ - ("objects", django.contrib.auth.models.UserManager()), - ], - ), - migrations.AddField( - model_name="workflow", - name="stoptime", - field=models.DateTimeField(blank=True, null=True), - ), - ] diff --git a/delft3dworker/migrations/0094_auto_20181204_1539.py b/delft3dworker/migrations/0094_auto_20181204_1539.py deleted file mode 100644 index 52432c17..00000000 --- a/delft3dworker/migrations/0094_auto_20181204_1539.py +++ /dev/null @@ -1,83 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.16 on 2018-12-04 15:39 -from __future__ import unicode_literals - -import django.contrib.postgres.fields.jsonb -import django.db.models.deletion -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0093_auto_20181112_1250"), - ] - - operations = [ - migrations.CreateModel( - name="Version_Docker", - fields=[ - ( - "id", - models.AutoField( - auto_created=True, - primary_key=True, - serialize=False, - verbose_name="ID", - ), - ), - ("release", models.CharField(db_index=True, max_length=256)), - ("revision", models.PositiveSmallIntegerField(db_index=True)), - ( - "versions", - django.contrib.postgres.fields.jsonb.JSONField(default={}), - ), - ("changelog", models.CharField(max_length=256)), - ("reviewed", models.BooleanField(default=False)), - ], - options={ - "ordering": ["-revision"], - "verbose_name": "Docker version", - "verbose_name_plural": "Docker versions", - }, - ), - migrations.RemoveField( - model_name="scene", - name="entrypoint", - ), - migrations.AddField( - model_name="workflow", - name="entrypoint", - field=models.CharField(max_length=64, null=True), - ), - migrations.AlterField( - model_name="template", - name="info", - field=django.contrib.postgres.fields.jsonb.JSONField( - blank=True, default={} - ), - ), - migrations.AlterField( - model_name="template", - name="shortname", - field=models.CharField(default={}, max_length=256), - ), - migrations.AddField( - model_name="version_docker", - name="template", - field=models.ForeignKey( - on_delete=django.db.models.deletion.CASCADE, - related_name="versions", - to="delft3dworker.Template", - ), - ), - migrations.AddField( - model_name="workflow", - name="version", - field=models.ForeignKey( - null=True, - on_delete=django.db.models.deletion.CASCADE, - to="delft3dworker.Version_Docker", - ), - ), - ] diff --git a/delft3dworker/migrations/0095_auto_20181204_1559.py b/delft3dworker/migrations/0095_auto_20181204_1559.py deleted file mode 100644 index 39774689..00000000 --- a/delft3dworker/migrations/0095_auto_20181204_1559.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.16 on 2018-12-04 15:59 -from __future__ import unicode_literals - -from django.db import migrations, models - -import delft3dworker.models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0094_auto_20181204_1539"), - ] - - operations = [ - migrations.AlterField( - model_name="template", - name="yaml_template", - field=models.FileField( - default="", upload_to=delft3dworker.models.parse_argo_workflow - ), - ), - ] diff --git a/delft3dworker/migrations/0096_auto_20181206_1234.py b/delft3dworker/migrations/0096_auto_20181206_1234.py deleted file mode 100644 index a3af48e0..00000000 --- a/delft3dworker/migrations/0096_auto_20181206_1234.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by Django 1.11.16 on 2018-12-06 12:34 -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0095_auto_20181204_1559"), - ] - - operations = [ - migrations.RemoveField( - model_name="version_docker", - name="id", - ), - migrations.AlterField( - model_name="version_docker", - name="revision", - field=models.AutoField(primary_key=True, serialize=False), - ), - ] diff --git a/delft3dworker/migrations/0097_auto_20190211_1126.py b/delft3dworker/migrations/0097_auto_20190211_1126.py deleted file mode 100644 index aad69e64..00000000 --- a/delft3dworker/migrations/0097_auto_20190211_1126.py +++ /dev/null @@ -1,80 +0,0 @@ -# Generated by Django 2.0.10 on 2019-02-11 11:26 - -from django.db import migrations, models - -import delft3dworker.models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0096_auto_20181206_1234"), - ] - - operations = [ - migrations.AlterField( - model_name="scenario", - name="parameters", - field=delft3dworker.models.JSONFieldTransition(blank=True, default=dict), - ), - migrations.AlterField( - model_name="scenario", - name="scenes_parameters", - field=delft3dworker.models.JSONFieldTransition(blank=True, default=dict), - ), - migrations.AlterField( - model_name="scene", - name="info", - field=delft3dworker.models.JSONFieldTransition(blank=True, default=dict), - ), - migrations.AlterField( - model_name="scene", - name="parameters", - field=delft3dworker.models.JSONFieldTransition(blank=True, default=dict), - ), - migrations.AlterField( - model_name="searchform", - name="sections", - field=delft3dworker.models.JSONFieldTransition(default=list), - ), - migrations.AlterField( - model_name="searchform", - name="templates", - field=delft3dworker.models.JSONFieldTransition(default=list), - ), - migrations.AlterField( - model_name="template", - name="export_options", - field=delft3dworker.models.JSONFieldTransition(blank=True, default=dict), - ), - migrations.AlterField( - model_name="template", - name="info", - field=delft3dworker.models.JSONFieldTransition(blank=True, default=dict), - ), - migrations.AlterField( - model_name="template", - name="meta", - field=delft3dworker.models.JSONFieldTransition(blank=True, default=dict), - ), - migrations.AlterField( - model_name="template", - name="sections", - field=delft3dworker.models.JSONFieldTransition(blank=True, default=dict), - ), - migrations.AlterField( - model_name="template", - name="shortname", - field=models.CharField(default=dict, max_length=256), - ), - migrations.AlterField( - model_name="template", - name="visualisation", - field=delft3dworker.models.JSONFieldTransition(blank=True, default=dict), - ), - migrations.AlterField( - model_name="version_docker", - name="versions", - field=delft3dworker.models.JSONFieldTransition(default=dict), - ), - ] diff --git a/delft3dworker/migrations/0098_auto_20200226_1452.py b/delft3dworker/migrations/0098_auto_20200226_1452.py deleted file mode 100644 index a068298e..00000000 --- a/delft3dworker/migrations/0098_auto_20200226_1452.py +++ /dev/null @@ -1,25 +0,0 @@ -# Generated by Django 2.0.13 on 2020-02-26 14:52 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0097_auto_20190211_1126"), - ] - - operations = [ - migrations.AlterModelOptions( - name="scenario", - options={}, - ), - migrations.AlterModelOptions( - name="scene", - options={}, - ), - migrations.AlterModelOptions( - name="template", - options={}, - ), - ] diff --git a/delft3dworker/migrations/0099_alter_scene_phase.py b/delft3dworker/migrations/0099_alter_scene_phase.py deleted file mode 100644 index 2494f503..00000000 --- a/delft3dworker/migrations/0099_alter_scene_phase.py +++ /dev/null @@ -1,32 +0,0 @@ -# Generated by Django 3.2.4 on 2021-06-21 16:12 - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0098_auto_20200226_1452"), - ] - - operations = [ - migrations.AlterField( - model_name="scene", - name="phase", - field=models.PositiveSmallIntegerField( - choices=[ - (0, "New"), - (6, "Idle: waiting for user input"), - (11, "Starting workflow"), - (12, "Running workflow"), - (13, "Removing workflow"), - (20, "Stopping workflow"), - (21, "Removing stopped workflow"), - (500, "Finished"), - (501, "Failed"), - (502, "Stopped"), - ], - default=0, - ), - ), - ] diff --git a/delft3dworker/migrations/0100_alter_scene_options.py b/delft3dworker/migrations/0100_alter_scene_options.py deleted file mode 100644 index ce37cbb6..00000000 --- a/delft3dworker/migrations/0100_alter_scene_options.py +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by Django 3.2.4 on 2021-06-23 14:39 - -from django.db import migrations - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0099_alter_scene_phase"), - ] - - operations = [ - migrations.AlterModelOptions( - name="scene", - options={ - "permissions": [("extended_view_scene", "Can view scene with actions.")] - }, - ), - ] diff --git a/delft3dworker/migrations/0101_add_restricted_group.py b/delft3dworker/migrations/0101_add_restricted_group.py deleted file mode 100644 index ceeee95d..00000000 --- a/delft3dworker/migrations/0101_add_restricted_group.py +++ /dev/null @@ -1,48 +0,0 @@ -from django.db import migrations - -restricted_world_permissions = [ - "view_scenario", - "view_scene", - "view_template", -] - - -def forwards_func(apps, schema_editor): - Group = apps.get_model("auth", "Group") - Permission = apps.get_model("auth", "Permission") - ContentType = apps.get_model("contenttypes", "ContentType") - Scenario = apps.get_model("delft3dworker", "Scenario") - Scene = apps.get_model("delft3dworker", "Scene") - Template = apps.get_model("delft3dworker", "Template") - - db_alias = schema_editor.connection.alias - - restricted_world, _ = Group.objects.using(db_alias).get_or_create( - name="access:world_restricted" - ) - for model, permission_code in zip( - [Scenario, Scene, Template], restricted_world_permissions - ): - content_type = ContentType.objects.get_for_model(model) - print(model, content_type, permission_code) - perm, _ = Permission.objects.using(db_alias).get_or_create( - codename=permission_code, content_type=content_type - ) - restricted_world.permissions.add(perm) - - -def reverse_func(apps, schema_editor): - Group = apps.get_model("auth", "Group") - db_alias = schema_editor.connection.alias - Group.objects.using(db_alias).filter(name="access:world_restricted").delete() - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0100_alter_scene_options"), - ] - - operations = [ - migrations.RunPython(forwards_func, reverse_func), - ] diff --git a/delft3dworker/migrations/0102_add_extended_view_permissions.py b/delft3dworker/migrations/0102_add_extended_view_permissions.py deleted file mode 100644 index 01cd5d5a..00000000 --- a/delft3dworker/migrations/0102_add_extended_view_permissions.py +++ /dev/null @@ -1,74 +0,0 @@ -from django.db import migrations -from django.contrib.auth.models import Group -from guardian.shortcuts import ( - assign_perm, - get_groups_with_perms, - get_users_with_perms, - remove_perm, -) - - -def forwards_func(apps, schema_editor): - Scene = apps.get_model("delft3dworker", "Scene") - db_alias = schema_editor.connection.alias - - restricted_world = Group.objects.using(db_alias).get(name="access:world_restricted") - - for scene in Scene.objects.using(db_alias).all(): - - # if a user has view permission on a scene, - # the user also has a extended_view - for user, _ in get_users_with_perms( - scene, - attach_perms=True, - with_group_users=False, - only_with_perms_in=("view_scene",), - ).items(): - assign_perm("extended_view_scene", user, scene) - - # if a group has a view permission on a scene, - # the group also has a extended view - for group, permissions in get_groups_with_perms( - scene, attach_perms=True - ).items(): - if "view_scene" in permissions: - assign_perm("extended_view_scene", group, scene) - - # if the world group has a view permission - # we also add view to the restricted world group - if "view_scene" in permissions and group.name == "access:world": - assign_perm("view_scene", restricted_world, scene) - - -def reverse_func(apps, schema_editor): - Scene = apps.get_model("delft3dworker", "Scene") - db_alias = schema_editor.connection.alias - - for scene in Scene.objects.using(db_alias).all(): - for user, _ in get_users_with_perms( - scene, - attach_perms=True, - with_group_users=False, - only_with_perms_in=("extended_view_scene",), - ).items(): - remove_perm("extended_view_scene", user, scene) - - for group, permissions in get_groups_with_perms( - scene, attach_perms=True - ).items(): - if "extended_view_scene" in permissions: - remove_perm("extended_view_scene", group, scene) - - if "view_scene" in permissions and group.name == "access:world_restricted": - remove_perm("view_scene", group, scene) - - -class Migration(migrations.Migration): - - dependencies = [ - ("delft3dworker", "0101_add_restricted_group"), - ] - - operations = [ - migrations.RunPython(forwards_func, reverse_func), - ] diff --git a/delft3dworker/models.py b/delft3dworker/models.py index 31a25c91..8c949bce 100644 --- a/delft3dworker/models.py +++ b/delft3dworker/models.py @@ -9,14 +9,16 @@ import shutil import uuid from os.path import join -import yaml +import yaml from celery.result import AsyncResult from django.conf import settings # noqa from django.contrib.auth.models import Group, User from django.core.files.base import ContentFile from django.db import models from django.db.models import JSONField +from django.db.models.signals import post_save +from django.dispatch import receiver from django.utils.text import slugify from django.utils.timezone import now from guardian.shortcuts import ( @@ -26,11 +28,11 @@ remove_perm, ) from model_utils import Choices + from delft3dcontainermanager.tasks import ( do_argo_create, do_argo_remove, do_argo_stop, - get_argo_workflows, get_kube_log, ) from delft3dworker.utils import ( @@ -44,6 +46,7 @@ # ################################### VERSION_DOCKER, SCENARIO, SCENE + # For backwards compatibility in migrations def default_svn_version(): pass @@ -91,26 +94,6 @@ def __str__(self): return "Release {} at revision {}".format(self.release, self.revision) -def parse_argo_workflow(instance, filename): - # If new worklow is uploaded, define a version - - # Load yaml and derive defaults - template = yaml.load(instance.yaml_template.read(), Loader=yaml.FullLoader) - defaults = derive_defaults_from_argo(template) - - # Create version based on defaults - version = Version_Docker( - release="Default for {}".format(filename), - versions=defaults, - changelog="default release based on template", - template=instance, - ) - version.save() - - # Otherwise just return the filepath - return join("workflow_templates", filename) - - class Scenario(models.Model): """ @@ -224,7 +207,6 @@ def publish_world(self, user): # TODO Workflow update this def _update_state_and_save(self): - count = self.scene_set.all().count() self.state = "inactive" @@ -242,7 +224,7 @@ def _update_state_and_save(self): return self.state def _parse_setting(self, key, setting): - if not ("values" in setting): + if "values" not in setting: return values = setting["values"] @@ -416,7 +398,6 @@ def export(self, zipfile, options): if root.endswith(option.get("location", "")) and ext in option.get( "extensions", [] ): - files_added = True abs_path = os.path.join(root, f) rel_path = os.path.join( @@ -430,7 +411,6 @@ def export(self, zipfile, options): # CRUD METHODS def save(self, *args, **kwargs): - # On first save if self.pk is None: self.workingdir = os.path.join(settings.WORKER_FILEDIR, str(self.suid), "") @@ -499,10 +479,8 @@ def publish_world(self, user): # HEARTBEAT UPDATE AND SAVE def update_and_phase_shift(self): - # Create Workflow model and shift to idle if self.phase == self.phases.new: - if not hasattr(self, "workflow"): workflow = Workflow.objects.create( scene=self, @@ -519,7 +497,6 @@ def update_and_phase_shift(self): # User started a scene. Create Workflow and shift if it's running. elif self.phase == self.phases.sim_start: - self.workflow.set_desired_state("running") if self.workflow.cluster_state == "running": self.shift_to_phase(self.phases.sim_run) @@ -556,15 +533,15 @@ def update_and_phase_shift(self): # Delete workflow in cluster elif self.phase in self.REMOVE_WORKFLOW: - self.workflow.set_desired_state("non-existent") - if self.workflow.cluster_state != "non-existent": - self.progress = self.workflow.progress - self.save(update_fields=["progress"]) - else: - if self.phase == self.phases.sim_fin: - self.shift_to_phase(self.phases.fin) - elif self.phase == self.phases.stop_fin: - self.shift_to_phase(self.phases.stopped) + # self.workflow.set_desired_state("non-existent") + # if self.workflow.cluster_state != "non-existent": + self.progress = self.workflow.progress + self.save(update_fields=["progress"]) + # else: + if self.phase == self.phases.sim_fin: + self.shift_to_phase(self.phases.fin) + elif self.phase == self.phases.stop_fin: + self.shift_to_phase(self.phases.stopped) return @@ -583,12 +560,11 @@ def _delete_datafolder(self): if os.path.exists(self.workingdir): try: shutil.rmtree(self.workingdir) - except: + except Exception as e: # Files written by root can't be deleted by django - logging.error("Failed to delete working directory") + logging.error(f"Failed to delete working directory: {e}") def _update_state_and_save(self): - # TODO: write _update_state_and_save method return self.state @@ -638,10 +614,8 @@ def _update_templates(self, tmpl_name, tmpl_id, tmpl_info): ) def _update_sections(self, tmpl_sections): - # for each section for tmpl_section in tmpl_sections: - # find matching (i.e. name && type equal) sections # in this search form matching_sections = [ @@ -652,7 +626,6 @@ def _update_sections(self, tmpl_sections): # add or update if not matching_sections: - # remove non-required fields from variables for variable in tmpl_section["variables"]: try: @@ -667,12 +640,10 @@ def _update_sections(self, tmpl_sections): self.sections.append(tmpl_section) else: - srch_section = matching_sections[0] # for each variable for tmpl_variable in tmpl_section["variables"]: - # find matching (i.e. name equal) sections # in this search form matching_variables = [ @@ -683,7 +654,6 @@ def _update_sections(self, tmpl_sections): # add or update if not matching_variables: - # remove non-required fields from variables try: del tmpl_variable["default"] @@ -696,7 +666,6 @@ def _update_sections(self, tmpl_sections): srch_section["variables"].append(tmpl_variable) else: - srch_variable = matching_variables[0] # only update min and max validators if numeric @@ -704,7 +673,6 @@ def _update_sections(self, tmpl_sections): srch_variable["type"] == "numeric" and tmpl_variable["type"] == "numeric" ): - tmpl_validators = tmpl_variable["validators"] srch_validators = srch_variable["validators"] @@ -738,7 +706,7 @@ class Template(models.Model): sections = JSONFieldTransition(blank=True, default=dict) visualisation = JSONFieldTransition(blank=True, default=dict) export_options = JSONFieldTransition(blank=True, default=dict) - yaml_template = models.FileField(upload_to=parse_argo_workflow, default="") + yaml_template = models.FileField(upload_to="workflow_templates", default="") # The following method is disabled as it adds to much garbage # to the MAIN search template @@ -757,7 +725,6 @@ def __str__(self): return self.name def save(self, *args, **kwargs): - # On first save set a shortname if self.pk is None: self.shortname = self.name.replace(" ", "-").lower() @@ -765,6 +732,28 @@ def save(self, *args, **kwargs): super(Template, self).save(*args, **kwargs) +@receiver(post_save, sender=Template) +def parse_argo_workflow(sender, instance, created, raw, using, update_fields, **kwargs): + # If new worklow is uploaded, define a version + if raw is True: + return + + # Load yaml and derive defaults + template = yaml.load(instance.yaml_template.read(), Loader=yaml.FullLoader) + defaults = derive_defaults_from_argo(template) + + # Create version based on defaults if different from current + current = instance.versions.first() + if current is None or (current is not None and current.versions != defaults): + version = Version_Docker( + release="Default for {}".format(instance.name), + versions=defaults, + changelog="default release based on template", + template=instance, + ) + version.save() + + class Workflow(models.Model): """Argo Workflow Instance.""" @@ -846,7 +835,6 @@ def update_task_result(self): result = AsyncResult(id=str(self.task_uuid)) time_passed = now() - self.task_starttime if result.ready(): - if result.successful(): # Log parsing if "get_kube_log" in result.result: @@ -984,9 +972,7 @@ def create_workflow(self): ) def stop_workflow(self): - result = do_argo_stop.apply_async( - args=(self.name,), expires=settings.TASK_EXPIRE_TIME - ) + do_argo_stop.apply_async(args=(self.name,), expires=settings.TASK_EXPIRE_TIME) # calculate runtime self.stoptime = now() self.action_log += "{} | Stopped \n".format(self.stoptime) diff --git a/delft3dworker/test_admin.py b/delft3dworker/test_admin.py index 2f0a8111..134ea243 100644 --- a/delft3dworker/test_admin.py +++ b/delft3dworker/test_admin.py @@ -2,12 +2,10 @@ from django.contrib.admin.sites import AdminSite from django.contrib.auth.models import Permission -from django.test import Client, RequestFactory, TestCase +from django.test import RequestFactory, TestCase from django.urls import reverse -from django.utils import timezone -from mock import Mock -from delft3dworker.admin import GroupUsageSummaryAdmin, SceneAdmin +from delft3dworker.admin import GroupUsageSummaryAdmin from delft3dworker.models import Group, Scene, User, Workflow # class AdminTest(TestCase): @@ -34,6 +32,7 @@ # queryset = Scene.objects.all() # self.scene_admin.resync(request, queryset) + # # scene_a should still be new # # scene_b should be in sync_create # self.assertEqual(Scene.objects.get(id=0).phase, Scene.phases.new) @@ -68,19 +67,29 @@ def setUp(self): self.workflow_a = Workflow.objects.create( name="WorkflowA", scene=self.scene_a, - starttime=datetime.datetime(2010, 10, 10, 10, 10, 00, tzinfo=timezone.utc), - stoptime=datetime.datetime(2010, 10, 10, 10, 20, 00, tzinfo=timezone.utc), + starttime=datetime.datetime( + 2010, 10, 10, 10, 10, 00, tzinfo=datetime.timezone.utc + ), + stoptime=datetime.datetime( + 2010, 10, 10, 10, 20, 00, tzinfo=datetime.timezone.utc + ), ) self.workflow_b = Workflow.objects.create( name="WorkflowB", scene=self.scene_b, - starttime=datetime.datetime(2010, 10, 10, 10, 20, 00, tzinfo=timezone.utc), - stoptime=datetime.datetime(2010, 10, 10, 10, 40, 00, tzinfo=timezone.utc), + starttime=datetime.datetime( + 2010, 10, 10, 10, 20, 00, tzinfo=datetime.timezone.utc + ), + stoptime=datetime.datetime( + 2010, 10, 10, 10, 40, 00, tzinfo=datetime.timezone.utc + ), ) self.workflow_c = Workflow.objects.create( name="WorkflowC", scene=self.scene_c, - starttime=datetime.datetime(2010, 10, 10, 10, 30, 00, tzinfo=timezone.utc), + starttime=datetime.datetime( + 2010, 10, 10, 10, 30, 00, tzinfo=datetime.timezone.utc + ), ) self.group_usage_summary_admin = GroupUsageSummaryAdmin(Group, AdminSite()) diff --git a/delft3dworker/test_management.py b/delft3dworker/test_management.py index 5d4273ac..0599161c 100644 --- a/delft3dworker/test_management.py +++ b/delft3dworker/test_management.py @@ -6,7 +6,7 @@ from django.core.management import call_command from django.test import TestCase from fakeredis import FakeStrictRedis -from mock import PropertyMock, call, patch +from mock import call, patch from delft3dworker.models import Scenario, Scene, Template, Workflow @@ -97,7 +97,7 @@ def test_sync_cluster_state( { "metadata": { "name": "test-template-abcdefg", - "labels": {u"workflows.argoproj.io/phase": "Running"}, + "labels": {"workflows.argoproj.io/phase": "Running"}, } } ), diff --git a/delft3dworker/test_models.py b/delft3dworker/test_models.py index 7bd79dc1..2d6dc012 100644 --- a/delft3dworker/test_models.py +++ b/delft3dworker/test_models.py @@ -158,14 +158,13 @@ def test_publish_world(self, mocked_scene_method): class SceneTestCase(TestCase): def setUp(self): - # create users, groups and assign permissions self.user_a = User.objects.create_user(username="A") self.user_b = User.objects.create_user(username="B") self.user_c = User.objects.create_user(username="C") company_w = Group.objects.create(name="access:world") - company_wr = Group.objects.create(name="access:world_restricted") + # company_wr = Group.objects.create(name="access:world_restricted") for user in [self.user_a, self.user_b, self.user_c]: company_w.user_set.add(user) for perm in ["view_scene", "add_scene", "change_scene", "delete_scene"]: @@ -417,7 +416,6 @@ def test_start_scene(self): # a scene should only start when it's idle: check for each phase for phase in self.scene_1.phases: - # shift scene to phase self.scene_1.shift_to_phase(phase[0]) @@ -434,23 +432,18 @@ def test_start_scene(self): # check date_started is untouched unless started from Idle state if phase[0] < self.scene_1.phases.idle: - self.assertEqual(self.scene_1.date_started, started_date) if phase[0] == self.scene_1.phases.idle: - self.assertTrue(self.scene_1.date_started <= now()) started_date = self.scene_1.date_started # store started date else: - self.assertEqual(self.scene_1.date_started, started_date) def test_abort_scene(self): - # abort is more complex for phase in self.scene_1.phases: - # shift scene to phase self.scene_1.shift_to_phase(phase[0]) @@ -469,7 +462,6 @@ def test_abort_scene(self): self.assertEqual(self.scene_1.phase, phase[0]) def test_export_scene(self): - # As taken from `views.py` stream = io.BytesIO() zf = zipfile.ZipFile(stream, "w", zipfile.ZIP_STORED, True) @@ -759,7 +751,6 @@ def test_phase_stopped(self): class WorkflowTestCase(TestCase): def setUp(self): - self.run_argo_ps_dict = { "apiVersion": "argoproj.io/v1alpha1", "kind": "Workflow", @@ -854,7 +845,6 @@ def test_outdated_entrypoints(self): @patch("logging.warn", autospec=True) @patch("delft3dworker.models.AsyncResult", autospec=True) def test_update_task_result(self, MockedAsyncResult, mocked_warn_method): - async_result = MockedAsyncResult.return_value # Set up: A previous task is not yet finished @@ -885,8 +875,9 @@ def test_update_task_result(self, MockedAsyncResult, mocked_warn_method): self.workflow.task_starttime = now() async_result.ready.return_value = True async_result.result = ( - "01234567890abcdefghijklmnopqrstuvwxyz01234567890abcdefghijkl" - ), "ERror MesSAge" + ("01234567890abcdefghijklmnopqrstuvwxyz01234567890abcdefghijkl"), + "ERror MesSAge", + ) async_result.state = "FAILURE" # call method @@ -900,8 +891,9 @@ def test_update_task_result(self, MockedAsyncResult, mocked_warn_method): async_result.ready.return_value = True async_result.successful.return_value = True async_result.result = ( - "01234567890abcdefghijklmnopqrstuvwxyz01234567890abcdefghijkl" - ), "INFO:root:Time to finish 70.0, 10.0% completed," + ("01234567890abcdefghijklmnopqrstuvwxyz01234567890abcdefghijkl"), + "INFO:root:Time to finish 70.0, 10.0% completed,", + ) async_result.state = "SUCCESS" # call method @@ -913,7 +905,6 @@ def test_update_task_result(self, MockedAsyncResult, mocked_warn_method): @patch("delft3dworker.models.AsyncResult", autospec=True) def test_update_progress(self, MockedAsyncResult): - async_result = MockedAsyncResult.return_value # Set up: A previous task is not yet finished @@ -921,7 +912,7 @@ def test_update_progress(self, MockedAsyncResult): self.workflow.task_starttime = now() async_result.ready.return_value = True async_result.state = "SUCCESS" - async_result.result = "dockerid", u"None" + async_result.result = "dockerid", "None" async_result.successful.return_value = True # call method @@ -950,7 +941,6 @@ def test_update_progress(self, MockedAsyncResult): @patch("logging.error", autospec=True) def test_update_state_and_save(self, mocked_error_method): - # This test will test the behavior of a workflow # when it receives snapshot @@ -1097,7 +1087,6 @@ def test_reset_scene(self): # a scene should only start when it's idle: check for each phase for phase in self.scene_1.phases: - # shift scene to phase self.scene_1.date_started = date_started self.scene_1.progress = progress @@ -1179,7 +1168,6 @@ def test_redo_scene(self): class SearchFormTestCase(TestCase): def setUp(self): - self.sections_a = """ [ { diff --git a/delft3dworker/test_utils.py b/delft3dworker/test_utils.py index 1893b42f..79e33283 100644 --- a/delft3dworker/test_utils.py +++ b/delft3dworker/test_utils.py @@ -1,6 +1,6 @@ from __future__ import absolute_import -from datetime import date, datetime, time +from datetime import date, datetime from django.test import TestCase from django.utils import timezone diff --git a/delft3dworker/test_views.py b/delft3dworker/test_views.py index b08f7fdd..5a650bd3 100644 --- a/delft3dworker/test_views.py +++ b/delft3dworker/test_views.py @@ -23,7 +23,6 @@ class ApiAccessTestCase(TestCase): """ def setUp(self): - # set up request factory self.factory = APIRequestFactory() @@ -181,7 +180,7 @@ def setUp(self): user.user_permissions.add(Permission.objects.get(codename=perm)) groups_world = Group.objects.create(name="access:world") - groups_world_restricted = Group.objects.create(name="access:world_restricted") + # groups_world_restricted = Group.objects.create(name="access:world_restricted") groups_world.user_set.add(self.user_foo) groups_world.user_set.add(self.user_bar) @@ -598,7 +597,6 @@ class SceneSearchTestCase(TestCase): """ def setUp(self): - self.user_bar = User.objects.create_user( id=1, username="bar", password="secret" ) @@ -660,7 +658,6 @@ def setUp(self): self.user_bar = User.objects.get(pk=self.user_bar.pk) def test_search_props(self): - # Exact matches search_query_exact_a = {"name": "Testscene 1"} search_query_exact_b = {"state": "FINISHED"} @@ -671,18 +668,16 @@ def test_search_props(self): self.assertEqual(len(self._request(search_query_exact_c)), 1) def test_search_search(self): - # Partial matches from beginning of line search_query_partial_a = {"search": "Te"} search_query_partial_b = {"search": "Tes"} - search_query_partial_c = {"search": "SUCC", "search": "Te", "search": "T"} + search_query_partial_c = {"search": "T"} self.assertEqual(len(self._request(search_query_partial_a)), 2) self.assertEqual(len(self._request(search_query_partial_b)), 2) self.assertEqual(len(self._request(search_query_partial_c)), 2) def test_search_params(self): - # Parameter searches search_query_parameter_a = {"parameter": "a"} search_query_parameter_b = {"parameter": "b"} @@ -714,7 +709,6 @@ def test_search_params(self): self.assertEqual(len(self._request(search_query_postproc_5)), 1) def test_search_user(self): - # user searches search_query_users_1 = {"users": []} search_query_users_2 = {"users": [""]} @@ -731,7 +725,6 @@ def test_search_user(self): self.assertEqual(len(self._request(search_query_users_6)), 2) def test_search_creation_date(self): - # creation date before searches search_query_date_before_1 = {"created_before": "2000-01-01"} search_query_date_before_2 = {"created_before": "2500-01-01"} @@ -755,7 +748,6 @@ def test_search_creation_date(self): self.assertEqual(len(self._request(search_query_date_after_4)), 2) def test_search_start_date(self): - # creation date before searches search_query_date_before_00 = {"started_before": "2000-01-01"} search_query_date_before_01 = {"started_before": "3000-01-01"} @@ -1118,7 +1110,6 @@ class UserTestCase(TestCase): """ def setUp(self): - # create user in dB self.user_foo = User.objects.create_user( username="foo", first_name="Foo", last_name="Oof", email="foo@company.nl" diff --git a/delft3dworker/urls.py b/delft3dworker/urls.py index 03f047e3..36bf5b2e 100644 --- a/delft3dworker/urls.py +++ b/delft3dworker/urls.py @@ -1,4 +1,4 @@ -from django.conf.urls import handler404, handler500, include, url # noqa +from django.urls import include, path from rest_framework import routers from delft3dworker import views @@ -23,8 +23,8 @@ # url patterns urlpatterns = ( - url(r"^oidc/", include("mozilla_django_oidc.urls")), + path("oidc/", include("mozilla_django_oidc.urls")), # REST Framework - url(r"^api/v1/", include(router.urls)), - url(r"^api-auth/", include("rest_framework.urls", namespace="rest_framework")), + path("api/v1/", include(router.urls)), + path("api-auth/", include("rest_framework.urls", namespace="rest_framework")), ) diff --git a/delft3dworker/utils.py b/delft3dworker/utils.py index 08b165d6..dfb3c3af 100644 --- a/delft3dworker/utils.py +++ b/delft3dworker/utils.py @@ -4,7 +4,6 @@ import logging import os import re -import sys from datetime import datetime, time from django.utils import timezone @@ -75,7 +74,6 @@ def delft3d_logparser(line): """ try: - percentage_re = re.compile( r""" ^(?P.*? # capture whole string as message @@ -104,10 +102,7 @@ def delft3d_logparser(line): match = {"message": None, "level": "INFO", "state": None, "progress": None} return match - except: - - e = sys.exc_info()[1] # get error msg - + except Exception as e: return { "message": "error '%s' on line '%s'" % (e.message, line), "level": "ERROR", @@ -125,7 +120,6 @@ def python_logparser(line): """ try: - python_re = re.compile( r""" ^(?P @@ -161,10 +155,7 @@ def python_logparser(line): match = {"message": line, "level": "INFO", "state": None, "progress": None} return match - except: - - e = sys.exc_info()[1] # get error msg - + except Exception as e: return { "message": "error '%s' on line '%s'" % (e.message, line), "level": "ERROR", @@ -188,7 +179,6 @@ def scan_output_files(workingdir, info_dict): processed_files = 0 required_keys = ["location", "extensions", "files"] for key, value in info_dict.items(): - # Check whether info dict is nested if not isinstance(value, dict): continue @@ -216,7 +206,7 @@ def scan_output_files(workingdir, info_dict): # If images, search by key # TODO Use regex expressions in the future if "_images" in key: - type_of_image = key.split("_images")[0] + type_of_image = value.get("pattern", "nomatch") if type_of_image in name: info_dict[key]["files"].append(fn) diff --git a/delft3dworker/views.py b/delft3dworker/views.py index f7aae347..22434b53 100644 --- a/delft3dworker/views.py +++ b/delft3dworker/views.py @@ -247,13 +247,11 @@ def get_queryset(self): # will sometimes fail try: for parameter in parameters: - p = parameter.split(",") p = [val for val in p if val != ""] # Key, min, max lookup if len(p) == 3: - key, minvalue, maxvalue = p logging.info( "Lookup value [{} - {}] for parameter {}".format( @@ -274,7 +272,6 @@ def get_queryset(self): # 1.9 So we loop manually (bad performance!) wanted = [] for scene in queryset: - # filter on input parameters value = scene.parameters.get(key, {}).get( "value", "None" @@ -318,7 +315,6 @@ def get_queryset(self): queryset = queryset.filter(parameters__icontains=key) for value in values: - # a blatant copy-paste of the above, because I # cannot be bothered @@ -333,7 +329,7 @@ def get_queryset(self): queryset = queryset.filter(pk__in=wanted) - except Exception as e: + except Exception: logging.exception( "Search with params {} and template {} failed".format( parameters, template @@ -446,7 +442,6 @@ def publish_company(self, request, pk=None): @action(methods=["post"], detail=False) # denied after publish to world def publish_company_all(self, request): - try: queryset = Scene.objects.filter(owner=self.request.user).filter( suid__in=request.data.getlist("suid", []) @@ -472,7 +467,6 @@ def publish_world(self, request, pk=None): @action(methods=["post"], detail=False) # denied after publish to world def publish_world_all(self, request): - try: queryset = Scene.objects.filter(owner=self.request.user).filter( suid__in=request.data.getlist("suid", []) @@ -652,7 +646,6 @@ def get_queryset(self): @action(detail=False) def me(self, request): - me = User.objects.filter(pk=request.user.pk) serializer = self.get_serializer(me, many=True) diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..0c84b8cc --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,51 @@ +version: "3.9" +services: + django: + build: . + volumes: + - .:/app + depends_on: + db: + condition: service_healthy + command: > + bash -c "python manage.py migrate && python manage.py loaddata delft3dgtmain/fixtures/default_users_groups.json && python manage.py loaddata delft3dworker/fixtures/default_template.json && python manage.py runserver 0.0.0.0:8000" + ports: + - "8000:8000" + redis: + image: "redis:alpine" + ports: + - "6379:6379" + celery: + build: . + volumes: + - .:/app + command: celery multi start 2 -A delft3dcontainermanager -Q:1 {{ node1 }} -Q:2 {{ node2 }} -c2 -l INFO -Ofair + depends_on: + - redis + - db + celerybeat: + build: . + volumes: + - .:/app + command: celery worker --app=delft3dgtmain -Q beat --beat -l INFO + depends_on: + - redis + - db + flower: + build: . + volumes: + - .:/app + command: celery --app=delft3dcontainermanager flower + ports: + - "5555:5555" + depends_on: + - redis + db: + image: postgres:12 + ports: + - "5432:5432" + healthcheck: + test: [ "CMD-SHELL", "pg_isready -U postgres" ] + interval: 1s + timeout: 5s + retries: 5 diff --git a/requirements.txt b/requirements.txt index 03c701f6..e6acf4b6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,13 +2,12 @@ -r worker_requirements.txt django-constance[database]==2.9.* -django-filter==22.1 +django-filter==23.5 django-admin-rangefilter==0.9.* -django-jsonfield==1.4.* # only for migrations -django-guardian==2.4.* # 1 year ago, no Django 4 support -django-model-utils==4.2.* +django-guardian==2.4.* +django-model-utils==4.3.* djangorestframework==3.14.* -djangorestframework-guardian==0.3.* # 3 years ago -flower==0.9.* # because of celery 4.4 -mozilla-django-oidc==2.0.* +djangorestframework-guardian2==0.5.* # 3 years ago +flower # because of celery 4.4 +mozilla-django-oidc==4.0.* psycopg2-binary==2.9.* diff --git a/test_requirements.txt b/test_requirements.txt index 6a0d48f9..22bb8754 100644 --- a/test_requirements.txt +++ b/test_requirements.txt @@ -1,5 +1,9 @@ # includes all non-test requirements -r requirements.txt -fakeredis==1.9.* -coverage==6.5.* +fakeredis==2.21.* +coverage +mock +ruff==0.2.* + + diff --git a/worker_requirements.txt b/worker_requirements.txt index d1fcce5c..ece86290 100644 --- a/worker_requirements.txt +++ b/worker_requirements.txt @@ -1,6 +1,7 @@ celery==4.4.* # stuck because of once celery-once==3.0.* # 3 years ago -ddtrace==1.5.* -Django==3.2.* # LTS +ddtrace==2.6.* +Django==4.2.* # LTS kubernetes==23.* # match cluster 1.23 -redis[hiredis]==4.3.* +redis[hiredis]==5.0.* +awscli