Skip to content

Commit aa47662

Browse files
committed
Split for WF setups
1 parent 9adfd25 commit aa47662

File tree

10 files changed

+270
-2
lines changed

10 files changed

+270
-2
lines changed

provision-contest/ansible/domserver.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
- python3-netaddr
1414

1515
- name: Setup domserver
16-
hosts: domserver
16+
hosts: domserver,online-domserver
1717
vars:
1818
host_type: domserver
1919
become: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/secret.yml
2+
/all.yml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# Directory of the domjudge repository checkout.
2+
DJ_DIR: /opt/domjudge
3+
4+
# Branch to checkout and use.
5+
DJ_BRANCH: main
6+
7+
# Whether to force-pull changes to the checkout, overwriting any local changes.
8+
DJ_FORCE_UPDATE: true
9+
10+
# Server VLAN IP prefix.
11+
SERVER_IP_PREFIX: 10.3.3
12+
13+
# IP address of the git server.
14+
LOCAL_GIT_IP: "{{SERVER_IP_PREFIX}}.207"
15+
16+
# URL and IP of domserver from judgehosts. A hostname 'domserver' with
17+
# DOMSERVER_IP will be added to the judgehost /etc/hosts file.
18+
DOMSERVER: https://domjudge
19+
DOMSERVER_IP: "{{SERVER_IP_PREFIX}}.215"
20+
DOMSERVER_URL: "{{DOMSERVER}}"
21+
DOMSERVER_SSL_CERT: /etc/ssl/certs/domserver.crt
22+
DOMSERVER_SSL_KEY: /etc/ssl/private/domserver.key
23+
24+
# Set this to true when you are using the ICPC World Finals Contest Image
25+
ICPC_IMAGE: false
26+
27+
# Set this to true when you are using a graphical desktop
28+
GRAPHICAL: false
29+
30+
# Set this to true when you use an (ICPC) AWS machine
31+
AWS: true
32+
33+
# Set this when on the blue network at the World Finals where no
34+
# internet access is available and "packages" must be used as APT repo
35+
# server.
36+
WF_RESTRICTED_NETWORK: false
37+
WF_GREEN: false
38+
39+
# Static IP address configuration. Uses the ansible_host variable as the static
40+
# IP address. Only configured if STATIC_IP_ENABLED is true.
41+
STATIC_IP_ENABLED: false
42+
STATIC_IP_NETMASK: 255.255.252.0
43+
STATIC_IP_GATEWAY: 172.29.0.1
44+
STATIC_IP_INTERFACE: enp1s0
45+
46+
# Additional entries for the /etc/hosts file.
47+
HOSTS:
48+
cds: 10.3.3.207
49+
packages: 10.3.3.209
50+
ntp1: 10.3.3.208
51+
ntp2: 10.3.3.209
52+
nisprint: 10.3.3.211
53+
nismaster: 10.3.3.211
54+
printsrv: 10.3.3.211
55+
domjudge-laptop: 10.3.3.200
56+
pc2: 10.3.3.241
57+
58+
TIMEZONE: "Europe/Amsterdam"
59+
60+
PHP_FPM_MAX_CHILDREN: 400
61+
PHP_FPM_MAX_REQUESTS: 500
62+
PHP_MEMORY_LIMIT: 1024M
63+
PHP_UPLOAD_MAX_FILESIZE: 512M
64+
PHP_POST_MAX_SIZE: 512M
65+
PHP_MAX_FILE_UPLOADS: 101
66+
67+
# Git repo URL
68+
DJ_GIT_HOST: "{{LOCAL_GIT_IP}}"
69+
DJ_GIT_REPO: "https://github.com/domjudge/domjudge.git"
70+
DJ_GIT_REPO_RESTRICTED: "domjudge@{{DJ_GIT_HOST}}:domjudge"
71+
DJ_GIT_REPO_SCRIPTS: "https://github.com/domjudge/domjudge-scripts.git"
72+
DJ_GIT_REPO_SCRIPTS_RESTRICTED: "domjudge@{{DJ_GIT_HOST}}:domjudge-scripts-bare"
73+
CONTEST_REPO: "wf2021"
74+
75+
PHPSTORM_VERSION: 2022.2
76+
PHPSTORM_FULL_VERSION: 222.4345.15
77+
78+
GRAFANA_MONITORING: false
79+
80+
# Hostname of the CDS. If set, will add an nginx in front of the CDS
81+
# If not set, will only expose CDS directly
82+
CDS_HOSTNAME: cds
83+
CDS_PORT: 80
84+
CDS_PORT_SECURE: 443
85+
86+
# CDS SSL cert and key. Only needed when CDS_HOSTNAME is set
87+
CDS_SSL_CERT: /etc/ssl/certs/cds.crt
88+
CDS_SSL_KEY: /etc/ssl/private/cds.key
89+
90+
# Hostname of the static scoreboard
91+
STATIC_SCOREBOARD_HOSTNAME: scoreboard
92+
93+
STATIC_SCOREBOARD_SSL_CERT: /etc/ssl/certs/scoreboard.crt
94+
STATIC_SCOREBOARD_SSL_KEY: /etc/ssl/private/scoreboard.key
95+
96+
# Block access to the CDS for IPs other than these
97+
#CDS_IP_FILTER:
98+
# - 127.0.0.1-127.0.0.1
99+
# - 192.168.0.0-192.168.255.255
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Templated passwords as `{some-strong-password}` are written to make sure our
2+
# script detects those, if you manually change those the `{}` are not required and
3+
# would become part of the password.
4+
# Adding `strong` in the template will create longer passwords and is used for the
5+
# passwords which almost never need to be manually typed.
6+
7+
# Password for the MySQL replication user.
8+
# Set this to enable master-master replication between two domservers.
9+
#REPLICATION_PASSWORD: {some-strong-replication-password}
10+
11+
# Database user password.
12+
DB_PASSWORD: {some-strong-database-password}
13+
14+
# Credentials for the judgehost.
15+
JUDGEHOST_USER: judgehost
16+
JUDGEHOST_PASSWORD: {some-strong-judgehost-password}
17+
18+
# Username and password to be used in .netrc files on admin machines
19+
ADMIN_USER: admin
20+
ADMIN_PASSWORD: {some-admin-password}
21+
22+
# Password for domjudge shell user
23+
# Set this to enable a password on the 'domjudge' shell accounts
24+
# created on the domserver and judgehosts.
25+
#DJ_SHELL_USER_PW: {some-hashed-password}
26+
27+
# Accounts to create when setting up the CDS
28+
CDS_ACCOUNTS:
29+
- username: admin
30+
password: {some-adm1n-password}
31+
type: admin
32+
- username: presAdmin
33+
password: {some-presentation-adm1n-password}
34+
type: admin
35+
- username: presentation
36+
password: {some-public-presentation-password}
37+
type: public
38+
#- username: blue
39+
# password: blu3
40+
# type: staff
41+
#- username: balloon
42+
# password: balloonPr1nter
43+
# type: balloon
44+
#- username: public
45+
# password: publ1c
46+
# type: public
47+
#- username: myicpc
48+
# password: my1cpc
49+
# type: spectator
50+
#- username: live
51+
# password: l1ve
52+
# type: analyst
53+
#- username: team1
54+
# password: t3am
55+
# type: team
56+
# team_id: 1
57+
58+
# Contest(s) to configure in the CDS
59+
CDS_CONTESTS:
60+
- path: nwerc18 # Path in the contest directory
61+
ccs:
62+
id: nwerc18 # ID of the contest if hosted at DOMJUDGE_URL
63+
# Or provide a absolute URL
64+
# url: https://www.domjudge.org/demoweb/api/contests/nwerc18
65+
username: admin
66+
password: admin
67+
68+
PRESCLIENT_CONTEST: nwerc18
69+
70+
# Sentry DSN URL
71+
# SENTRY_DSN:

