4.1 KiB
Chronos Installation Guide
This document provides instructions for installing Chronos on supported Linux distributions.
System Requirements
- Linux kernel 5.0 or newer
- Rust 1.70 or newer (stable toolchain)
- PostgreSQL 13 or newer
- Redis 6 or newer (optional, for caching)
- Node.js 18 or newer (for frontend build)
Supported Distributions
Chronos is officially supported on:
- Debian 12 (Bookworm) and newer
- Ubuntu 22.04 LTS (Jammy) and newer
- Arch Linux
Other distributions may work but are not officially tested.
Prerequisites
Before installing Chronos, ensure the following packages are installed:
Debian/Ubuntu:
sudo apt update
sudo apt install -y build-essential postgresql redis-server nodejs npm
Arch Linux:
sudo pacman -Syu --needed base-devel postgresql redis nodejs npm
Installation Steps
-
Clone the repository:
git clone https://github.com/chronos/chronos.git cd chronos -
Install Rust (if not already installed):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source ~/.cargo/env -
Set up PostgreSQL database:
sudo systemctl start postgresql sudo systemctl enable postgresql sudo -u postgres createuser chronos sudo -u postgres createdb chronos -
Create Chronos system users:
sudo useradd -r -s /bin/false chronos-api sudo useradd -r -s /bin/false chronos-scheduler sudo useradd -r -s /bin/false chronos-worker -
Build the application:
cargo build --release -
Install systemd service files:
sudo cp systemd/*.service /etc/systemd/system/ sudo systemctl daemon-reload -
Configure the application:
cp config/chronos.example.toml config/chronos.toml # Edit config/chronos.toml with your settings -
Run database migrations:
cargo run --bin chronos-cli -- migrate -
Start services:
sudo systemctl enable chronos-api.service sudo systemctl enable chronos-scheduler.service sudo systemctl enable chronos-worker.service sudo systemctl start chronos-api.service sudo systemctl start chronos-scheduler.service sudo systemctl start chronos-worker.service
Configuration
Chronos uses a TOML configuration file. The example configuration is located at config/chronos.example.toml.
Key configuration sections:
[server]- API server settings[database]- PostgreSQL connection details[redis]- Redis cache settings (optional)[scheduler]- Scheduling behavior[workers]- Worker pool configuration[execution]- Execution environment settings
Verification
Check that services are running:
sudo systemctl status chronos-api.service
sudo systemctl status chronos-scheduler.service
sudo systemctl status chronos-worker.service
Verify the API is accessible:
curl http://localhost:8080/api/v1/health
Updating
To update Chronos:
-
Pull latest changes:
git pull origin master -
Rebuild:
cargo build --release -
Run migrations if needed:
cargo run --bin chronos-cli -- migrate -
Restart services:
sudo systemctl restart chronos-api.service sudo systemctl restart chronos-scheduler.service sudo systemctl restart chronos-worker.service
Uninstalling
To uninstall Chronos:
-
Stop services:
sudo systemctl stop chronos-api.service sudo systemctl stop chronos-scheduler.service sudo systemctl stop chronos-worker.service -
Disable services:
sudo systemctl disable chronos-api.service sudo systemctl disable chronos-scheduler.service sudo systemctl disable chronos-worker.service -
Remove systemd service files:
sudo rm /etc/systemd/system/chronos-*.service sudo systemctl daemon-reload -
Remove system users:
sudo userdel chronos-api sudo userdel chronos-scheduler sudo userdel chronos-worker -
Remove application files:
sudo rm -rf /path/to/chronos