Skip to content

Commit

Permalink
Update deploy_test script to work with changes made since initial rel…
Browse files Browse the repository at this point in the history
…ease

The deploy_test script and its helper scripts were never updated to work
with the new build system.

Signed-off-by: Patrick MacArthur <patrick@patrickmacarthur.net>
  • Loading branch information
patrickmacarthur committed Jul 8, 2018
1 parent 24bf2fc commit d30ba11
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 29 deletions.
5 changes: 4 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# Authors: Patrick MacArthur <patrick@patrickmacarthur.net>
#
# Copyright (c) 2016, University of New Hampshire
# Copyright (c) 2016-2018, University of New Hampshire
#
# This software is available to you under a choice of one of two
# licenses. You may choose to be licensed under the terms of the GNU
Expand Down Expand Up @@ -174,6 +174,9 @@ TESTS = tests/binheap tests/list_test

dist_doc_DATA = doc/urdma-schema.json

dist_noinst_SCRIPTS = scripts/deploy_test.bash scripts/run_real.sh \
scripts/run_real_with_perf.sh

# Disable the uninstall check since the kernel build system doesn't
# provide a module uninstall target.
distuninstallcheck:
Expand Down
27 changes: 14 additions & 13 deletions scripts/deploy_test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Authors: Patrick MacArthur <patrick@patrickmacarthur.net>
#
# Copyright (c) 2016, IBM Corporation
# Copyright (c) 2018, University of New Hampshire
#
# This software is available to you under a choice of one of two
# licenses. You may choose to be licensed under the terms of the GNU
Expand Down Expand Up @@ -47,10 +48,8 @@ source "${profile}"

# Make input variables read-only
readonly TOP_SRCDIR DEPLOY_DIR SERVER_NODE CLIENT_NODE
readonly SERVER_DPDK_IP SERVER_DPDK_IP_PREFIX
readonly CLIENT_DPDK_IP CLIENT_DPDK_IP_PREFIX
readonly DPDK_LOG_LEVEL SERVER_LCORE_LAYOUT CLIENT_LCORE_LAYOUT
readonly SERVER_PORT CLIENT_PORT
readonly SERVER_DPDK_IP
readonly CLIENT_DPDK_IP
readonly SERVER_EXTRA_ARGS CLIENT_EXTRA_ARGS

# Log ID
Expand All @@ -65,25 +64,27 @@ mkfifo ${our_tmpdir}/client_fifo
cd ${TOP_SRCDIR}
ssh ${SERVER_NODE} mkdir -p ${DEPLOY_DIR}
ssh ${CLIENT_NODE} mkdir -p ${DEPLOY_DIR}
git archive --format tar HEAD \
| ssh ${SERVER_NODE} tar -C ${DEPLOY_DIR} -x
git archive --format tar HEAD \
| ssh ${CLIENT_NODE} tar -C ${DEPLOY_DIR} -x
rm -f urdma-*.tar.gz
make distcheck || exit 1
tarname=urdma-*.tar.gz
tarbn=$(basename ${tarname} .tar.gz)
ssh ${SERVER_NODE} tar -C ${DEPLOY_DIR} -xz <${tarname}
ssh ${CLIENT_NODE} tar -C ${DEPLOY_DIR} -xz <${tarname}
tmux neww -n dpdk-server \
"ret=127
trap 'exec 3>${our_tmpdir}/server_fifo; echo \${ret} >&3' EXIT
ssh -t ${SERVER_NODE} ${DEPLOY_DIR}/scripts/run_real.sh \
${DEPLOY_DIR} ${SERVER_APP} ${LOGID} \
ssh -t ${SERVER_NODE} ${DEPLOY_DIR}/${tarbn}/scripts/run_real.sh \
${DEPLOY_DIR}/${tarbn} ${SERVER_APP} ${LOGID} \
${SERVER_EXTRA_ARGS}
ret=\$?"
sleep 5
tmux neww -n dpdk-client \
"ret=127
trap 'exec 3>${our_tmpdir}/client_fifo; echo \${ret} >&3' EXIT
ssh -t ${CLIENT_NODE} ${DEPLOY_DIR}/scripts/run_real.sh \
${DEPLOY_DIR} ${CLIENT_APP} ${LOGID} \
ssh -t ${CLIENT_NODE} ${DEPLOY_DIR}/${tarbn}/scripts/run_real.sh \
${DEPLOY_DIR}/${tarbn} ${CLIENT_APP} ${LOGID} \
${CLIENT_EXTRA_ARGS} \
${SERVER_DPDK_IP}
-a ${SERVER_DPDK_IP}
ret=\$?"

