.gitlab-ci.yml 3.98 KiB
Newer Older
Tommaso Tocci's avatar
Tommaso Tocci committed
stages:
  - download deps
  - build deps
  - build
  - test

variables:
  DEPS_SRC_PATH:     "${CI_PROJECT_DIR}/deps/src"
Tommaso Tocci's avatar
Tommaso Tocci committed
  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"
Tommaso Tocci's avatar
Tommaso Tocci committed
  TESTS_BUILD_PATH:  "${CI_PROJECT_DIR}/test/build"
Tommaso Tocci's avatar
Tommaso Tocci committed
  LOG_PATH:          "${CI_PROJECT_DIR}/logs"
  LD_LIBRARY_PATH:   "${CI_PROJECT_DIR}/deps/install/lib;${CI_PROJECT_DIR}/deps/install/lib64"
Tommaso Tocci's avatar
Tommaso Tocci committed
  # Configuration variables
  GKFS_LOG_LEVEL:   "100"
  GKFS_DAEMON_LOG_PATH:  "${CI_PROJECT_DIR}/logs/daemon.log"
  GKFS_PRELOAD_LOG_PATH: "${CI_PROJECT_DIR}/logs/preload.log"
  GKFS_FORWARDER: 0
Tommaso Tocci's avatar
Tommaso Tocci committed

image: jeanbez/gekkofs-forwarding:latest
Tommaso Tocci's avatar
Tommaso Tocci committed

compile dependencies:
  stage: build deps
  cache:
    key: deps-cache
    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 ) || (
Tommaso Tocci's avatar
Tommaso Tocci committed
           rm -f ${DEPS_COMMIT} &&
           scripts/dl_dep.sh ${DEPS_SRC_PATH} -n ofi &&
           scripts/compile_dep.sh -n ofi ${DEPS_SRC_PATH} ${DEPS_INSTALL_PATH} &&
Tommaso Tocci's avatar
Tommaso Tocci committed
           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}
Tommaso Tocci's avatar
Tommaso Tocci committed
      -Wdev
      -Wdeprecate
      -DCMAKE_BUILD_TYPE=Debug
      -DCMAKE_PREFIX_PATH=${DEPS_INSTALL_PATH}
      -DCMAKE_INSTALL_PREFIX=${INSTALL_PATH}
      ${CI_PROJECT_DIR}
    - make -j$(nproc) install
Tommaso Tocci's avatar
Tommaso Tocci committed
  artifacts:
    paths:
     - ${INSTALL_PATH}
Tommaso Tocci's avatar
Tommaso Tocci committed

compile tests:
  stage: build
  dependencies:
    - "compile dependencies"
  script:
    - mkdir -p ${TESTS_BUILD_PATH} && cd ${TESTS_BUILD_PATH}
    - cmake -DCMAKE_BUILD_TYPE=Debug ..
Tommaso Tocci's avatar
Tommaso Tocci committed
    - make -j$(nproc)
  artifacts:
    paths:
     - ${TESTS_BUILD_PATH}

test wr:
  stage: test
  script:
    - mkdir -p "${LOG_PATH}"
    - cp agios/* /tmp
Jean Bez's avatar
Jean Bez committed
    - echo "`hostname` 0" > gkfs_forwarding.map
    - ${INSTALL_PATH}/bin/gkfs_daemon --mount /tmp/mountdir --root /tmp/root &
Tommaso Tocci's avatar
Tommaso Tocci committed
    - sleep 4
    - LD_PRELOAD=${INSTALL_PATH}/lib/libgkfs_intercept.so ${TESTS_BUILD_PATH}/gkfs_test_wr
Tommaso Tocci's avatar
Tommaso Tocci committed
  artifacts:
    paths:
     - "${LOG_PATH}"

test directories:
  stage: test
  script:
    - mkdir -p "${LOG_PATH}"
    - cp agios/* /tmp
Jean Bez's avatar
Jean Bez committed
    - echo "`hostname` 0" > gkfs_forwarding.map
    - ${INSTALL_PATH}/bin/gkfs_daemon --mount /tmp/mountdir --root /tmp/root &
Tommaso Tocci's avatar
Tommaso Tocci committed
    - sleep 4
    - LD_PRELOAD=${INSTALL_PATH}/lib/libgkfs_intercept.so ${TESTS_BUILD_PATH}/gkfs_test_dir
Tommaso Tocci's avatar
Tommaso Tocci committed
  artifacts:
    paths:
     - "${LOG_PATH}"
Tommaso Tocci's avatar
Tommaso Tocci committed

test truncate:
  stage: test
  script:
    - mkdir -p "${LOG_PATH}"
    - cp agios/* /tmp
Jean Bez's avatar
Jean Bez committed
    - echo "`hostname` 0" > gkfs_forwarding.map
    - ${INSTALL_PATH}/bin/gkfs_daemon --mount /tmp/mountdir --root /tmp/root &
Tommaso Tocci's avatar
Tommaso Tocci committed
    - sleep 4
    - LD_PRELOAD=${INSTALL_PATH}/lib/libgkfs_intercept.so ${TESTS_BUILD_PATH}/gkfs_test_truncate
Tommaso Tocci's avatar
Tommaso Tocci committed
  artifacts:
    paths:
     - "${LOG_PATH}"
Tommaso Tocci's avatar
Tommaso Tocci committed

test path resolution:
  stage: test
  script:
    - mkdir -p "${LOG_PATH}"
    - cp agios/* /tmp
Jean Bez's avatar
Jean Bez committed
    - echo "`hostname` 0" > gkfs_forwarding.map
    - ${INSTALL_PATH}/bin/gkfs_daemon --mount /tmp/mountdir --root /tmp/root &
Tommaso Tocci's avatar
Tommaso Tocci committed
    - sleep 4
    - LD_PRELOAD=${INSTALL_PATH}/lib/libgkfs_intercept.so ${TESTS_BUILD_PATH}/gkfs_test_path_resolution
Tommaso Tocci's avatar
Tommaso Tocci committed
  artifacts:
    paths:
     - "${LOG_PATH}"

test lseek:
  stage: test
  script:
    - mkdir -p "${LOG_PATH}"
    - cp agios/* /tmp
Jean Bez's avatar
Jean Bez committed
    - echo "`hostname` 0" > gkfs_forwarding.map
    - ${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:
    paths:
     - "${LOG_PATH}"