Commit e8382b74 authored by Jorrit Schaap's avatar Jorrit Schaap

TMSS-153: added CEP4 cluster and LustreFS

parent c375742a
......@@ -10,4 +10,5 @@ class Migration(migrations.Migration):
]
operations = [ migrations.RunPython(populate_choices),
migrations.RunPython(populate_misc),
migrations.RunPython(populate_lofar_json_schemas) ]
......@@ -17,8 +17,8 @@ class Migration(migrations.Migration):
import json
from lofar.sas.tmss.tmss.tmssapp.models.specification import Role, Datatype, Dataformat, CopyReason
from lofar.sas.tmss.tmss.tmssapp.models.scheduling import SubtaskState, SubtaskType, SubtaskTemplate, Subtask, \
StationType, Algorithm, ScheduleMethod
StationType, Algorithm, ScheduleMethod, Cluster, Filesystem
from lofar.common.json_utils import add_defaults_to_json_object_for_schema
def populate_choices(apps, schema_editor):
'''
......@@ -38,6 +38,10 @@ def populate_lofar_json_schemas(apps, schema_editor):
_populate_example_data()
def populate_misc(apps, schema_editor):
cluster = Cluster.objects.create(name="CEP4", location="CIT")
fs = Filesystem.objects.create(name="LustreFS", cluster=cluster, capacity=3.6e15)
def _populate_correlator_schema():
subtask_template_data = {"type": SubtaskType.objects.get(value='observation'),
......@@ -178,6 +182,8 @@ def _populate_example_data():
taskblueprint = None
# subtask 1
subtask_template = SubtaskTemplate.objects.get(name='correlator schema')
specifications_doc = {
"duration": 60,
"calibrator": {"enabled": False,
......@@ -189,7 +195,7 @@ def _populate_example_data():
"integration_time": 1,
"storage_cluster": "CEP4"}
subtask_template = SubtaskTemplate.objects.get(name='correlator schema')
specifications_doc = add_defaults_to_json_object_for_schema(specifications_doc, subtask_template.schema)
subtask_data = {"start_time": datetime.utcnow().isoformat(),
"stop_time": datetime.utcnow().isoformat(),
......@@ -207,6 +213,7 @@ def _populate_example_data():
Subtask.objects.create(**subtask_data)
# subtask 2
subtask_template = SubtaskTemplate.objects.get(name='obscontrol schema')
specifications_doc = {
"stations": {"station_list": ["CS001", "CS002"],
"antenna_set": "HBA_DUAL",
......@@ -218,12 +225,12 @@ def _populate_example_data():
"pointing": {"direction_type": "J2000",
"angle1": 45,
"angle2": 20},
"subbands": list(range(0, 488))
"subbands": list(range(0, 16))
}]
}
}
subtask_template = SubtaskTemplate.objects.get(name='obscontrol schema')
specifications_doc = add_defaults_to_json_object_for_schema(specifications_doc, subtask_template.schema)
subtask_data = {"start_time": datetime.utcnow().isoformat(),
"stop_time": datetime.utcnow().isoformat(),
......@@ -427,6 +434,7 @@ def _populate_obscontrol_schema():
"type": "array",
"title": "Subband list",
"additionalItems": false,
"default": [],
"items": {
"type": "integer",
"title": "Subband",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment