diff --git a/.gitmodules b/.gitmodules index 58f89d39..87a00e09 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "scons_local"] path = scons_local - url = https://review.hpdd.intel.com/coral/scons_local + url = https://github.com/daos-stack/scons_local.git diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..32bb524b --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,303 @@ +// To use a test branch (i.e. PR) until it lands to master +// I.e. for testing library changes +@Library(value="pipeline-lib@debug") _ + +pipeline { + agent any + + environment { + GITHUB_USER = credentials('aa4ae90b-b992-4fb6-b33b-236a53a26f77') + BAHTTPS_PROXY = "${env.HTTP_PROXY ? '--build-arg HTTP_PROXY="' + env.HTTP_PROXY + '" --build-arg http_proxy="' + env.HTTP_PROXY + '"' : ''}" + BAHTTP_PROXY = "${env.HTTP_PROXY ? '--build-arg HTTPS_PROXY="' + env.HTTPS_PROXY + '" --build-arg https_proxy="' + env.HTTPS_PROXY + '"' : ''}" + UID=sh(script: "id -u", returnStdout: true) + BUILDARGS = "--build-arg NOBUILD=1 --build-arg UID=$env.UID $env.BAHTTP_PROXY $env.BAHTTPS_PROXY" + } + + options { + // preserve stashes so that jobs can be started at the test stage + preserveStashes(buildCount: 5) + } + + stages { + stage('Pre-build') { + parallel { + stage('checkpatch') { + agent { + dockerfile { + filename 'Dockerfile.centos:7' + dir 'utils/docker' + label 'docker_runner' + additionalBuildArgs '$BUILDARGS' + } + } + steps { + checkPatch user: GITHUB_USER_USR, + password: GITHUB_USER_PSW, + ignored_files: "src/control/vendor/*" + } + post { + /* temporarily moved into stepResult due to JENKINS-39203 + success { + githubNotify credentialsId: 'daos-jenkins-commit-status', description: 'checkpatch', context: 'pre-build/checkpatch', status: 'SUCCESS' + } + unstable { + githubNotify credentialsId: 'daos-jenkins-commit-status', description: 'checkpatch', context: 'pre-build/checkpatch', status: 'FAILURE' + } + failure { + githubNotify credentialsId: 'daos-jenkins-commit-status', description: 'checkpatch', context: 'pre-build/checkpatch', status: 'ERROR' + } + */ + always { + archiveArtifacts artifacts: 'pylint.log', allowEmptyArchive: true + } + } + } + } + } + stage('Build') { + // abort other builds if/when one fails to avoid wasting time + // and resources + failFast true + parallel { + stage('Build on CentOS 7') { + agent { + dockerfile { + filename 'Dockerfile.centos:7' + dir 'utils/docker' + label 'docker_runner' + additionalBuildArgs '$BUILDARGS' + } + } + steps { + sconsBuild clean: "_build.external-Linux" + stash name: 'CentOS-install', includes: 'install/**' + stash name: 'CentOS-build-vars', includes: '.build_vars-Linux.*' + //stash name: 'CentOS-tests', includes: 'build/src/rdb/raft/src/tests_main, build/src/common/tests/btree_direct, build/src/common/tests/btree, src/common/tests/btree.sh, build/src/common/tests/sched, build/src/client/api/tests/eq_tests, src/vos/tests/evt_ctl.sh, build/src/vos/vea/tests/vea_ut, src/rdb/raft_tests/raft_tests.py' + } + post { + always { + recordIssues enabledForFailure: true, + aggregatingResults: true, + id: "analysis-centos7", + tools: [ + [tool: [$class: 'GnuMakeGcc']], + [tool: [$class: 'CppCheck']], + ], + filters: [excludeFile('.*\\/_build\\.external\\/.*'), + excludeFile('_build\\.external\\/.*')] + } + /* temporarily moved into stepResult due to JENKINS-39203 + success { + githubNotify credentialsId: 'daos-jenkins-commit-status', description: 'CentOS 7 Build', context: 'build/centos7', status: 'SUCCESS' + } + unstable { + githubNotify credentialsId: 'daos-jenkins-commit-status', description: 'CentOS 7 Build', context: 'build/centos7', status: 'FAILURE' + } + failure { + githubNotify credentialsId: 'daos-jenkins-commit-status', description: 'CentOS 7 Build', context: 'build/centos7', status: 'ERROR' + } + */ + } + } + stage('Build on Ubuntu 18.04') { + agent { + dockerfile { + filename 'Dockerfile.ubuntu:18.04' + dir 'utils/docker' + label 'docker_runner' + additionalBuildArgs '$BUILDARGS' + } + } + steps { + sh '''echo "Skipping Ubuntu 18 build due to https://jira.hpdd.intel.com/browse/CART-548" + exit 0''' + //sconsBuild clean: "_build.external-Linux" + } + post { + always { + recordIssues enabledForFailure: true, + aggregatingResults: true, + id: "analysis-ubuntu18", + tools: [ + [tool: [$class: 'GnuMakeGcc']], + [tool: [$class: 'CppCheck']], + ], + filters: [excludeFile('.*\\/_build\\.external\\/.*'), + excludeFile('_build\\.external\\/.*')] + } + /* temporarily moved into stepResult due to JENKINS-39203 + success { + githubNotify credentialsId: 'daos-jenkins-commit-status', description: 'Ubuntu 18 Build', context: 'build/ubuntu18', status: 'SUCCESS' + } + unstable { + githubNotify credentialsId: 'daos-jenkins-commit-status', description: 'Ubuntu 18 Build', context: 'build/ubuntu18', status: 'FAILURE' + } + failure { + githubNotify credentialsId: 'daos-jenkins-commit-status', description: 'Ubuntu 18 Build', context: 'build/ubuntu18', status: 'ERROR' + } + */ + } + } + } + } +//NOTESTYET stage('Unit Test') { +//NOTESTYET parallel { +//NOTESTYET stage('run_test.sh') { +//NOTESTYET agent { +//NOTESTYET label 'single' +//NOTESTYET } +//NOTESTYET steps { +//NOTESTYET runTest stashes: [ 'CentOS-tests', 'CentOS-install', 'CentOS-build-vars' ], +//NOTESTYET script: 'LD_LIBRARY_PATH=install/Linux/lib64:install/Linux/lib HOSTPREFIX=wolf-53 bash -x utils/run_test.sh --init && echo "run_test.sh exited successfully with ${PIPESTATUS[0]}" || echo "run_test.sh exited failure with ${PIPESTATUS[0]}"', +//NOTESTYET junit_files: null +//NOTESTYET } +//NOTESTYET post { +//NOTESTYET /* temporarily moved into runTest->stepResult due to JENKINS-39203 +//NOTESTYET success { +//NOTESTYET githubNotify credentialsId: 'daos-jenkins-commit-status', description: 'run_test.sh', context: 'test/run_test.sh', status: 'SUCCESS' +//NOTESTYET } +//NOTESTYET unstable { +//NOTESTYET githubNotify credentialsId: 'daos-jenkins-commit-status', description: 'run_test.sh', context: 'test/run_test.sh', status: 'FAILURE' +//NOTESTYET } +//NOTESTYET failure { +//NOTESTYET githubNotify credentialsId: 'daos-jenkins-commit-status', description: 'run_test.sh', context: 'test/run_test.sh', status: 'ERROR' +//NOTESTYET } +//NOTESTYET */ +//NOTESTYET always { +//NOTESTYET sh '''rm -rf run_test.sh/ +//NOTESTYET mkdir run_test.sh/ +//NOTESTYET [ -f /tmp/daos.log ] && mv /tmp/daos.log run_test.sh/ || true''' +//NOTESTYET archiveArtifacts artifacts: 'run_test.sh/**' +//NOTESTYET } +//NOTESTYET } +//NOTESTYET } +//NOTESTYET } +//NOTESTYET } + stage('Test') { + /* pity we cannot do this. these three tests would fit nicely + * on a single 8 node cluster + * https://issues.jenkins-ci.org/browse/JENKINS-54945 + agent { + label 'cluster_provisioner' + } + */ + parallel { + stage('Single node') { + agent { + label 'single' + } + steps { + runTest stashes: [ 'CentOS-install', 'CentOS-build-vars' ], + script: '''id || true + pwd || true + ls $HOME || true + pip3 list || true + find /home/jenkins/ -type f | xargs ls -ld || true + ln -s $(which fusermount) install/Linux/bin/fusermount3 + mount + . ./.build_vars-Linux.sh + DAOS_BASE=${SL_OMPI_PREFIX%/install/*} + if [ "$PWD" != "$DAOS_BASE" ]; then + export LD_LIBRARY_PATH=$PWD/install/lib64:$PWD/install/lib: + fi + if ! OMPI_MCA_rmaps_base_oversubscribe=1 PATH=$PATH:$PWD/install/Linux/bin nosetests-3.4 --exe --with-xunit; then + echo "rc: ${PIPESTATUS[0]}" + fi''', + junit_files: "nosetests.xml" + } + post { + /* temporarily moved into runTest->stepResult due to JENKINS-39203 + success { + githubNotify credentialsId: 'daos-jenkins-commit-status', description: env.STAGE_NAME, context: 'test/functional_quick', status: 'SUCCESS' + } + unstable { + githubNotify credentialsId: 'daos-jenkins-commit-status', description: env.STAGE_NAME, context: 'test/functional_quick', status: 'FAILURE' + } + failure { + githubNotify credentialsId: 'daos-jenkins-commit-status', description: env.STAGE_NAME, context: 'test/functional_quick', status: 'ERROR' + } + */ + always { + junit 'nosetests.xml' + archiveArtifacts artifacts: 'test/output/Testlocal/*/*.log' + } + } + } + stage('Two-node') { + agent { + label 'cluster_provisioner-2_nodes' + } + steps { + echo "Starting Two-node" + checkoutScm url: 'ssh://review.hpdd.intel.com:29418/exascale/jenkins', + checkoutDir: 'jenkins', + credentialsId: 'bf21c68b-9107-4a38-8077-e929e644996a' + + checkoutScm url: 'ssh://review.hpdd.intel.com:29418/coral/scony_python-junit', + checkoutDir: 'scony_python-junit', + credentialsId: 'bf21c68b-9107-4a38-8077-e929e644996a' + + echo "Starting Two-node runTest" + runTest stashes: [ 'CentOS-install', 'CentOS-build-vars' ], + script: 'bash -x ./multi-node-test.sh 2; echo "rc: $?"', + junit_files: "IOF_2-node_junit.xml" + } + post { + /* temporarily moved into runTest->stepResult due to JENKINS-39203 + success { + githubNotify credentialsId: 'daos-jenkins-commit-status', description: 'Functional daos_test', context: 'test/functional_daos_test', status: 'SUCCESS' + } + unstable { + githubNotify credentialsId: 'daos-jenkins-commit-status', description: 'Functional daos_test', context: 'test/functional_daos_test', status: 'FAILURE' + } + failure { + githubNotify credentialsId: 'daos-jenkins-commit-status', description: 'Functional daos_test', context: 'test/functional_daos_test', status: 'ERROR' + } + */ + always { + junit 'IOF_2-node_junit.xml' + archiveArtifacts artifacts: 'install/Linux/TESTING/testLogs-2_node/**' + } + } + } + stage('Five-node') { + agent { + label 'cluster_provisioner-5_nodes' + } + steps { + echo "Starting Five-node" + checkoutScm url: 'ssh://review.hpdd.intel.com:29418/exascale/jenkins', + checkoutDir: 'jenkins', + credentialsId: 'bf21c68b-9107-4a38-8077-e929e644996a' + + checkoutScm url: 'ssh://review.hpdd.intel.com:29418/coral/scony_python-junit', + checkoutDir: 'scony_python-junit', + credentialsId: 'bf21c68b-9107-4a38-8077-e929e644996a' + + echo "Starting Five-node runTest" + runTest stashes: [ 'CentOS-install', 'CentOS-build-vars' ], + script: 'bash -x ./multi-node-test.sh 5; echo "rc: $?"', + junit_files: "IOF_5-node_junit.xml" + } + post { + /* temporarily moved into runTest->stepResult due to JENKINS-39203 + success { + githubNotify credentialsId: 'daos-jenkins-commit-status', description: 'Functional daos_test', context: 'test/functional_daos_test', status: 'SUCCESS' + } + unstable { + githubNotify credentialsId: 'daos-jenkins-commit-status', description: 'Functional daos_test', context: 'test/functional_daos_test', status: 'FAILURE' + } + failure { + githubNotify credentialsId: 'daos-jenkins-commit-status', description: 'Functional daos_test', context: 'test/functional_daos_test', status: 'ERROR' + } + */ + always { + junit 'IOF_5-node_junit.xml' + archiveArtifacts artifacts: 'install/Linux/TESTING/testLogs-5_node/**' + } + } + } + } + } + } +} diff --git a/multi-node-test.sh b/multi-node-test.sh new file mode 100755 index 00000000..eb86eee4 --- /dev/null +++ b/multi-node-test.sh @@ -0,0 +1,238 @@ +#!/bin/bash + +set -ex -o pipefail + +# shellcheck disable=SC1091 +if [ -f .localenv ]; then + # read (i.e. environment, etc.) overrides + . .localenv +fi + +HOSTPREFIX=${HOSTPREFIX-${HOSTNAME%%.*}} +NFS_SERVER=${NFS_SERVER:-$HOSTPREFIX} + +trap 'echo "encountered an unchecked return code, exiting with error"' ERR + +# shellcheck disable=SC1091 +. .build_vars-Linux.sh + +if [ "$1" = "2" ]; then + test_runner_vm=$((${EXECUTOR_NUMBER:-0}*3+7)) + vm1="$((test_runner_vm+1))" + vm2="$((test_runner_vm+2))" + vmrange="$vm1-$vm2" + test_runner_vm="vm$test_runner_vm" + vm1="vm$vm1" + vm2="vm$vm2" +elif [ "$1" = "5" ]; then + test_runner_vm="vm1" + vmrange="2-6" +fi + +log_base_path="testLogs-${1}_node" + +rm -f results_1.yml IOF_[25]-node_junit.xml + +curl -O 'https://build.hpdd.intel.com/job/mdtest-iof_devel/lastSuccessfulBuild/arch=x86_64,distro=el7/artifact/artifacts/mpich_files.tar.gz' +curl -O 'https://build.hpdd.intel.com/job/mdtest-iof_devel/lastSuccessfulBuild/arch=x86_64,distro=el7/artifact/artifacts/mdtest_files.tar.gz' + +# shellcheck disable=SC2154 +trap 'set +e +i=5 +# due to flakiness on wolf-53, try this several times +while [ $i -gt 0 ]; do + pdsh -R ssh -S -w "${HOSTPREFIX}$test_runner_vm,${HOSTPREFIX}vm[$vmrange]" "set -x + x=0 + while [ \$x -lt 30 ] && + grep $DAOS_BASE /proc/mounts && + ! sudo umount $DAOS_BASE; do + ps axf + sleep 1 + let x+=1 + done + sudo sed -i -e \"/added by multi-node-test-$1.sh/d\" /etc/fstab + sudo rmdir $DAOS_BASE || find $DAOS_BASE || true" 2>&1 | dshbak -c + if [ ${PIPESTATUS[0]} = 0 ]; then + i=0 + fi + let i-=1 +done' EXIT + +DAOS_BASE=${SL_OMPI_PREFIX%/install/*} +if ! pdsh -R ssh -S -w "${HOSTPREFIX}$test_runner_vm,${HOSTPREFIX}vm[$vmrange]" "set -ex +ulimit -c unlimited +sudo mkdir -p $DAOS_BASE +sudo ed <&1 | dshbak -c; then + echo "Cluster setup (i.e. provisioning) failed" + exit 1 +fi + +#echo "hit enter to continue" +#read -r +#exit 0 + +rm -f install/Linux/bin/fusermount3 +ln -s "$(command -v fusermount)" install/Linux/bin/fusermount3 + +# shellcheck disable=SC2029 +if ! ssh "${HOSTPREFIX}$test_runner_vm" "set -ex +ulimit -c unlimited +cd $DAOS_BASE + +# now run it! +pushd install/Linux/TESTING/ +if [ \"$1\" = \"2\" ]; then + cat < scripts/iof_fio_main.cfg +{ + \"should_be_host_list\": [\"${HOSTPREFIX}${vm1}\", \"${HOSTPREFIX}${vm2}\"], + \"host_list\": [\"${HOSTPREFIX}${test_runner_vm}\", \"${HOSTPREFIX}${vm1}\"], + \"test_mode\": \"littleChief\", + \"log_base_path\": \"$log_base_path\" +} +EOF + cp scripts/iof_{fio,ior}_main.cfg + cp scripts/iof_{fio,iozone}_main.cfg + cp scripts/iof_{fio,mdtest}_main.cfg + + rm -rf $log_base_path/ + python3 test_runner config=scripts/iof_fio_main.cfg \\ + scripts/iof_multi_two_node.yml || { + rc=\${PIPESTATUS[0]} + echo \"Test exited with \$rc\" + } + mv $log_base_path/testRun{,-fio} + find $log_base_path/testRun-fio -name subtest_results.yml \\ + -exec grep -Hi fail {} \\; + python3 test_runner config=scripts/iof_ior_main.cfg \\ + scripts/iof_multi_two_node.yml || { + rc=\${PIPESTATUS[0]} + echo \"Test exited with \$rc\" + } + mv $log_base_path/testRun{,-ior} + find $log_base_path/testRun-ior -name subtest_results.yml \\ + -exec grep -Hi fail {} \\; + python3 test_runner config=scripts/iof_iozone_main.cfg \\ + scripts/iof_multi_two_node.yml || { + rc=\${PIPESTATUS[0]} + echo \"Test exited with \$rc\" + } + mv $log_base_path/testRun{,-iozone} + find $log_base_path/testRun-iozone -name subtest_results.yml \\ + -exec grep -Hi fail {} \\; + python3 test_runner config=scripts/iof_mdtest_main.cfg \\ + scripts/iof_multi_two_node.yml || { + rc=\${PIPESTATUS[0]} + echo \"Test exited with \$rc\" + } + mv $log_base_path/testRun{,-mdtest} + find $log_base_path/testRun-mdtest -name subtest_results.yml \\ + -exec grep -Hi fail {} \\; +elif [ \"$1\" = \"5\" ]; then + cat < scripts/iof_multi_five_node.cfg +{ + \"should_be_host_list\": [ + \"${HOSTPREFIX}vm2\", + \"${HOSTPREFIX}vm3\", + \"${HOSTPREFIX}vm4\", + \"${HOSTPREFIX}vm5\", + \"${HOSTPREFIX}vm6\" + ], + \"host_list\": [\"${HOSTPREFIX}${test_runner_vm}\", + \"${HOSTPREFIX}vm2\", + \"${HOSTPREFIX}vm3\", + \"${HOSTPREFIX}vm4\", + \"${HOSTPREFIX}vm5\" + ], + \"test_mode\": \"littleChief\", + \"log_base_path\": \"$log_base_path\" +} +EOF + rm -rf $log_base_path/ + python3 test_runner config=scripts/iof_multi_five_node.cfg \\ + scripts/iof_multi_five_node.yml || { + rc=\${PIPESTATUS[0]} + echo \"Test exited with \$rc\" + } + find $log_base_path/testRun -name subtest_results.yml \\ + -exec grep -Hi fail {} \\; +fi +popd +ls -ld install install/Linux install/Linux/TESTING >&2 +ls -l install/Linux/TESTING >&2 +df -h install/Linux/TESTING >&2 +ls -ltar +exit \$rc"; then + rc=${PIPESTATUS[0]} +else + rc=0 +fi + +hostname +pwd +scp -r "${HOSTPREFIX}$test_runner_vm:$DAOS_BASE/install/Linux/TESTING/$log_base_path" install/Linux/TESTING/ +#ls -l . "$log_base_path" +# i=10 +# while [ "$i" -gt 0 ]; do +# ls -ld install install/Linux install/Linux/TESTING >&2 +# ls -l install/Linux/TESTING >&2 +# df -h install/Linux/TESTING >&2 +# ssh "${HOSTPREFIX}$test_runner_vm" "set -x +# set +e +# if [ \"$i\" -lt 3 ]; then +# sync; sync +# fi +# ls -l $DAOS_BASE/install/Linux/TESTING +# exit 0" >&2 +# sleep 5 +# let i-=1 +# done +{ + cat < results_1.yml +cat results_1.yml + +PYTHONPATH=scony_python-junit/ jenkins/autotest_utils/results_to_junit.py +ls -ltar + +## collect the logs +#if ! rpdcp -R ssh -w "${HOSTPREFIX}"vm[1,$vmrange] \ +# /tmp/Functional_"$TEST_TAG"/\*daos.log "$PWD"/; then +# echo "Copying daos.logs from remote nodes failed" +# # pass +#fi +ls -l +exit "$rc" diff --git a/scons_local b/scons_local index 205b87f3..3d544ebe 160000 --- a/scons_local +++ b/scons_local @@ -1 +1 @@ -Subproject commit 205b87f329cc5e50f539dc04084c41b2b6edefd3 +Subproject commit 3d544ebe05c90dc648698fd17eb80b61748e4c2c diff --git a/src/cnss/cnss.c b/src/cnss/cnss.c index 34b21a17..769d679e 100644 --- a/src/cnss/cnss.c +++ b/src/cnss/cnss.c @@ -980,7 +980,9 @@ int main(int argc, char **argv) "Plugin %s(%p) calling destroy_plugin_data at %p", entry->fns->name, entry->fns->handle, - FN_TO_PVOID(entry->fns->destroy_plugin_data)); + FN_TO_PVOID( + entry->fns->destroy_plugin_data + )); entry->fns->destroy_plugin_data(entry->fns->handle); } diff --git a/src/ioc/ioc.h b/src/ioc/ioc.h index 2cab4489..4f8575e2 100644 --- a/src/ioc/ioc.h +++ b/src/ioc/ioc.h @@ -453,15 +453,16 @@ struct fuse_lowlevel_ops *iof_get_fuse_ops(uint64_t); IOF_TRACE_DOWN(ioc_req); \ } while (0) -#define IOC_REPLY_IOCTL(handle, req, gah_info) \ - do { \ - int __rc; \ - IOF_TRACE_DEBUG(handle, "Returning ioctl"); \ - __rc = fuse_reply_ioctl(req, 0, &(gah_info), sizeof(gah_info)); \ - if (__rc != 0) \ - IOF_TRACE_ERROR(handle, \ +#define IOC_REPLY_IOCTL(handle, req, gah_info) \ + do { \ + int __rc; \ + IOF_TRACE_DEBUG(handle, "Returning ioctl"); \ + __rc = fuse_reply_ioctl(req, 0, &(gah_info), \ + sizeof(gah_info)); \ + if (__rc != 0) \ + IOF_TRACE_ERROR(handle, \ "fuse_reply_ioctl returned %d:%s", \ - __rc, strerror(-__rc)); \ + __rc, strerror(-__rc)); \ } while (0) struct ioc_request; diff --git a/src/ioc/ioc_main.c b/src/ioc/ioc_main.c index 2668b4b4..8021a133 100644 --- a/src/ioc/ioc_main.c +++ b/src/ioc/ioc_main.c @@ -318,10 +318,12 @@ static void gah_decref(struct iof_projection_info *fs_handle) if (ref > 1) { int rc; - rc = fuse_lowlevel_notify_inval_entry(fs_handle->session, - ie->parent, - ie->name, - strlen(ie->name)); + rc = fuse_lowlevel_notify_inval_entry( + fs_handle->session, + ie->parent, + ie->name, + strlen(ie->name) + ); IOF_TRACE_INFO(ie, "inval returned %d", rc); if (rc == -ENOENT) { @@ -1328,14 +1330,16 @@ fh_reset(void *arg) } rc = crt_req_create(fh->open_req.fsh->proj.crt_ctx, NULL, - FS_TO_OP(fh->open_req.fsh, open), &fh->open_req.rpc); + FS_TO_OP(fh->open_req.fsh, open), + &fh->open_req.rpc); if (rc || !fh->open_req.rpc) { D_FREE(fh->ie); return false; } rc = crt_req_create(fh->open_req.fsh->proj.crt_ctx, NULL, - FS_TO_OP(fh->open_req.fsh, create), &fh->creat_req.rpc); + FS_TO_OP(fh->open_req.fsh, create), + &fh->creat_req.rpc); if (rc || !fh->creat_req.rpc) { D_FREE(fh->ie); crt_req_decref(fh->open_req.rpc); @@ -1343,7 +1347,8 @@ fh_reset(void *arg) } rc = crt_req_create(fh->open_req.fsh->proj.crt_ctx, NULL, - FS_TO_OP(fh->open_req.fsh, close), &fh->release_req.rpc); + FS_TO_OP(fh->open_req.fsh, close), + &fh->release_req.rpc); if (rc || !fh->release_req.rpc) { D_FREE(fh->ie); crt_req_decref(fh->open_req.rpc); @@ -2173,16 +2178,20 @@ initialize_projection(struct iof_state *iof_state, IOF_TRACE_DEBUG(fs_handle, "Setting timeout to %d", fs_info->timeout); - ret = crt_context_set_timeout(fs_handle->proj.crt_ctx, fs_info->timeout); + ret = crt_context_set_timeout(fs_handle->proj.crt_ctx, + fs_info->timeout); if (ret != -DER_SUCCESS) { IOF_TRACE_ERROR(iof_state, "Context timeout not set"); D_GOTO(err, 0); } for (i = 0; i < fs_handle->ctx_num; i++) { - fs_handle->ctx_array[i].crt_ctx = fs_handle->proj.crt_ctx; - fs_handle->ctx_array[i].poll_interval = iof_state->iof_ctx.poll_interval; - fs_handle->ctx_array[i].callback_fn = iof_state->iof_ctx.callback_fn; + fs_handle->ctx_array[i].crt_ctx = + fs_handle->proj.crt_ctx; + fs_handle->ctx_array[i].poll_interval = + iof_state->iof_ctx.poll_interval; + fs_handle->ctx_array[i].callback_fn = + iof_state->iof_ctx.callback_fn; /* TODO: Much better error checking is required here, not least * terminating the thread if there are any failures in the rest @@ -2713,9 +2722,10 @@ static void iof_finish(void *arg) /*send a detach RPC to IONSS*/ rc = crt_req_create(iof_state->iof_ctx.crt_ctx, &group->grp.psr_ep, - CRT_PROTO_OPC(iof_state->handshake_proto->cpf_base, - iof_state->handshake_proto->cpf_ver, - 1), + CRT_PROTO_OPC( + iof_state->handshake_proto->cpf_base, + iof_state->handshake_proto->cpf_ver, + 1), &rpc); if (rc != -DER_SUCCESS || !rpc) { IOF_TRACE_ERROR(iof_state, @@ -2767,7 +2777,8 @@ static void iof_finish(void *arg) rc = crt_context_destroy(iof_state->iof_ctx.crt_ctx, false); if (rc != -DER_SUCCESS) - IOF_TRACE_ERROR(iof_state, "Could not destroy context %d", + IOF_TRACE_ERROR(iof_state, + "Could not destroy context %d", rc); IOF_TRACE_DOWN(&iof_state->iof_ctx); } diff --git a/src/ioc/ops/create.c b/src/ioc/ops/create.c index bd4c942c..1555c13d 100644 --- a/src/ioc/ops/create.c +++ b/src/ioc/ops/create.c @@ -44,7 +44,8 @@ static bool ioc_create_ll_cb(struct ioc_request *request) { - struct iof_file_handle *handle = container_of(request, struct iof_file_handle, creat_req); + struct iof_file_handle *handle = container_of( + request, struct iof_file_handle, creat_req); struct iof_projection_info *fs_handle = request->fsh; struct iof_create_out *out = crt_reply_get(request->rpc); struct fuse_file_info fi = {0}; @@ -183,7 +184,8 @@ void ioc_ll_create(fuse_req_t req, fuse_ino_t parent, const char *name, IOF_TRACE_UP(handle, fs_handle, fs_handle->fh_pool->reg.name); IOF_TRACE_UP(&handle->creat_req, handle, "creat_req"); - IOF_TRACE_LINK(handle->creat_req.rpc, &handle->creat_req, "creat_file_rpc"); + IOF_TRACE_LINK(handle->creat_req.rpc, &handle->creat_req, + "creat_file_rpc"); handle->common.projection = &fs_handle->proj; handle->creat_req.req = req; diff --git a/src/ioc/ops/forget.c b/src/ioc/ops/forget.c index 06048881..efacac8f 100644 --- a/src/ioc/ops/forget.c +++ b/src/ioc/ops/forget.c @@ -68,7 +68,8 @@ ioc_forget_one(struct iof_projection_info *fs_handle, if (rc != -DER_SUCCESS) { IOF_TRACE_ERROR(fs_handle, "Invalid refcount %lu on %p", nlookup, - container_of(rlink, struct ioc_inode_entry, ie_htl)); + container_of(rlink, struct ioc_inode_entry, + ie_htl)); } } diff --git a/src/ioc/ops/fsync.c b/src/ioc/ops/fsync.c index 10aac101..c1c40ebe 100644 --- a/src/ioc/ops/fsync.c +++ b/src/ioc/ops/fsync.c @@ -50,7 +50,8 @@ void ioc_ll_fsync(fuse_req_t req, fuse_ino_t ino, int datasync, struct fuse_file_info *fi) { - struct iof_file_handle *handle = (struct iof_file_handle *)fi->fh; + struct iof_file_handle *handle = + (struct iof_file_handle *)fi->fh; struct iof_projection_info *fs_handle = handle->open_req.fsh; struct ioc_request *request; crt_opcode_t opcode; diff --git a/src/ioc/ops/lookup.c b/src/ioc/ops/lookup.c index f14b4d58..086dbf63 100644 --- a/src/ioc/ops/lookup.c +++ b/src/ioc/ops/lookup.c @@ -89,7 +89,8 @@ iof_entry_cb(struct ioc_request *request) * the parent anyway, so keep that one, but drop one in the call * to ie_close(). */ - IOF_TRACE_INFO(container_of(rlink, struct ioc_inode_entry, ie_htl), + IOF_TRACE_INFO(container_of(rlink, struct ioc_inode_entry, + ie_htl), "Existing file %lu " GAH_PRINT_STR, entry.ino, GAH_PRINT_VAL(out->gah)); atomic_fetch_sub(&desc->ie->ie_ref, 1); diff --git a/src/ioc/ops/open.c b/src/ioc/ops/open.c index 6557baa7..dd3a0a1a 100644 --- a/src/ioc/ops/open.c +++ b/src/ioc/ops/open.c @@ -44,7 +44,8 @@ static bool ioc_open_ll_cb(struct ioc_request *request) { - struct iof_file_handle *handle = container_of(request, struct iof_file_handle, open_req); + struct iof_file_handle *handle = container_of( + request, struct iof_file_handle, open_req); struct iof_open_out *out = crt_reply_get(request->rpc); struct fuse_file_info fi = {0}; @@ -125,7 +126,8 @@ void ioc_ll_open(fuse_req_t req, fuse_ino_t ino, struct fuse_file_info *fi) } IOF_TRACE_UP(handle, fs_handle, fs_handle->fh_pool->reg.name); IOF_TRACE_UP(&handle->open_req, handle, "open_req"); - IOF_TRACE_LINK(handle->open_req.rpc, &handle->open_req, "open_file_rpc"); + IOF_TRACE_LINK(handle->open_req.rpc, &handle->open_req, + "open_file_rpc"); handle->common.projection = &fs_handle->proj; handle->open_req.req = req; diff --git a/src/ioc/ops/write.c b/src/ioc/ops/write.c index 9d5dd7ca..fe8ec117 100644 --- a/src/ioc/ops/write.c +++ b/src/ioc/ops/write.c @@ -44,7 +44,8 @@ static bool write_cb(struct ioc_request *request) { - struct iof_wb *wb = container_of(request, struct iof_wb, wb_req); + struct iof_wb *wb = container_of(request, + struct iof_wb, wb_req); struct iof_writex_out *out = crt_reply_get(request->rpc); struct iof_writex_in *in = crt_req_get(request->rpc); diff --git a/src/ionss/config.c b/src/ionss/config.c index d3d90e17..bcf9f9b9 100644 --- a/src/ionss/config.c +++ b/src/ionss/config.c @@ -110,7 +110,7 @@ const uint32_t default_max_iov_write_size = 64; const uint32_t default_max_read_count = 3; const uint32_t default_max_write_count = 3; const uint32_t default_inode_htable_size = 5; -const uint32_t default_cnss_thread_count = 0; +const uint32_t default_cnss_thread_count; const uint32_t default_cnss_timeout = 60; const bool default_cnss_threads = true; const bool default_fuse_read_buf = true; @@ -305,13 +305,17 @@ static int parse_node(yaml_document_t *document, yaml_node_t *node, ret = sel_option->setter(sel_option, document, val_node); if (ret) { if (val_node->type == YAML_SCALAR_NODE) { - IOF_LOG_WARNING("Unknown configuration value %s %.*s", - sel_option->key, - (int)val_node->data.scalar.length, - (char *)val_node->data.scalar.value); + IOF_LOG_WARNING( + "Unknown configuration value %s %.*s", + sel_option->key, + (int)val_node->data.scalar.length, + (char *)val_node->data.scalar.value + ); } else { - IOF_LOG_WARNING("Unknown configuration value %s", - sel_option->key); + IOF_LOG_WARNING( + "Unknown configuration value %s", + sel_option->key + ); } return ret; } diff --git a/src/ionss/ionss.c b/src/ionss/ionss.c index b929e8aa..2e2eb116 100644 --- a/src/ionss/ionss.c +++ b/src/ionss/ionss.c @@ -2934,7 +2934,8 @@ int main(int argc, char **argv) base.fs_list[i].max_iov_write = projection->max_iov_write_size; base.fs_list[i].htable_size = projection->inode_htable_size; base.fs_list[i].timeout = projection->cnss_timeout; - base.fs_list[i].cnss_thread_count = projection->cnss_thread_count; + base.fs_list[i].cnss_thread_count = + projection->cnss_thread_count; base.fs_list[i].flags = IOF_FS_DEFAULT; if (projection->failover) diff --git a/test/Dockerfile.centos:7 b/test/Dockerfile.centos:7 new file mode 100644 index 00000000..6c8d68e0 --- /dev/null +++ b/test/Dockerfile.centos:7 @@ -0,0 +1,40 @@ +# +# Copyright 2018, Intel Corporation +# +# 'recipe' for Docker to build an image of centOS-based +# environment for testing the IOF project. +# + +# Pull base image +FROM centos:7 +MAINTAINER Brian J. Murrell + +# use same UID as host and default value of 1000 if not specified +ARG UID=1000 + +# Install basic tools +RUN yum install -y epel-release +RUN yum install -y fuse python34-nose python34-pip python34-PyYAML \ + numactl-libs libevent openssh-clients librdmacm \ + infinipath-psm libpsm2 valgrind CUnit rsync + +# Add Jenkins user +ENV USER jenkins +ENV PASSWD jenkins +RUN useradd -u $UID -ms /bin/bash $USER +RUN echo "$USER:$PASSWD" | chpasswd + +# Switch to new user +USER $USER +WORKDIR /home/$USER + +# no python3-tabulate RPM +# TODO: build one +RUN pip3 install --user tabulate + +# Set environment variables +#ENV PATH=/home/daos/daos/install/bin:$PATH +#ENV LD_LIBRARY_PATH=/home/daos/daos/install/lib:/home/daos/daos/install/lib/daos_srv:$LD_LIBRARY_PATH +#ENV CPATH=/home/daos/daos/install/include:$CPATH +#ENV CRT_PHY_ADDR_STR="ofi+sockets" +#ENV OFI_INTERFACE=eth0 diff --git a/test/mdtest.yml b/test/mdtest.yml index b7e7b38c..5c0aeb46 100644 --- a/test/mdtest.yml +++ b/test/mdtest.yml @@ -2,6 +2,7 @@ description: "scripts test module" defaultENV: D_LOG_MASK: "WARN" + LD_LIBRARY_PATH: "/testbin/mdtest/lib" module: name: "mdtest" diff --git a/utils/docker/Dockerfile.centos:7 b/utils/docker/Dockerfile.centos:7 new file mode 100644 index 00000000..69caa450 --- /dev/null +++ b/utils/docker/Dockerfile.centos:7 @@ -0,0 +1,66 @@ +# +# Copyright 2018, Intel Corporation +# +# 'recipe' for Docker to build an image of centOS-based +# environment for building the DAOS project. +# + +# Pull base image +FROM centos:7 +MAINTAINER Johann Lombardi + +# Build arguments can be set via -build-arg +# set NOBUILD to disable git clone & build +ARG NOBUILD +# use same UID as host and default value of 1000 if not specified +ARG UID=1000 + +# Update distribution +#Nothing to do for CentOS + +# Install basic tools +RUN yum install -y epel-release +RUN yum install -y git gcc gcc-c++ make cmake golang libtool scons boost-devel \ + libuuid-devel openssl-devel libevent-devel libtool-ltdl-devel \ + libcmocka libcmocka-devel readline-devel \ + doxygen pandoc flex patch nasm yasm ninja-build meson \ + CUnit-devel libaio-devel python-pep8 lcov \ + python clang-analyzer sg3_utils libiscsi-devel \ + numactl-devel doxygen graphviz pylint file libyaml-devel \ + ShellCheck python2-pygithub yum-plugin-copr +RUN yum copr -y enable jhli/ipmctl +RUN yum copr -y enable jhli/safeclib +RUN yum install -y libsafec libipmctl-devel + +# Dependencies +# Packages for NVML, PMIx, hwloc and OpenMPI exist in CentOS, but are unfortunately +# outdated. The DAOS build system will rebuild those packages. + +# Add DAOS user +ENV USER daos +ENV PASSWD daos +RUN useradd -u $UID -ms /bin/bash $USER +RUN echo "$USER:$PASSWD" | chpasswd + +# Create directory for DAOS backend storage +RUN mkdir /mnt/daos +RUN chown daos.daos /mnt/daos + +# Switch to new user +USER $USER +WORKDIR /home/$USER + +# Fetch DAOS code +RUN if [ "x$NOBUILD" = "x" ] ; then git clone https://github.com/daos-stack/daos.git; fi +WORKDIR /home/$USER/daos + +# Build DAOS & dependencies +RUN if [ "x$NOBUILD" = "x" ] ; then git submodule init && git submodule update; fi +RUN if [ "x$NOBUILD" = "x" ] ; then scons --build-deps=yes USE_INSTALLED=all install; fi + +# Set environment variables +ENV PATH=/home/daos/daos/install/bin:$PATH +ENV LD_LIBRARY_PATH=/home/daos/daos/install/lib:/home/daos/daos/install/lib/daos_srv:$LD_LIBRARY_PATH +ENV CPATH=/home/daos/daos/install/include:$CPATH +ENV CRT_PHY_ADDR_STR="ofi+sockets" +ENV OFI_INTERFACE=eth0 diff --git a/utils/docker/Dockerfile.ubuntu:18.04 b/utils/docker/Dockerfile.ubuntu:18.04 new file mode 100644 index 00000000..d4396de7 --- /dev/null +++ b/utils/docker/Dockerfile.ubuntu:18.04 @@ -0,0 +1,73 @@ +# +# Copyright 2018, Intel Corporation +# +# 'recipe' for Docker to build an image of Ubuntu-based +# environment for building the DAOS project. +# + +# Pull base image +FROM ubuntu:18.04 +MAINTAINER Johann Lombardi + +# Build arguments can be set via -build-arg +# set NOBUILD to disable git clone & build +ARG NOBUILD +# use same UID as host and default value of 1000 if not specified +ARG UID=1000 + +# Update distribution +# It's better to put the apt-get update in the same "cache layer" as the +# apt-get install command so that the apt database is updated if/when the +# installed packages list below is updated + +# Install basic tools +RUN apt-get update; \ + DEBIAN_FRONTEND=noninteractive \ + apt-get install -y software-properties-common; \ + add-apt-repository ppa:jhli/libsafec; \ + add-apt-repository ppa:jhli/ipmctl; \ + apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y git \ + gcc golang-go make cmake libtool-bin scons autoconf \ + libboost-dev uuid-dev libssl-dev libevent-dev \ + libltdl-dev librdmacm-dev libcmocka0 libcmocka-dev \ + libreadline6-dev curl doxygen pandoc flex patch nasm \ + yasm graphviz doxygen libibverbs-dev librdmacm-dev \ + libcunit1-dev libnuma-dev libaio-dev sg3-utils \ + libiscsi-dev python-dev mscgen ninja-build meson \ + pylint bash locales libyaml-dev libsafec-dev \ + libipmctl-dev +# hack the default shell to bash instead of dash +RUN rm /bin/sh && ln -s bash /bin/sh + +RUN locale-gen en_US.UTF-8 + +# Dependencies + +# Add DAOS user +ENV USER daos +ENV PASSWD daos +RUN useradd -u $UID -ms /bin/bash $USER +RUN echo "$USER:$PASSWD" | chpasswd + +# Create directory for DAOS backend storage +RUN mkdir /mnt/daos +RUN chown daos.daos /mnt/daos + +# Switch to new user +USER $USER +WORKDIR /home/$USER + +# Fetch DAOS code +RUN if [ "x$NOBUILD" = "x" ] ; then git clone https://github.com/daos-stack/daos.git; fi +WORKDIR /home/$USER/daos + +# Build DAOS & dependencies +RUN if [ "x$NOBUILD" = "x" ] ; then git submodule init && git submodule update; fi +RUN if [ "x$NOBUILD" = "x" ] ; then scons --build-deps=yes USE_INSTALLED=all install; fi + +# Set environment variables +ENV PATH=/home/daos/daos/install/bin:$PATH +ENV LD_LIBRARY_PATH=/home/daos/daos/install/lib:/home/daos/daos/install/lib/daos_srv:$LD_LIBRARY_PATH +ENV CPATH=/home/daos/daos/install/include:$CPATH +ENV CRT_PHY_ADDR_STR="ofi+sockets" +ENV OFI_INTERFACE=eth0