This repository contains the backend part of the implementation of a competitive programming stress testing platform.
What exactly is stress testing in Competitive Programming? Let me explain...
Suppose you have a solution to some problem A that you are very sure of (a bruteforce, for instance). And you have a solution B for that problem that (maybe more optimal) you are not sure of. So, you may wanna run some tests to figure out, whether their output coincide or, more importantly, differ. This application (with some good UI) may come in handy for such problems. (This will be useful only in case there is just one correct output for an input)
export USERNAME=username_for_dashboard
export PASSWORD=setthis
export HASHED_PASSWORD=$(openssl passwd -apr1 $PASSWORD)
export FASTAPI_URL=fastapi-back.domain.com
export TRAEFIK_DASHBOARD_URL=traefik-dashboard.domain.com
POSTGRES_PASSWORD=setthis
POSTGRES_USER=postgres
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_DB=Stress_DB_NAME
OAUTH_SECRET_KEY=VERYLATGEKEY
[entryPoints]
[entryPoints.web]
address = ":80"
[entryPoints.web.http]
[entryPoints.web.http.redirections]
[entryPoints.web.http.redirections.entryPoint]
to = "websecure"
scheme = "https"
[entryPoints.websecure]
address = ":443"
[accessLog]
[api]
dashboard = true
[providers]
[providers.docker]
exposedByDefault = false
[certificatesResolvers.letsencrypt.acme]
email = "email@email.ru"
storage = "/certificates/acme.json"
[certificatesResolvers.letsencrypt.acme.httpChallenge]
entryPoint = "web"
docker build -t stress_container testing_env/
docker-compose -f docker-compose.prod.yml up
We have a monolith here, the logic is separated between multiple modules: one handles room management
(just code files user wish to test) and stress-testing logic, where the most important
stuff is. Also there are user management, and OAuth modules.
Each module has:
schemas.py- for types used in the module- file with helping procedures (e.g. crud or like testing implementation)
router- for endpointsmodels- possibly db models
main.py contains the FastApi class instance and there all the modules endpoints are binded to it.
db_connection - connects to db.
There also is directory testing_env. It has Dockerfile for lightweight alpineOS-based container, which is used as testing sandbox. It has "testing_pipeline.py" code that drives the testing procedure.
Seems to be easy and structured... let's see what I and others will say after a while...