|Description||Generates verification pages for users to verify statements about politicians for entry into Wikidata.|
|Author(s)||mySociety Democratic Commons Team|
|License||No license specified|
Controlling the service
become verification-pages webservice --backend=kubernetes ruby2 start /data/project/verification-pages/verification-pages/script/toolforge-start
become verification-pages webservice --backend=kubernetes ruby2 stop
Update code and restart
Toolforge doesn't currently, at least as far as I understand, offer zero-downtime deploys, so there will be a short time while deploying where the webapp will return a 502 error. This should resolve itself once the Kubernetes pod has started up correctly.
become verification-pages cd verification-pages git pull bundle check || bundle install bin/rails db:migrate assets:precompile webservice --backend=kubernetes ruby2 restart
Sometimes when running that last restart command you'll see a Python stacktrace from the
webservice tool. This appears to be harmless, but it's prudent to check that the service has correctly by checking the running pods and viewing the logs for the service using the Kubernetes commands below.
Check which pods are running
kubectl get pods
View logs for a pod
First copy the pod name from the output of
kubectl get pods and then run:
kubectl logs -f <POD-NAME>
In order to install the crontab I ran the following commands:
become verification-pages crontab -e
Then I added the following crontab entry, which refreshes all prompts at 05:00 UTC:
0 5 * * * /usr/bin/jsub -N cron-tools.verification-pages-1 -once -quiet /data/project/verification-pages/verification-pages/script/toolforge-cron.daily
./script/toolforge-cron.daily from the verification-pages repo, which currently just runs the script to pull in new statements from suggestions-store.