Skip to content

tubagundem/ALICEQL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ALICEQL Flask CCDB Proxy

Overview

Lightweight Flask app providing a searchable home page and a proxy endpoint to the ALICE CCDB with simple in‑memory caching.

Features

  • Browse & filter CCDB subfolders (/)
  • Proxy CCDB paths (/ccdb/)
  • Header forwarding (Accept, Browse-Limit, Time-Machine)
  • Client-side object/table filtering & timestamp validity view
  • Server-side validation of limits & timestamps

Environment Variables

Variable Default Description
FLASK_DEBUG 0 Enable Flask debug mode when set to 1
LOG_LEVEL WARNING Python logging level (DEBUG, INFO, etc.)
QUIET 0 Suppress werkzeug access logs when 1
MAX_BROWSE_LIMIT 1000000 Absolute upper cap for Browse-Limit

Requirements

Python 3.10+ See requirements.txt.

Quick Start

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python3 app.py

App runs on http://0.0.0.0:8000

Production Deployment (Linux and macOS)

Use Gunicorn for production. Do not use the Flask dev server.

macOS (simple)

Run locally with Gunicorn:

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
LOG_LEVEL=INFO QUIET=1 gunicorn -b 0.0.0.0:8000 -w 2 -k gthread --threads 8 --timeout 60 ccdb_proxy:app

Linux (simple systemd)

  1. Install into /opt/aliceql and create a venv:
sudo mkdir -p /opt/aliceql && sudo chown "$USER":"$USER" /opt/aliceql
cp -r . /opt/aliceql
cd /opt/aliceql
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
  1. Create /etc/systemd/system/aliceql.service:
[Unit]
Description=AliceQL CCDB Proxy
After=network.target

[Service]
WorkingDirectory=/opt/aliceql
Environment=LOG_LEVEL=INFO
Environment=QUIET=1
Environment=MAX_BROWSE_LIMIT=1000000
ExecStart=/opt/aliceql/.venv/bin/gunicorn -b 0.0.0.0:8000 -w 2 -k gthread --threads 8 --timeout 60 ccdb_proxy:app
Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target
  1. Enable and start:
sudo systemctl daemon-reload
sudo systemctl enable --now aliceql
  1. Verify:
curl -f http://127.0.0.1:8000/ | head

Notes

  • Set LOG_LEVEL=INFO and QUIET=1 in production.
  • Adjust workers/threads for your CPU and traffic.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published