Skip to content

switch to updated ghcr image #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM jkleinh/slurm-cluster@sha256:afd20dafc831b0fa781460dc871232579ccf1b54955e434531394c331ce388e4 as base
MAINTAINER Joseph Kleinhenz <[email protected]>
FROM ghcr.io/kleinhenz/docker-slurm-cluster@sha256:c62b169970eaab879898a7df5950f888b0417147e06f8c0e32fd15087b22d9f2

ARG JULIA_VERSION=1.6.0
ARG JULIA_VERSION=1.11.2

RUN mkdir -p /home/docker/.local/opt/julia \
&& cd /home/docker/.local/opt/julia \
Expand Down
5 changes: 3 additions & 2 deletions ci/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
version: "3.3"

services:
slurmctld:
image: slurm-cluster-julia
build:
context: ..
dockerfile: ci/Dockerfile
command: ["slurmctld"]
container_name: slurmctld
hostname: slurmctld
Expand Down
22 changes: 11 additions & 11 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,33 @@ using Distributed, Test, SlurmClusterManager
project_path = abspath(joinpath(@__DIR__, ".."))
println("project_path = $project_path")
jobid = withenv("JULIA_PROJECT"=>project_path) do
read(`sbatch --export=ALL --parsable -n 4 -o test.out script.jl`, String)
strip(read(`sbatch --export=ALL --parsable -n 4 -o test.out script.jl`, String))
end
println("jobid = $jobid")

# get job state from jobid
getjobstate = jobid -> read(`sacct -j $jobid --format=state --noheader`, String)
getjobstate = jobid -> begin
cmd = Cmd(`scontrol show jobid=$jobid`, ignorestatus=true)
info = read(cmd, String)
state = match(r"JobState=(\S*)", info)
return state === nothing ? nothing : state.captures[1]
end

# wait for job to complete
status = timedwait(60.0, pollint=1.0) do
state = getjobstate(jobid)
state == "" && return false
state = first(split(state)) # don't care about jobsteps
state == nothing && return false
println("jobstate = $state")
return state == "COMPLETED" || state == "FAILED"
end

state = getjobstate(jobid)

# check that job finished running within timelimit (either completed or failed)
@test status == :ok
@test state == "COMPLETED"

# print job output
output = read("test.out", String)
println("script output:")
println(output)

state = getjobstate(jobid) |> split
# length should be two because creating the workers creates a job step
@test length(state) == 2

# check that everything exited without errors
@test all(state .== "COMPLETED")
1 change: 1 addition & 0 deletions test/script.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ hosts = map(workers()) do id
remotecall_fetch(() -> gethostname(), id)
end
sort!(hosts)
println(hosts)

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