Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

3.1 KB
Raw Blame

Production Deployments

This describes Ente's production deployment. It is specific to our infrastructure and is generally unnecessary for self-hosted instances.

Overview

We run Museum's Docker image on Ubuntu hosts with Docker and manage it with systemd, following the service pattern used by the rest of our infrastructure.

Installation

To bring up another Museum node, prepare the instance to run our services.

Set up Alloy, Prometheus and node-exporter.

If running behind Nginx, install the nginx service.

Add credentials:

sudo mkdir -p /root/museum/credentials
sudo tee /root/museum/credentials/pst-service-account.json
sudo tee /root/museum/credentials/fcm-service-account.json
sudo tee /root/museum/credentials.yaml

Add billing data from the pricing-data repository:

scp /path/to/pricing-data/{us,in,black-friday}.json <instance>:

sudo mkdir -p /root/museum/data/billing
sudo mv *.json /root/museum/data/billing/

Add TLS credentials unless running behind Nginx:

sudo tee /root/museum/credentials/tls.cert
sudo tee /root/museum/credentials/tls.key

Copy the service definition and restart script to the new instance, then install them in their system locations.

# If using nginx
scp scripts/deploy/museum.nginx.service <instance>:museum.service
# otherwise
scp scripts/deploy/museum.service <instance>:

scp scripts/deploy/update-and-restart-museum.sh <instance>:

sudo install -o root -g root -m 0644 museum.service \
    /etc/systemd/system/museum.service && rm museum.service
sudo install -o root -g root -m 0755 update-and-restart-museum.sh \
    /usr/local/sbin/update-and-restart-museum.sh && rm update-and-restart-museum.sh
sudo systemctl daemon-reload

If running behind Nginx, install Museum's Nginx configuration with suitable rate limits:

scp scripts/deploy/museum.nginx.conf <instance>:

sudo mv museum.nginx.conf /root/nginx/conf.d
sudo systemctl reload nginx

Starting

SSH into the instance and run:

sudo /usr/local/sbin/update-and-restart-museum.sh

Rollback

The update script tags the currently running image as museum-prod:previous before pulling. To roll back:

sudo docker tag rg.fr-par.scw.cloud/ente/museum-prod:previous rg.fr-par.scw.cloud/ente/museum-prod:latest
sudo systemctl restart museum

[!NOTE]

This doesn't work if there are migrations!

To reset the local latest back to the registry image, run sudo /usr/local/sbin/update-and-restart-museum.sh again, or

sudo docker pull rg.fr-par.scw.cloud/ente/museum-prod:latest