exec 3<${our_tmpdir}/server_fifo
Expand Down
25 changes: 18 additions & 7 deletions scripts/run_real.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Authors: Patrick MacArthur <patrick@patrickmacarthur.net>
#
# Copyright (c) 2016, IBM Corporation
# Copyright (c) 2016, University of New Hampshire
# Copyright (c) 2016-2018, University of New Hampshire
#
# This software is available to you under a choice of one of two
# licenses. You may choose to be licensed under the terms of the GNU
Expand Down Expand Up @@ -52,13 +52,24 @@ mkdir -p $(dirname ${LOGFILE})
exec > >(tee ${LOGFILE}) 2>&1

cd ${TOP_SRCDIR}
make O=build clean
make O=build
sudo make O=build RTE_SDK=${RTE_SDK} RTE_TARGET=${RTE_TARGET} modules_install
sudo setcap cap_net_admin+ep $(realpath build/src/${TESTAPP}/${RTE_TARGET}/app/${TESTAPP})
. /usr/share/dpdk/dpdk-sdk-env.sh
make distclean || true
./configure --sysconfdir=/etc
make
sudo make install
sudo ldconfig
sudo depmod -A
sudo chown root:dpdk /usr/local/bin/urdmad
sudo chmod 0750 /usr/local/bin/urdmad
sudo setcap cap_sys_admin,cap_net_admin+ep /usr/local/bin/urdmad
systemctl --user daemon-reload

systemctl --user stop urdmad || true
sudo modprobe -r urdma || true
sudo modprobe rte_kni
sudo modprobe urdma

export IBV_DRIVERS=$(realpath build/src/liburdma/${RTE_TARGET}/lib/liburdma)
build/src/${TESTAPP}/${RTE_TARGET}/app/${TESTAPP} "$@"
systemctl --user start urdmad
sleep 5
${TESTAPP} "$@"
systemctl --user stop urdmad
27 changes: 19 additions & 8 deletions scripts/run_real_with_perf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Authors: Patrick MacArthur <patrick@patrickmacarthur.net>
#
# Copyright (c) 2016, IBM Corporation
# Copyright (c) 2016, University of New Hampshire
# Copyright (c) 2016-2018, University of New Hampshire
#
# This software is available to you under a choice of one of two
# licenses. You may choose to be licensed under the terms of the GNU
Expand Down Expand Up @@ -52,13 +52,24 @@ mkdir -p $(dirname ${LOGFILE})
exec > >(tee ${LOGFILE}) 2>&1

cd ${TOP_SRCDIR}
make O=build clean
make O=build
sudo make O=build RTE_SDK=${RTE_SDK} RTE_TARGET=${RTE_TARGET} modules_install
sudo setcap cap_net_admin+ep ${TOP_SRCDIR}/build/src/${TESTAPP}/${RTE_TARGET}/app/${TESTAPP}
. /usr/share/dpdk/dpdk-sdk-env.sh
make distclean || true
./configure --sysconfdir=/etc
make
sudo make install
sudo ldconfig
sudo depmod -A
sudo chown root:dpdk /usr/local/bin/urdmad
sudo chmod 0750 /usr/local/bin/urdmad
sudo setcap cap_sys_admin,cap_net_admin+ep /usr/local/bin/urdmad
systemctl --user daemon-reload

sudo modprobe -r urdma &>/dev/null || true
systemctl --user stop urdmad || true
sudo modprobe -r urdma || true
sudo modprobe rte_kni
sudo modprobe urdma

export IBV_DRIVERS=$(realpath build/src/liburdma/${RTE_TARGET}/lib/liburdma)
perf record --call-graph dwarf -o ${HOME}/perf.${LOGID}.data -- ${TOP_SRCDIR}/build/src/${TESTAPP}/${RTE_TARGET}/app/${TESTAPP} "$@"
systemctl --user start urdmad
sleep 5
perf record --call-graph dwarf -o ${HOME}/perf.${LOGID}.data -- ${TESTAPP} "$@"
systemctl --user stop urdmad

0 comments on commit d30ba11

Please sign in to comment.