-The stability test is performed on VMs running in Intel Wind River Lab environment.
-There are 2 seperate VMs. One for running API while the other running JMeter & other necessary components, e.g. MariaDB, to simulate steady flow of transactions.
-For simplicity, let's assume:
-
-VM1 will be running JMeter, MariaDB.
-VM2 will be running API REST service and visualVM.
-
-**Lab Environment**
-
-Intel ONAP Integration and Deployment Labs
-`Physical Labs <https://wiki.onap.org/display/DW/Physical+Labs>`_,
-`Wind River <https://www.windriver.com/>`_
-
-**API VM Details (VM2)**
-
-OS: Ubuntu 18.04 LTS
-
-CPU: 4 core
-
-RAM: 8 GB
-
-HardDisk: 91 GB
-
-Docker Version: 18.09.8
-
-Java: OpenJDK 1.8.0_212
-
-**JMeter VM Details (VM1)**
-
-OS: Ubuntu 18.04 LTS
-
-CPU: 4 core
-
-RAM: 8GB
-
-HardDisk: 91GB
-
-Docker Version: 18.09.8
-
-Java: OpenJDK 1.8.0_212
-
-JMeter: 5.1.1
-
-**Software Installation & Configuration**
-
-**VM1 & VM2 in lab**
-
-**Install Java & Docker**
-
-Make the etc/hosts entries
-
-.. code-block:: bash
-
- $ echo $(hostname -I | cut -d\ -f1) $(hostname) | sudo tee -a /etc/hosts
-
-Update the Ubuntu software installer
-
-.. code-block:: bash
-
- $ sudo apt-get update
-
-Check and install Java
-
-.. code-block:: bash
-
- $ sudo apt-get install -y openjdk-8-jdk
- $ java -version
-
-Ensure that the Java version executing is OpenJDK version 8
-
-Check and install docker
-
-.. code-block:: bash
-
- $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- $ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- $ sudo apt-get update
- $ sudo apt-cache policy docker-ce
- $ sudo apt-get install -y unzip docker-ce
- $ systemctl status docker
- $ docker ps
-
-Change the permissions of the Docker socket file
-
-.. code-block:: bash
-
- $ sudo chmod 777 /var/run/docker.sock
-
-Or add the current user to the docker group
-
-.. code-block:: bash
-
- $ sudo usermod -aG docker $USER
-
-Check the status of the Docker service and ensure it is running correctly
-
-.. code-block:: bash
-
- $ service docker status
- $ docker ps
-
-**VM1 in lab**
-
-**Install JMeter**
-
-Download & install JMeter
-
-.. code-block:: bash
-
- $ mkdir jMeter
- $ cd jMeter
- $ wget http://mirrors.whoishostingthis.com/apache//jmeter/binaries/apache-jmeter-5.2.1.zip
- $ unzip apache-jmeter-5.2.1.zip
-
-**Install other necessary components**
-
-Pull api code & run setup components script
-
-.. code-block:: bash
-
- $ cd ~
- $ git clone https://git.onap.org/policy/api
- $ cd api/testsuites/stability/src/main/resources/simulatorsetup
- $ . ./setup_components.sh
-
-After installation, make sure the following mariadb container is up and running
-
-.. code-block:: bash
-
- ubuntu@test:~/api/testsuites/stability/src/main/resources/simulatorsetup$ docker ps
- CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
- 3849ce44b86d mariadb:10.2.14 "docker-entrypoint.s…" 11 days ago Up 11 days 0.0.0.0:3306->3306/tcp mariadb
-
-**VM2 in lab**
-
-**Install policy-api**
-
-Pull api code & run setup api script
-
-.. code-block:: bash
-
- $ cd ~
- $ git clone https://git.onap.org/policy/api
- $ cd api/testsuites/stability/src/main/resources/apisetup
- $ . ./setup_api.sh <host ip running api> <host ip running mariadb>
-
-After installation, make sure the following api container is up and running
-
-.. code-block:: bash
-
- ubuntu@tools-2:~/api/testsuites/stability/src/main/resources/apisetup$ docker ps
- CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
- 4f08f9972e55 nexus3.onap.org:10001/onap/policy-api:2.1.1-SNAPSHOT "bash ./policy-api.sh" 11 days ago Up 11 days 0.0.0.0:6969->6969/tcp, 0.0.0.0:9090->9090/tcp policy-api
-
-**Install & configure visualVM**
-
-VisualVM needs to be installed in the virtual machine having API up and running. It will be used to monitor CPU, Memory, GC for API while stability test is running.
-
-Install visualVM
-
-.. code-block:: bash
-
- $ sudo apt-get install visualvm
-
-Run few commands to configure permissions
-
-.. code-block:: bash
-
- $ cd /usr/lib/jvm/java-8-openjdk-amd64/bin/
- $ sudo touch visualvm.policy
- $ sudo chmod 777 visualvm.policy
-
- $ vi visualvm.policy
-
- Add the following in visualvm.policy
-
-
- grant codebase "file:/usr/lib/jvm/java-8-openjdk-amd64/lib/tools.jar" {
- permission java.security.AllPermission;
- };
-
-Run following commands to start jstatd using port 1111
-
-.. code-block:: bash
-
- $ cd /usr/lib/jvm/java-8-openjdk-amd64/bin/
- $ ./jstatd -p 1111 -J-Djava.security.policy=visualvm.policy &
-
-**Local Machine**
-
-**Run & configure visualVM**
-
-Run visualVM by typing
-
-.. code-block:: bash
-
- $ jvisualvm
-
-Connect to jstatd & remote policy-api JVM
-
- 1. Right click on "Remote" in the left panel of the screen and select "Add Remote Host..."
- 2. Enter the IP address of VM2 (running policy-api)
- 3. Right click on IP address, select "Add JMX Connection..."
- 4. Enter the VM2 IP Address (from step 2) <IP address>:9090 ( for example, 10.12.6.151:9090) and click OK.
- 5. Double click on the newly added nodes under "Remote" to start monitoring CPU, Memory & GC.
-
-Sample Screenshot of visualVM
-
-.. image:: images/results-5.png
-
-Run Test
---------
-
-**Local Machine**
-
-Connect to lab VPN
-
-.. code-block:: bash
-
- $ sudo openvpn --config <path to lab ovpn key file>
-
-SSH into JMeter VM (VM1)
-
-.. code-block:: bash
-
- $ ssh -i <path to lab ssh key file> ubuntu@<host ip of JMeter VM>
-
-Run JMeter test in background for 72+ hours