A stack that provides a service that compiles Quirkbot programs.
The service is divided into 2 processes: a webserver and compiler worker.
Takes in compilation requests (as c++ source code), and queues them in a database.
After a program has been queued and is waiting for compilation, clients can check query the compilation status by providing the build id.
The programs will only be stored in the server for 15 seconds! Clients should request the compilation and check it's status immediately after.
Reads queued compilation requests out of a database and compiles them. It doesn't serve any content to external clients.
- Node.js
- NPM
- Mongo
The service is depends on OS specific precompiled packages:
These packages simply mirror the files officially distributed by Arduino.
$ git clone https://github.com/Quirkbot/QuirkbotCompilerStack.git
$ cd QuirkbotCompilerStack
$ sudo npm install
ConfigureS in which port the server will respond to.
Defaults to 8080
.
ConfigureS in which database the services will connect to.
Defaults to mongodb://localhost:27017/quirkbot-compiler
.
The number of forks that will be spawned for each process.
On Heroku, it defaults to [Total available memory] / WEB_MEMEORY
, so the best way to configure is to set WEB_MEMORY
according to what is best for your dyno.
If WEB_CONCURRENCY
is falsey, it will default to the number of cores of the machine.
If Mongo is not running, start it up with:
$ mongod
Start the webserver with
$ node server.js
Start the compiler worker
$ node compiler.js
See package.json
.