Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tango
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
LOFAR2.0
tango
Commits
a3f998b6
Commit
a3f998b6
authored
3 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-470
: Updated calls to boot using new command and attribute names
parent
b8a7b4b2
No related branches found
No related tags found
1 merge request
!176
L2SS-470: Fix boot
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
jupyter-notebooks/Home.ipynb
+7
-5
7 additions, 5 deletions
jupyter-notebooks/Home.ipynb
with
7 additions
and
5 deletions
jupyter-notebooks/Home.ipynb
+
7
−
5
View file @
a3f998b6
...
@@ -58,7 +58,7 @@
...
@@ -58,7 +58,7 @@
"# Request to reinitialise the station.\n",
"# Request to reinitialise the station.\n",
"#\n",
"#\n",
"# WARNING: This will reset settings across the station!\n",
"# WARNING: This will reset settings across the station!\n",
"boot.
initialise_station
()\n",
"boot.
boot
()\n",
"assert boot.state() != DevState.FAULT"
"assert boot.state() != DevState.FAULT"
]
]
},
},
...
@@ -71,14 +71,16 @@
...
@@ -71,14 +71,16 @@
"source": [
"source": [
"import time\n",
"import time\n",
"\n",
"\n",
"while boot.
initialising_station
_R:\n",
"while boot.
booting
_R:\n",
" print(f\"Still initialising station. {boot.
initialisation_
progress_R}% complete. State: {boot.
initialisation_
status_R}\")\n",
" print(f\"Still initialising station. {boot.progress_R}% complete. State: {boot.status_R}\")\n",
" time.sleep(1)\n",
" time.sleep(1)\n",
"\n",
"\n",
"if boot.
initialisation_
progress_R == 100:\n",
"if boot.progress_R == 100:\n",
" print(\"Done initialising station.\")\n",
" print(\"Done initialising station.\")\n",
"else:\n",
"else:\n",
" print(f\"Failed to initialise station: {boot.initialisation_status_R}\")"
" print(f\"Failed to initialise station: {boot.status_R}\")\n",
"print(f\"Initialised devices: {boot.initialised_devices_R}\")\n",
"print(f\"Uninitialised devices: {boot.uninitialised_devices_R}\")"
]
]
},
},
{
{
...
...
%% Cell type:markdown id:e051e48d tags:
%% Cell type:markdown id:e051e48d tags:
# Welcome to your LOFAR2.0 station!
# Welcome to your LOFAR2.0 station!
The following interfaces are available to you, on the same host as this notebook, but on different ports:
The following interfaces are available to you, on the same host as this notebook, but on different ports:
|Interface |Subsystem |Port|Credentials |
|Interface |Subsystem |Port|Credentials |
|----------|----------|----|--------------|
|----------|----------|----|--------------|
|Scripting |Jupyter |8888| |
|Scripting |Jupyter |8888| |
|Monitoring|Grafana |3000|admin/admin |
|Monitoring|Grafana |3000|admin/admin |
|Logs |Kibana |5601| |
|Logs |Kibana |5601| |
|ReST |tango-rest|8080|tango-cs/tango|
|ReST |tango-rest|8080|tango-cs/tango|
Below are codes to manage the station at high level. For more detailed status information, look in Grafana.
Below are codes to manage the station at high level. For more detailed status information, look in Grafana.
%% Cell type:markdown id:32ae8bcf tags:
%% Cell type:markdown id:32ae8bcf tags:
## (Re)boot station
## (Re)boot station
The code below is used to:
The code below is used to:
*
Reboot all station software
*
Reboot all station software
*
Reset the hardware configuration
*
Reset the hardware configuration
%% Cell type:code id:38037a71 tags:
%% Cell type:code id:38037a71 tags:
```
python
```
python
# Restart boot device itself
# Restart boot device itself
boot
.
off
()
boot
.
off
()
assert
boot
.
state
()
==
DevState
.
OFF
,
boot
.
state
()
assert
boot
.
state
()
==
DevState
.
OFF
,
boot
.
state
()
boot
.
initialise
()
boot
.
initialise
()
assert
boot
.
state
()
==
DevState
.
STANDBY
,
boot
.
state
()
assert
boot
.
state
()
==
DevState
.
STANDBY
,
boot
.
state
()
boot
.
on
()
boot
.
on
()
assert
boot
.
state
()
==
DevState
.
ON
,
boot
.
state
()
assert
boot
.
state
()
==
DevState
.
ON
,
boot
.
state
()
```
```
%% Cell type:code id:21aba361 tags:
%% Cell type:code id:21aba361 tags:
```
python
```
python
# Request to reinitialise the station.
# Request to reinitialise the station.
#
#
# WARNING: This will reset settings across the station!
# WARNING: This will reset settings across the station!
boot
.
initialise_station
()
boot
.
boot
()
assert
boot
.
state
()
!=
DevState
.
FAULT
assert
boot
.
state
()
!=
DevState
.
FAULT
```
```
%% Cell type:code id:c00b465a tags:
%% Cell type:code id:c00b465a tags:
```
python
```
python
import
time
import
time
while
boot
.
initialising_station
_R
:
while
boot
.
booting
_R
:
print
(
f
"
Still initialising station.
{
boot
.
initialisation_
progress_R
}
% complete. State:
{
boot
.
initialisation_
status_R
}
"
)
print
(
f
"
Still initialising station.
{
boot
.
progress_R
}
% complete. State:
{
boot
.
status_R
}
"
)
time
.
sleep
(
1
)
time
.
sleep
(
1
)
if
boot
.
initialisation_
progress_R
==
100
:
if
boot
.
progress_R
==
100
:
print
(
"
Done initialising station.
"
)
print
(
"
Done initialising station.
"
)
else
:
else
:
print
(
f
"
Failed to initialise station:
{
boot
.
initialisation_status_R
}
"
)
print
(
f
"
Failed to initialise station:
{
boot
.
status_R
}
"
)
print
(
f
"
Initialised devices:
{
boot
.
initialised_devices_R
}
"
)
print
(
f
"
Uninitialised devices:
{
boot
.
uninitialised_devices_R
}
"
)
```
```
%% Cell type:markdown id:b444b751 tags:
%% Cell type:markdown id:b444b751 tags:
## Inspect Docker status
## Inspect Docker status
Docker containers that are not running will not provide any functionality, and are ignored when the station is rebooted.
Docker containers that are not running will not provide any functionality, and are ignored when the station is rebooted.
%% Cell type:code id:8b09f9da tags:
%% Cell type:code id:8b09f9da tags:
```
python
```
python
container_status
=
{
attr_name
:
getattr
(
docker
,
attr_name
)
container_status
=
{
attr_name
:
getattr
(
docker
,
attr_name
)
for
attr_name
in
docker
.
get_attribute_list
()
for
attr_name
in
docker
.
get_attribute_list
()
if
attr_name
.
endswith
(
"
_R
"
)
if
attr_name
.
endswith
(
"
_R
"
)
and
attr_name
!=
'
version_R
'
}
and
attr_name
!=
'
version_R
'
}
not_running_containers
=
[
container
for
container
,
running
in
container_status
.
items
()
if
running
is
False
]
not_running_containers
=
[
container
for
container
,
running
in
container_status
.
items
()
if
running
is
False
]
if
not
not_running_containers
:
if
not
not_running_containers
:
print
(
"
All docker containers are running
"
)
print
(
"
All docker containers are running
"
)
else
:
else
:
print
(
f
"
Docker containers that are NOT running:
{
not_running_containers
}
"
)
print
(
f
"
Docker containers that are NOT running:
{
not_running_containers
}
"
)
```
```
%% Cell type:markdown id:55f3981d tags:
%% Cell type:markdown id:55f3981d tags:
## Inspect Device status
## Inspect Device status
Check whether all software devices are indeed up and running.
Check whether all software devices are indeed up and running.
%% Cell type:code id:637e6e22 tags:
%% Cell type:code id:637e6e22 tags:
```
python
```
python
for
d
in
devices
:
for
d
in
devices
:
try
:
try
:
print
(
f
"
Device
{
d
.
dev_name
()
}
is in state
{
d
.
state
()
}
"
)
print
(
f
"
Device
{
d
.
dev_name
()
}
is in state
{
d
.
state
()
}
"
)
except
ConnectionFailed
as
e
:
except
ConnectionFailed
as
e
:
print
(
f
"
Device
{
d
.
dev_name
()
}
is in state DOWN:
{
e
.
args
[
0
].
desc
}
"
)
print
(
f
"
Device
{
d
.
dev_name
()
}
is in state DOWN:
{
e
.
args
[
0
].
desc
}
"
)
```
```
%% Cell type:code id:23008885 tags:
%% Cell type:code id:23008885 tags:
```
python
```
python
```
```
...
...
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