Content translation/Apertium/Deployment

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

Testing
Note image tag version from Gerrit patchset to be deploy. For eg:.

Run:

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

TODO: Add: How to test it with cxserver.

Updating packages

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

Config
Apertium on Production config stays in:

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

 * 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:   This will show the changes that it will be applied on the cluster.
 * 7) Execute:   This will materialize the previous diff in the cluster and also will log into SAL the change.

Status
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:
 * 4) You can see the status with

Logs
Logs can be access from deploy1001 if needed:

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

To see all logs:

Rolling back changes
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   to see what you'll be changing.
 * 6) Execute    where CLUSTER is one of (staging, eqiad, codfw).