Skip to content

Add example docker-compose file #4

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 51 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
d59752e
Update mailing list URL's
nickygerritsen Jan 28, 2022
7ae802a
Release 8.0.0.
nickygerritsen Jan 30, 2022
3c80a40
All current issues are for single quoted items
vmcj Mar 9, 2022
5ace33e
Allow single domserver usage
vmcj Mar 9, 2022
bcf6b6d
Use default used at regional contests
vmcj Mar 9, 2022
1835a47
Allow bare repo and upstream usage
vmcj Mar 9, 2022
2a7890f
Set this on host level
vmcj Mar 9, 2022
e3cf853
With inplace-conf being broken this was needed to install domserver
vmcj Mar 9, 2022
7f4fbd8
Address comments from Nicky+Jaap
vmcj Mar 9, 2022
3543032
untested
vmcj Mar 9, 2022
209120d
Install composer 2.x.
nickygerritsen Mar 22, 2022
7432f03
We always want to clone the repo.
nickygerritsen Mar 22, 2022
f156348
Add CDS role to Ansible.
nickygerritsen Apr 2, 2022
fa3b55b
Add Ansible role for setting up static scoreboard.
nickygerritsen Apr 3, 2022
0d1a7f1
Use loop instead of with_items in all the places.
nickygerritsen Apr 3, 2022
5d268c2
Add scripts to dump and load database to mysql server role.
nickygerritsen Apr 3, 2022
3502b6f
Add judgehost .target systemd file.
nickygerritsen Apr 5, 2022
f313a84
Fix updating of docs by removing vendor directory in each loop iterat…
nickygerritsen Apr 9, 2022
9f8eb1e
Add accounts and persons to JSON API verifier.
nickygerritsen Apr 9, 2022
1d01dc8
Update CDS role to work with new 2.5 CDS with accounts.json.
nickygerritsen Apr 10, 2022
9986155
Fix CDS_HOSTNAME check.
nickygerritsen Apr 12, 2022
628d729
Fix another CDS hostname check.
nickygerritsen Apr 12, 2022
deddb35
CDS now has YAML support for accounts, use it as it is way more easy …
Apr 13, 2022
b96fd93
Monitor the management machine
vmcj Apr 14, 2022
90c5005
Update metric scraping for new webservers
vmcj Apr 14, 2022
492fad9
Wirte correct target file
Apr 16, 2022
e159610
Use up-to-date prometheus to fix grafana bug
vmcj Apr 21, 2022
a6f9d50
Use promtail to gather local logs and PUSH these to grafana
vmcj Apr 21, 2022
058b3ae
Use consistent naming format for webservers
vmcj Apr 21, 2022
3e63a12
Deduplicate domlogo.
meisterT Apr 22, 2022
30482b9
Use relative symlink instead.
meisterT Apr 22, 2022
758edd8
Update maintainerlist from github info (#43)
vmcj Apr 27, 2022
e408210
Promote Nicky/GEHACK autologin
vmcj Apr 27, 2022
f5bf666
Notify demoweb users of sentry usage
vmcj May 5, 2022
07dd870
Test ansible scripts with default linter
vmcj Feb 2, 2022
76c5e91
Various yaml fixes
vmcj Apr 30, 2022
a8687d8
Fix variable spacing issues, no change intended
vmcj Apr 30, 2022
578a31a
Notify is not needed as we can check the aptDB
vmcj Apr 30, 2022
9226912
For all these files the tabs are not needed
vmcj Apr 30, 2022
92d2df5
Command is less risky
vmcj Apr 30, 2022
f011574
Changing to systemd instead of the service or command
vmcj Apr 30, 2022
a0a0520
In the future we should see if we can do this without shell
vmcj Apr 30, 2022
de5ff9f
Some of these permissions might need to be redone
vmcj Apr 30, 2022
057846d
Use newer syntax
vmcj Apr 30, 2022
cd64844
Variables cannot be uppercased
vmcj Apr 30, 2022
69680df
Those are old style linters
vmcj May 1, 2022
9f1a7ab
These scripts are also used outside WF
vmcj May 1, 2022
9fe5a80
Fix link to ICPC Contest API specification.
eldering May 21, 2022
5655aff
Only make replication an explicit choice
vmcj May 26, 2022
97b5c7b
DOMjudge 8.1 is now released
vmcj Jun 2, 2022
07bd7db
Link to example compose file
vmcj Jun 9, 2022
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
14 changes: 14 additions & 0 deletions .github/linting.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/bash

set -euxo pipefail

# shellcheck disable=SC2044
for book in $(find ./ -maxdepth 1 -name "*.yml"); do
if [ "$book" != "./handlers.yml" ]; then
ansible-lint "$book" -x braces,line-length
fi
done
# shellcheck disable=SC2044
for dir in $(find ./roles -maxdepth 1 -type d); do
ansible-lint "$dir" -x braces,line-length
done
22 changes: 22 additions & 0 deletions .github/workflows/ansible-linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Test contest deployment (ansible scripts)

on: [push,pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Install ansible lint tools
run: sudo apt update; sudo pip install ansible-lint
- name: Lint the different scripts
run: |
set -eux
ansible-lint --version
ansible-lint .
working-directory: provision-contest/ansible
- name: Lint the different scripts (Via the script)
run: ../../.github/linting.sh
working-directory: provision-contest/ansible

2 changes: 1 addition & 1 deletion .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
env:
SHELLCHECK_OPTS: -e SC1090
SHELLCHECK_OPTS: -e SC1090 -e SC2086 -e SC2046
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ developers, but might be of use for others too.

The following subdirectories contain:
* `website` the HTML code for www.domjudge.org
* `icpc-wf` scripts used at the ICPC World Finals
* `provision-contest` scripts used at ICPC style contests, such as the World Finals
* `contest-api` a script to validate an implementation of the
[ICPC contest API](https://ccs-specs.icpc.io/contest_api)
4 changes: 4 additions & 0 deletions contest-api/check-api.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ languages
problems
groups
organizations
persons
team-members
accounts
teams
state
submissions
Expand All @@ -30,6 +32,8 @@ scoreboard

ENDPOINTS_OPTIONAL='
team-members
persons
accounts
awards
commentary
'
Expand Down
23 changes: 23 additions & 0 deletions contest-api/json-schema/account.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "CLICS Contest API - account",
"description": "Definition of a single account object",

"type": "object",
"properties": {
"id": { "$ref": "common.json#/identifier" },
"username": { "type": "string" },
"password": { "type": ["string", "null"] },
"type": {
"oneOf": [
{ "enum": [ "team", "judge", "admin", "analyst", "staff" ] },
{ "type": "null" }
]
},
"ip": { "type": ["string", "null"] },
"team_id": { "$ref": "common.json#/identifierornull" },
"person_id": { "$ref": "common.json#/identifierornull" }
},
"required": ["id", "username", "type"],
"$ref": "common.json#/strictproperties"
}
12 changes: 12 additions & 0 deletions contest-api/json-schema/accounts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "CLICS Contest API: accounts",
"description": "JSON response of this API call",

"type": "array",
"uniqueItems": true,
"$ref": "common.json#/nonemptyarray",
"items": {
"$ref": "account.json#"
}
}
2 changes: 2 additions & 0 deletions contest-api/json-schema/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
"problems",
"groups",
"organizations",
"persons",
"team-members",
"accounts",
"teams",
"state",
"submissions",
Expand Down
2 changes: 2 additions & 0 deletions contest-api/json-schema/event-feed.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
{ "$ref": "group.json#" },
{ "$ref": "organization.json#" },
{ "$ref": "team.json#" },
{ "$ref": "person.json#" },
{ "$ref": "team-member.json#" },
{ "$ref": "account.json#" },
{ "$ref": "state.json#" },
{ "$ref": "submission.json#" },
{ "$ref": "judgement.json#" },
Expand Down
25 changes: 25 additions & 0 deletions contest-api/json-schema/person.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "CLICS Contest API - person",
"description": "Definition of a single person object",

"type": "object",
"properties": {
"id": { "$ref": "common.json#/identifier" },
"team_id": { "$ref": "common.json#/identifier" },
"icpc_id": { "type": [ "string", "null" ] },
"name": { "type": "string" },
"title": { "type": [ "string", "null" ] },
"email": { "type": [ "string", "null" ] },
"sex": {
"oneOf": [
{ "enum": [ "male", "female" ] },
{ "type": "null" }
]
},
"role": { "enum": [ "contestant", "coach", "staff" ] },
"photo": { "$ref": "common.json#/imagerefsornull" }
},
"required": ["id", "team_id", "name", "role"],
"$ref": "common.json#/strictproperties"
}
12 changes: 12 additions & 0 deletions contest-api/json-schema/persons.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "CLICS Contest API: persons",
"description": "JSON response of this API call",

