This playbook deploys ioi/cms.
10.0.0.31 | 10.0.0.50 | 10.0.0.11~1x | 10.0.0.101~1xx | 10.0.0.221 |
---|---|---|---|---|
[nginx_contest] Nginx for AdminWebService & ContestWebService |
[cms_db] PostgreSQL |
[cms_contest_web] ContestWebService |
[cms_worker] WorkerService |
[nginx_public] Nginx for RankingWebService |
[cms_admin_web] AdminWebService |
[cms_ranking] RankingWebService |
|||
[cms_scoring] ScoringService |
||||
[cms_checker] CheckerService |
||||
[cms_evaluation] EvaluationService |
||||
[cms_proxy] ProxyService |
||||
[cms_log] LogService |
-
Provision VMs as specified in the mapping table above, updating
env/hosts.ini
accordingly. -
Fill the CMS configs in
env/vars.yml
. Several notes:cms_worker_host_slots
: the number of (static) IPs should be equal to the maximum number of workers you want to deploy during a contest. See also "Worker management" section below.
-
Deploy:
ansible-playbook -i env/hosts.ini -e @env/vars.yml cms/deploy.yml
-
Verify that the following services can be accessed:
- Contest web service (
https://cms.[domain]
) - Admin web service (
https://admin.[domain]
) - Ranking web service (
https://ranking.[domain]
)
- Contest web service (
Modify env/data/admins.csv
, then run:
ansible-playbook -i env/hosts.ini -e @env/vars.yml cms/add_admins.yml
Modify env/data/teams.csv
, then run:
ansible-playbook -i env/hosts.ini -e @env/vars.yml cms/add_teams.yml
Modify env/data/users.csv
, then run:
ansible-playbook -i env/hosts.ini -e @env/vars.yml cms/add_users.yml
- Open admin web service.
- Create the contest.
By default, contest web service will show a dropdown of all contests. Contestants need to select one of the contests to enter.
To force the contestants to enter one of the contests:
-
Obtain the contest id (integer) from contest URL in the admin web service.
-
Run:
ansible-playbook -i env/hosts.ini -e @env/vars.yml -e contest_id=<ID> cms/deploy.yml --tags=services
-
Open contest web service, and verify that the contest is automatically selected.
Notes
-
REMEMBER to always add
-e contest_id=<ID>
when running ansible playbooks from this point, otherwise the contest will be unset.- Alternatively,
contest_id
can also be set inenv/vars.yml
.
- Alternatively,
-
To revert this behavior (show the dropdown again), set
contest_id
asALL
(or leave it unspecified), and run the above playbook again.
Run:
ansible-playbook -i env/hosts.ini -e @env/vars.yml -e contest_id=<ID> cms/add_participations.yml
-
Rsync files from Translation app's
/opt/translation/final_pdf/
toenv/data/final_pdf/
. -
(IMPORTANT) For each task, check for possibly multiple files for a language! This could happen when there was a race condition in saving the versions. In such cases, take the latest one and remove the duplicates. It could be the case that the latest one has some hash appended to the filename -- please remove it.
-
Run:
ansible-playbook -i env/hosts.ini -e @env/vars.yml cms/add_statements.yml
- Upload logo to
/var/local/lib/cms/ranking/logo.png
. - Upload user faces to
/var/local/lib/cms/ranking/faces/
.
To deploy workers after the other CMS services have been deployed, run:
ansible-playbook -i env/hosts.ini -e @env/vars.yml -e contest_id=<ID> cms/deploy.yml --limit=cms_worker
On a cms_log
instance, run:
sudo journalctl -u cms-log -f
(If somehow it does not output anything -- try restarting journald via sudo service systemd-journald restart
.)
Or, to view latest per-service CMS logs, open /var/local/log/cms/<service_name>-<shard>/last.log
.