|
33 | 33 | src: chroot-list
|
34 | 34 | dest: /tmp/dj_ansible/
|
35 | 35 |
|
| 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 | + |
36 | 53 | - name: Create chroot
|
37 | 54 | shell: "set -o pipefail &&
|
38 | 55 | {{ DJ_DIR }}/misc-tools/dj_make_chroot -y -H
|
39 |
| - -i icpc-kotlinc,openjdk-17-jdk-headless |
| 56 | + -i openjdk-21-jdk-headless |
40 | 57 | -l \"$(ls /tmp/dj_ansible/install-chroot/*.deb 2>/dev/null | tr '\n' ',')\"
|
41 | 58 | -s \"$(ls /tmp/dj_ansible/chroot-list/*.list 2>/dev/null | tr '\n' ',')\"
|
42 | 59 | 2>&1 | tee /tmp/dj_make_chroot.log;
|
43 | 60 | grep '^Done building chroot in' /tmp/dj_make_chroot.log"
|
44 | 61 | 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 |
47 | 64 | {%- else -%}
|
48 | 65 | {%- endif -%}"
|
49 | 66 | args:
|
50 | 67 | executable: /bin/bash
|
51 | 68 | creates: "/chroot/domjudge"
|
52 | 69 |
|
| 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 | + |
53 | 96 | - name: Pre-generate the kernel flags for ansible usage
|
54 | 97 | 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(',') }}" |
56 | 99 |
|
57 | 100 | - name: Add cgroup kernel parameters
|
58 | 101 | lineinfile:
|
|
0 commit comments