"type": "array",
"uniqueItems": true,
"$ref": "common.json#/nonemptyarray",
"items": {
"$ref": "person.json#"
}
}
17 changes: 11 additions & 6 deletions domlogo/domlogo.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
import requests
import re
import time

font = ('Roboto', 14)
team_image = sg.Image(filename='domlogo-files/photos/idle.png')
Expand Down Expand Up @@ -41,18 +42,21 @@
api_url = f'{api_url}/contests/{cid}'
print(f'Contest is {cid}.')

latest_logfile = max(glob.glob('output/log/judge.*-0.log'), key=os.path.getctime)
latest_logfile = max(glob.glob('output/log/judge.*-2.log'), key=os.path.getctime)
print(f'Checking logfile {latest_logfile}')
with open(latest_logfile, 'r') as logfile:
# Seeks to the end of the file.
logfile.seek(0, 2)
results = []
last_seen, needs_update = (None, None)
while True:
event, values = window.read(timeout=10)
event, values = window.read(timeout=30)
if event == sg.WIN_CLOSED:
break
line = logfile.readline()
# Sleep here for a tiny amount of time to avoid using too much CPU.
if len(line) == 0:
time.sleep(0.01)
if 'Working directory:' in line:
token = line.strip().split('/')
judging_id = token[-1]
Expand All @@ -65,10 +69,9 @@
team_id = submission_data['team_id']
last_seen = (submission_id, judging_id, team_id)
new_filename = f'domlogo-files/photos/{team_id}.png'
if team_id>=120:
team_image.update(filename=new_filename)
f'domlogo-files/photos/{team_id}.png')
team_image.update(filename=f'domlogo-files/photos/{team_id}.png')
if (int)(team_id) >= 120:
new_filename = f'domlogo-files/photos/crew.png'
team_image.update(filename=new_filename)
metadata_text.update(f's{submission_id} / {submission_data["problem_id"]} / {submission_data["language_id"]}')
results_text.update('Busy compiling.')
elif 'No submissions in queue' in line:
Expand Down Expand Up @@ -96,6 +99,8 @@
color = 'DeepSkyBlue'
for i in range(len(cache)-1):
cache[i] = cache[i+1]
if (int)(tid) >= 120:
tid = 'DOMjudge'
cache[-1] = (f'domlogo-files/logos/{tid}.png', f's{sid}/j{jid}\n{verdict}', color, jid)
for i in range(len(cache)):
previous_column[i][0].update(filename=cache[i][0])
Expand Down
19 changes: 0 additions & 19 deletions icpc-wf/ansible/group_vars/all/secret.yml.example

This file was deleted.

100 changes: 0 additions & 100 deletions icpc-wf/ansible/roles/base_packages/tasks/main.yml

This file was deleted.

35 changes: 0 additions & 35 deletions icpc-wf/ansible/roles/domjudge_checkout/tasks/main.yml

This file was deleted.

Loading