aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap-verify-perf-ligato.sh
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2017-10-12 09:06:58 +0000
committerPeter Mikus <pmikus@cisco.com>2017-10-16 08:55:52 +0000
commitfcaf06abdd27a3a6ef18de14ce3d1dab2c75a8c9 (patch)
tree2561f791fbb9a07168428f6ab7ed8a55d4996135 /bootstrap-verify-perf-ligato.sh
parent9a261ea61549fc6a5c23369d2e236b002dc35038 (diff)
CSIT-841 Optimize creating of vnf-agent docker image Part I
- Optimize building of prod_vpp_agent docker image by using dev_vpp_agent docker image pulled from dockerhub/ligato instead of building on slave. - Add detailed logs from every POD deployed in namespace. - Hardening condition for considering PODs Running. Change-Id: I9f771d6365d38fef2ec2e00ab642853e6a44ad03 Signed-off-by: Peter Mikus <pmikus@cisco.com>
Diffstat (limited to 'bootstrap-verify-perf-ligato.sh')
-rw-r--r--bootstrap-verify-perf-ligato.sh82
1 files changed, 71 insertions, 11 deletions
diff --git a/bootstrap-verify-perf-ligato.sh b/bootstrap-verify-perf-ligato.sh
index 7c4c6d3962..f00183fe5a 100644
--- a/bootstrap-verify-perf-ligato.sh
+++ b/bootstrap-verify-perf-ligato.sh
@@ -29,10 +29,65 @@ PYBOT_ARGS="-W 150 -L TRACE"
ARCHIVE_ARTIFACTS=(log.html output.xml report.html output_perf_data.xml)
+# If we run this script from CSIT jobs we want to use stable vpp version
+if [[ ${JOB_NAME} == csit-* ]] ;
+then
+ mkdir -p vpp/build-root
+ cd vpp/build-root
+
+ if [[ ${TEST_TAG} == *NIGHTLY ]] || \
+ [[ ${TEST_TAG} == *DAILY ]] || \
+ [[ ${TEST_TAG} == *WEEKLY ]];
+ then
+ # Download the latest VPP build .deb install packages
+ echo Downloading VPP packages...
+ bash ${SCRIPT_DIR}/resources/tools/scripts/download_install_vpp_pkgs.sh --skip-install
+
+ VPP_DEBS="$( readlink -f *.deb | tr '\n' ' ' )"
+ # Take vpp package and get the vpp version
+ VPP_STABLE_VER="$( expr match $(ls *.deb | head -n 1) 'vpp-\(.*\)-deb.deb' )"
+ else
+ DPDK_STABLE_VER=$(cat ${SCRIPT_DIR}/DPDK_STABLE_VER)_amd64
+ VPP_REPO_URL=$(cat ${SCRIPT_DIR}/VPP_REPO_URL_UBUNTU)
+ VPP_STABLE_VER=$(cat ${SCRIPT_DIR}/VPP_STABLE_VER_UBUNTU)
+ VPP_CLASSIFIER="-deb"
+ # Download vpp build from nexus and set VPP_DEBS variable
+ wget -q "${VPP_REPO_URL}/vpp/${VPP_STABLE_VER}/vpp-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
+ wget -q "${VPP_REPO_URL}/vpp-dbg/${VPP_STABLE_VER}/vpp-dbg-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
+ wget -q "${VPP_REPO_URL}/vpp-dev/${VPP_STABLE_VER}/vpp-dev-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
+ # Temporary disable using dpdk
+ # wget -q "${VPP_REPO_URL}/vpp-dpdk-dkms/${DPDK_STABLE_VER}/vpp-dpdk-dkms-${DPDK_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
+ wget -q "${VPP_REPO_URL}/vpp-lib/${VPP_STABLE_VER}/vpp-lib-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
+ wget -q "${VPP_REPO_URL}/vpp-plugins/${VPP_STABLE_VER}/vpp-plugins-${VPP_STABLE_VER}${VPP_CLASSIFIER}.deb" || exit
+ VPP_DEBS="$( readlink -f *.deb | tr '\n' ' ' )"
+ fi
+
+ # Temporary workaround as ligato docker file requires specific file name
+ rename -v 's/^(.*)-(\d.*)-deb.deb/$1_$2.deb/' *.deb
+ cd ${SCRIPT_DIR}
+
+# If we run this script from vpp project we want to use local build
+elif [[ ${JOB_NAME} == vpp-* ]] ;
+then
+ mkdir -p vpp/build-root
+ # Use local packages provided as argument list
+ # Jenkins VPP deb paths (convert to full path)
+ VPP_DEBS="$( readlink -f $@ | tr '\n' ' ' )"
+ # Take vpp package and get the vpp version
+ VPP_STABLE_VER="$( expr match $1 'vpp-\(.*\)-deb.deb' )"
+ # Move files to build-root for packing
+ for deb in ${VPP_DEBS}; do mv ${deb} vpp/build-root/; done
+else
+ echo "Unable to identify job type based on JOB_NAME variable: ${JOB_NAME}"
+ exit 1
+fi
+
+# Compress all VPP debs and remove temporary directory
+tar -zcvf ${SCRIPT_DIR}/vpp.tar.gz vpp/* && rm -R vpp
+
LIGATO_REPO_URL=$(cat ${SCRIPT_DIR}/LIGATO_REPO_URL)
-LIGATO_STABLE_VER=$(cat ${SCRIPT_DIR}/LIGATO_STABLE_VER)
-VPP_COMMIT=$1
-VPP_BUILD=$1
+VPP_AGENT_STABLE_VER=$(cat ${SCRIPT_DIR}/VPP_AGENT_STABLE_VER)
+VPP_AGENT_STABLE_COMMIT="$( expr match `cat VPP_AGENT_STABLE_VER` '.*g\(.*\)' )"
DOCKER_DEB="docker-ce_17.06.2~ce-0~ubuntu_amd64.deb"
# Clone & checkout stable vnf-agent
@@ -42,10 +97,10 @@ if [ $? != 0 ]; then
echo "Failed to run: git clone --depth 1 ${LIGATO_REPO_URL}/vpp-agent"
exit 1
fi
-cd vpp-agent && git checkout ${LIGATO_STABLE_VER}
+cd vpp-agent && git checkout ${VPP_AGENT_STABLE_COMMIT}
# If the git checkout fails, complain clearly and exit
if [ $? != 0 ]; then
- echo "Failed to run: git checkout ${LIGATO_STABLE_VER}"
+ echo "Failed to run: git checkout ${VPP_AGENT_STABLE_VER}"
exit 1
fi
@@ -58,12 +113,17 @@ if [ $? != 0 ]; then
exit 1
fi
-# Compile vnf-agent docker image
-cd ${SCRIPT_DIR}/../vpp-agent/docker/dev_vpp_agent/ &&\
- ./build.sh --agent ${LIGATO_STABLE_VER} --vpp ${VPP_COMMIT} &&\
- ./shrink.sh
+# Pull ligato/dev_vpp_agent docker image and re-tag as local
+sudo docker pull ligato/dev-vpp-agent:${VPP_AGENT_STABLE_VER}
+sudo docker tag ligato/dev-vpp-agent:${VPP_AGENT_STABLE_VER}\
+ dev_vpp_agent:latest
+sudo docker images
+
+# Build prod_vpp_agent docker image
cd ${SCRIPT_DIR}/../vpp-agent/docker/prod_vpp_agent/ &&\
- ./build.sh &&\
+ mv ${SCRIPT_DIR}/vpp.tar.gz . &&\
+ ./extract_agent_files.sh &&\
+ sudo docker build -t prod_vpp_agent --no-cache . &&\
./shrink.sh
# Export Docker image
sudo docker save prod_vpp_agent_shrink | gzip > prod_vpp_agent_shrink.tar.gz
@@ -347,7 +407,7 @@ echo Post-processing test data...
python ${SCRIPT_DIR}/resources/tools/scripts/robot_output_parser.py \
-i ${SCRIPT_DIR}/output.xml \
-o ${SCRIPT_DIR}/output_perf_data.xml \
- -v ${VPP_BUILD}
+ -v ${VPP_STABLE_VER}
if [ ! $? -eq 0 ]; then
echo "Parsing ${SCRIPT_DIR}/output.xml failed"
fi