GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - codebench-dev/api: The CodeBench main API

BranchesTags
Open more actions menu

Latest commit

 

History

194 Commits
194 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
doc/assets
doc/assets
 
 
src
src
 
 
.commitlintrc.json
.commitlintrc.json
 
 
.dockerignore
.dockerignore
 
 
.env.example
.env.example
 
 
.eslintrc.json
.eslintrc.json
 
 
.gitignore
.gitignore
 
 
.prettierignore
.prettierignore
 
 
.prettierrc
.prettierrc
 
 
.releaserc.json
.releaserc.json
 
 
Dockerfile
Dockerfile
 
 
README.md
README.md
 
 
commitlint.config.js
commitlint.config.js
 
 
docker-compose.yml
docker-compose.yml
 
 
fly.toml
fly.toml
 
 
nest-cli.json
nest-cli.json
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.build.json
tsconfig.build.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

codebench-api

The CodeBench main API.

Requirements

  • NodeJS v16+
  • PostgreSQL (cf docker-compose.yml)

Linters

  • pylint
  • golangci-lint
  • clang-tidy

Run API

Dev with hot-reloading:

npm run dev

Prod:

npm start

Architecture

Submission jobs execution flow

Component Action
Worker Launch and maintain pool of X prebooted microVMs in the background
Worker Bind to RabbitMQ queue jobs_q on jobs_ex exchange and jobs_rk routing key
API Bind to RabbitMQ queue jobs_status_q on jobs_status_ex exchange and jobs_status_rk routing key
Front POST /submissions
Front Poll GET /submissions/:id every 500 ms
API Send job to RabbitMQ on jobs_ex direct exchange with jobs_rk routing key.
Worker Receive job, get ready microVM from pool, send job to agent in microVM
Agent Compile/Run code, return result
Worker During two previous steps, send status of jobs on jobs_status_ex exchange with jobs_status_rk routing key
API Receive each new status on jobs_status_q, and insert them into DB and in-memory cache, so that the polling can get the latest status.
Front Get the final result, stop polling and display it.

Contribute

Manage database with TypeORM

Delete schema:

npm run db:drop

Run all migrations:

npm run db:migrate

Reset db (combination of drop and migrate)

npm run db:reset
npm run typeorm migration:generate -- -n xxx

Create migration:

# After editing or adding an Entity
npm run typeorm migration:generate -- -n AddNewEntity

Code Style

Available commands for eslint/prettier:

npm run lint:check
npm run lint:fix
npm run format:check
npm run format:fix

About

The CodeBench main API

Resources

Readme
Activity
Custom properties

Stars

5 stars

Watchers

1 watching

Forks

3 forks
Report repository

Releases

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.