.gitlab-ci.yml 5.5 KB
Newer Older
1 2 3
variables:
  GIT_STRATEGY: fetch
  GIT_SUBMODULE_STRATEGY: recursive
4
# PREFIX: /usr/
5
  DOCKER_FILE: utils/Dockerfile
6
  DOCKER_TAG: ${CI_COMMIT_REF_NAME}
7 8 9
  DOCKER_IMAGE_DEV: cricket
  # MAKE_OPTS: -j 16

10 11 12 13 14
before_script:
  - git config --local core.longpaths true
  - git submodule sync --recursive
  - git submodule update --init --recursive

15 16 17 18 19 20 21 22 23
stages:
  - prepare
  - build
  - test

# Stage: prepare
##############################################################################

# Build docker image
24
prepare:centos8:docker-dev:
25 26 27 28
  stage: prepare
  script:
    - docker build
        --file ${DOCKER_FILE}
29 30
        --tag ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
        --tag ${DOCKER_IMAGE_DEV}:latest .
31 32 33 34
  tags:
    - shell
    - linux

35 36 37 38 39 40 41 42 43 44 45
prepare:centos8:cuda10:
  stage: prepare
  script:
    - docker build
        --file utils/Dockerfile.cuda10
        --tag ${DOCKER_IMAGE_DEV}_cuda10:${DOCKER_TAG}
        --tag ${DOCKER_IMAGE_DEV}_cuda10:latest .
  tags:
    - shell
    - linux

46
# check if styleguide is fulfilled
47 48 49 50 51 52 53 54 55
#style_check:
#  stage: build
#  image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
#  allow_failure: true
#  tags:
#    - docker
#  script:
#    - ls
#    - utils/test_style.sh
56 57 58 59 60 61 62

# Stage: build
##############################################################################

build:
  stage: build
  script:
63 64
   - make -j 32 libtirpc
   - make -j 32 cuda-gdb
Niklas Eiling's avatar
Niklas Eiling committed
65
   - make -j 1 LOG=INFO
66 67 68
  artifacts:
    expire_in: 1 week
    paths:
69
      - bin
70
  image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
