diff --git a/docs/source/index.rst b/docs/source/index.rst index 57574bbf425b53a65a388b0f1647dc59b75047b0..3dca97b0649c606263f2a4a8e735a548b1fa9750 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -11,7 +11,7 @@ Welcome to LOFAR2.0 Station Control's documentation! :caption: Contents: usage/installation - + usage/remote_interfaces Indices and tables diff --git a/docs/source/usage/installation.rst b/docs/source/usage/installation.rst index aae472ad35813271fc63f7b301acce4192c65041..48f94fdd97ec83b80bb9ad3a3b42a1b1be5ccc2e 100644 --- a/docs/source/usage/installation.rst +++ b/docs/source/usage/installation.rst @@ -34,44 +34,38 @@ You should see the following state: If not, you can inspect why with `docker logs <container>`. Note that the containers will automatically be restarted on failure, and also if you reboot. Stop them explicitly to bring them down (`make stop <container>`). -Start up ------------ +Initialisation +---------------- -The start-up procedure is needed both after bootstrapping, and after a system reboot. Once per reboot, the host kernel needs to be configured:: +The following procedure describes how to initialise the system, which is required after installation and after a system reboot. + +The docker containers will automatically restart after a system reboot. But the Linux kernel will lose its required custom settings required by our ELK stack. To reconfigure the kernel parameters, run:: make start elk-configure-host + make restart elk + +We can now initialise the station configuration, that is, start all the software devices to control the station hardware, and to initialise the hardware with the configured default settings. Go to http://localhost:8888, start a new *Station Control* notebook, and initiate the software boot sequence:: + + # reset our boot device + boot.off() + assert boot.state() == DevState.OFF + boot.initialise() + assert boot.state() == DevState.STANDBY + boot.on() + assert boot.state() == DevState.ON + + # start and initialise the other devices + boot.initialise_station() + + # wait for the devices to be initialised + import time -The software devices start in an OFF state, after bootstrap or reboot. To boot the devices, go to Jupyter (replace "localhost" with the hostname of your installation, if required): http://localhost:8888/notebooks/Home.ipynb . Then, in Grafana (http://localhost:3000), you should see the devices reaching the ON state. - -# Remote Interfaces - -The station provides the following interfaces accessible through your browser (assuming you run on `localhost`): - -+---------------------+---------+----------------------+-------------------+ -|Interface |Subsystem|URL |Default credentials| -+=====================+=========+======================+===================+ -|Interactive scripting|Jupyter |http://localhost:8888 | | -+---------------------+---------+----------------------+-------------------+ -|Monitoring |Grafana |http://localhost:3000 |admin/admin | -+---------------------+---------+----------------------+-------------------+ -|Logs |Kibana |http://localhost:5601 | | -+---------------------+---------+----------------------+-------------------+ - -Futhermore, there are some low-level interfaces: - -+---------------------+--------------+----------------------+-------------------+ -|Interface |Subsystem |URL |Default credentials| -+=====================+==============+======================+===================+ -|Tango API |Tango |http://localhost:10000| | -+---------------------+--------------+----------------------+-------------------+ -|Timeseries Database |Prometheus |http://localhost:9090 | | -+---------------------+--------------+----------------------+-------------------+ -|ReST API |tango-rest |http://localhost:8080 |tango-cs/tango | -+---------------------+--------------+----------------------+-------------------+ -|Tango Database |MariaDB |http://localhost:3306 |tango/tango | -+---------------------+--------------+----------------------+-------------------+ -|Archive Database |MariaDB |http://localhost:3307 |tango/tango | -+---------------------+--------------+----------------------+-------------------+ -|Log Database |ElasticSearch |http://localhost:9200 | | -+---------------------+--------------+----------------------+-------------------+ + while boot.initialising_station_R: + print(f"Still initialising station. {boot.initialisation_progress_R}% complete. State: {boot.initialisation_status_R}") + time.sleep(1) + # print conclusion + if boot.initialisation_progress_R == 100: + print("Done initialising station.") + else: + print(f"Failed to initialise station: {boot.initialisation_status_R}") diff --git a/docs/source/usage/installation.rst~Stashed changes b/docs/source/usage/installation.rst~Stashed changes new file mode 100644 index 0000000000000000000000000000000000000000..5735ec54af7d388d110e03175f4ae9f7a27c3b51 --- /dev/null +++ b/docs/source/usage/installation.rst~Stashed changes @@ -0,0 +1,61 @@ +Installation +================== + +You start with checking out the source code, f.e. the master branch, as well as the git submodules we use:: + + git clone https://git.astron.nl/lofar2.0/tango.git + cd tango + git submodule init + git submodule update + +Next, we bootstrap the system. This will build our docker images, start key ones, and load the base configuration. This may take a while:: + + cd docker-compose + make bootstrap + +If you lack access to LOFAR station hardware, load additional configurations to use the simulators instead:: + + for sim in ../CDB/\*-sim-config.json; do + ../sbin/update_ConfigDb.sh ../CDB${sim}-config.json + done + +Now we are ready to start the other containers:: + + make start + +and make sure they are all up and running:: + + make status + +You should see the following state: + +- Containers `astor`, `hdbpp-viewer`, `jive`, `log-viewer` and `pogo` will have State `Exit 1`. These are containers that are interactive X11 tools, and not needed for now, +- Other containers have either State `Up` or `Exit 0`. + +If not, you can inspect why with `docker logs <container>`. Note that the containers will automatically be restarted on failure, and also if you reboot. Stop them explicitly to bring them down (`make stop <container>`). + +Initialisation +---------------- + +The following procedure describes how to initialise the system, which is required after installation and after a system reboot. + +The docker containers will automatically restart after a system reboot. But the Linux kernel will lose its required custom settings required by our ELK stack. To reconfigure the kernel parameters, run:: + + make start elk-configure-host + make restart elk + +We can now initialise the station configuration, that is, start all the software devices to control the station hardware, and to initialise the hardware with the configured default settings. Go to http://localhost:8888, start a new *Station Control* notebook, and initiate the software boot sequence:: + + # reset our boot device + boot.off() + assert boot.state() == DevState.OFF + boot.initialise() + assert boot.state() == DevState.STANDBY + boot.on() + assert boot.state() == DevState.ON + + # start and initialise the other devices + boot.initialise_station() + + # wait for the devices to be initialised + diff --git a/docs/source/usage/remote_interfaces.rst b/docs/source/usage/remote_interfaces.rst new file mode 100644 index 0000000000000000000000000000000000000000..452c834a2649f94ecaf47731fdc35998c9e487da --- /dev/null +++ b/docs/source/usage/remote_interfaces.rst @@ -0,0 +1,37 @@ +Remote Interfaces +====================== + +The station provides the following interfaces accessible through your browser (assuming you run on `localhost`): + ++---------------------+---------+----------------------+-------------------+ +|Interface |Subsystem|URL |Default credentials| ++=====================+=========+======================+===================+ +|Interactive scripting|Jupyter |http://localhost:8888 | | ++---------------------+---------+----------------------+-------------------+ +|Monitoring |Grafana |http://localhost:3000 |admin/admin | ++---------------------+---------+----------------------+-------------------+ +|Logs |Kibana |http://localhost:5601 | | ++---------------------+---------+----------------------+-------------------+ + +Futhermore, there are some low-level interfaces: + ++---------------------+--------------+----------------------+-------------------+ +|Interface |Subsystem |URL |Default credentials| ++=====================+==============+======================+===================+ +|Tango API |Tango |http://localhost:10000| | ++---------------------+--------------+----------------------+-------------------+ +|Timeseries Database |Prometheus |http://localhost:9090 | | ++---------------------+--------------+----------------------+-------------------+ +|ReST API |tango-rest |http://localhost:8080 |tango-cs/tango | ++---------------------+--------------+----------------------+-------------------+ +|Tango Database |MariaDB |http://localhost:3306 |tango/tango | ++---------------------+--------------+----------------------+-------------------+ +|Archive Database |MariaDB |http://localhost:3307 |tango/tango | ++---------------------+--------------+----------------------+-------------------+ +|Log Database |ElasticSearch |http://localhost:9200 | | ++---------------------+--------------+----------------------+-------------------+ + +Jupyter: Interactive Scripting +------------------------------------ + +The station offers Juypyter notebooks On http://localhost:8888, which allow one to interact with the station, for example to set control points, access monitoring points, or to graph their values.