Files
sloppyware/docs/installation.md
2026-11-22 02:02:18 +01:00

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

  1. Clone the repository:

    git clone https://github.com/chronos/chronos.git
    cd chronos
    
  2. Install Rust (if not already installed):

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    source ~/.cargo/env
    
  3. Set up PostgreSQL database:

    sudo systemctl start postgresql
    sudo systemctl enable postgresql
    sudo -u postgres createuser chronos
    sudo -u postgres createdb chronos
    
  4. 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
    
  5. Build the application:

    cargo build --release
    
  6. Install systemd service files:

    sudo cp systemd/*.service /etc/systemd/system/
    sudo systemctl daemon-reload
    
  7. Configure the application:

    cp config/chronos.example.toml config/chronos.toml
    # Edit config/chronos.toml with your settings
    
  8. Run database migrations:

    cargo run --bin chronos-cli -- migrate
    
  9. 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:

  1. Pull latest changes:

    git pull origin master
    
  2. Rebuild:

    cargo build --release
    
  3. Run migrations if needed:

    cargo run --bin chronos-cli -- migrate
    
  4. Restart services:

    sudo systemctl restart chronos-api.service
    sudo systemctl restart chronos-scheduler.service
    sudo systemctl restart chronos-worker.service
    

Uninstalling

To uninstall Chronos:

  1. Stop services:

    sudo systemctl stop chronos-api.service
    sudo systemctl stop chronos-scheduler.service
    sudo systemctl stop chronos-worker.service
    
  2. Disable services:

    sudo systemctl disable chronos-api.service
    sudo systemctl disable chronos-scheduler.service
    sudo systemctl disable chronos-worker.service
    
  3. Remove systemd service files:

    sudo rm /etc/systemd/system/chronos-*.service
    sudo systemctl daemon-reload
    
  4. Remove system users:

    sudo userdel chronos-api
    sudo userdel chronos-scheduler
    sudo userdel chronos-worker
    
  5. Remove application files:

    sudo rm -rf /path/to/chronos