71 72 73 74 75
  cache:
    paths:
      - gpu/build
      - cpu/*.o
      - tests/*.o
76
      - tests/cpu/*.o
77
      - submodules/libtirpc/install
78
      - submodules/cuda-gdb/build
79
      - bin
80
    key: build
81 82
  tags:
    - docker
83

84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
build:ib:
  stage: build
  script:
   - make -j 32 libtirpc
   - make -j 32 cuda-gdb
   - make -j 1 LOG=INFO WITH_IB=yes
  artifacts:
    expire_in: 1 week
    paths:
      - bin
  image: ${DOCKER_IMAGE_DEV}:${DOCKER_TAG}
  cache:
    paths:
      - gpu/build
      - cpu/*.o
      - tests/*.o
      - tests/cpu/*.o
      - submodules/libtirpc/install
      - submodules/cuda-gdb/build
      - bin
    key: buildib
  tags:
    - docker

108 109 110 111 112
build:cuda10:
  stage: build
  script:
   - make -j 32 libtirpc
   - make -j 32 cuda-gdb
Niklas Eiling's avatar
Niklas Eiling committed
113
   - make -j 1 LOG=INFO
114 115 116 117 118 119 120 121 122 123
  artifacts:
    expire_in: 1 week
    paths:
      - bin
  image: ${DOCKER_IMAGE_DEV}_cuda10:${DOCKER_TAG}
  cache:
    paths:
      - gpu/build
      - cpu/*.o
      - tests/*.o
124
      - tests/cpu/*.o
125
      - submodules/libtirpc/install
126
      - submodules/cuda-gdb/build
127 128 129 130 131
      - bin
    key: build_cuda10
  tags:
    - docker

Niklas Eiling's avatar
Niklas Eiling committed
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
build:debug:
  stage: build
  script:
   - make -j 32 libtirpc
   - make -j 32 cuda-gdb
   - make -j 1 LOG=INFO WITH_DEBUG=yes
  artifacts:
    expire_in: 1 week
    paths:
      - bin
  image: ${DOCKER_IMAGE_DEV}_cuda10:${DOCKER_TAG}
  cache:
    paths:
      - gpu/build
      - cpu/*.o
      - tests/*.o
      - tests/cpu/*.o
      - submodules/libtirpc/install
      - submodules/cuda-gdb/build
      - bin
    key: build_debug
  tags:
    - docker
155

Niklas Eiling's avatar
Niklas Eiling committed
156
.remote-gpu:
157
  stage: test
158
  variables:
Niklas Eiling's avatar
Niklas Eiling committed
159
    GPU_TARGET: 'gitlab-runner@ghost'
160
    RDIR: '/tmp/gitlab-jobs/$CI_PROJECT_NAME/$CI_JOB_ID'
Niklas Eiling's avatar
Niklas Eiling committed
161
    LDIR: '$CI_BUILDS_DIR/$CI_PROJECT_PATH/bin'
162
    SAMPLES_PATH: '/usr/local/cuda/samples'
163
  script:
164 165 166 167 168 169
    - mkdir ~/.ssh &&
      echo "-----BEGIN OPENSSH PRIVATE KEY-----" > ~/.ssh/id_rsa &&
      echo $SSH_PRIVATE | sed "s/\S\{64\}/&\n/g" >> ~/.ssh/id_rsa &&
      echo "-----END OPENSSH PRIVATE KEY-----" >> ~/.ssh/id_rsa &&
      echo $SSH_PUBLIC > ~/.ssh/id_rsa.pub &&
      echo $KNOWN_HOSTS > ~/.ssh/known_hosts && chmod 600 ~/.ssh/id_rsa
Niklas Eiling's avatar
Niklas Eiling committed
170 171
    - ssh $GPU_TARGET mkdir -p $RDIR
    - scp -r $LDIR/* $GPU_TARGET:$RDIR/
Niklas Eiling's avatar
Niklas Eiling committed
172
    - ssh $GPU_TARGET "LD_PRELOAD=$RDIR/libtirpc.so.3:$RDIR/cricket-server.so $RDIR/$TEST_BINARY" &
173
    - sleep 2
Niklas Eiling's avatar
Niklas Eiling committed
174
    - REMOTE_GPU_ADDRESS="ghost.acs-lab.eonerc.rwth-aachen.de" PATH=$LDIR:$PATH LD_PRELOAD=$LDIR/libtirpc.so.3:$LDIR/cricket-client.so $LDIR/$TEST_BINARY
175
  after_script:
Niklas Eiling's avatar
Niklas Eiling committed
176 177
    - ssh $GPU_TARGET rm -rf $RDIR
    - ssh $GPU_TARGET pkill -fe -2 $RDIR/test_kernel
178
  image: ${DOCKER_IMAGE_DEV}_cuda10:${DOCKER_TAG}
179
  dependencies:
180
    - build:cuda10
181 182 183
  tags:
    - docker

184
test:test_programs(1/2):
185 186 187 188
  stage: test
  script:
      - CRICKET_DISABLE_RPC=yes LD_LIBRARY_PATH="./bin:$LD_LIBRARY_PATH" bin/tests/test_list.test
  image: ${DOCKER_IMAGE_DEV}_cuda10:${DOCKER_TAG}
189
  dependencies:
Niklas Eiling's avatar
Niklas Eiling committed
190
    - build:debug
191 192 193 194 195 196 197 198
  tags:
    - docker

test:test_programs(2/2):
  stage: test
  script:
      - CRICKET_DISABLE_RPC=yes LD_LIBRARY_PATH="./bin:$LD_LIBRARY_PATH" bin/tests/test_resource_mg.test
  image: ${DOCKER_IMAGE_DEV}_cuda10:${DOCKER_TAG}
199
  dependencies:
Niklas Eiling's avatar
Niklas Eiling committed
200
    - build:debug
201 202 203 204
  tags:
    - docker


Niklas Eiling's avatar
Niklas Eiling committed
205 206 207 208
test:test_kernel:
    extends: .remote-gpu
    variables:
      TEST_BINARY: 'test_kernel'
209 210
    before_script:
      - source /global/modules_init.bash && module load gcc/4.9.4
211 212 213 214 215 216

test:samples:matrixMul:
    extends: .remote-gpu
    variables:
      TEST_BINARY: 'matrixMul'
    before_script:
217 218
      - source /global/modules_init.bash && module load gcc/4.9.4
      - make -C $SAMPLES_PATH/0_Simple/matrixMul NVCCFLAGS="-m64 -cudart shared" GENCODE_FLAGS="-arch=sm_61" HOST_COMPILER=$(which g++)
219 220 221 222 223 224 225
      - cp $SAMPLES_PATH/0_Simple/matrixMul/matrixMul $LDIR

test:samples:bandwidthTest:
    extends: .remote-gpu
    variables:
      TEST_BINARY: 'bandwidthTest'
    before_script:
226 227
      - source /global/modules_init.bash && module load gcc/4.9.4
      - make -C $SAMPLES_PATH/1_Utilities/bandwidthTest NVCCFLAGS="-m64 -cudart shared" GENCODE_FLAGS="-arch=sm_61" HOST_COMPILER=$(which g++)
228 229
      - cp $SAMPLES_PATH/1_Utilities/bandwidthTest/bandwidthTest $LDIR