You are browsing a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org

Performance/Runbook/WebPageTest

From Wikitech-static
< Performance‎ | Runbook
Revision as of 08:45, 9 April 2019 by imported>Phedenskog (Added how to deploy)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This is the runbook for deploying new versions of WebPageTest.

Meta

Update the WebPageTest agent

Whenever there is a new version of Chrome or Firefox we need to deploy a new version of the WebPageTest agent. You need to do that in two steps: First build a new container with the new version of Chrome/Firefox and then log into the agent server and update to the new version.

Build a new Docker container

Clone https://github.com/WPO-Foundation/wptagent or update your fork.

  1. git clone git@github.com:WPO-Foundation/wptagent.git
  2. Go to the right directory: cd wptagent
  3. Build a new container, make sure you run with --no-cache so all layers are rebuilt:docker build --no-cache -t wikimedia/wptagent .
  4. Log into the container:docker run -it wikimedia/wptagent /bin/bash
  5. Get the version of Chrome and Firefox. This will output a string that you will use a Docker tag. Let us call the output NEW_TAG:echo $(firefox --version)-$(google-chrome --version)-$(date +%Y-%m-%d) | sed -e 's/ /_/g'
  6. Re-tag the image docker tag wikimedia/wptagent:latest wikimedia/wptagent:NEW_TAG
  7. Publish the new version to the Docker hub: docker push wikimedia/wptagent:NEW_TAG

Deploy the new container

  1. Log into the server ssh -i "WebPageTestAgent.pem" ubuntu@ec2-3-87-120-168.compute-1.amazonaws.com
  2. Edit the start script and update the version (VERSION) to the new tag: nano start.sh
  3. Stop the current running agent container: docker stop wptagent && docker rm wptagent
  4. Delete the old containers and data: docker system prune --all --volumes -f
  5. Start the agent: ./start.sh