Page MenuHomePhabricator

[backend] Get Celery and Redis running
Closed, ResolvedPublic

Description

As the name suggests.

Event Timeline

NicoleLBee changed the task status from Open to In Progress.Mar 13 2023, 6:38 AM
NicoleLBee triaged this task as High priority.
NicoleLBee moved this task from Backlog to In Progress on the Toolhunt board.

Celery is up and running on Toolforge.

If for some reason the kubernetes pod should go down or need to be restarted for some reason, here are the steps needed to get it back up again.

  1. kubectl get pods to see if a toolhunt-api.worker pod exists
  2. if it does, kill it with kubectl delete deploy toolhunt-api.worker
  3. spin up a new pod with kubectl create --validate=true -f $HOME/www/python/src/deployment.yaml

To check Celery logs (I'll try to add proper logging at some point):

  1. kubectl get pods to see the name of the pod (currently toolhunt-api.worker-ff8d56c79-5r62g)
  2. kubectl logs <name>
  1. kubectl get pods to see if a toolhunt-api.worker pod exists
  2. if it does, kill it with kubectl delete deploy toolhunt-api.worker
  3. spin up a new pod with kubectl create --validate=true -f $HOME/www/python/src/deployment.yaml

Unless you are changing the contents of the deployment itself, kubectl delete pod <pod name> would be a faster way to recreate the toolhunt-api.worker pod. The Deployment maintains a replicaset which will notice that 0/1 desired pods are present and recreate the deleted pod. This can be turned into a 1-liner by using the 'name' label you setup in the Deployment to find the pod's name: kubectl delete $(kubectl get pod -l name=toolhunt-api.worker -o name)

PR merged into main.