An automated installation script for the Cafe Grader system - a web-based programming contest grading platform.
This script automates the complete installation and configuration of Cafe Grader on Ubuntu/Debian systems. It handles all dependencies, database setup, system configuration, and service management to get a fully functional grading system running.
- Fully Automated: One-script installation with interactive configuration
- Complete Setup: Installs all dependencies, configures services, and sets up databases
- Helper Scripts: Generates start/stop/status scripts for easy management
- Secure Configuration: Sets up proper user permissions and database security
- Ubuntu 18.04+ or Debian 10+ (recommended)
- Root/sudo access
- Internet connection for package downloads
- At least 4GB RAM and 10GB disk space
-
Download the script:
curl -O https://raw.githubusercontent.com/folkiesss/grader-install-script/main/grader-install.sh chmod +x grader-install.sh
-
Run the installation:
./grader-install.sh
-
Follow the interactive prompts to configure your installation
-
Reboot your system (required for kernel changes)
-
Start Cafe Grader:
~/cafe-grader/start_grader.sh
During installation, you'll be prompted to configure:
| Setting | Default | Description |
|---|---|---|
| Main Database Name | grader |
Primary MySQL database |
| Queue Database Name | grader_queue |
Queue management database |
| Database Username | grader_user |
MySQL user for the application |
| Database Password | grader_pass |
MySQL password (hidden input) |
| Installation Directory | ~/cafe-grader |
Where to install the application |
| Number of Workers | 4 |
Grader worker processes |
| Web Server Port | 3000 |
HTTP port for the web interface |
- Web Server: Apache2 with development headers
- Database: MySQL Server
- Runtime: Ruby (from .ruby-version via RVM)
- Development Tools: Git and required system libraries
- IOI Isolate: Secure sandbox for code execution
- System Hardening: Disabled swap, address space randomization
- cgroup Memory: Kernel configuration for resource control
- Cafe Grader Web: Main web application
- Solid Queue: Background job processing
- Database Schema: Properly migrated and seeded
- Asset Pipeline: Precompiled for production
solid_queue.service: Background job processorisolate.service: Security sandbox serviceset-ioi-isolate.service: System configuration service
The installer creates convenient management scripts in your installation directory:
~/cafe-grader/start_grader.sh # Start all services
~/cafe-grader/stop_grader.sh # Stop all services
~/cafe-grader/status_grader.sh # Check service statusYour installation details are saved to:
~/cafe-grader/installation_config.txt- Complete configuration record~/cafe-grader/web/config/database.yml- Database configuration~/cafe-grader/web/config/worker.yml- Worker configuration
After installation and reboot:
- Start the services:
~/cafe-grader/start_grader.sh - Open your browser to:
http://localhost:3000(or your configured port) - Default credential is
rootwith passwordioionrails
Installation fails during RVM setup:
# Log out and log back in, then run:
source /etc/profile.d/rvm.sh
./grader-install.shServices won't start after reboot:
# Check service status:
sudo systemctl status solid_queue
sudo systemctl status isolate
# Restart services:
sudo systemctl restart solid_queue
~/cafe-grader/start_grader.shDatabase connection errors:
# Verify MySQL is running:
sudo systemctl status mysql
# Test database connection:
mysql -u grader_user -p graderCheck these locations for debugging:
- Application logs:
~/cafe-grader/web/log/ - System logs:
sudo journalctl -u solid_queue - Installation output: Terminal output during script execution
- The script disables swap and address space randomization for grading security
- Database passwords are stored in plain text in config files (consider encryption for production)
- The web server runs on all interfaces (0.0.0.0) - configure firewall accordingly
- Default credentials should be changed after installation
This installation script is designed to work with the official Cafe Grader project. For issues with the grader itself, please refer to the main project repository.
For script-specific issues:
- Check the troubleshooting section above
- Verify your system meets the prerequisites
- Run with verbose output:
bash -x grader-install.sh
This installation script is provided as-is for educational and development purposes. Please refer to the Cafe Grader project for licensing information about the main application.
- Cafe Grader - The main grading platform
- IOI Isolate - Secure sandbox system