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

Performance/Runbook/WebPageTest: Difference between revisions

From Wikitech-static
Jump to navigation Jump to search
imported>Phedenskog
(Added how to deploy)
 
imported>Phedenskog
(We don't use the docker version anymore)
 
Line 6: Line 6:


== Update the WebPageTest agent ==
== 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.
The current version of the WebPageTest agent auto updates itself with a git pull and browser are updated with apt get.
 
=== Build a new Docker container ===
Clone https://github.com/WPO-Foundation/wptagent or update your fork.
 
# <code>git clone git@github.com:WPO-Foundation/wptagent.git</code>
# Go to the right directory: <code>cd wptagent</code>
# Build a new container, make sure you run with --no-cache so all layers are rebuilt:<code>docker build --no-cache -t wikimedia/wptagent .</code>
# Log into the container:<code>docker run -it wikimedia/wptagent /bin/bash</code>
# 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:<code>echo $(firefox --version)-$(google-chrome --version)-$(date +%Y-%m-%d) | sed -e 's/ /_/g'</code>
# Re-tag the image <code>docker tag wikimedia/wptagent:latest wikimedia/wptagent:NEW_TAG</code>
# Publish the new version to the Docker hub: <code>docker push wikimedia/wptagent:NEW_TAG</code>
 
=== Deploy the new container ===
 
# Log into the server <code>ssh -i "WebPageTestAgent.pem" ubuntu@ec2-3-87-120-168.compute-1.amazonaws.com</code>
# Edit the start script and update the version ('''VERSION''')  to the new tag: <code>nano start.sh</code>
# Stop the current running agent container: <code>docker stop wptagent &&  docker rm wptagent</code>
# Delete the old containers and data: <code>docker system prune --all --volumes -f</code>
# Start the agent: <code>./start.sh</code>


[[Category:Runbooks]]
[[Category:Runbooks]]

Latest revision as of 11:38, 18 February 2020

This is the runbook for deploying new versions of WebPageTest.

Meta

Update the WebPageTest agent

The current version of the WebPageTest agent auto updates itself with a git pull and browser are updated with apt get.