Skip to content

Update variables.yml #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9ae3f74
Update instructions for versioned docs.
meisterT Jun 20, 2020
16e6ef9
Unbreak snapshot creation
thijskh Jun 26, 2020
a6c126e
release 7.3.0
thijskh Jun 26, 2020
944421c
Update release instructions
thijskh Jun 26, 2020
48d7d38
For millennials, move Docker more to the top.
thijskh Jun 29, 2020
83f1fa3
Advertise wiki a bit
thijskh Sep 1, 2020
4d2c6d5
Update ICPC Contest API urls
thijskh Oct 28, 2020
6b9847b
Release 7.3.1
thijskh Nov 10, 2020
cdda95f
Upgrade logo to svg
thijskh Nov 12, 2020
2e16022
Fix website image installation
thijskh Nov 12, 2020
d8f6e5d
Release 7.3.2
thijskh Nov 23, 2020
c65626f
Improve copypastability
thijskh Nov 23, 2020
702a16f
Use mailto links
vmcj Jan 1, 2021
25fd1dd
Allow down to 80% of PHP scripts to succeed to compile.
eldering Jan 17, 2021
89691ca
Restructure to allow CI/CD usage
vmcj Feb 7, 2021
487a67c
Updates for Ubuntu 20.04 and newer DOMjudge git code.
nickygerritsen Mar 7, 2021
e645183
Disable apport to not have crash handling by Ubuntu.
nickygerritsen Mar 7, 2021
61a4ecf
Create gdm3 custom.conf file if it doesn't exist
nickygerritsen Mar 17, 2021
8cbf4f5
Shellcheck and bashate fixes
vmcj Mar 21, 2021
2e74a5a
Fix restart of judgedaemon service for judgehost-only-code.
nickygerritsen Mar 23, 2021
4b01b23
Make sure tune_cpu can be enabled/installed
nickygerritsen Mar 27, 2021
ffe8a10
DEBUG no longer needed
thijskh Mar 30, 2021
3d98db0
Also no need to change DEBUG back anymore
thijskh Apr 4, 2021
51f4842
Improve instructions to release tarball
vmcj Mar 20, 2021
7758d67
Cronjob to release on new tags
vmcj Feb 27, 2021
14ff174
Release 7.3.3
thijskh Apr 6, 2021
ecbf675
Forgotten debug statements removed
vmcj Apr 5, 2021
c6854eb
Domjudge folder is located in different folder
vmcj Apr 5, 2021
be5f628
Disable signing on released tag
vmcj Apr 5, 2021
d9eda51
Release message now has URL to tarball
vmcj Apr 5, 2021
7bd76a9
Update variables.yml
vmcj May 1, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ The following subdirectories contain:
* `website` the HTML code for www.domjudge.org
* `icpc-wf` scripts used at the ICPC World Finals
* `contest-api` a script to validate an implementation of the
[ICPC contest API](https://clics.ecs.baylor.edu/index.php/Contest_API)
[ICPC contest API](https://ccs-specs.icpc.io/contest_api)
4 changes: 2 additions & 2 deletions contest-api/check-api.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
# Checks whether a Contest API conforms to the specification
# https://clics.ecs.baylor.edu/index.php/Contest_API
# https://ccs-specs.icpc.io/contest_api

# Set path to json-validate binary if it's not in PATH:
#VALIDATE_JSON=/path/to/validate-json
Expand Down Expand Up @@ -71,7 +71,7 @@ $(basename $0) - Validate a Contest API implementation with JSON schema.
Usage: $(basename $0) [option]... URL

This program validates a Contest API implementation against the
specification: https://clics.ecs.baylor.edu/index.php/Contest_API
specification: https://ccs-specs.icpc.io/contest_api

The URL must point to the base of the API, for example:

Expand Down
61 changes: 61 additions & 0 deletions cron_tag_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/bash

set -eu

. ~/.tagrelease

main=master

RELEASE_DIR="/srv/http/domjudge/releases"

notify_channel () {
# Local debug
echo "$1"
# When cron is run often one should have time to
# fix the issue.
if [ ! -f /tmp/$2 ]; then
# Write to syslog on server
logger "$1"
DATA='{"text":"'"$1"'"}'
# Notify DOMjudge Slack channel (github-notifications)
# SLACK_URL should be exported in the .bashrc (it should be secret)
curl -X POST -H 'Content-type: application/json' --data "$DATA" "$SLACK_URL"
touch /tmp/$2
fi
}

process_tag () {
TAG="$1"
NUMB="[0-9]+"
DOT="\."
RELEASE="$NUMB$DOT$NUMB$DOT$NUMB"
OPTRC="((RC|rc)[0-9])?"
if [[ $TAG =~ ^$RELEASE$OPTRC$ ]]; then
# TODO: check if the file already exists
if [ -f "$RELEASE_DIR/domjudge-$TAG.tar.gz" ]; then
# Tag is already handled
return 0
fi
# To find the signer key of a earlier tag:
# gpg --search 780355B5EA6BFC8235A99C4B56F61A79401DAC04
# And if one trusts the internet to be correct
# gpg --recv-keys 780355B5EA6BFC8235A99C4B56F61A79401DAC04
if git verify-tag $TAG; then
# At this point the tarball should already be locally tested
~/domjudge-scripts/make_release.sh "$TAG"
mv domjudge-$TAG.* $RELEASE_DIR/
notify_channel "Tarball finished ($TAG).\nURL: https://www.domjudge.org/releases/domjudge-$TAG.tar.gz" "$TAG"
else
notify_channel "Untrusted tag ($TAG)" "$TAG"
fi
fi
}

# Reset to main branch
cd ~domjudge/git/domjudge
git checkout $main

while read -r tag; do
process_tag "$tag"
done <<< "$(git tag)"

8 changes: 4 additions & 4 deletions icpc-wf/ansible/admin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- name: restart nginx
service: name=nginx state=restarted
- name: restart PHP FPM
service: name=php7.2-fpm state=restarted
service: name=php7.4-fpm state=restarted
- name: update-ca-certificates
command: update-ca-certificates
- name: restart rsyslog
Expand Down Expand Up @@ -49,7 +49,7 @@
- mariadb-server
- nginx
- php-fpm
- python-mysqldb
- python3-mysqldb
- php-intl
- mycli
- mmv
Expand All @@ -59,15 +59,15 @@

- name: set PHP timezone for FPM
lineinfile:
dest: /etc/php/7.2/fpm/php.ini
dest: /etc/php/7.4/fpm/php.ini
state: present
regexp: 'date\.timezone\s*='
line: 'date.timezone = {{TIMEZONE}}'

- name: enable php modules
command: phpenmod {{item}}
args:
creates: /etc/php/7.2/fpm/conf.d/20-{{item}}.ini
creates: /etc/php/7.4/fpm/conf.d/20-{{item}}.ini
with_items:
- zip
- intl
Expand Down
21 changes: 9 additions & 12 deletions icpc-wf/ansible/common_tasks_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,19 @@

- include: common_tasks_packages_icpc-wf.yml

- name: Update and upgrade apt packages
become: true
apt:
upgrade: yes
update_cache: yes
cache_valid_time: 86400 #One day

- name: install common required/useful packages
tags: packages
apt:
state: present
pkg:
- acl
- ack-grep
- git
- htop
Expand Down Expand Up @@ -51,7 +59,7 @@

- name: set PHP timezone for CLI
lineinfile:
dest: /etc/php/7.2/cli/php.ini
dest: /etc/php/7.4/cli/php.ini
state: present
regexp: 'date\.timezone\s*='
line: 'date.timezone = {{TIMEZONE}}'
Expand Down Expand Up @@ -94,17 +102,6 @@
mode: 0600
when: DJ_GIT_SSH_KEY is defined

- name: Create SSH config
template: src=files/ssh-config-domjudge.j2 dest=/home/domjudge/.ssh/config owner=domjudge group=domjudge mode=0600
when: DJ_GIT_HOST is defined

- name: add all hosts to hosts file
lineinfile:
dest: /etc/hosts
regexp: '{{ item }}$'
line: "{{ hostvars[item].ansible_host }} {{ item }}"
loop: "{{ groups['all'] }}"

- name: configure domjudge logging
copy: src=files/rsyslog.domjudge.conf dest=/etc/rsyslog.d/domjudge.conf
notify: restart rsyslog
Expand Down
31 changes: 5 additions & 26 deletions icpc-wf/ansible/common_tasks_packages_icpc-wf.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,10 @@
# Common packaging stuff during ICPC World Finals.
---
- name: fix apt sources list
tags: packages
replace:
dest: /etc/apt/sources.list
regexp: 'pc2cancer\.ecs\.csus\.edu'
replace: 'packages'

- name: remove pycharm repo
tags: packages
replace:
dest: /etc/apt/sources.list
regexp: '^([^#].*pycharm.*)$'
replace: '# \1'

- name: add packages to hosts file
tags: packages
lineinfile:
dest: /etc/hosts
regexp: '^10\.3\.3\.209'
line: "10.3.3.209 packages"

- name: remove some packages
tags: packages
apt:
pkg: ntp
state: absent
# - name: remove some packages
# tags: packages
# apt:
# pkg: ntp
# state: absent

- meta: flush_handlers
tags: packages
Expand Down
21 changes: 0 additions & 21 deletions icpc-wf/ansible/common_tasks_prebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,27 +87,6 @@
- COLLECTD_MYSQL_PASSWORD is defined
- "'domjudge' == ansible_hostname or 'domjudge-laptop' in ansible_hostname or 'domjudge-backup' in ansible_hostname"

- name: copy DOMjudge logo binary
copy: src=files/domlogo dest=/home/domjudge/domlogo owner=domjudge group=domjudge mode=0755

- name: enable GDM autologin
lineinfile:
path: /etc/gdm3/custom.conf
regexp: 'AutomaticLoginEnable'
line: 'AutomaticLoginEnable=true'
notify: restart gdm

- name: Automatically login domjudge user
lineinfile:
path: /etc/gdm3/custom.conf
regexp: 'AutomaticLogin'
line: 'AutomaticLogin=domjudge'
notify: restart gdm

- name: make sure autostart directory exists
file: dest=/home/domjudge/.config/autostart state=directory owner=domjudge group=domjudge
tags: fix_autostart

- name: install SSL server certificates
copy:
src: "{{ item }}"
Expand Down
2 changes: 1 addition & 1 deletion icpc-wf/ansible/domserver-only-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- name: restart nginx
service: name=nginx state=restarted
- name: restart PHP FPM
service: name=php7.2-fpm state=restarted
service: name=php7.4-fpm state=restarted
- name: update-ca-certificates
command: update-ca-certificates
- name: restart collectd
Expand Down
50 changes: 5 additions & 45 deletions icpc-wf/ansible/domserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- name: restart nginx
service: name=nginx state=restarted
- name: restart PHP FPM
service: name=php7.2-fpm state=restarted
service: name=php7.4-fpm state=restarted
- name: update-ca-certificates
command: update-ca-certificates
- name: restart collectd
Expand All @@ -35,25 +35,26 @@
- mariadb-server
- nginx
- php-fpm
- python-mysqldb
- python3-mysqldb
- php-intl
- mycli
- macchanger
- acl

- name: copy in MySQL config
copy: src=files/my.cnf dest=/root/.my.cnf

- name: set PHP timezone for FPM
lineinfile:
dest: /etc/php/7.2/fpm/php.ini
dest: /etc/php/7.4/fpm/php.ini
state: present
regexp: 'date\.timezone\s*='
line: 'date.timezone = {{TIMEZONE}}'

- name: enable php modules
command: phpenmod {{item}}
args:
creates: /etc/php/7.2/fpm/conf.d/20-{{item}}.ini
creates: /etc/php/7.4/fpm/conf.d/20-{{item}}.ini
with_items:
- zip
- intl
Expand All @@ -69,32 +70,6 @@
copy: src=files/mysql.domjudge.cnf dest=/etc/mysql/mariadb.conf.d/zz_domjudge.cnf
notify: restart mysql

- name: add mysql config snippet for replication
template: src=files/mysql.replication.cnf.j2 dest=/etc/mysql/mariadb.conf.d/zzz_replication.cnf
notify: restart mysql
when: REPLICATION_PASSWORD is defined

- name: disable mysql listen on localhost only
replace:
path: /etc/mysql/mariadb.conf.d/50-server.cnf
regexp: '^bind-address\s*='
replace: '#bind-address ='
when: REPLICATION_PASSWORD is defined

- name: copy script to setup replication
template: src=files/setup-replication.sh.j2 dest=/usr/local/sbin/setup-replication.sh mode=0755
when: REPLICATION_PASSWORD is defined

- name: create mysql replication user
mysql_user:
name: replication
host: '%'
password: "{{REPLICATION_PASSWORD}}"
append_privs: true
priv: '*.*:REPLICATION SLAVE'
state: present
when: REPLICATION_PASSWORD is defined

- name: make sure mysql is restarted
meta: flush_handlers

Expand All @@ -119,25 +94,10 @@
command: "{{DJ_DIR}}/bin/dj_setup_database -u root bare-install"
when: "'failed' in db_status.stdout"

- name: fix background color
lineinfile:
regexp: '^(\s*background-color):\s+white\s*;'
line: '\1: {{BACKGROUND_COLOR}};'
backrefs: yes
dest: "{{DJ_DIR}}/webapp/web/style.css"
when: BACKGROUND_COLOR is defined

- name: disable developer mode
lineinfile:
regexp: '^APP_ENV=dev'
state: absent
dest: "{{DJ_DIR}}/webapp/.env.local"

- include: nginx-setup.yml

- name: add autostart shortcuts
copy: src=files/{{item}}.desktop dest=/home/domjudge/.config/autostart/ owner=domjudge group=domjudge mode=0755
with_items:
- htop
- taillog-domserver-nginx-error
- taillog-domserver-symfony-error
4 changes: 2 additions & 2 deletions icpc-wf/ansible/files/setup-replication.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ echo "Recreating empty database..."
mysql -e 'STOP SLAVE; DROP DATABASE domjudge;'
{{DJ_DIR}}/sql/dj_setup_database create-db-users

ssh "$MASTER" "service php7.2-fpm stop"
ssh "$MASTER" "service php7.4-fpm stop"

MASTER_STATUS=$(ssh "$MASTER" "mysql -e 'SHOW MASTER STATUS;'" | tail -n1)
MASTER_BINLOG=$(echo "$MASTER_STATUS" | cut -f 1)
Expand All @@ -48,7 +48,7 @@ CHANGE MASTER TO MASTER_HOST='10.3.3.${MASTER_SERVER_ID}',
MASTER_LOG_POS=${MASTER_LOGPOS};
START SLAVE;"

ssh "$MASTER" "service php7.2-fpm start"
ssh "$MASTER" "service php7.4-fpm start"

if ! mysql -e 'SHOW SLAVE STATUS\G' | grep 'Slave_SQL_Running: Yes' ; then
echo "Error: slave SQL replication not running."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[Desktop Entry]
Name=taillog-domserver-symfony-error
Type=Application
Exec=gnome-terminal --window --geometry 74x17+1000+400 -e 'bash -c "tail -F /opt/domjudge/webapp/var/logs/prod.log"'
Exec=gnome-terminal --window --geometry 74x17+1000+400 -e 'bash -c "tail -F /opt/domjudge/webapp/var/log/prod.log"'
3 changes: 3 additions & 0 deletions icpc-wf/ansible/files/tune_cpu.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ Description=Tune CPU cores: disable turboboost, downclocking, etc.
Type=oneshot
ExecStart=/usr/local/sbin/disable-turboboost_ht
RemainAfterExit=true

[Install]
WantedBy=multi-user.target
Loading