Forecasting

From acumen Wiki
Jump to navigation Jump to search

The Forecast, in acumen parlance relates to a group of services which provide and maintain a train service forecast and is not therefore, a single service.

The Forecast relies heavily on the Redis key/value store - it is utilised as it provides a very low latency data store and retrieval system which is demanded by the data and computational intensive Forecast; Administrators are therefore guided to consider the value in established the health and status of Redis prior to diagnosing any issues with the Forecast as without a healthy Redis service, the Forecast will not function as intended.

If a user reports the system is lagging, the forecast may need to be drained. However, first ask what other applications they had open at the same time.

Note: Here the host name in PuTTY is likely to be acumen.tms-uk-rail.co.uk. (Rather than gateway.tms)

Application Logs[edit]

All Forecast services provide comprehensive application logging; to browse the application logs, undertake the following steps:

  1. Identify the ip address of the server in the Administration page;
  2. Browse to the following url: http://<ip address>:8080/logs/forecasting/
  3. Browse to the following url: http://<ip address>:8080/logs/conflict-list/
  4. Browse to the following url: http://<ip address>:8080/logs/conflict_detection/

Should any error messages or other log entries of concern be identified, Administrators are requested to update the support ticket with the details.

Draining the forecast[edit]

The action of draining the forecast is where all forecast services are removed from the relevant Redis store. This action can sometimes resolve issues with the forecast.

1. <user>@acumen-app-server:~$ cd /dockerise/

2. <user>@acumen-app-server:~/dockerise$ docker exec -ti dockerise_redis_1 /bin/bash

Administrators will then be presented with a prompt from inside the container:

3. :/data# redis-cli -n 0

At the Redis Command Line Interface (CLI) prompt:

4. 127.0.0.1:6379> FLUSHDB

5. To return to the session prompt, type exit followed by [ENTER] twice.

Note: Administrators are guided to undertake this action whilst viewing the RQ Dashboard as described in the Middleware section.

Note: Administrators should be aware that this action will remove all forecast services from acumen until a movement report is received.

Note: Users should be advised beforehand about the forecast being drained. This could be achieved via a flash alert.

Re-building the forecasting services - last resort[edit]

Where an issue with the forecast services has been identified, and where draining of the forecast has not resolved the issue, Administrators can attempt to re-build the forecast services containers.

  1. <user>@acumen-app-server:~$ cd /dockerise/
  2. <user>@acumen-app-server:~/dockerise$ make fc_update

This action re-builds the containers for several services, including flask-app and conflict services therefore, users of the system can expect momentary disruption whilst this action completes. Administrators should observe the build process and consider any error messages printed to the terminal during the make process.

Once complete, Administrators should peruse application and container logs to check that the issue has been resolved; paying particular attention to RQ Dashboard will pay dividends once this process has complete.