Skip to content

Commit 1aa99a2

Browse files
authored
Merge pull request #33 from kleinhenz/image
switch to updated ghcr image
2 parents c218cfe + 65e006a commit 1aa99a2

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

ci/Dockerfile

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

4-
ARG JULIA_VERSION=1.6.0
3+
ARG JULIA_VERSION=1.11.2
54

65
RUN mkdir -p /home/docker/.local/opt/julia \
76
&& cd /home/docker/.local/opt/julia \

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: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,33 @@ 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
18-
getjobstate = jobid -> read(`sacct -j $jobid --format=state --noheader`, String)
18+
getjobstate = jobid -> begin
19+
cmd = Cmd(`scontrol show jobid=$jobid`, ignorestatus=true)
20+
info = read(cmd, String)
21+
state = match(r"JobState=(\S*)", info)
22+
return state === nothing ? nothing : state.captures[1]
23+
end
1924

2025
# wait for job to complete
2126
status = timedwait(60.0, pollint=1.0) do
2227
state = getjobstate(jobid)
23-
state == "" && return false
24-
state = first(split(state)) # don't care about jobsteps
28+
state == nothing && return false
2529
println("jobstate = $state")
2630
return state == "COMPLETED" || state == "FAILED"
2731
end
2832

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

3239
# print job output
3340
output = read("test.out", String)
3441
println("script output:")
3542
println(output)
36-
37-
state = getjobstate(jobid) |> split
38-
# length should be two because creating the workers creates a job step
39-
@test length(state) == 2
40-
41-
# check that everything exited without errors
42-
@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)