Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Next »

About

This doc describes how we deploy and run the tests

Deploy the instance

  • using ansible
TIS-DEVOPS $ ansible-playbook -i ansible/inventory/dev ansible/soaktest.yml


  • using jenkins

https://build.tis.nhs.uk/jenkins/job/tis-soaktest/

That is all we need to get soak testing running. Below is how we set the system up.

Read the logs

  • manually

For DEV, discover what ETL instance IP is

$ cd TIS-DEVOPS
$ ./ansible/inventory/dev
$ ssh -v 10.140.0.136
$ less /tmp/Jmeter/jmeter.log


Create docker image

Currently this is a hack

The procedure: 

  • create ansible/docker-compose/templates/soaktest/Dockerfile and ansible/docker-compose/templates/soaktest/docker-compose.yml
  • deploy somewhere
  • create an image from the running instance, then push the iage to the docker registry

Dockerfile

FROM ubuntu:18.04
ENV LC_ALL C
ENV DEBIAN_FRONTEND noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN true
RUN apt-get update && apt-get install -y gnupg wget
RUN apt-get install -y openssh-server
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# SSH login fix. Otherwise user is kicked off after login
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd

ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile

EXPOSE 22
RUN mkdir -p /run/sshd
RUN echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" > /etc/apt/sources.list.d/webupd8team-java.list && \
    echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" >> /etc/apt/sources.list.d/webupd8team-java.list && \
    apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886 && \
    apt-get -y update && \
    echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
    apt-get install -y oracle-java8-installer && \
    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/cache/oracle-jdk8-installer
ENV JAVA_HOME /usr/lib/jvm/java-8-oracle
RUN echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" | tee /etc/apt/sources.list.d/google-chrome.list
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN apt-get update && apt-get install -y google-chrome-stable && mkdir /Jmeter && chmod 755 -R /Jmeter
RUN useradd -ms /bin/bash soaktester
#RUN chmod +x /Jmeter/bin/jmeter
#USER soaktester
#COPY /tmp/Jmeter/* /Jmeter/
ENV JMETER_HOME=/Jmeter
ENV PATH $JMETER_HOME/bin:$PATH
#VOLUME /result
#VOLUME /Jmeter
ENV DISPLAY=:1
WORKDIR /Jmeter
CMD ["/usr/sbin/sshd", "-D"]
#ENTRYPOINT ["sh", "-c", "./bin/jmeter -n -t ./SoakTestPlan.jmx -l /result/TestResult.jtl"]


docker-compose.yml

version: '2'

services:
  soaktest:
    restart: "on-failure:1"
    build: .
    logging:
      options:
        max-size: '500m'
        max-file: '3'
    cap_add:
    - SYS_ADMIN
    volumes:
      - /tmp/Jmeter:/Jmeter
      - /dev/shm:/dev/shm # Mitigates the Chromium issue described at https://code.google.com/p/chromium/issues/detail?id=519952

then we can run

$ ansible-playbook -i ansible/inventory/<ENV> ansible/soaktest.yml

then enter the docker instance and do this hack

# cp /opt/google/chrome/google-chrome /opt/google/chrome/google-chrome.real
# echo '/opt/google/chrome/google-chrome.real --headless --no-gui "$@"' > /opt/google/chrome/google-chrome
# su - soaktester

Create and upload the image to our docker repo

$ docker commit  -a "@TIS-DEVOPS" -m "SoakTest" soaktest_soaktest_1 soaktest
$ docker tag soaktest repository.tis.nhs.uk:5000/hee/soaktest:0.1.0
$ docker push repository.tis.nhs.uk:5000/hee/soaktest:0.1.0
  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.