Maintaining RAP4
Once RAP4 is running, there are maintenance tasks you might want to do. The most frequently used tasks are described here for RAP-3 maintainers to refer to.
The purpose of maintaining software is to guarantee continuous operation for all users. In this chapter we use the RAP4 server at OUNL as an example, trusting that you will figure out what to do for servers of your own.

Tasks

Here is an overview of all tasks described on this page. Refer to the related section below for details on each specific task
  1. 1.
    Connect Before doing any maintenance, you need credentials to gain access to your server. Then you can connect to the server. We assume you gain access to a command-line interface (CLI) of your server. In this text that CLI is /bin/bash on a linux machine.
  2. 2.
    Check the configuration When you start a maintenance session, you may want to check on the system. RAP4 runs in containers on a docker-platform, so you can check whether the containers are running and you can check the configuration in which they should be running.
  3. 3.
    Upgrade to a new version of RAP
  4. 4.
    Upgrade to a new version of Ubuntu
  5. 5.
    Refresh the configuration Refreshing the RAP4 configuration is something you need to do only when developers tell you to do that.

Connecting to the RAP4 server

The RAP-server has been configured to communicate via ssh. The Open Universiteit allows ssh-connections only through VPN. So I made sure my VPN-connection is active.
I entered the server using command ssh rap.cs.ou.nl and the right user/password combination, upon which I gained access to the CLI.
The RAP4-instance is installed from directory ~\RAP4, which is the working directory from which maintenance is done.
This is what you can expect to see:
1
stefjoosten$ ssh [email protected]
2
[email protected]'s password:
3
Permission denied, please try again.
4
[email protected]'s password:
5
Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.4.0-124-generic x86_64)
6
7
* Documentation: https://help.ubuntu.com
8
* Management: https://landscape.canonical.com
9
* Support: https://ubuntu.com/advantage
10
11
170 packages can be updated.
12
12 updates are security updates.
13
14
New release '18.04.2 LTS' available.
15
Run 'do-release-upgrade' to upgrade to it.
16
17
18
Last login: Wed May 29 12:03:17 2019 from 145.20.142.195
19
Copied!

Checking which containers are running

The server should show at least two containers, a database container called rap4_db and a RAP-container called rap4. There may be a third container called phpmyadmin, which is there to gain access to the database (for maintainers only). To verify, give the command docker ps. This is what you may expect to see:
1
[email protected]:~/RAP4$ docker ps
2
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3
40e5e97c1b26 phpmyadmin/phpmyadmin "/run.sh superviso..." 4 months ago Up 36 seconds 9000/tcp, 0.0.0.0:8080->80/tcp rap3_phptools_1
4
bff782b2da89 ampersandtarski/rap4-db "docker-entrypoint..." 4 months ago Up 2 weeks 3306/tcp rap3_db_1
5
773f7ad86527 dockerampersand_rap3 "docker-php-entryp..." 18 months ago Up 2 weeks 0.0.0.0:80->80/tcp dockerampersand_rap3_1
6
7525eb7ea95f dockerampersand_db "docker-entrypoint..." 18 months ago Up 2 weeks 3306/tcp dockerampersand_db_1
Copied!
In this case it appears that a fourth container is running. This poses no problem, because other processes may run concurrently without interfering with RAP4.
The configuration file that specifies this configuration is the only file in the working directory:
1
[email protected]:~/RAP4$ ls -al
2
total 20
3
drwxrwxr-x 3 sjo sjo 4096 Oct 25 2018 .
4
drwxr-xr-x 18 sjo sjo 4096 Jan 9 2018 ..
5
-rw-rw-r-- 1 sjo sjo 472 Oct 25 2018 docker-compose.yml
6
drwxr-xr-x 5 root root 4096 Dec 15 2017 volumes
Copied!
By inspecting the contents you can see whether the configuration matches what you see in docker. This is what you can expect in docker-compose.yml:
1
[email protected]:~/RAP4$ cat docker-compose.yml
2
version: '3'
3
4
services:
5
rap4:
6
restart: always
7
image: ampersandtarski/ampersand-rap:latest
8
ports:
9
- "80:80"
10
links:
11
- db
12
volumes:
13
- ./volumes/log:/var/www/html/RAP4/log
14
- ./volumes/scripts:/var/www/html/RAP4/scripts
15
16
db:
17
restart: always
18
image: ampersandtarski/rap4-db
19
volumes:
20
- ./volumes/mysql:/var/lib/mysql
21
22
phptools:
23
image: phpmyadmin/phpmyadmin
24
ports:
25
- "8080:80"
26
links:
27
- db
Copied!
The directory volumes contains the Ampersand data, which is kept outside the containers so the data persists if containers get killed or if you restart the software.
1
[email protected]:~/RAP4$ ls -al volumes/
2
total 40
3
drwxr-xr-x 5 root root 4096 Dec 15 2017 .
4
drwxrwxr-x 3 sjo sjo 4096 Oct 25 2018 ..
5
drwxr-xr-x 2 www-data www-data 4096 Dec 28 11:16 log
6
drwxr-xr-x 229 999 999 20480 May 13 07:48 mysql
7
drwxr-xr-x 75 www-data www-data 4096 Oct 25 2018 scripts
Copied!
There are three data sets. The directory log contains logging information of the RAP4-server. The directory mysql contains the data from MariaDB. The directory scripts contains the student scripts and the files they generated when working in RAP4.

Upgrade to a new version of RAP

If you need to upgrade RAP4 to the latest release run this command:
1
[email protected]:~/RAP4$ docker-compose up -d
Copied!
As you can see in the configuration (docker-compose.yml)

Upgrade to a new version of Ubuntu

When you connect to the server, you get hints about the state your Ubuntu server is in. E.g.
2
Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 4.15.0-151-generic x86_64)
3
4
* Documentation: https://help.ubuntu.com
5
* Management: https://landscape.canonical.com
6
* Support: https://ubuntu.com/advantage
7
8
System information as of Wed Aug 11 10:26:22 CEST 2021
9
10
System load: 0.08
11
Usage of /: 68.3% of 48.83GB
12
Memory usage: 17%
13
Swap usage: 0%
14
Processes: 264
15
Users logged in: 0
16
IP address for ens160: 145.20.188.96
17
IP address for br-0b19c7bfdba3: 172.20.0.1
18
IP address for br-0f95c427718c: 172.26.0.1
19
IP address for docker0: 172.17.0.1
20
21
* Canonical Livepatch is enabled.
22
- All available patches applied.
23
24
84 packages can be updated.
25
1 update is a security update.
26
27
28
*** System restart required ***
29
Last login: Mon Aug 2 11:14:56 2021 from 145.20.142.176
Copied!
In such cases you can update by giving two commands:
1
[email protected]:~$ sudo apt update
2
[email protected]:~$ sudo apt upgrade
Copied!
Sometimes a package is kept back because there is a problem with dependencies. You will have to upgrade such packages by hand.

Refreshing the code

In the rare event that the configuration of RAP4 has changed (to be announced by the developers), you must update the file docker-compose.ymlby hand, using the command:
1
wget https://raw.githubusercontent.com/AmpersandTarski/RAP/master/docker-compose.yml
Copied!