Using CRIU to test OpenLiberty based applications
- Install CRIU:
- On ubuntu
sudo apt install criu - On rhel
sudo yum install criu
- On ubuntu
- Download Java 8
Extract it and set
JAVA_HOMEenv variable. - Download OpenLiberty
- Clone this repository
In the following steps it is assumed that this repository is cloned at /opt/criu-ol.
Please change the location according to your setup.
Make sure following steps are run as root user.
-
create a directory where the app would be placed:
# mkdir /opt/app/pingperf # cd /opt/app/pingperf -
extract the downloaded openliberty zip here:
# unzip -q <path to openliberty zip> -
create server
# ./wlp/bin/server create defaultServer -
copy app files from the cloned repo to
/opt/criu-ol/pingperf/# cp /opt/criu-ol/pingperf/pingperf.war ./wlp/usr/servers/defaultServer/apps # cp /opt/criu-ol/pingperf/jvm.options ./wlp/usr/servers/defaultServer # cp /opt/criu-ol/pingperf/server.xml ./wlp/usr/servers/defaultServer -
Go to top directory of the cloned repo:
# cd /opt/criu-ol -
If you have installed the app at different location than
/opt/app/pingperfthen adjust the variableSERVER_INSTALL_DIRinpingperf_test.shaccordingly.Now run the script as:
# ./pingperf_test.sh <batches> <iterations>eg
# ./pingperf_test.sh 5 8would run 5 batches with 8 iterations in each batch.If all goes fine, a summary would be displayed at the end of the run.
-
create a directory where the app would be placed:
# mkdir /opt/app/acmeair # cd /opt/app/acmeair -
extract the downloaded openliberty zip here:
# unzip -q <path to openliberty zip> -
create server
# ./wlp/bin/server create defaultServer -
copy app files from the cloned repo to
/opt/criu-ol/acmeair/# cp /opt/criu-ol/acmeair/acmeair-webapp-2.0.0-SNAPSHOT.war ./wlp/usr/servers/defaultServer/apps # cp /opt/criu-ol/acmeair/mongo.properties ./wlp/usr/servers/defaultServer # cp /opt/criu-ol/acmeair/server.xml ./wlp/usr/servers/defaultServer -
create mongdb docker image using the script in the cloned repo
# cd /opt/criu-ol/acmeair # ./build_mongo.sh -
Go to top directory of the cloned repo:
# cd /opt/criu-ol -
If you have installed the app at different location than
/opt/app/acmeairthen adjust the variableSERVER_INSTALL_DIRinacmeair_test.shaccordingly.Now run the script as:
# ./acmeair_test.sh <batches> <iterations>eg:
# ./acmeair_test.sh 5 8would run 5 batches with 8 iterations in each batch.If all goes fine, summary would be displayed at the end of the run.
-
create a directory where the app would be placed:
# mkdir /opt/app/daytrader7 # cd /opt/app/daytrader7 -
extract the downloaded openliberty zip here:
# unzip -q <path to openliberty zip> -
create server
# ./wlp/bin/server create defaultServer -
copy app files from the cloned repo to
/opt/criu-ol/daytrader7/# cp -r /opt/criu-ol/daytrader7/shared ./wlp/usr/ # cp -r /opt/criu-ol/daytrader7/servers/defaultServer ./wlp/usr/servers -
Go to top directory of the cloned repo:
# cd /opt/criu-ol -
If you have installed the app at different location than
/opt/app/daytrader7then adjust the variableSERVER_INSTALL_DIRindaytrader7_test.shaccordingly.Now run the script as:
# ./daytrader7_test.sh <batches> <iterations>eg
# ./daytrader7_test.sh 5 8would run 5 batches with 8 iterations in each batch.If all goes fine, a summary would be displayed at the end of the run.