Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monitoring app docs #17

Merged
merged 7 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions docs/setting_up_VM_with_app.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## Steps to follow to get a VM with monitoring app running on Apache

To get a 'prototype' of the monitoring app running with Apache, follow these steps:
- create a cloud VM of the type: scientific-linux-7-aq
- continue by selecting sandbox 'testing_personality_2', archetype 'ral-tier1', personality 'apel-data-validation-test'

Allow 15 minutes after the machine is created, then remember to edit security groups from OpenStack to allow Apache to work.
Then follow these steps from within the machine:
- yum remove git && quattor-fetch && quattor-configure --all
tofu-rocketry marked this conversation as resolved.
Show resolved Hide resolved
- cd /usr/share/DJANGO_MONITORING_APP/monitoring
- modify the file settings.py, specifically the dict called DATABASES, to include the right credentials and database names
- cd ..
- source venv/bin/activate
- systemctl restart httpd
- sudo chown apache .

At this point the app should be working, so just get the ip address by writing "hostname -I" within the machine and the app should be already running at that address.


## What to do if the app seems to stop working after closing the VM
If the VM is shut down, next time we try to open the app, Apache might give the error message "Unable to open the database file".
If this happens, just follow these steps on the machine:
1. cd /usr/share/DJANGO_MONITORING_APP
2. source venv/bin/activate
3. sudo chown apache .

Note that step 2 is necessary for step 3 to work and the error message to disappear.
23 changes: 23 additions & 0 deletions docs/what_gets_installed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
For Django to work with apache, it is common to have a venv within the app, where django and djangorestframework get installed. Other packages needed for the app to work are installed by Aquilon outside the venv.

## Packages installed by Aquilon outside the venv
Following the config file that Aquilon uses, the following are the packages installed, in this order:
tofu-rocketry marked this conversation as resolved.
Show resolved Hide resolved
- httpd
- python3-mod_wsgi (for apache to work with django)
- python3-devel
- gcc (needed for dependencies)
- mariadb.


## Packages installed within the venv
Within venv, the following are installed through pip:
- djangorestframework (3.11.2)
- pymysql (needed for mariadb to work)
- pandas (needed by the app)
- django (2.1.*).

Note that when the version of the packages is specified, the app would not work with a different version (due to dependencies conflicts).
Also, as long as mariadb is installed (both client and server), it is not necessary to install mysqlclient (at least when the OS is Scientific Linux).

Is is also important to note that different types of OS require different packages to be installed.
The above are the packages that allow the app to work on a scientific linux 7 machine. A Centos machine would require slightly different packages.
22 changes: 22 additions & 0 deletions docs/what_pages_can_be_accessed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Pages that can be accessed through the app

The following urls are the ones that can be accessed without passing any parameter:
- http://ip-address/publishing/cloud/
- http://ip-address/publishing/gridsync/

These pages show info for a number of sites, so do not require a site name to be specified within the url.

The url http://ip-address/publishing/grid/ , instead, should be used together with the name of the site we are looking for.
For example: http://ip-address/publishing/grid/BelGrid-UCL/
It is not supposed to be used without passing the name of the site.

The url http://ip-address/publishing/gridsync/ shows a sync table, and it's probably the most important bit of the personality 'apel-data-validation'.
This table contains data related to many sites, specifically number of jobs being published vs in the db, and this number is shown for every (available) month of each site.

Clicking on any name in the first column (containing site names) allows to access a similar table which only shows the data relative to that site.
This more specific table is such that the first columns shows the months for which we have data (for that site).
Clicking on the month allows to open another table that shows data for that month and site only, divided by submithost.

The pages accessed through the links can of course be accessed by typing directly the url. For example, if we want data related to the site 'CSCS-LCG2' and month '2013-11', we would type :
http://ip-address/publishing/gridsync/CSCS-LCG2/2013-11/
However, in this case if there is no data for the month we are looking for, we would get an error.