Skip to content
Snippets Groups Projects
Commit 3afd6d1d authored by Jan David Mol's avatar Jan David Mol
Browse files

L2SS-391: Improved landing notebook

parent 30a35bb1
No related branches found
No related tags found
1 merge request!144L2SS-391: Add boot device
%% 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
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment