Skip to content

Commit 3cc058b

Browse files
authored
Merge pull request #48 from natefoo/test-20.11
Fix functional tests for 20.11
2 parents 698fcf8 + 9d548fa commit 3cc058b

4 files changed

Lines changed: 76 additions & 55 deletions

File tree

.github/workflows/slurm-drmaa.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: slurm-drmaa
2+
#on: [push, pull_request]
3+
on: [pull_request]
4+
jobs:
5+
functional:
6+
name: Functional Tests
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
include:
11+
- os: ubuntu-latest
12+
docker_image: centos:7
13+
slurm_version: 18.08
14+
- os: ubuntu-latest
15+
docker_image: centos:7
16+
slurm_version: 19.05
17+
- os: ubuntu-latest
18+
docker_image: centos:7
19+
slurm_version: 20.02
20+
- os: ubuntu-latest
21+
docker_image: centos:7
22+
slurm_version: 20.11
23+
- os: ubuntu-latest
24+
docker_image: debian:buster
25+
slurm_version: apt
26+
env:
27+
DOCKER_IMAGE: ${{ matrix.docker_image }}
28+
SLURM_VERSION: ${{ matrix.slurm_version }}
29+
steps:
30+
- uses: actions/checkout@v2
31+
with:
32+
submodules: true
33+
- name: Fetch bats
34+
run: git clone https://github.com/bats-core/bats-core.git/ .ci/bats
35+
- name: Install autogen dependencies
36+
run: sudo apt-get install -y gperf ragel bison
37+
- name: Run autogen
38+
run: sh autogen.sh
39+
- name: Configure drmaa_utils
40+
run: cd drmaa_utils && ./configure
41+
- name: Build drmaa_utils
42+
run: make -C drmaa_utils/drmaa_utils conf_tab.c conf_tab.h datetime_tab.c datetime_tab.h drmaa_attrib.c timedelta.c
43+
- name: Clean drmaa_utils
44+
run: make -C drmaa_utils distclean
45+
- name: Build Docker image
46+
run: 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
47+
- name: Run ./configure
48+
run: docker run --volume $(pwd):$(pwd) --workdir $(pwd) --user $(id -u):$(id -g) ci/$DOCKER_IMAGE ./configure --prefix=/ci
49+
- name: Run make install
50+
run: docker run --volume $(pwd):$(pwd) --volume $(pwd)/.ci:/ci --workdir $(pwd) --user $(id -u):$(id -g) ci/$DOCKER_IMAGE make install
51+
- name: Run Slurm
52+
run: echo cid=$(docker run --volume $(pwd):$(pwd) --volume $(pwd)/.ci:/ci --detach ci/$DOCKER_IMAGE /runslurm.sh) >> $GITHUB_ENV
53+
- name: Wait for slurmctld
54+
run: for i in {0..29}; do [ "$(docker exec $cid sinfo --noheader --nodes=localhost --format=%t --responding --states=IDLE)" == "idle" ] && break || { echo "waiting for slurmctld..."; sleep 1; }; done; echo slurmctld_attempt=$i >> $GITHUB_ENV
55+
- name: Node info
56+
run: docker exec $cid scontrol show node localhost
57+
- name: Partition info
58+
run: docker exec $cid scontrol show partition debug
59+
- name: Log failure
60+
run: if [ $slurmctld_attempt -eq 29 ]; then echo "[slurmctld.log]"; cat .ci/slurmctld.log; echo "[slurmd.log]"; cat .ci/slurmd.log; exit 1; fi
61+
- name: Run tests
62+
run: 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; exit 1; }

.travis.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

slurm_drmaa/drmaa.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
* PSNC DRMAA for SLURM
3-
* Copyright (C) 2011 Poznan Supercomputing and Networking Center
3+
* Copyright (C) 2011-2015 Poznan Supercomputing and Networking Center
4+
* Copyright (C) 2014-2021 The Pennsylvania State University
45
*
56
* This program is free software: you can redistribute it and/or modify
67
* it under the terms of the GNU General Public License as published by
@@ -62,7 +63,7 @@ slurmdrmaa_get_DRM_system( fsd_drmaa_singletone_t *self )
6263
{
6364
if(slurmdrmaa_version[0] == '\0') /*no locks as drmaa_get_drm_system is usually called only once */
6465
{
65-
#if SLURM_VERSION_NUMBER > SLURM_VERSION_NUM(20,11,0)
66+
#if SLURM_VERSION_NUMBER >= SLURM_VERSION_NUM(20,11,0)
6667
slurm_conf_t * conf_info_msg_ptr = NULL;
6768
#else
6869
slurm_ctl_conf_t * conf_info_msg_ptr = NULL;

test/slurm_ping.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,28 @@
33
/* Slurm doesn't provide a public method to just use the local config, which we need in order to set a timeout without
44
* having to contact slurmctld first... */
55
extern int slurm_conf_destroy(void);
6+
#if SLURM_VERSION_NUMBER >= SLURM_VERSION_NUM(20,11,0)
7+
extern slurm_conf_t *slurm_conf_lock(void);
8+
#else
69
extern slurm_ctl_conf_t *slurm_conf_lock(void);
10+
#endif
711
extern void slurm_conf_unlock(void);
812

913
int main(int argc, char **argv) {
1014
int status = 1;
1115

12-
slurm_ctl_conf_t *slurm_ctl_conf_ptr = slurm_conf_lock();
13-
slurm_ctl_conf_ptr->msg_timeout = 3;
16+
#if SLURM_VERSION_NUMBER >= SLURM_VERSION_NUM(20,11,0)
17+
slurm_conf_t *slurm_conf_ptr = slurm_conf_lock();
18+
#else
19+
slurm_ctl_conf_t *slurm_conf_ptr = slurm_conf_lock();
20+
#endif
21+
slurm_conf_ptr->msg_timeout = 3;
1422
slurm_conf_unlock();
1523

1624
#if SLURM_VERSION_NUMBER < SLURM_VERSION_NUM(18,8,0)
1725
for (uint32_t i = 1; i < 2; i++) {
1826
#else
19-
for (uint32_t i = 0; i < slurm_ctl_conf_ptr->control_cnt; i++) {
27+
for (uint32_t i = 0; i < slurm_conf_ptr->control_cnt; i++) {
2028
#endif
2129
printf("slurm_ping(%i) == %i\n", i, slurm_ping(i));
2230
if (slurm_ping(i) == SLURM_SUCCESS) {

0 commit comments

Comments
 (0)