File tree 2 files changed +70
-0
lines changed
2 files changed +70
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Unit Tests
2
+
3
+ on :
4
+ pull_request :
5
+
6
+ push :
7
+ branches :
8
+ - master
9
+
10
+ jobs :
11
+ test-slurm :
12
+ timeout-minutes : 20
13
+ strategy :
14
+ matrix :
15
+ os : [ubuntu-latest]
16
+ julia_version : ["1.5", "nightly"]
17
+ julia_arch : [x64]
18
+ fail-fast : false
19
+
20
+ runs-on : ${{ matrix.os }}
21
+
22
+ env :
23
+ SLURM : " latest"
24
+
25
+ steps :
26
+ - name : Checkout
27
+
28
+
29
+ - uses : julia-actions/setup-julia@latest
30
+ with :
31
+ arch : ${{ matrix.julia_arch }}
32
+ version : ${{ matrix.julia_version }}
33
+
34
+ - name : Start Slurm Docker image
35
+ run : |
36
+ docker pull giovtorres/docker-centos7-slurm:$SLURM
37
+ docker run -d -it -h ernie -v $(pwd):/SlurmTools -v $(julia -e 'print(dirname(Sys.BINDIR))'):/julia --name slurm-$SLURM giovtorres/docker-centos7-slurm:$SLURM
38
+
39
+ - name : Instantiate package
40
+ run : docker exec slurm-$SLURM /julia/bin/julia --project=/SlurmTools -e 'using Pkg; Pkg.instantiate(verbose=true); Pkg.build(verbose=true)'
41
+
42
+ - name : Run tests without allocation
43
+ run : docker exec slurm-$SLURM /julia/bin/julia --project=/SlurmTools -e 'using Pkg; Pkg.test(test_args=["slurm"])'
44
+
45
+ - name : Run tests inside allocation
46
+ run : docker exec slurm-$SLURM salloc -t 00:10:00 -n 2 /julia/bin/julia --project=/SlurmTools -e 'using Pkg; Pkg.test(test_args=["slurm"])'
47
+
48
+ - name : Run tests inside sbatch
49
+ run : |
50
+ cat << EOF > sbatch.sh
51
+ #!/bin/bash
52
+ #SBATCH --ntasks=2
53
+ #SBATCH --time=00:10:00
54
+ /julia/bin/julia --project=/SlurmTools -e 'using Pkg; Pkg.test(test_args=["slurm"])'
55
+ EOF
56
+ docker exec slurm-$SLURM sbatch --wait --output=/SlurmTools/output --error=/SlurmTools/output /SlurmTools/sbatch.sh
57
+ cat output
Original file line number Diff line number Diff line change @@ -18,6 +18,19 @@ using Distributed
18
18
wait (rmprocs (workers ()))
19
19
end
20
20
21
+ if " slurm" in ARGS
22
+ @testset " Slurm" begin
23
+ p = addprocs_slurm (1 )
24
+ @test nprocs () == 2
25
+ @test workers () == p
26
+ @test fetch (@spawnat :any myid ()) == p[1 ]
27
+ @test remotecall_fetch (+ ,p[1 ],1 ,1 ) == 2
28
+ rmprocs (p)
29
+ @test nprocs () == 1
30
+ @test workers () == [1 ]
31
+ end
32
+ end
33
+
21
34
@static if Sys. iswindows ()
22
35
windows_which (command) = ` powershell.exe -Command Get-Command $command `
23
36
is_lsf_installed () = success (windows_which (" bsub.exe" ))
You can’t perform that action at this time.
0 commit comments