Skip to content

Commit 2e9458d

Browse files
Initial changes for the ICPC World Finals in Baku
* Install php-bcmath extension * Copy the pc2packages key to the Ubuntu archive keyring * Install openjdk 21 * Copy kotlin folder instead of using old apt package * Use correct repo URL * Do not use cgroupv1
1 parent dc537ea commit 2e9458d

File tree

2 files changed

+48
-4
lines changed
  • provision-contest/ansible/roles

2 files changed

+48
-4
lines changed

provision-contest/ansible/roles/base_packages/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ INSTALLED_PACKAGES:
4242
- php-mysql
4343
- php-xml
4444
- php-zip
45+
- php-bcmath
4546
- pv
4647
- python3-sphinx
4748
- python3-sphinx-rtd-theme

provision-contest/ansible/roles/judgedaemon/tasks/main.yml

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,26 +33,69 @@
3333
src: chroot-list
3434
dest: /tmp/dj_ansible/
3535

36+
- name: Check if pc2packages key is already in ubuntu-archive-keyring.gpg
37+
ansible.builtin.shell: |
38+
gpg --no-default-keyring --keyring /usr/share/keyrings/ubuntu-archive-keyring.gpg --list-keys --with-colons | \
39+
grep -q "$(gpg --show-keys --with-colons /etc/apt/trusted.gpg.d/pc2packages.asc | grep '^fpr:' | head -1 | cut -d: -f10)"
40+
register: key_exists
41+
failed_when: false
42+
changed_when: false
43+
check_mode: false
44+
when: ICPC_IMAGE
45+
46+
- name: Add pc2packages key to ubuntu-archive-keyring.gpg
47+
ansible.builtin.shell: |
48+
gpg --no-default-keyring --keyring /usr/share/keyrings/ubuntu-archive-keyring.gpg --import /etc/apt/trusted.gpg.d/pc2packages.asc
49+
when:
50+
- ICPC_IMAGE
51+
- key_exists.rc != 0
52+
3653
- name: Create chroot
3754
shell: "set -o pipefail &&
3855
{{ DJ_DIR }}/misc-tools/dj_make_chroot -y -H
39-
-i icpc-kotlinc,openjdk-17-jdk-headless
56+
-i openjdk-21-jdk-headless
4057
-l \"$(ls /tmp/dj_ansible/install-chroot/*.deb 2>/dev/null | tr '\n' ',')\"
4158
-s \"$(ls /tmp/dj_ansible/chroot-list/*.list 2>/dev/null | tr '\n' ',')\"
4259
2>&1 | tee /tmp/dj_make_chroot.log;
4360
grep '^Done building chroot in' /tmp/dj_make_chroot.log"
4461
environment:
45-
DEBMIRROR: "{%- if WF_RESTRICTED_NETWORK and ICPC_IMAGE -%}https://packages/ubuntu
46-
{%- elif ICPC_IMAGE -%}https://sysopspackages.icpc.global/ubuntu
62+
DEBMIRROR: "{%- if WF_RESTRICTED_NETWORK and ICPC_IMAGE -%}https://packages/ubuntu-noble
63+
{%- elif ICPC_IMAGE -%}https://sysopspackages.icpc.global/ubuntu-noble
4764
{%- else -%}
4865
{%- endif -%}"
4966
args:
5067
executable: /bin/bash
5168
creates: "/chroot/domjudge"
5269

70+
- name: Create kotlinc directory in chroot
71+
ansible.builtin.file:
72+
path: /chroot/domjudge/usr/lib/kotlinc
73+
state: directory
74+
mode: '0755'
75+
when: ICPC_IMAGE
76+
77+
- name: Sync kotlinc folder to chroot
78+
ansible.posix.synchronize:
79+
src: /opt/kotlinc/
80+
dest: /chroot/domjudge/usr/lib/kotlinc/
81+
delete: false
82+
recursive: true
83+
delegate_to: "{{ inventory_hostname }}"
84+
when: ICPC_IMAGE
85+
86+
- name: Create symlinks for kotlin binaries in chroot
87+
ansible.builtin.file:
88+
src: ../../lib/kotlinc/bin/{{ item }}
89+
dest: /chroot/domjudge/usr/local/bin/{{ item }}
90+
state: link
91+
loop:
92+
- kotlin
93+
- kotlinc
94+
when: ICPC_IMAGE
95+
5396
- name: Pre-generate the kernel flags for ansible usage
5497
set_fact:
55-
procline: "apparmor=0 systemd.unified_cgroup_hierarchy=0 cgroup_enable=memory swapaccount=1 isolcpus={{ cpucore | join(',') }}"
98+
procline: "apparmor=0 cgroup_enable=memory swapaccount=1 isolcpus={{ cpucore | join(',') }}"
5699

57100
- name: Add cgroup kernel parameters
58101
lineinfile:

0 commit comments

Comments
 (0)