Migrating from v2 to v3
A. Summary
We can upgrade from v2 to v3 in place, reusing the same VMs and database. We will need to do the following by hand:
- Deploy using the new
deployment/v3-ubuntu-24.04directory, after renaming or removing some variables inenv/vars.yml. - Re-enter the app name, slogan, home banner, announcements and session limits in the Admin tab. They are moved from the config files to the database, and will not be migrated automatically.
Everything else is migrated automatically on deploy:
- The database gets a new
judgels_settingtable, for the settings above. - Grading is moved to new RabbitMQ queues.
There is also a breaking API change: the user role fields are renamed; see User roles.
B. Backing up existing config
Back up env/vars.yml. Some of its settings will not be migrated, and we will need their values to re-enter them later.
If you have set any announcements, also copy jophiel.web.announcements from /opt/judgels/server/var/conf/judgels-server.yml in the core VM.
C. Deploying Judgels v3
Pull the latest Judgels repository, and link the existing env directory as
envindeployment/v3-ubuntu-24.04/ansible. Thehosts.inifile does not need any changes.In
env/vars.yml, set the Judgels version, rename two variables, and remove the ones that are moved to the database:-app_version: '2.23.0'
+app_version: '3.0.0'
-jophiel_superadmin_initialPassword: ...
+superadmin_initialPassword: ...
-gabriel_grading_numWorkerThreads: ...
+grading_numWorkerThreads: ...
-app_name: ...
-app_slogan: ...
-app_title: ...
-app_description: ...
-app_footer: ...
-jophiel_session_maxConcurrentSessionsPerUser: ...
-jophiel_session_disableLogout: ...app_footeris removed for good: the footer is now always "Powered by Judgels". Any other variables with thejophiel_,gabriel_, orjerahmeel_prefix are ignored in v3.
Then, run the deploy playbook:
ansible-playbook -e @env/vars.yml playbooks/deploy.yml
This will deploy the server, client, and graders together, and migrate the database automatically. We don't need to rerun the provision playbook.
D. Restoring settings
Open the contestant web interface and log in as superadmin. Go to the Admin tab, then System → Settings. Re-enter the values from the backed up env/vars.yml:
| Setting | From |
|---|---|
| App name | app_name |
| App slogan | app_slogan |
| App announcement | jophiel.web.announcements in judgels-server.yml |
| Home banner | app_title and app_description |
| Disable logout | jophiel_session_disableLogout |
| Max concurrent sessions per user | jophiel_session_maxConcurrentSessionsPerUser |
E. Verifying
- Verify that we can log in as
superadminin the admin web interface. - Verify that the contestant web interface shows the correct app name and home banner.
- Submit a solution to a contest problem, and verify that it gets graded.
At this point, Judgels v3 should be fully operational.
F. Cleaning up
- (Optional) We can remove the remaining variables with the
jophiel_,gabriel_, orjerahmeel_prefix fromenv/vars.yml, which are no longer used. - (Optional) We can remove the following unused queues from the RabbitMQ management web interface:
gabriel-grading-requestsandalphon-grading-responseuriel-grading-responsejerahmeel-grading-response
G. What changed
Settings in the database
The following settings are now managed in the Admin tab, under System → Settings, instead of in the config files:
| Setting | v2 |
|---|---|
| App name, slogan and home banner | env/vars.yml |
| Announcements | judgels-server.yml |
| Session limits | env/vars.yml |
They are stored in a new judgels_setting table, which is created by the deploy playbook.
Account and role management
Accounts and roles are now managed in the Admin tab of the contestant web interface, instead of in the admin web interface.
Ansible variables
The jophiel_, gabriel_, and jerahmeel_ prefixes are dropped. jophiel_superadmin_initialPassword and gabriel_grading_numWorkerThreads are renamed to superadmin_initialPassword and grading_numWorkerThreads; the others are either moved to the database or no longer used.
Grading queues
| v2 | v3 |
|---|---|
gabriel-grading-request | judgels-grading-request |
sandalphon-grading-response | judgels-grading-response-problem |
uriel-grading-response | judgels-grading-response-contest |
jerahmeel-grading-response | judgels-grading-response-training |
User roles
In the user role API, the role fields are renamed after the layers:
| v2 | v3 |
|---|---|
jophiel | account |
sandalphon | problem |
uriel | contest |
jerahmeel | training |