Skip to content

Commit 4c41d3c

Browse files
authored
Merge branch 'main' into dark-mode-toggle
2 parents 0551409 + 60a0f42 commit 4c41d3c

File tree

8 files changed

+47
-16
lines changed

8 files changed

+47
-16
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ GEM
220220
gemoji (>= 3, < 5)
221221
html-pipeline (~> 2.2)
222222
jekyll (>= 3.0, < 5.0)
223-
json (2.12.2)
223+
json (2.13.0)
224224
kramdown (2.4.0)
225225
rexml
226226
kramdown-parser-gfm (1.1.0)

_docs/developer/development_instructions/automated_grading.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,14 @@ number:
118118

119119
---
120120

121-
## Debugging
121+
## Debugging
122122

123123
To debug new features for autograding, it can be helpful to run
124124
`submitty_autograding_shipper.py` and `submitty_autograding_worker.py`
125125
interactively and inspect the output.
126126

127+
_NOTE: A cron job runs hourly to detect autograding shipper outages on the primary machine. To avoid interference during debugging, this job should be disabled before proceeding. See [Capture Cron Error Messages](/sysadmin/installation/system_customization#capture-cron-error-messages) for instructions on disabling the script._
128+
127129
To do this:
128130

129131
1. Stop the daemons (on each server, as appropriate)

_docs/developer/testing/install_php.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ you will need to have PHP installed on your host machine first.
88

99
### Linux & WSL:
1010

11-
*If you're distro cannot find the correct package or installs the wrong version you may have to specify php7.0 in each package name*
11+
*If you're distro cannot find the correct package or installs the wrong version you may have to specify php8.1 in each package name*
1212

1313
```bash
1414
sudo apt-get update
@@ -23,6 +23,10 @@ If you are missing extensions you can install them with `PECL` which will be
2323
installed automatically with PHP, but you should have everything required by
2424
default.
2525

26+
### Windows
27+
28+
Download [php 8.1](https://windows.php.net/download/) as a zip file under the thread safe category. Then extract the contents of the zip to a folder, and add the path to that folder to your path system variable. It's suggested that one extracts the contents of the zip to a folder called `php`, which can be put at `C:\php` for simplicity. You can then add `C:\php` to your path system environment variable.
29+
2630
-------------
2731

2832
Verify you have PHP installed correctly, submitty requires a version greater than 7.0

_docs/developer/testing/linting_static_analysis.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ The following instructions were tested for Windows:
5858

5959
1. First, you will need PHP installed on your host system first. See [Installing PHP](/developer/testing/install_php)*
6060

61-
2. Next, you will need [Composer](https://getcomposer.org/doc/00-intro.md) installed on your host system as well.
61+
2. Next, you will need [Composer](https://getcomposer.org/download/) installed on your host system as well.
6262
During this install, you will need to change settings in a php.ini file. Change the settings the prompt recommends.
6363

6464
3. Run ``composer global require slevomat/coding-standard`` and ``composer global require "squizlabs/php_codesniffer=*"`` inside your terminal.

_docs/developer/testing/php_unit_tests.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,37 @@ To validate the unit behavior of the site code, we utilize
99

1010
### Running PHP Unit Tests
1111

12-
*You will need PHP installed on your host system first, see [Installing PHP](/developer/testing/install_php)*
12+
*If you are running on WSL and are seeing errors, remove `php` from the following commands.*
1313

14-
To run the PHP unit test suite locally, `cd` to the `Submitty/site` directory and type:
14+
To run the PHP unit test suite in VM use the alias
1515

16-
If you are running on WSL and are seeing errors, remove "`php`" from the following commands.
16+
```
17+
submitty_test php-unit
18+
```
19+
20+
or
1721

1822
```
19-
php vendor/bin/phpunit
23+
sudo -u submitty_php php vendor/bin/phpunit
2024
```
2125

2226
To run just an individual class or test, you can use the `--filter` flag on PHPUnit.
2327
For example, to run the function `testInvalidProperty` would be
24-
`php vendor/bin/phpunit --filter testInvalidProperty` and running all
28+
`sudo -u submitty_php php vendor/bin/phpunit --filter testInvalidProperty` and running all
2529
of `AccessControlTester` would be
2630
`php vendor/bin/phpunit--filter AccessControlTester`. Be aware, filter
2731
can match against partial strings, so if you have two tests `testFoo` and `testFooBar`,
2832
running `--filter testFoo` will run them both. Alternatively, you can also directly run
2933
`phpunit` against a specific class by passing the path to the test class directly to
3034
`phpunit`, for example
31-
`php vendor/bin/phpunit tests/app/authentication/DatabaseAuthenticationTester.php` will run
35+
`sudo -u submitty_php php vendor/bin/phpunit tests/app/authentication/DatabaseAuthenticationTester.php` will run
3236
only the test methods in `DatabaseAuthenticationTester.php`.
3337

3438
The two concepts above can be combined to run a specific test function in a specific
3539
class by doing:
3640

3741
```bash
38-
vendor/bin/phpunit --filter testFunction tests/app/path/to/TestClass.php
42+
sudo -u submitty_php php vendor/bin/phpunit --filter testFunction tests/app/path/to/TestClass.php
3943
```
4044

4145
You can pass in the `--debug` flag when using PHPUnit to see PHP output, this can be

_docs/sysadmin/installation/system_customization.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,25 @@ You may want to back up more of `/var/local/submitty` to save configurations and
2828

2929
## Capture cron error messages
3030

31-
The `submitty_daemon` user runs the [sbin/send_email.py](https://github.com/Submitty/Submitty/blob/master/sbin/send_email.py)
32-
script. Console output from this script can be emailed to a sysadmin to help ensure that errors can be reported and addressed.
31+
To ensure the reliability of the various Submitty services, such as the WebSocket server, their health status is monitored and restarted hourly via the [sbin/repair_services.sh](https://github.com/Submitty/Submitty/blob/master/sbin/repair_services.sh) script run by the `submitty_daemon` user. This script leverages `systemctl` along with various health-check utility scripts to verify the active state of these services, triggering a restart if an inactive state is detected.
3332

34-
The first line should be set as `MAILTO=` with a valid email address. For example:
33+
Service failures can occur for various reasons, including unhandled exceptions, memory leaks, port binding issues, or OS-level disruptions such as resource exhaustion. All failures are logged with their relevant timestamp, source, and last output within the `/var/log/services` directory for the given day in the format `YYYYMMDD.txt`.
34+
35+
To disable this auto-repair mechanism, comment out the relevant line in the source `.setup/submitty_crontab` file within your repository. Since the crontab is auto-generated during installation, any changes must be followed by a re-run of `submitty_install` to persist them.
36+
37+
```bash
38+
# In .setup/submitty_crontab, comment out the repair_services.sh line:
39+
# 0 * * * * submitty_daemon sudo /usr/local/submitty/sbin/repair_services.sh
40+
41+
# Then re-apply the configuration:
42+
$ submitty_install
43+
```
44+
45+
_Note: This mechanism should only be disabled with caution in production environments._
46+
47+
The `submitty_daemon` user runs a variety of other scripts, such as [sbin/send_email.py](https://github.com/Submitty/Submitty/blob/master/sbin/send_email.py) to send pending emails every minute. Console output from these scripts can be emailed to a sysadmin to help ensure that errors can be reported and addressed.
48+
49+
The first line of the relevant script should be set as `MAILTO=` with a valid email address, as shown below.
3550
```
3651
3752
* * * * * python3 /usr/local/submitty/sbin/send_email.py

_docs/sysadmin/installation/version_notes/v20.08.00.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ requires the following edits:
1616

1717
1. Locate your `php.ini` file.
1818

19-
_It is probably something like `/etc/php/7.2/fpm/php.ini`._
19+
_It is probably something like `/etc/php/8.1/fpm/php.ini`._
2020

2121
Note: You can run this command to print your specific version of php:
2222

@@ -32,7 +32,7 @@ requires the following edits:
3232
3. Restart php fpm:
3333

3434
```
35-
sudo systemctl restart php7.2-fpm
35+
sudo systemctl restart php8.1-fpm
3636
```
3737

3838
Or more generally:

_docs/sysadmin/troubleshooting/system_debugging.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ redirect_from:
6262
/var/log/nginx/error.log
6363
```
6464

65+
* Look for errors in the daily service outage log
66+
67+
```
68+
/var/local/submitty/logs/services/YYYYMMDD.txt
69+
```
70+
6571
* Check the SSL keys / certificates for apache & nginx.
6672
Look for ssl key & certificate files specified in the enabled
6773
`.conf` files for apache & nginx:

0 commit comments

Comments
 (0)