[Technology] SYZOJ implementation of distributed Reviews

SYZOJ implementation of distributed Reviews

This blog is the cause of the school's OJ because the entrance was cut off, but I was a public network OJ achieve very halal UOJ but with only 1core and 1GB of memory. After a few twists and turns fee deployed syzoj be loved by everybody card often / memory card ... so the need to review the evaluation task distributed to shunt some of the excellent performance of the new lease of servers.

However, due to the development team is now occupied by pigeons so distributed evaluation of the wiki Gugu Gu ...

Own xjb engage in a distributed now engage in evaluation (site-side and evaluation Kyi not on the same server)

So here the record about their future reproduction convenient, and hope to help everyone want to deploy syzoj to some extent.

SYZOJ the GitHub repository and the Wiki

SYZOJ message mechanism

This part is asked Menci know of ...

Currently SYZOJ this structure is long: web evaluation tasks assigned to the end of the evaluation Ji judge-daemon, judge-daemon then run the task assigned to each judge-runner.

The entire communication system is: web using the machine end of the inner Redis communications, web-to judge-daemon using SocketIO via HTTP, the communication between the judge-daemon and judge-runner is achieved with Redis + RabbitMQ (?).

But the web end communication between judge-daemon does not pass the test data. That is the test data must exist and be synchronized simultaneously on the server-side web server and judge-daemon is located.

The actual implementation

Communication section

According to the mechanism described above, as long as we can find that actually solve web-to-judge-daemon communication between the distributed evaluation can be achieved. That is to change config/daemon.jsonthe ServerUrlentry for the URL to web side. If there is, then nginx reverse proxy You may need to fill in the domain name instead of IP.

Therefore, in accordance Wiki installed judger basically get away.

That redis also need to share the web server and external access redis I toss some time ... the last time in amqp autistic asked about Menci discovery mechanism is not required to share the message

Synchronous test data

Because no matter SocketIO and test data, we need to self-synchronize data/testdataall files under. Personal use strategy is to use inotify+rsyncto do real-time synchronization difference. (Perhaps with NFS can?)

inotify Is a kernel interface, the kernel will send a signal to the program after the specified file is specified operation.

Then the rest of the course work online synchronization (

The general process is the judger other end open rsync --daemon, and then write a script in the web This is the first synchronization.

Note that a wide variety of issues like token

Guess you like

Origin www.cnblogs.com/rvalue/p/10984336.html