Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to add proxy-judge feature #34

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open

Conversation

OmeletWithoutEgg
Copy link
Contributor

An attempt using ActiveJob to add proxy-judge feature for TIOJ.

TODOs

  • choose language according to submission.compiler.name
  • make sure active jobs are well-maintained
  • rejudge functionality
  • add more files in judges/
  • add information about proxy judge in problem edit panel

@adrien1018
Copy link
Member

Nice! I will take a closer look and do some testing later. A few things I already noticed and would like to change:

  • Separate proxy judge option to a boolean field instead of using a special judge option, or just use the proxy_judge_type field (which will give a more natural UI, for example selecting proxy judge will hide all native judge settings in the Judge Settings tab and show the proxy judge settings)
    • proxy_judge_type can be an enum field
  • Reuse the queued, received and Validating verdict

Also it would probably be a good idea to change the Compiler table to store the supported compilers for each OJ (though I am still not entirely sure how to integrate this change with current features such as contest compiler banned list or submission search).

@OmeletWithoutEgg
Copy link
Contributor Author

I've made some changes, including rewriting the proxy judge type as an enum.
Also, the compiler supported by each judge is now accessible in PROXY_COMPILERS hashmap. I'm not sure if there's a better approach.

About the UI layout of the problem form, I'm not sure where should the proxy judge option be placed and what should be hidden when the proxy judge option is selected.

@adrien1018
Copy link
Member

I would like to decouple submission and result fetching, because this way it can tolerate server restart.
I'm still researching for a clean way to run multiple jobs at the same time and also avoid races (i.e. multiple jobs trying to fetch the same submission at the same time), but currently Resque's queue mechanism seems promising.

I did some rewrite to prepare for decoupling (storing proxy judge information in submission table), and also fixed the POJ submission identification issue.

@OmeletWithoutEgg
Copy link
Contributor Author

At this moment Codeforces and POJ are not available for our proxy judge, so I added another proxy judge type QOJ.

Also, currently if the user chose the wrong compiler it will be JE, and I think it would be better to ban these compiler when making new submission. I'm not sure where is the best place to put a helper to select the class based on proxyjudge_type, or there are other approaches to do this.

@adrien1018
Copy link
Member

I think it works for now. In the future we could probably put this into the compilers DB table, and display the correct compiler information to the users.

Also what did you mean by "Codeforces and POJ are not available"?

@OmeletWithoutEgg
Copy link
Contributor Author

Codeforces is now protected (more aggressively) by cloudflare so that one can't just crawl it now.
POJ submissions have been in the waiting state for at least a week and not being judged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants