CloudJudge
- 1 Devlogs
- 11 Total hours
A fully functional Online-Judge platform for Competitive Programming that could be hosted on Cloudflare free infrastructure
A fully functional Online-Judge platform for Competitive Programming that could be hosted on Cloudflare free infrastructure
Hi guyss, this is my first devlog on this project, and also my first devlog on Stardance
So i’ve been messing around with a serverless online judge.
To be clear, this didn’t start because I thought traditional judges were bad. most of them are pretty well engineered, running millions of untrusted code submissions safely is no joke. This was just me asking an intrusive question: “Can I build a functioning judge platform entirely inside Cloudflare’s free tier without paying a single dime?” then, the project just kinda snowballed.
My idea is to experiment with moving some of the execution stuffs out of traditional dedicated servers. Cloudflare has been dropping so much interesting infra lately (Workers, DO, D1, R2, Workflows, Browser Run,…), so it’s a great opportunity to build something old in a new domain
The goal is:
I’d love to see someone able to just clone the repo and deploy a working OJ on their Cloudflare without needing to touch a single VPS or k8s cluster..
Spent some times working on the foundation and the biggest milestone is that the execution pipeline is officially wired up. Here is how things works under the hood:
Which means we currently have:
Looks simple enough, but took a good amount of tinkering to get it running.
My original plan was way simpler: user compile code and submit the wasm module itself, backend run it directly inside Cloudflare Workers. In my head, this was already solved. Then I discovered that Cloudflare Workers don’t let you just fetch and execute external wasm modules at runtime. Which, unfortunately, was my entire plan
So after a brief period of questioning my life choices, I started looking for alternatives. That’s when Browser Run caught my eye. My thought process was basically: okay, if I managed to run code inside the user’s browser… what if I just use another browser managed by me to actually run the code? So I tried using that headless browser as the execution environment itself. And honestly, Browser Run just worked, it literally helped save this project. There’s still a lot I don’t know yet, still haven’t benchmarked performance, tested large workloads, so its sounds pretty unreliable, but IT WORKS.
Right now I’m trying to figure out things like:
And my next focus is preparing to host a live demo so you guys can actually mess around with it. I’m also refining the app to make selfhosting on your own Cloudflare account dead simple.
OKAY that was a realy long devlog, still a long way to go, but getting that pipeline working felt like a win to me. Let’s see how far this slightly unhinged idea can go!!!