provision-contest/ansible/hosts.example

+22
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,22 @@ ansible_python_interpreter=/usr/bin/python3
55
# When moving clients for ad-hoc actions:
66
# move them to their own group to keep hosts files on deployed machines in sync.
77

8+
[onprem:children]
9+
domserver
10+
judgehost
11+
cds
12+
grafana
13+
admin
14+
presclient
15+
presadmin
16+
scoreboard
17+
mgmt
18+
autoanalyst
19+
20+
[online:children]
21+
online-domserver
22+
online-judgehost
23+
824
[domserver]
925
domjudge-primary ansible_host=10.3.3.216 KEEPALIVED_PRIORITY=100 EFI_ORDER='0\,1\,3\,4'
1026
domjudge-backup ansible_host=10.3.3.217 KEEPALIVED_PRIORITY=99 EFI_ORDER='0\,1\,3\,4'
@@ -63,3 +79,9 @@ domjudge-scoreboard ansible_host=10.2.2.229
6379
domjudge-mgmg ansible_host=10.3.3.223
6480

6581
[autoanalyst]
82+
83+
[online-domserver]
84+
online-domserver ansible_host=192.168.255.255
85+
86+
[online-judgehost]
87+
online-judgehost1 ansible_host=192.168.255.255

provision-contest/ansible/judgehost.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This playbook installs the DOMjudge judgehosts
33

