About
This doc describes how we deploy and run the tests
Create docker image
Currently this is a hack
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 # cat /opt/google/chrome/google-chrome: /opt/google/chrome/google-chrome.real --headless --no-gui "$@"
Create and upload the image to our docker repo
Deploy the instance
- using ansible
TIS-DEVOPS $ ansible-playbook -i ansible/inventory/dev ansible/soaktest.yml
- using jenkins
Add Comment