Skip to content
Snippets Groups Projects
Commit e8382b74 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

TMSS-153: added CEP4 cluster and LustreFS

parent c375742a
No related branches found
No related tags found
1 merge request!102Resolve TMSS-153
...@@ -10,4 +10,5 @@ class Migration(migrations.Migration): ...@@ -10,4 +10,5 @@ class Migration(migrations.Migration):
] ]
operations = [ migrations.RunPython(populate_choices), operations = [ migrations.RunPython(populate_choices),
migrations.RunPython(populate_misc),
migrations.RunPython(populate_lofar_json_schemas) ] migrations.RunPython(populate_lofar_json_schemas) ]
...@@ -17,8 +17,8 @@ class Migration(migrations.Migration): ...@@ -17,8 +17,8 @@ class Migration(migrations.Migration):
import json import json
from lofar.sas.tmss.tmss.tmssapp.models.specification import Role, Datatype, Dataformat, CopyReason 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, \ 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): def populate_choices(apps, schema_editor):
''' '''
...@@ -38,6 +38,10 @@ def populate_lofar_json_schemas(apps, schema_editor): ...@@ -38,6 +38,10 @@ def populate_lofar_json_schemas(apps, schema_editor):
_populate_example_data() _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(): def _populate_correlator_schema():
subtask_template_data = {"type": SubtaskType.objects.get(value='observation'), subtask_template_data = {"type": SubtaskType.objects.get(value='observation'),
...@@ -178,6 +182,8 @@ def _populate_example_data(): ...@@ -178,6 +182,8 @@ def _populate_example_data():
taskblueprint = None taskblueprint = None
# subtask 1 # subtask 1
subtask_template = SubtaskTemplate.objects.get(name='correlator schema')
specifications_doc = { specifications_doc = {
"duration": 60, "duration": 60,
"calibrator": {"enabled": False, "calibrator": {"enabled": False,
...@@ -189,7 +195,7 @@ def _populate_example_data(): ...@@ -189,7 +195,7 @@ def _populate_example_data():
"integration_time": 1, "integration_time": 1,
"storage_cluster": "CEP4"} "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(), subtask_data = {"start_time": datetime.utcnow().isoformat(),
"stop_time": datetime.utcnow().isoformat(), "stop_time": datetime.utcnow().isoformat(),
...@@ -207,6 +213,7 @@ def _populate_example_data(): ...@@ -207,6 +213,7 @@ def _populate_example_data():
Subtask.objects.create(**subtask_data) Subtask.objects.create(**subtask_data)
# subtask 2 # subtask 2
subtask_template = SubtaskTemplate.objects.get(name='obscontrol schema')
specifications_doc = { specifications_doc = {
"stations": {"station_list": ["CS001", "CS002"], "stations": {"station_list": ["CS001", "CS002"],
"antenna_set": "HBA_DUAL", "antenna_set": "HBA_DUAL",
...@@ -218,12 +225,12 @@ def _populate_example_data(): ...@@ -218,12 +225,12 @@ def _populate_example_data():
"pointing": {"direction_type": "J2000", "pointing": {"direction_type": "J2000",
"angle1": 45, "angle1": 45,
"angle2": 20}, "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(), subtask_data = {"start_time": datetime.utcnow().isoformat(),
"stop_time": datetime.utcnow().isoformat(), "stop_time": datetime.utcnow().isoformat(),
...@@ -427,6 +434,7 @@ def _populate_obscontrol_schema(): ...@@ -427,6 +434,7 @@ def _populate_obscontrol_schema():
"type": "array", "type": "array",
"title": "Subband list", "title": "Subband list",
"additionalItems": false, "additionalItems": false,
"default": [],
"items": { "items": {
"type": "integer", "type": "integer",
"title": "Subband", "title": "Subband",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment