Skip to content

Commit 08d6b9f

Browse files
committed
fixes
1 parent 715f683 commit 08d6b9f

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

ci/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
FROM ghcr.io/kleinhenz/docker-slurm-cluster@sha256:ed26ab967e84c955f75499d50ef7a4f844e48d7812de5ef6b64423728d9d10c2 as base
2-
MAINTAINER Joseph Kleinhenz <jkleinh@umich.edu>
1+
FROM ghcr.io/kleinhenz/docker-slurm-cluster@sha256:c62b169970eaab879898a7df5950f888b0417147e06f8c0e32fd15087b22d9f2
32

43
ARG JULIA_VERSION=1.11.2
54

ci/docker-compose.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
version: "3.3"
2-
31
services:
42
slurmctld:
53
image: slurm-cluster-julia
4+
build:
5+
context: ..
6+
dockerfile: ci/Dockerfile
67
command: ["slurmctld"]
78
container_name: slurmctld
89
hostname: slurmctld

test/runtests.jl

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ using Distributed, Test, SlurmClusterManager
1010
project_path = abspath(joinpath(@__DIR__, ".."))
1111
println("project_path = $project_path")
1212
jobid = withenv("JULIA_PROJECT"=>project_path) do
13-
read(`sbatch --export=ALL --parsable -n 4 -o test.out script.jl`, String)
13+
strip(read(`sbatch --export=ALL --parsable -n 4 -o test.out script.jl`, String))
1414
end
1515
println("jobid = $jobid")
1616

1717
# get job state from jobid
1818
getjobstate = jobid -> begin
19-
info = read(Cmd(`scontrol show jobid=$jobid`, ignorestatus=true), String)
19+
cmd = Cmd(`scontrol show jobid=$jobid`, ignorestatus=true)
20+
info = read(cmd, String)
2021
state = match(r"JobState=(\S*)", info)
21-
return state
22+
return isnothing(state) ? nothing : state.captures[1]
2223
end
2324

2425
# wait for job to complete
@@ -29,17 +30,13 @@ status = timedwait(60.0, pollint=1.0) do
2930
return state == "COMPLETED" || state == "FAILED"
3031
end
3132

33+
state = getjobstate(jobid)
34+
3235
# check that job finished running within timelimit (either completed or failed)
3336
@test status == :ok
37+
@test state == "COMPLETED"
3438

3539
# print job output
3640
output = read("test.out", String)
3741
println("script output:")
3842
println(output)
39-
40-
state = getjobstate(jobid) |> split
41-
# length should be two because creating the workers creates a job step
42-
@test length(state) == 2
43-
44-
# check that everything exited without errors
45-
@test all(state .== "COMPLETED")

test/script.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ hosts = map(workers()) do id
99
remotecall_fetch(() -> gethostname(), id)
1010
end
1111
sort!(hosts)
12+
println(hosts)
1213

1314
@assert hosts == ["c1", "c1", "c2", "c2"]

0 commit comments

Comments
 (0)