Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
e8382b74
Commit
e8382b74
authored
5 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-153
: added CEP4 cluster and LustreFS
parent
c375742a
No related branches found
No related tags found
1 merge request
!102
Resolve TMSS-153
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SAS/TMSS/src/tmss/tmssapp/migrations/0002_populate.py
+1
-0
1 addition, 0 deletions
SAS/TMSS/src/tmss/tmssapp/migrations/0002_populate.py
SAS/TMSS/src/tmss/tmssapp/populate.py
+13
-5
13 additions, 5 deletions
SAS/TMSS/src/tmss/tmssapp/populate.py
with
14 additions
and
5 deletions
SAS/TMSS/src/tmss/tmssapp/migrations/0002_populate.py
+
1
−
0
View file @
e8382b74
...
@@ -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
)
]
This diff is collapsed.
Click to expand it.
SAS/TMSS/src/tmss/tmssapp/populate.py
+
13
−
5
View file @
e8382b74
...
@@ -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
"
}
s
ubtask_template
=
SubtaskTemplate
.
objects
.
get
(
name
=
'
correlator
schema
'
)
s
pecifications_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
))
}]
}]
}
}
}
}
s
ubtask_template
=
SubtaskTemplate
.
objects
.
get
(
name
=
'
obscontrol
schema
'
)
s
pecifications_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
"
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment