Newer
Older
DEPS_SRC_PATH: "${CI_PROJECT_DIR}/deps/src"
DEPS_INSTALL_PATH: "${CI_PROJECT_DIR}/deps/install"
DEPS_COMMIT: "${CI_PROJECT_DIR}/deps/install/gkfs_deps_commit"
BUILD_PATH: "${CI_PROJECT_DIR}/gkfs/build"
INSTALL_PATH: "${CI_PROJECT_DIR}/gkfs/install"
INTEGRATION_TESTS_BIN_PATH: "${CI_PROJECT_DIR}/gkfs/install/share/gkfs/tests/integration"
INTEGRATION_TESTS_RUN_PATH: "${CI_PROJECT_DIR}/gkfs/install/share/gkfs/tests/integration/run"
TESTS_BUILD_PATH: "${CI_PROJECT_DIR}/test/build"
PYTEST: "${CI_PROJECT_DIR}/gkfs/install/share/gkfs/tests/integration/pytest-venv/bin/py.test"
LOG_PATH: "${CI_PROJECT_DIR}/logs"
LD_LIBRARY_PATH: "${CI_PROJECT_DIR}/deps/install/lib;${CI_PROJECT_DIR}/deps/install/lib64"
GKFS_LOG_LEVEL: "100"
GKFS_DAEMON_LOG_PATH: "${CI_PROJECT_DIR}/logs/daemon.log"
LIBGKFS_LOG: "all"
LIBGKFS_LOG_OUTPUT: "${CI_PROJECT_DIR}/logs/gkfs_client.log"
GIT_SUBMODULE_STRATEGY: recursive
check format:
stage: check format
script:
- ${CI_PROJECT_DIR}/scripts/check_format.sh -s "${CI_PROJECT_DIR}/src" -i "${CI_PROJECT_DIR}/include" -v
paths:
- ${DEPS_INSTALL_PATH}/
script:
# Folder of built dependencies is cached and marked with the ID of the commit from which have been built.
# If the download and compile script have been modified the cache gets invalidated and dependencies will be built again.
- ( [ -f "${DEPS_COMMIT}" ] && git diff --quiet "`cat ${DEPS_COMMIT}`" -- scripts/dl_dep.sh scripts/compile_dep.sh ) || (
scripts/dl_dep.sh ${DEPS_SRC_PATH} -n ofi -c ci &&
scripts/compile_dep.sh -n ofi -c ci ${DEPS_SRC_PATH} ${DEPS_INSTALL_PATH} &&
echo "${CI_COMMIT_SHA}" > "${DEPS_COMMIT}"
)
artifacts:
paths:
- ${DEPS_INSTALL_PATH}
compile GekkoFS:
stage: build
dependencies:
- "compile dependencies"
script:
- mkdir -p ${BUILD_PATH} && cd ${BUILD_PATH}
- cmake
-Wdev
-Wdeprecate
-DCMAKE_BUILD_TYPE=Debug
-DGKFS_INSTALL_TESTS:BOOL=ON
-DGKFS_ENABLE_FORWARDING:BOOL=ON
-DGKFS_ENABLE_AGIOS:BOOL=ON
-DCMAKE_INSTALL_PREFIX=${INSTALL_PATH}
${CI_PROJECT_DIR}
- make -j$(nproc) install
- find ${BUILD_PATH} -name "*.o" -delete
# cleanup nlohmann_json: it includes around 500MiB of test data
- rm -rf ${BUILD_PATH}/_deps/nlohmann_json-src/test/data
- rm -rf ${BUILD_PATH}/_deps/nlohmann_json-src/benchmarks/data
- rm -rf ${BUILD_PATH}/_deps/nlohmann_json-src/.git
- ${BUILD_PATH}
- ${INSTALL_PATH}
exclude:
# remove object files
- ${BUILD_PATH}/**/*.o
stage: build
dependencies:
- "compile dependencies"
script:
- mkdir -p ${TESTS_BUILD_PATH} && cd ${TESTS_BUILD_PATH}
- cmake -DCMAKE_BUILD_TYPE=Debug ..
- make -j$(nproc)
artifacts:
paths:
- ${TESTS_BUILD_PATH}
integration tests:
stage: test
script:
## run tests
- cd ${BUILD_PATH}/tests/integration
- unbuffer ${PYTEST} -v | tee session.log
## capture coverage information
- cd ${BUILD_PATH}
- ${CI_PROJECT_DIR}/scripts/ci/coverage.sh
--capture integration
--root-dir ${CI_PROJECT_DIR}
--build-dir ${BUILD_PATH}
--exclusions "${CI_PROJECT_DIR}/scripts/ci/.coverage-exclusions"
# - "${INTEGRATION_TESTS_RUN_PATH}"
- ${BUILD_PATH}
## capture coverage information
- ${CI_PROJECT_DIR}/scripts/ci/coverage.sh
--capture unit
--root-dir ${CI_PROJECT_DIR}
--build-dir ${BUILD_PATH}
--exclusions "${CI_PROJECT_DIR}/scripts/ci/.coverage-exclusions"
test wr:
stage: test
script:
- mkdir -p "${LOG_PATH}"
- ${INSTALL_PATH}/bin/gkfs_daemon --mount /tmp/mountdir --root /tmp/root &
- LD_PRELOAD=${INSTALL_PATH}/lib/libgkfs_intercept.so ${TESTS_BUILD_PATH}/gkfs_test_wr
paths:
- "${LOG_PATH}"
test directories:
stage: test
script:
- mkdir -p "${LOG_PATH}"
- ${INSTALL_PATH}/bin/gkfs_daemon --mount /tmp/mountdir --root /tmp/root &
- LD_PRELOAD=${INSTALL_PATH}/lib/libgkfs_intercept.so ${TESTS_BUILD_PATH}/gkfs_test_dir
test truncate:
stage: test
script:
- mkdir -p "${LOG_PATH}"
- ${INSTALL_PATH}/bin/gkfs_daemon --mount /tmp/mountdir --root /tmp/root &
- LD_PRELOAD=${INSTALL_PATH}/lib/libgkfs_intercept.so ${TESTS_BUILD_PATH}/gkfs_test_truncate
test lseek:
stage: test
script:
- mkdir -p "${LOG_PATH}"
- ${INSTALL_PATH}/bin/gkfs_daemon --mount /tmp/mountdir --root /tmp/root &
- sleep 4
- LD_PRELOAD=${INSTALL_PATH}/lib/libgkfs_intercept.so ${TESTS_BUILD_PATH}/gkfs_test_lseek
artifacts:
################################################################################
## Generation of code coverage reports
################################################################################
coverage:
stage: report
image: gekkofs/coverage
script:
- cd ${BUILD_PATH}
## merge the partial coverage files from each test in the pipeline
- ${CI_PROJECT_DIR}/scripts/ci/coverage.sh
--merge
--root-dir ${CI_PROJECT_DIR}
--build-dir ${BUILD_PATH}
artifacts:
reports:
cobertura: ${BUILD_PATH}/.coverage/coverage-cobertura.xml
paths:
- ${BUILD_PATH}/.coverage
expire_in: 2 weeks