DMOJ / online-judge

A modern open-source online judge and contest platform system.
https://dmoj.ca
GNU Affero General Public License v3.0
951 stars 364 forks source link

Only one runtime (Python 3) is available on the site whereas more runtimes are available on the judge server log #2033

Closed sondt166 closed 2 years ago

sondt166 commented 2 years ago

This is a fresh install, I installed the judge server using the pip install -e . command. Although the judge server detects multiple runtimes, only Python3 is available on the site.

$ dmoj-autoconf
...
Configuration result:
runtime:
  as_x64: /usr/bin/x86_64-linux-gnu-as
  as_x86: /usr/bin/as
  awk: /usr/bin/mawk
  cat: /usr/bin/cat
  g++: /usr/bin/g++
  g++11: /usr/bin/g++
  g++14: /usr/bin/g++
  g++17: /usr/bin/g++
  g++20: /usr/bin/g++
  gcc: /usr/bin/gcc
  gcc11: /usr/bin/gcc
  ld_x64: /usr/bin/x86_64-linux-gnu-ld
  ld_x86: /usr/bin/ld
  perl: /usr/bin/perl
  python3: /home/administrator/dmoj/dmojsite/bin/python3
  sed: /usr/bin/sed
$ dmoj -c judge.yml localhost
Self-testing executors
Self-testing AWK:    Success [0.005s, 904 KB]    awk 1.3.4
Self-testing BF:     Success [0.002s, 568 KB]    bf 1.33.7
Self-testing C:      Success [0.002s, 568 KB]    gcc 10
Self-testing C11:    Success [0.004s, 568 KB]    gcc11 10
Self-testing CPP03:  Success [0.004s, 1508 KB]   g++ 10
Self-testing CPP11:  Success [0.006s, 1508 KB]   g++11 10
Self-testing CPP14:  Success [0.006s, 1508 KB]   g++14 10
Self-testing CPP17:  Success [0.002s, 1508 KB]   g++17 10
Self-testing CPP20:  Success [0.006s, 1508 KB]   g++20 10
Self-testing GAS64:  Success [0.002s, 4 KB]      as_x64 2.35.2, ld_x64 2.35.2
Self-testing PERL:   Success [0.011s, 6096 KB]   perl 5.32.1
Self-testing PY3:    Success [0.023s, 9112 KB]   python3 3.9.2
Self-testing SED:    Success [0.003s, 760 KB]    sed 4.7
Self-testing TEXT:   Success [0.003s, 1712 KB]   cat 8.32

Running live judge...
INFO 2022-11-07 01:59:58,771 49653 packet Preparing to connect to [localhost]:9999 as: new_judge
INFO 2022-11-07 01:59:58,771 49653 packet TLS not enabled.
INFO 2022-11-07 01:59:58,771 49653 packet Opening connection to: [localhost]:9999
INFO 2022-11-07 01:59:58,773 49653 packet Starting handshake with: [localhost]:9999
INFO 2022-11-07 01:59:58,773 49653 packet Awaiting handshake response: [localhost]:9999
INFO 2022-11-07 01:59:58,776 49653 packet Judge "new_judge" online: [localhost]:9999
INFO 2022-11-07 01:59:58,776 49653 monitor Scheduled for monitoring: /mnt/problems

image

I also tried installing the judge server using docker, it yields the same result.

Riolku commented 2 years ago

Can we see the entirety of judge.yml?

sondt166 commented 2 years ago

@Riolku sure

id: new_judge
key: "my_super_secret_key"
problem_storage_root:
  - /mnt/problems
runtime:
  as_x64: /usr/bin/x86_64-linux-gnu-as
  as_x86: /usr/bin/as
  awk: /usr/bin/mawk
  cat: /usr/bin/cat
  g++: /usr/bin/g++
  g++11: /usr/bin/g++
  g++14: /usr/bin/g++
  g++17: /usr/bin/g++
  g++20: /usr/bin/g++
  gcc: /usr/bin/gcc
  gcc11: /usr/bin/gcc
  ld_x64: /usr/bin/x86_64-linux-gnu-ld
  ld_x86: /usr/bin/ld
  perl: /usr/bin/perl
  python3: /home/administrator/dmoj/dmojsite/bin/python3
  sed: /usr/bin/sed
Riolku commented 2 years ago

Please delete the key next time, and regenerate this one now, lol. Let's not create any more security holes in the world.

Do you have multiple judges, or is this the only one?

Have you tried submitting in other languages?

sondt166 commented 2 years ago

@Riolku Don't worry about the key, I only test this on the local machine :D . I only have one judge. Python 3 is the only option that I can summit (other languages are not displaying)

Riolku commented 2 years ago

How did you create the judge in the site interface?

Have you tried re-creating the judge in the site interface?

sondt166 commented 2 years ago

From the site, I went to /admin/judge/judge/ and add a new judge, gave it a name and generated a new key. Yes, I tried re-creating the judge, same result.

Riolku commented 2 years ago

Can you judge in python properly?

sondt166 commented 2 years ago

Yes, judging in Python3 works properly, the only issue is that other runtimes are not shown anywhere on the site.

Riolku commented 2 years ago

Odd. I might have to leave this for someone else. My only two good guesses right now are

But then again, I'm no expert here.

sondt166 commented 2 years ago

@Riolku Thanks a lot for your effort!

WallE256 commented 2 years ago

Do you have all the languages defined site-side? If not, you can import a part of them with the command python3 manage.py loaddata language_small ran in the site root folder.

sondt166 commented 2 years ago

@WallE256 After running the command, all runtimes are available now. I'm sure I ran the command while setting up the site as per the manual, not sure why rerunning it now helps. Anyway, the issue is resolved, thank you all so much!

sondt166 commented 2 years ago

For anyone used python3 manage.py loaddata language_small and it does not include the language you need, Run python3 manage.py loaddata language_all instead. Note: There could be a database duplicate error while running the command, fastest way I used is to drop the database, then migrate again. You can go to the database and delete the duplicated row instead.