Skip to content

Upgrade

adrien1018 edited this page Mar 2, 2025 · 2 revisions

The process for upgrading TIOJ depends on how you installed it.

Docker

Upgrading Dockerized TIOJ is very simple:

  1. Pull the tioj repo to the desired version.
  2. Run docker compose up -d --build
  3. Done!

Direct Installation

The general process for upgrading a direct-installed TIOJ (using the installation script) is:

  1. Pull the tioj (and tioj-judge if instructed in the release notes) repo to the desired version.
  2. (Only if tioj-judge is upgraded) Run ninja && sudo ninja install under the build/ directory of the tioj-judge repo.
  3. (Only for major / minor releases) Follow the instruction in the release notes. Generally it will be some of the operations listed below, but some versions may have special upgrade steps.
  4. Run sudo systemctl restart nginx && sudo systemctl restart tioj-judge to restart the services
  5. Done!

Upgrade JavaScript packages

Run yarn install --frozen-lockfile in the tioj repo. After running this, follow the next section to regenerate static assets.

Regenerate static assets

Run RAILS_ENV=production rails assets:precompile in the tioj repo.

Migrate database

Run RAILS_ENV=production rails db:migrate in the tioj repo.

Upgrade gems

Run bundle install in the tioj repo.

Upgrade Ruby

Run the following commands to upgrade Ruby using RVM:

rvm install [version]
rvm alias create default [version]
rvm use [version]
bundle install # should be run in the `tioj` repo

After upgrading Ruby, follow the next section to re-install NGINX.

Upgrade NGINX

Run the following command to upgrade or reinstall NGINX:

passenger-install-nginx-module --force-colors --auto --auto-download --languages ruby

The command will output something like this at the end:

passenger_root /home/tioj/.rvm/gems/ruby-[version]/gems/passenger-[version];
passenger_ruby /home/tioj/.rvm/gems/ruby-[version]/wrappers/ruby;

Use these to replace the similar two lines in /opt/nginx/conf/nginx.conf.

Clone this wiki locally