Skip to content

Restore Imager worker

benoit74 edited this page Mar 21, 2024 · 1 revision

Restoring from a blank machine / VM

We suppose you have a freshly installed Debian machine / VM

Basic machine configuration

Follow the normal node setup procedure (up to what is specific to k8s): https://github.com/kiwix/k8s/wiki/Machine-and-k8s-node-Setup

Docker

Install Docker by following documentation at https://docs.docker.com/engine/install/debian/

Imager configuration

Restore the imager configuration at /etc/imager.config ; this file contains secret values (to connect to S3) so it is kept by admins in their Key Vault

Sample file:

USERNAME="--------------"
PASSWORD="--------------"
CONTAINER="imager-worker"
IMAGE="ghcr.io/offspot/imager-worker:latest"
#IMAGE="ghcr.io/offspot/cardshop-worker:imager"
S3_ACCESS_KEY="-------------"
S3_SECRET_KEY="--------------------"

Restore the startup script from https://github.com/offspot/imager-service/blob/main/contrib/imager-worker-restart.sh to /usr/local/bin/imager-worker-restart

wget -O /usr/local/bin/imager-worker-restart https://raw.githubusercontent.com/offspot/imager-service/main/contrib/imager-worker-restart.sh
chmod +x /usr/local/bin/imager-worker-restart

Cache policy

Restore the startup script from https://raw.githubusercontent.com/offspot/imager-service/main/contrib/cache-policy.yaml to /data/cache/policy.yaml

wget -O /data/cache/policy.yaml https://raw.githubusercontent.com/offspot/imager-service/main/contrib/cache-policy.yaml

Add worker IP to Wasabi whitelist

If worker IP has changed, update the Wasabi policy containing IP whitelists (remove old worker IP / add new worker IP): arn:aws:iam::100000050990:policy/CardshopWorkers