Skip to content

Install

Lajos Santa edited this page Feb 3, 2021 · 23 revisions

Requirements

  • python v3.9
  • virtualenv (optional, but recommended)
  • postgresql (and create user, db, etc..)
  • redis

Create virtualenv (optional)

  • sudo pip install virtualenv
  • pick some folder for the virtualenv's files (eg /var/www/buck)
  • virtualenv /var/www/buck
  • source /var/www/buck/bin/activate

Install buck

  • TODO (at this moment: clone this repo, build, copy the dist to the target system, and install)
  • put the example config to /etc/buck.yaml
  • update database:
cd /var/www/buck/lib/python3.9/site-packages/buck
alembic upgrade head
  • test the install: uvicorn buck.app:app --host 0.0.0.0 --port 9000

Systemd services

  • make writable /var/www/buck/ by the www-data user (chown www-data /var/www/buck/)

Web

  • create systemd service file /etc/systemd/system/buck-web.service with this content:
[Unit]
Description=Buck web service
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=www-data
Environment=BUCK_CONFIG_FILE=/etc/buck.yaml
ExecStart=/var/www/buck/bin/uvicorn buck.app:app --workers 4 --port 9000

[Install]
WantedBy=multi-user.target
  • start: systemctl start buck-web
  • automatically get it to start on boot systemctl enable buck-web
  • Follow logs: journalctl -u buck-web.service -f

Celery

  • create systemd service file /etc/systemd/system/buck-celery.service with this content:
[Unit]
Description=Buck celery service
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=www-data
Environment=BUCK_CONFIG_FILE=/etc/buck.yaml
ExecStart=/var/www/buck/bin/celery -A buck.celery.app worker --loglevel=info --statedb=/var/www/buck/celery.state

[Install]
WantedBy=multi-user.target

Raspberry specific steps

Raspberry-specific-steps

Clone this wiki locally