Appendix A: Updating the Docker Image - Distributed Load Testing on AWS

Appendix A: Updating the Docker Image

Distributed Load Testing on AWS uses AWS CodePipeline to help build and register the Taurus Docker image in Amazon Elastic Container Registry (Amazon ECR). During initial deployment, a container ZIP file is uploaded to Amazon Simple Storage Service (Amazon S3). AWS CodeBuild unpacks the ZIP file, builds the Docker image, and sends it to Amazon ECR for registration.


      Docker image pipeline

Figure 2: Docker image pipeline

To update the Taurus Docker image, upload a new or updated container ZIP file to Amazon S3. AWS CodePipeline will automatically start the build and registration process with the new file.

The following example shows the Docker file.

FROM blazemeter/taurus # taurus includes python and pip RUN pip install --no-cache-dir awscli # Taurus working directory = /bzt-configs ADD ./load-test.sh /bzt-configs/ RUN chmod 755 /bzt-configs/load-test.sh ENTRYPOINT ["sh", "-c","./load-test.sh"]

In addition to a Docker file, the container ZIP file contains the following Bash script that downloads the test configuration from Amazon S3 before running the Taurus executable.

# set a uuid for the results xml file name in S3 UUID=$(cat /proc/sys/kernel/random/uuid) echo "S3_BUCKET:: ${S3_BUCKET}" echo "TEST_ID:: ${TEST_ID}" echo "UUID ${UUID}" echo "Download test scenario" aws s3 cp s3://$S3_BUCKET/test-scenarios/$TEST_ID/$TEST_ID.json test.json echo "Running test" bzt test.yml -o modules.console.disable=true echo "Uploading results" aws s3 cp /tmp/artifacts/results.xml s3://$S3_BUCKET/test-scenarios/$TEST_ID results/${UUID}.xml