forked from natefoo/slurm-drmaa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
50 lines (46 loc) · 2.58 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
sudo: required
language: c
os:
- linux
services:
- docker
env:
# need to update slurm rpms
#- DOCKER_IMAGE=centos:6
#- DOCKER_IMAGE=centos:7
#- DOCKER_IMAGE=debian:stable
# https://bugs.launchpad.net/ubuntu/+source/slurm-llnl/+bug/1802374
#- DOCKER_IMAGE=ubuntu:latest
jobs:
include:
- env: DOCKER_IMAGE=centos:7 SLURM_VERSION=18.08
- env: DOCKER_IMAGE=centos:7 SLURM_VERSION=19.05
- env: DOCKER_IMAGE=centos:7 SLURM_VERSION=20.02
- env: DOCKER_IMAGE=debian:stable SLURM_VERSION=apt
before_install:
# Docker version in the current Travis image doesn't support `docker run --workdir`
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get update
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
- git clone https://github.com/bats-core/bats-core.git/ .ci/bats
before_script:
# these steps prep the source as if it were a distribution tarball
- sudo apt-get install -y gperf ragel bison
- sh autogen.sh
- (cd drmaa_utils && ./configure)
- make -C drmaa_utils/drmaa_utils conf_tab.c conf_tab.h datetime_tab.c datetime_tab.h drmaa_attrib.c timedelta.c
- make -C drmaa_utils distclean
# set up build env
- docker build --build-arg from=$DOCKER_IMAGE --build-arg uid=$(id -u) --build-arg gid=$(id -g) --build-arg version=$SLURM_VERSION -t ci/$DOCKER_IMAGE -f .ci/Dockerfile .ci
#- SLURM_USER=$(docker run ci/$DOCKER_IMAGE /bin/sh -c 'echo $(id -u slurm):$(id -g slurm)')
script:
- docker run --volume $(pwd):$(pwd) --workdir $(pwd) --user $(id -u):$(id -g) ci/$DOCKER_IMAGE ./configure --prefix=/ci
- docker run --volume $(pwd):$(pwd) --volume $(pwd)/.ci:/ci --workdir $(pwd) --user $(id -u):$(id -g) ci/$DOCKER_IMAGE make install
- cid=$(docker run --volume $(pwd):$(pwd) --volume $(pwd)/.ci:/ci --detach ci/$DOCKER_IMAGE /runslurm.sh)
- for i in {0..29}; do [ "$(docker exec $cid sinfo --noheader --nodes=localhost --format=%t --responding --states=IDLE)" == "idle" ] && break || { echo "waiting for slurmd..."; sleep 1; }; done
- docker exec $cid scontrol show node localhost
- docker exec $cid scontrol show partition debug
- if [ $i -eq 29 ]; then echo "[slurmctld.log]"; cat .ci/slurmctld.log; echo "[slurmd.log]"; cat .ci/slurmd.log; travis_terminate 1; fi
#- bash $(pwd)/.ci/runtest.sh $cid 1
- docker exec --workdir $(pwd) $cid make check || { echo "[test-suite.log]"; cat test/test-suite.log; echo "[functional-basic.log]"; cat test/functional-basic.log; travis_terminate 1; }