Skip to content
GitLab
Explore
Sign in
Register
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
3afd6d1d
Commit
3afd6d1d
authored
3 years ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-391
: Improved landing notebook
parent
30a35bb1
No related branches found
No related tags found
1 merge request
!144
L2SS-391: Add boot device
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
jupyter-notebooks/Home.ipynb
+61
-9
61 additions, 9 deletions
jupyter-notebooks/Home.ipynb
with
61 additions
and
9 deletions
jupyter-notebooks/Home.ipynb
+
61
−
9
View file @
3afd6d1d
...
...
@@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "
d3ffb821
",
"id": "
e051e48d
",
"metadata": {},
"source": [
"# Welcome to your LOFAR2.0 station!\n",
...
...
@@ -16,12 +16,12 @@
"|Logs |Kibana |5601| |\n",
"|ReST |tango-rest|8080|tango-cs/tango|\n",
"\n",
"Below are codes to manage the station at high level."
"Below are codes to manage the station at high level.
For more detailed status information, look in Grafana.
"
]
},
{
"cell_type": "markdown",
"id": "
70a5de26
",
"id": "
32ae8bcf
",
"metadata": {},
"source": [
"## (Re)boot station\n",
...
...
@@ -32,8 +32,8 @@
},
{
"cell_type": "code",
"execution_count":
16
,
"id": "
57263a16
",
"execution_count":
null
,
"id": "
38037a71
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -50,8 +50,8 @@
},
{
"cell_type": "code",
"execution_count":
17
,
"id": "
64f33a76
",
"execution_count":
null
,
"id": "
21aba361
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -65,7 +65,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "
714b7f0b
",
"id": "
c00b465a
",
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -81,10 +81,62 @@
" print(f\"Failed to initialise station: {boot.initialisation_status_R}\")"
]
},
{
"cell_type": "markdown",
"id": "b444b751",
"metadata": {},
"source": [
"## Inspect Docker status\n",
"Docker containers that are not running will not provide any functionality, and are ignored when the station is rebooted."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8b09f9da",
"metadata": {},
"outputs": [],
"source": [
"container_status = {attr_name: getattr(docker, attr_name)\n",
" for attr_name in docker.get_attribute_list()\n",
" if attr_name.endswith(\"_R\")\n",
" and attr_name != 'version_R'}\n",
"\n",
"not_running_containers = [container for container, running in container_status.items() if running is False]\n",
"\n",
"if not not_running_containers:\n",
" print(\"All docker containers are running\")\n",
"else:\n",
" print(f\"Docker containers that are NOT running: {not_running_containers}\")"
]
},
{
"cell_type": "markdown",
"id": "55f3981d",
"metadata": {},
"source": [
"## Inspect Device status\n",
"Check whether all software devices are indeed up and running."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "637e6e22",
"metadata": {},
"outputs": [],
"source": [
"for d in devices:\n",
" try:\n",
" print(f\"Device {d.dev_name()} is in state {d.state()}\")\n",
" except ConnectionFailed as e:\n",
" print(f\"Device {d.dev_name()} is in state DOWN: {e.args[0].desc}\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2
99b0ceb
",
"id": "2
3008885
",
"metadata": {},
"outputs": [],
"source": []
...
...
%% Cell type:markdown id:
d3ffb821
tags:
%% Cell type:markdown id:
e051e48d
tags:
# Welcome to your LOFAR2.0 station!
The following interfaces are available to you, on the same host as this notebook, but on different ports:
|Interface |Subsystem |Port|Credentials |
|----------|----------|----|--------------|
|Scripting |Jupyter |8888| |
|Monitoring|Grafana |3000|admin/admin |
|Logs |Kibana |5601| |
|ReST |tango-rest|8080|tango-cs/tango|
Below are codes to manage the station at high level.
Below are codes to manage the station at high level.
For more detailed status information, look in Grafana.
%% Cell type:markdown id:
70a5de26
tags:
%% Cell type:markdown id:
32ae8bcf
tags:
## (Re)boot station
The code below is used to:
*
Reboot all station software
*
Reset the hardware configuration
%% Cell type:code id:
57263a16
tags:
%% Cell type:code id:
38037a71
tags:
```
python
# Restart boot device itself
boot
.
off
()
assert
boot
.
state
()
==
DevState
.
OFF
,
boot
.
state
()
boot
.
initialise
()
assert
boot
.
state
()
==
DevState
.
STANDBY
,
boot
.
state
()
boot
.
on
()
assert
boot
.
state
()
==
DevState
.
ON
,
boot
.
state
()
```
%% Cell type:code id:
64f33a76
tags:
%% Cell type:code id:
21aba361
tags:
```
python
# Request to reinitialise the station.
#
# WARNING: This will reset settings across the station!
boot
.
initialise_station
()
assert
boot
.
state
()
!=
DevState
.
FAULT
```
%% Cell type:code id:
714b7f0b
tags:
%% Cell type:code id:
c00b465a
tags:
```
python
import
time
while
boot
.
initialising_station_R
:
print
(
f
"
Still initialising station.
{
boot
.
initialisation_progress_R
}
% complete. State:
{
boot
.
initialisation_status_R
}
"
)
time
.
sleep
(
1
)
if
boot
.
initialisation_progress_R
==
100
:
print
(
"
Done initialising station.
"
)
else
:
print
(
f
"
Failed to initialise station:
{
boot
.
initialisation_status_R
}
"
)
```
%% Cell type:code id:299b0ceb tags:
%% Cell type:markdown id:b444b751 tags:
## Inspect Docker status
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:
```
python
container_status
=
{
attr_name
:
getattr
(
docker
,
attr_name
)
for
attr_name
in
docker
.
get_attribute_list
()
if
attr_name
.
endswith
(
"
_R
"
)
and
attr_name
!=
'
version_R
'
}
not_running_containers
=
[
container
for
container
,
running
in
container_status
.
items
()
if
running
is
False
]
if
not
not_running_containers
:
print
(
"
All docker containers are running
"
)
else
:
print
(
f
"
Docker containers that are NOT running:
{
not_running_containers
}
"
)
```
%% Cell type:markdown id:55f3981d tags:
## Inspect Device status
Check whether all software devices are indeed up and running.
%% Cell type:code id:637e6e22 tags:
```
python
for
d
in
devices
:
try
:
print
(
f
"
Device
{
d
.
dev_name
()
}
is in state
{
d
.
state
()
}
"
)
except
ConnectionFailed
as
e
:
print
(
f
"
Device
{
d
.
dev_name
()
}
is in state DOWN:
{
e
.
args
[
0
].
desc
}
"
)
```
%% Cell type:code id:23008885 tags:
```
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