44
- name: Setup judgehost
5-
hosts: judgehost
5+
hosts: judgehost,online-judgehost
66
strategy: free
77
vars:
88
host_type: judgehost

provision-contest/ansible/roles/grafana/templates/prometheus.yml.j2

+74
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,77 @@ scrape_configs:
154154
{% for host in groups["domserver"] %}
155155
- {{ hostvars[host].ansible_host }}:9253
156156
{% endfor %}
157+
- job_name: 'online-db'
158+
basic_auth:
159+
username: "prometheus"
160+
password: "{{ PROMETHEUS_PASS }}"
161+
tls_config:
162+
insecure_skip_verify: true
163+
scheme: https
164+
static_configs:
165+
- targets:
166+
{% for host in groups["online-domserver"] %}
167+
- {{ hostvars[host].ansible_host }}:9104
168+
{% endfor %}
169+
- job_name: node_domserver_online
170+
basic_auth:
171+
username: "prometheus"
172+
password: "{{ PROMETHEUS_PASS }}"
173+
tls_config:
174+
insecure_skip_verify: true
175+
scheme: https
176+
static_configs:
177+
- targets:
178+
{% for host in groups["online-domserver"] %}
179+
- {{ hostvars[host].ansible_host }}:9100
180+
{% endfor %}
181+
- job_name: online-domjudge
182+
basic_auth:
183+
username: admin
184+
password: {{ ADMIN_PASSWORD }}
185+
metrics_path: /api/v4/metrics/prometheus
186+
scheme: https
187+
tls_config:
188+
insecure_skip_verify: true
189+
static_configs:
190+
- targets:
191+
{% for host in groups["online-domserver"] %}
192+
- {{ hostvars[host].ansible_host }}
193+
{% endfor %}
194+
- job_name: 'web_nginx_domserver_online'
195+
basic_auth:
196+
username: "prometheus"
197+
password: "{{ PROMETHEUS_PASS }}"
198+
tls_config:
199+
insecure_skip_verify: true
200+
scheme: https
201+
static_configs:
202+
- targets:
203+
{% for host in groups["online-domserver"] %}
204+
- {{ hostvars[host].ansible_host }}:9113
205+
{% endfor %}
206+
- job_name: 'web_fpm_domserver_online'
207+
basic_auth:
208+
username: "prometheus"
209+
password: "{{ PROMETHEUS_PASS }}"
210+
tls_config:
211+
insecure_skip_verify: true
212+
scheme: https
213+
static_configs:
214+
- targets:
215+
{% for host in groups["online-domserver"] %}
216+
- {{ hostvars[host].ansible_host }}:9253
217+
{% endfor %}
218+
- job_name: node_judgehost_online
219+
basic_auth:
220+
username: "prometheus"
221+
password: "{{ PROMETHEUS_PASS }}"
222+
tls_config:
223+
insecure_skip_verify: true
224+
scheme: https
225+
static_configs:
226+
- targets:
227+
{% for host in groups["online-judgehost"] %}
228+
- {{ hostvars[host].ansible_host }}:9100
229+
{% endfor %}
230+

0 commit comments

Comments
 (0)