Skip to content

Commit 98151f5

Browse files
Merge release v0.1.16
Release v0.1.16
2 parents b2d275c + 6cebbf9 commit 98151f5

9 files changed

Lines changed: 548 additions & 292 deletions

File tree

.github/workflows/int-test.yaml

Lines changed: 262 additions & 262 deletions
Large diffs are not rendered by default.

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ toolchain go1.22.5
77
require (
88
github.com/DataWorkflowServices/dws v0.0.1-0.20250424161110-635a3b991607
99
github.com/NearNodeFlash/lustre-fs-operator v0.0.1-0.20250425152023-c5cd382612d7
10-
github.com/NearNodeFlash/nnf-ec v0.0.1-0.20250508164611-4e8b76ddad31 // indirect
11-
github.com/NearNodeFlash/nnf-sos v0.0.1-0.20250508182118-6dc2325affff
10+
github.com/NearNodeFlash/nnf-ec v0.0.1-0.20250509164504-1a625db7d3c6 // indirect
11+
github.com/NearNodeFlash/nnf-sos v0.0.1-0.20250603174844-af2e0f0cec9c
1212
github.com/onsi/ginkgo/v2 v2.22.2
1313
github.com/onsi/gomega v1.36.2
1414
go.openly.dev/pointy v1.3.0

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ github.com/DataWorkflowServices/dws v0.0.1-0.20250424161110-635a3b991607 h1:KQfD
22
github.com/DataWorkflowServices/dws v0.0.1-0.20250424161110-635a3b991607/go.mod h1:i9v4K2d64a9uyd9ZazOJ85RWzVQjIgHWXkLo895KDAE=
33
github.com/NearNodeFlash/lustre-fs-operator v0.0.1-0.20250425152023-c5cd382612d7 h1:FxMaus1rRbrE/GkU8bF5cRvbqSyqBpxNV12BApQ9zmw=
44
github.com/NearNodeFlash/lustre-fs-operator v0.0.1-0.20250425152023-c5cd382612d7/go.mod h1:A6zVcD/8ydhY7UuUGU9/VBU0iB8Sw46x0/RI9SkWcn8=
5-
github.com/NearNodeFlash/nnf-ec v0.0.1-0.20250508164611-4e8b76ddad31 h1:86N4qhxqWmNy/Oszo2xIi1jURpMsXyFQamo9DdLey14=
6-
github.com/NearNodeFlash/nnf-ec v0.0.1-0.20250508164611-4e8b76ddad31/go.mod h1:lx13ustzE/+39fLECky+CFKkAV8GYlX9eaI6IGmHQkY=
7-
github.com/NearNodeFlash/nnf-sos v0.0.1-0.20250508182118-6dc2325affff h1:4gaYVr70uRgT47OuNklYxEZrWmOrb1403ZiUWkTVDjs=
8-
github.com/NearNodeFlash/nnf-sos v0.0.1-0.20250508182118-6dc2325affff/go.mod h1:7Q04Qh/316C/CU5YNgoUGwpJ4zKwZHIL1PDqFp+amQg=
5+
github.com/NearNodeFlash/nnf-ec v0.0.1-0.20250509164504-1a625db7d3c6 h1:1ztureDKlY4DkleSAff72198Sei4g9oEFYptq9mIkKs=
6+
github.com/NearNodeFlash/nnf-ec v0.0.1-0.20250509164504-1a625db7d3c6/go.mod h1:lx13ustzE/+39fLECky+CFKkAV8GYlX9eaI6IGmHQkY=
7+
github.com/NearNodeFlash/nnf-sos v0.0.1-0.20250603174844-af2e0f0cec9c h1:rXQNGsMm4HuOj3MKCGPkQ5Q3sM8PAYrlrtJaOKGYEB0=
8+
github.com/NearNodeFlash/nnf-sos v0.0.1-0.20250603174844-af2e0f0cec9c/go.mod h1:iuLx3IJ0h8auZEtnm7hy61bpmUlmtEyhs7bZvax+dk0=
99
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
1010
github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A=
1111
github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=

system-test/dm/copy-in-copy-out/copy-in-copy-out.bats

Lines changed: 139 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,25 @@ if [ "${COPY_OFFLOAD}" != "" ]; then
5555
copy_out_method="offload"
5656
fi
5757

58+
# Default to using the lib-copy-offload-tester binary for copy offload tests
59+
if [[ -z "${COPY_OFFLOAD_TEST_BIN}" ]]; then
60+
COPY_OFFLOAD_TEST_BIN=lib-copy-offload-tester
61+
fi
62+
5863
# Flux command
59-
FLUX="flux run -l -N${N} --wait-event=clean"
64+
FLUX="flux run -l -N${N}"
65+
FLUX_A="flux alloc -N${N}"
6066

6167
# Use a Flux queue
6268
if [ "${Q}" != "" ]; then
6369
FLUX+=" -q ${Q}"
70+
FLUX_A+=" -q ${Q}"
6471
fi
6572

6673
# Require specific rabbits
6774
if [ "${R}" != "" ]; then
6875
FLUX+=" --requires=hosts:${R}"
76+
FLUX_A+=" --requires=hosts:${R}"
6977
fi
7078

7179
# Read the test file and create a bats test for each entry
@@ -75,6 +83,9 @@ for ((i = 0; i < NUM_TESTS; i++)); do
7583
done
7684

7785
function setup() {
86+
# Create a test tmpdir at the supplied prefix (e.g. /home/user/nnf/tmp.x8e8f0a/)
87+
export TEST_TMPDIR=$(mktemp -d -p ${TEST_TMPDIR_PREFIX})
88+
7889
# Make a unique directory to support simulteanous tests
7990
export UUID=$(uuidgen | cut -d'-' -f1)
8091
export DESTDIR=${TESTDIR}/${UUID}
@@ -83,12 +94,115 @@ function setup() {
8394
}
8495

8596
function teardown() {
97+
if [[ -n "$TEST_TMPDIR" ]]; then
98+
rm -rf $TEST_TMPDIR
99+
fi
100+
86101
# clean up if it succeeded, otherwise leave it around for inspection (if no other tests run afterwards)
87102
if [[ "${BATS_TEST_COMPLETED}" -eq 1 ]]; then
88103
rm -rf ${DESTDIR}
89104
fi
105+
90106
}
91107

108+
# Create a copy offload file to be used in the test by the flux job. This file is used to
109+
# run the lib-copy-offload-tester program. This file is created in the test tmpdir and
110+
# is passed to the flux job. The file is created with the following contents:
111+
function create_copyoffload_file {
112+
runit_file="$TEST_TMPDIR/run-it.sh"
113+
touch $runit_file
114+
chmod +x $runit_file
115+
cat << 'EOF' >> $runit_file
116+
#!/bin/bash
117+
echo "starting test on $(hostname)"
118+
set -e
119+
120+
src=$1
121+
dst=$2
122+
profile=$3
123+
124+
prog=<COPY_OFFLOAD_TEST_BIN>
125+
126+
jobid=$FLUX_JOB_ID
127+
jobuid=$(echo $FLUX_KVS_NAMESPACE | cut -d '-' -f2)
128+
wf=fluxjob-$jobuid
129+
130+
echo "jobid: $jobid"
131+
echo "workflow: $wf"
132+
echo "hostname: $(hostname)"
133+
echo "src: $src"
134+
echo "dst: $dst"
135+
echo "profile: $profile"
136+
137+
if [[ -z "$src" || -z "$dst" || -z "$profile" ]]; then
138+
echo "Error: One or more required variables are not set"
139+
exit 1
140+
fi
141+
142+
# For HPE systems with older versions of flux, fake out the bits that flux will provide on LLNL
143+
# systems. Do this if the env vars are not set for us by flux. This assumes each compute has access
144+
# to k8s.
145+
if [[ -z "$DW_WORKFLOW_TOKEN" || -z "$NNF_CONTAINER_LAUNCHER" || -z "$NNF_CONTAINER_PORTS" ]]; then
146+
echo "Fetching workflow information from kubernetes rather than flux..."
147+
148+
if command -v kubectl >/dev/null 2>&1 && kubectl version --request-timeout=5s >/dev/null 2>&1; then
149+
echo "kubectl is available and can contact the server"
150+
else
151+
echo "kubectl is not available or cannot contact the server"
152+
exit 1
153+
fi
154+
155+
export NNF_CONTAINER_LAUNCHER=$(kubectl get workflow $wf -ojson | jq -rM '.status.env["NNF_CONTAINER_LAUNCHER"]')
156+
export NNF_CONTAINER_PORTS=$(kubectl get workflow $wf -ojson | jq -rM '.status.env["NNF_CONTAINER_PORTS"]')
157+
export DW_WORKFLOW_TOKEN=$(kubectl get secret `kubectl get workflow $wf -ojson | jq -rM .status.workflowToken.secretName` -ojson | jq -rM .data.token | base64 -d)
158+
fi
159+
160+
echo "NNF* env vars:"
161+
env | grep -E "NNF|DW_JOB|WORKFLOW|TOKEN"
162+
163+
# expand the $DW_JOB variable
164+
src=$(eval echo "$src")
165+
echo "src: $src"
166+
167+
export DW_WORKFLOW_NAME=$wf
168+
export DW_WORKFLOW_NAMESPACE=default
169+
170+
# Start a copy offload and capture the ID
171+
args=(
172+
-o
173+
-S $src
174+
-D $dst
175+
-P $profile
176+
)
177+
echo "Running $prog ${args[@]}..."
178+
ID=$($prog "${args[@]}")
179+
prog_status=$?
180+
if [[ $prog_status -ne 0 ]]; then
181+
echo "ERROR: $prog failed with exit code $prog_status"
182+
echo " Command: $prog ${args[@]}"
183+
exit $prog_status
184+
fi
185+
echo "ID: $ID"
186+
187+
# Wait for the copy offload to finish
188+
args=(
189+
-q
190+
-j $ID
191+
-w -1
192+
)
193+
echo "Running $prog ${args[@]}..."
194+
$prog "${args[@]}"
195+
EOF
196+
197+
# replace the prog name
198+
sed -i "s/<COPY_OFFLOAD_TEST_BIN>/$COPY_OFFLOAD_TEST_BIN/g" $runit_file
199+
200+
echo $runit_file
201+
}
202+
203+
# This function runs the copy_in/copy_out test. It takes a single argument, which is the index
204+
# of the test to run. It reads the test parameters from the JSON file and runs the test using
205+
# flux.
92206
function test_copy_in_copy_out() {
93207
local idx=$1
94208
local src=$(cat $tests_file | jq -r ".[$idx].src")
@@ -104,14 +218,16 @@ function test_copy_in_copy_out() {
104218
# Use copy offload to do the copy_out (copy_in isn't supported)
105219
if [[ "$copy_out_method" == "offload" ]]; then
106220
# replace the hyphen in src with underscore since it's being used on the compute node rather than in a directive
107-
echo "SOURCE: $src"
108221
src="${src//-/_}"
109-
echo "AFTER SOURCE: $src"
222+
223+
runit_file=$(create_copyoffload_file)
224+
echo "runit_file: $runit_file"
110225
${FLUX} --setattr=dw="\
111-
#DW jobdw type=$fs_type capacity=10GiB name=copyout-test \
112-
#DW copy_in source=$copy_in_src destination=\$DW_JOB_copyout-test" \
113-
bash -c "hostname && \
114-
dm-client-go -source=$src -destination=$dest -profile=$DM_PROFILE"
226+
#DW jobdw type=$fs_type capacity=10GiB name=copyout-test requires=copy-offload \
227+
#DW copy_in source=$copy_in_src destination=\$DW_JOB_copyout-test \
228+
#DW container name=copyoff-container profile=copy-offload-default \
229+
DW_JOB_my_storage=copyout-test DW_GLOBAL_lus=$GLOBAL_LUSTRE_ROOT" \
230+
$runit_file $src $dest $DM_PROFILE
115231
else
116232
${FLUX} --setattr=dw="\
117233
#DW jobdw type=$fs_type capacity=10GiB name=copyout-test \
@@ -127,13 +243,24 @@ function test_copy_in_copy_out() {
127243

128244
# grab the output from ls
129245
local ls_output=$(/bin/ls -l ${expected})
130-
echo "$ls_output" # print it out in case of fail
246+
echo "ls_output: $ls_output" # print it out in case of fail
247+
248+
local actual_count=$(echo "$ls_output" | wc -l)
249+
local expected_count
131250

132-
# if lustre, then no index mounts and only 1 file
133251
if [[ "$fs_type" == "lustre" ]]; then
134-
echo "$ls_output" | wc -l | grep 1
135-
# otherwise verify the number of lines from `ls -l`
252+
expected_count=1
136253
else
137-
echo "$ls_output" | wc -l | grep $N
254+
expected_count=$N
255+
fi
256+
257+
if [[ "$actual_count" -ne "$expected_count" ]]; then
258+
echo "ERROR: File count mismatch for $expected"
259+
echo " Filesystem type: $fs_type"
260+
echo " Expected count: $expected_count"
261+
echo " Actual count: $actual_count"
262+
echo " ls output:"
263+
echo "$ls_output"
264+
return 1
138265
fi
139266
}

system-test/dm/copy-in-copy-out/create-testfiles.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
# This file is repsonsible for creating the environment needed to run the copy-in-copy-out tests on
2121
# a global lustre filesystem that is mounted on `/lus/global`
22+
TESTFILE_SIZE=100M
2223

2324
if [[ -z $1 ]]; then
2425
echo "testdir must be supplied"
@@ -28,7 +29,8 @@ TESTDIR=$1
2829

2930
mkdir -p ${TESTDIR}/src/job/job2
3031
mkdir -p ${TESTDIR}/src/job2
31-
echo "hello_there" >${TESTDIR}/src/job/data.out
32+
fallocate -l ${TESTFILE_SIZE} -x ${TESTDIR}/src/job/data.out
33+
3234
cp ${TESTDIR}/src/job/data.out ${TESTDIR}/src/job/data2.out
3335
cp ${TESTDIR}/src/job/data.out ${TESTDIR}/src/job/job2/data3.out
3436
cp ${TESTDIR}/src/job/data.out ${TESTDIR}/src/job2/data.out

system-test/dm/test-copy-in-copy-out.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ if [[ -z "${DM_PROFILE}" ]]; then
3232
DM_PROFILE=default
3333
fi
3434

35+
if [[ -z "${COPY_OFFLOAD_TEST_BIN}" ]]; then
36+
COPY_OFFLOAD_TEST_BIN=lib-copy-offload-tester
37+
fi
38+
3539
# for now, expect the user directory to exist in global lustre root directory
3640
export TESTDIR=${GLOBAL_LUSTRE_ROOT}/${USER}/dm-system-test
3741

@@ -44,9 +48,11 @@ if [[ -n "${FS_TYPE}" ]]; then
4448
bats -j "${J}" -T ./copy-in-copy-out.bats
4549
else
4650
# Run copy_out tests for each filesystem
47-
FS_TYPE=gfs2 bats -j "${J}" -T ./copy-in-copy-out.bats
48-
FS_TYPE=xfs bats -j "${J}" -T ./copy-in-copy-out.bats
49-
FS_TYPE=lustre bats -j "${J}" -T ./copy-in-copy-out.bats
51+
if [ -z "$ONLY_COPY_OFFLOAD" ]; then
52+
FS_TYPE=gfs2 bats -j "${J}" -T ./copy-in-copy-out.bats
53+
FS_TYPE=xfs bats -j "${J}" -T ./copy-in-copy-out.bats
54+
FS_TYPE=lustre bats -j "${J}" -T ./copy-in-copy-out.bats
55+
fi
5056

5157
# Run the same with copy offload with supported filesystems (gfs2->lustre, lustre->lustre)
5258
if [ "$ENABLE_COPY_OFFLOAD" == "yes" ]; then

system-test/env.example

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,39 @@
1010
GLOBAL_LUSTRE_ROOT?=/lus/global
1111

1212
# Test TEMPDIR Prefix. This must be available on the computes as well.
13-
TEST_TMPDIR_PREFIX?=/nfs/
13+
TEST_TMPDIR_PREFIX?=/nfs/imports/run/${USER}
1414

15-
# If running as a priviledge user that can make persistent NNF filesystems, set to "yes". Otherwise
15+
# If running as a priviledged user that can make persistent NNF filesystems, set to "yes". Otherwise
1616
# tests are skipped.
1717
ENABLE_PERSISTENT?=no
1818

1919
# For dm-system-test, if a copy offload client is available on the compute nodes, then run copy
2020
# offload tests for lustre and gfs2 if set to "yes".
21-
ENABLE_COPY_OFFLOAD?=no
21+
ENABLE_COPY_OFFLOAD?=yes
22+
23+
# If ENABLE_COPY_OFFLOAD and this is set, then *only* run the copy offload tests - skipping the
24+
# copyout tests
25+
ONLY_COPY_OFFLOAD?=no
26+
27+
# For dm-system-test, when ENABLE_COPY_OFFLOAD is "yes", then the tests rely on the libcopyoffload
28+
# tester tool to be present on the compute nodes. Set the location here. Defaults to
29+
# "lib-copyoff-load-tester" which is assumed on PATH. See
30+
# https://github.com/NearNodeFlash/nnf-dm/tree/master/daemons/lib-copy-offload.
31+
COPY_OFFLOAD_TEST_BIN?=lib-copy-offload-tester
32+
33+
# If ENABLE_COPY_OFFLOAD and this is set, then *only* run the copy offload tests - skipping the
34+
# copyout tests
35+
ONLY_COPY_OFFLOAD?=yes
36+
37+
# For dm-system-test, when ENABLE_COPY_OFFLOAD is "yes", then the tests rely on the libcopyoffload
38+
# tester tool to be present on the compute nodes. Set the location here. Defaults to
39+
# "lib-copyoff-load-tester" which is assumed on PATH. See
40+
# https://github.com/NearNodeFlash/nnf-dm/tree/master/daemons/lib-copy-offload.
41+
COPY_OFFLOAD_TEST_BIN?=lib-copy-offload-tester
2242

2343
# Use 2 computes, 4 workflows in parallel using the flux queue `rabbit` and only on the two supplied
2444
# compute nodes
2545
N?=2
2646
J?=4
2747
Q?=rabbit
28-
R?=rabbit-compute2,rabbit-compute3
48+
R?=rabbit-compute2,rabbit-compute3

0 commit comments

Comments
 (0)