Feat(judgehost): test legacy with debian11

This commit is contained in:
2025-04-07 00:06:41 +08:00
parent 1a5976caea
commit 9480d38ca4
7 changed files with 50 additions and 9 deletions

View File

@@ -2,9 +2,20 @@
## Usage ## Usage
0. Install Arch Linux for domserver and **Debian 11** for judgehost.
1. Fill in the vars in `group_vars`. 1. Fill in the vars in `group_vars`.
2. Fill in `domserver` and `judgehost` machine ips in `hosts` file. 2. Fill in `domserver` and `judgehost` groups in `hosts` file.
3. Run `ansible-playbook playbooks/domserver`. 3. Run `ansible-playbook playbooks/domserver`.
4. Run `ansible-playbook playbooks/judgehost`. 4. Run `ansible-playbook playbooks/judgehost`.
5. Put web cert and key to `/etc/haproxy/cert.pem` on domserver. 5. Put web cert and key to `/etc/haproxy/cert.pem` on domserver.
6. Check if judgehost been registered. 6. Check if judgehost been registered.
## Trouble shooting
### Judgehost cannot startup
The cgroups v2 support had been patched since October, 2024. However the latest
release of domjudge is 8.3.1, which was published on September, 2024.
Therefore, before cgroups v2 patch came out as a stable release, we still have
to use a older release, like Debian 11, to make things work.

View File

@@ -1,2 +1,5 @@
--- ---
judgehost_version: 8.3.1 judgehost_version: 8.3.1
# For legacy support
domjudge_tarball_url: https://www.domjudge.org/releases/domjudge-8.3.1.tar.gz

2
hosts
View File

@@ -10,4 +10,4 @@ localhost ansible_connection=local
10.4.2.228 10.4.2.228
[all:vars] [all:vars]
ansible_python_interpreter=/usr/bin/python ansible_python_interpreter=/usr/bin/python3

View File

@@ -2,5 +2,5 @@
- name: Install judgehost - name: Install judgehost
hosts: judgehost hosts: judgehost
roles: roles:
- role: install_packages - role: install_packages_debian11
- role: configure_judgehost - role: configure_judgehost_legacy

View File

@@ -3,11 +3,7 @@
ansible.builtin.lineinfile: ansible.builtin.lineinfile:
path: /boot/loader/entries/arch.conf path: /boot/loader/entries/arch.conf
line: >- line: >-
options options cgroup_enable=memory
cgroup_enable=memory
swapaccount=1
SYSTEMD_CGROUP_ENABLE_LEGACY_FORCE=1
systemd.unified_cgroup_hierarchy=0
notify: Reboot notify: Reboot
- name: Flush handlers - name: Flush handlers
ansible.builtin.meta: flush_handlers ansible.builtin.meta: flush_handlers

View File

@@ -0,0 +1,13 @@
- name: Download domjudge tarball
ansible.builtin.get_url:
url: "{{ domjudge_tarball_url }}"
dest: /opt/
mode: '0644'
owner: root
group: root
register: downloaded_tarball
- name: Extract domjudge tarball
ansible.builtin.unarchive:
src: "{{ downloaded_tarball.dest }}"
dest: "{{ (downloaded_tarball.dest | basename).split('.') | first }}"
remote_src: true

View File

@@ -0,0 +1,18 @@
---
- name: Install packages
ansible.builtin.apt:
pkg:
- make
- pkg-config
- sudo
- debootstrap
- libcgroup-dev
- php-cli
- php-curl
- php-json
- php-xml
- php-zip
- lsof
- procps
- gcc
- g++