Content translation/Apertium/Deployment

From mediawiki.org
Jump to navigation Jump to search

This document describes deployment procedure Apertium in production, which is almost similar to cxserver now.

Testing[edit]

Note image tag version from Gerrit patchset to be deploy. For eg: 2020-12-01-140153-production.

Run:

docker pull docker-registry.wikimedia.org/wikimedia/mediawiki-services-apertium:2020-12-01-140153-production

to get Apertium docker image, which can be tested locally.

TODO: Add: How to test it with cxserver.

Updating packages[edit]

  1. Clone https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/services/apertium/
  2. Edit or update package list at: .pipeline/blubber.yaml

Config[edit]

Apertium on Production config stays in: helmfile.d/services/apertium/values.yaml

Once list of packages is changed, we need to do deploy new image in production. Config change can be directly deployed without updating image.

Deployment[edit]

  1. Clone deployment-charts repository (for first time).
  2. Do needful changes in config (update image or other configuration changes as needed).
  3. Make a CR (Example: https://gerrit.wikimedia.org/r/c/operations/deployment-charts/+/623475) and after a successful review, merge it.
  4. After merge, log in in a deployment server (eg: deploy1001), there is a cron (1 minute) that will update the /srv/deployment-charts directory with the contents from git.
  5. Go to /srv/deployment-charts/helmfile.d/services/apertium.
  6. Execute: helmfile -e ${CLUSTER} diff This will show the changes that it will be applied on the cluster.
  7. Execute: helmfile -e ${CLUSTER} -i apply This will materialize the previous diff in the cluster and also will log into SAL the change.

Status[edit]

This is done using helmfile:

  1. Change directory to /srv/deployment-charts/helmfile.d/services/${CLUSTER}/apertium on a deployment server
  2. Unless you are mid un-applied changes the current values files should reflect the deployed values
  3. You can check for un-applied changes with: helmfile -e ${CLUSTER} diff
  4. You can see the status with helmfile -e ${CLUSTER} status

Logs[edit]

Logs can be access from deploy1001 if needed:

cd /srv/deployment-charts/helmfile.d/services/${CLUSTER}/apertium

source .hfenv

kubectl logs apertium-production-8649f66884-znfgl

apertium-production-8649f66884-znfgl is pod name.

To see all logs:

kubectl logs -l app=apertium -c apertium-production

Rolling back changes[edit]

If you need to roll back a change because something went wrong:

  1. Revert the git commit to the deployment-charts repo
  2. Merge the revert (with review if needed)
  3. Wait one minute for the cron job to pull the change to the deployment server
  4. Change directory to /srv/deployment-charts/helmfile.d/services/apertium
  5. Execute helmfile -e ${CLUSTER} diff to see what you'll be changing.
  6. Execute helmfile -e ${CLUSTER} -i apply where CLUSTER is one of (staging, eqiad, codfw).

See also[edit]