Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion buildlib/pr/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,10 @@ stages:
parameters:
name: new_namespace
demands: ucx_new -equals yes

- template: namespace_tests.yml
parameters:
name: gpu_namespace
demands: ucx_gpu -equals yes
- stage: io_demo
dependsOn: [Static_check]
condition: false
Expand Down
37 changes: 27 additions & 10 deletions contrib/test_namespace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,33 @@
# - WORKSPACE : path to work dir
#

source $(dirname $0)/../buildlib/az-helpers.sh
source $(dirname $0)/../buildlib/tools/common.sh

ucx_inst=${WORKSPACE}/install

echo "==== Running namespace tests on $(hostname) ===="

test_namespace_pid() {
local tl=$1
local mem_type=$2
local test_type=$3

echo "==== Running perftest different PID namespace test for $tl ====" >&2

cmd="$base_perftest -t $test_type -m $mem_type -p $server_port"
unshare_cmd="sudo unshare --pid --fork --mount-proc sudo -u $USER UCX_PROTO_INFO=y UCX_TLS=$tl,sysv $cmd"
step_server_port
$unshare_cmd &
sleep 3
$unshare_cmd localhost
}

test_namespace() {
# Make sure to try to use CMA when possible
# Expect fallback on SYSV
perftest="$ucx_inst/bin/ucx_perftest -t ucp_get -s 9999999 -n 5"

base_perftest="$ucx_inst/bin/ucx_perftest -s 9999999 -n 5"
perftest="$base_perftest -t ucp_get"
echo "==== Running perftest namespace positive tests ===="

for tls in posix cma,sysv
Expand All @@ -33,16 +49,16 @@ test_namespace() {
unshare --user bash -c "{ $cmd & sleep 3; $cmd localhost; }"
done

test_namespace_pid posix host ucp_get
test_namespace_pid cma host ucp_get
if [ "X$have_cuda" != "Xno" ]
then
output=$(test_namespace_pid cuda_ipc,cuda_copy cuda ucp_put_bw)
echo "$output" | grep -q "cuda_ipc"
fi

for tl in posix cma
do
echo "==== Running perftest different PID namespace test for $tl ===="

cmd="$perftest -p $server_port"
step_server_port
sudo unshare --pid --fork sudo -u $USER UCX_TLS=$tl,sysv $cmd &
sleep 3
sudo unshare --pid --fork sudo -u $USER UCX_TLS=$tl,sysv $cmd localhost

echo "==== Running perftest different USER namespace test for $tl ===="
cmd="$perftest -p $server_port"
step_server_port
Expand All @@ -60,5 +76,6 @@ test_namespace() {
}

prepare
try_load_cuda_env
build release
test_namespace
Loading