From 00b2a1b590e055865dae56eb028e38c1f6c147ca Mon Sep 17 00:00:00 2001 From: Dean Roehrich Date: Wed, 7 Dec 2022 12:29:02 -0600 Subject: [PATCH 1/2] Add a burst_buffer.conf to redefine the burst buffer directive from BB_LUA to DW. Signed-off-by: Dean Roehrich --- src/burst_buffer/burst_buffer.conf | 5 +++++ src/burst_buffer/burst_buffer.lua | 2 +- testsuite/integration/slurm/README.md | 5 +---- .../integration/slurm/docker-compose.yml | 3 +++ testsuite/integration/slurm/jobs/test-bb.sh | 2 +- testsuite/unit/src/burst_buffer/dws-test.lua | 20 +++++++++---------- 6 files changed, 21 insertions(+), 16 deletions(-) create mode 100644 src/burst_buffer/burst_buffer.conf diff --git a/src/burst_buffer/burst_buffer.conf b/src/burst_buffer/burst_buffer.conf new file mode 100644 index 0000000..2967ba0 --- /dev/null +++ b/src/burst_buffer/burst_buffer.conf @@ -0,0 +1,5 @@ +# The string that must be used by a job to request a DWS workflow. This +# string must be immediately preceeded by a single '#' character. +# See https://slurm.schedmd.com/burst_buffer.conf.html +Directive=DW + diff --git a/src/burst_buffer/burst_buffer.lua b/src/burst_buffer/burst_buffer.lua index b5acfce..4201142 100644 --- a/src/burst_buffer/burst_buffer.lua +++ b/src/burst_buffer/burst_buffer.lua @@ -19,7 +19,7 @@ -- The directive used in job scripts. This is the same value specified in the -- burst_buffer.conf "Directive" configuration parameter. -local DIRECTIVE = "BB_LUA" +local DIRECTIVE = "DW" -- A placeholder for the WLM ID. This value is not used by Slurm, but is -- used by other WLMs, so the DWS library expects it. diff --git a/testsuite/integration/slurm/README.md b/testsuite/integration/slurm/README.md index 613af6e..bb6249d 100644 --- a/testsuite/integration/slurm/README.md +++ b/testsuite/integration/slurm/README.md @@ -1,9 +1,6 @@ # Slurm Docker Cluster -This is a multi-container Slurm v22 cluster using docker-compose. The compose file -creates named volumes for persistent storage of MySQL data files as well as -Slurm state and log directories. The burst_buffer.lua script is mounted in the -slurmctld container and is available to be tested using `#BB_LUA` directives. +This is a multi-container Slurm v22 cluster using docker-compose. The compose file creates named volumes for persistent storage of MySQL data files as well as Slurm state and log directories. The burst_buffer.lua script and burst_buffer.conf are mounted in the slurmctld container and the burst_buffer script is available to be tested using `#DW` directives. ## Containers and Volumes diff --git a/testsuite/integration/slurm/docker-compose.yml b/testsuite/integration/slurm/docker-compose.yml index d25be32..6e5fee4 100644 --- a/testsuite/integration/slurm/docker-compose.yml +++ b/testsuite/integration/slurm/docker-compose.yml @@ -65,6 +65,9 @@ services: - type: bind source: ../../../src/burst_buffer/burst_buffer.lua target: /etc/slurm/burst_buffer.lua + - type: bind + source: ../../../src/burst_buffer/burst_buffer.conf + target: /etc/slurm/burst_buffer.conf - ../kubeconfig:/home/slurm/.kube/config expose: - "6817" diff --git a/testsuite/integration/slurm/jobs/test-bb.sh b/testsuite/integration/slurm/jobs/test-bb.sh index acf7e9e..98ea248 100644 --- a/testsuite/integration/slurm/jobs/test-bb.sh +++ b/testsuite/integration/slurm/jobs/test-bb.sh @@ -20,7 +20,7 @@ # #SBATCH --output=/jobs/slurm-%j.out -#BB_LUA +#DW /bin/hostname srun -l /bin/hostname srun -l /bin/pwd diff --git a/testsuite/unit/src/burst_buffer/dws-test.lua b/testsuite/unit/src/burst_buffer/dws-test.lua index e88fcde..3361a71 100644 --- a/testsuite/unit/src/burst_buffer/dws-test.lua +++ b/testsuite/unit/src/burst_buffer/dws-test.lua @@ -198,8 +198,8 @@ describe("The dws library initializer", function() it("can handle a non-empty array value for dwd", function() local dwd = {} - dwd[1] = "#BB_LUA line 1" - dwd[2] = "#BB_LUA line 2" + dwd[1] = "#DW line 1" + dwd[2] = "#DW line 2" fill_template(workflow, wlmID, jobID, userID, groupID, dwd) assert.is_not_nil(string.find(workflow.yaml, "dwDirectives:\n %- " .. dwd[1] .. "\n" .. " %- " .. dwd[2] .. "\n")) end) @@ -666,8 +666,8 @@ describe("Burst buffer helpers", function() it("finds directives in job script", function() local in_dwd = {} - in_dwd[1] = "#BB_LUA pool=pool1 capacity=1K" - in_dwd[2] = "#BB_LUA pool=pool2 capacity=1K" + in_dwd[1] = "#DW pool=pool1 capacity=1K" + in_dwd[2] = "#DW pool=pool2 capacity=1K" local job_script = "#!/bin/bash\n" .. in_dwd[1] .. "\n" .. in_dwd[2] .. "\nsrun application.sh\n" write_job_script(job_script_name, job_script) @@ -771,14 +771,14 @@ describe("Burst buffer helpers", function() it("can create workflow from job script with directives", function() local in_dwd = {} - in_dwd[1] = "#BB_LUA pool=pool1 capacity=1K" - in_dwd[2] = "#BB_LUA pool=pool2 capacity=1K" + in_dwd[1] = "#DW pool=pool1 capacity=1K" + in_dwd[2] = "#DW pool=pool2 capacity=1K" local job_script = "#!/bin/bash\n" .. in_dwd[1] .. "\n" .. in_dwd[2] .. "\nsrun application.sh\n" write_job_script(job_script_name, job_script) -- The DWS environment does not have a ruleset for - -- the BB_LUA directives, so we should expect an error. + -- the #DW directives, so we should expect an error. -- We'll look for only a small piece of the error -- message here. local result_wanted = "unable to find ruleset" @@ -907,13 +907,13 @@ describe("Slurm API", function() it("slurm_bb_job_process can validate workflow from job script with directives", function() local in_dwd = {} - in_dwd[1] = "#BB_LUA pool=pool1 capacity=1K" - in_dwd[2] = "#BB_LUA pool=pool2 capacity=1K" + in_dwd[1] = "#DW pool=pool1 capacity=1K" + in_dwd[2] = "#DW pool=pool2 capacity=1K" local job_script = "#!/bin/bash\n" .. in_dwd[1] .. "\n" .. in_dwd[2] .. "\nsrun application.sh\n" write_job_script(job_script_name, job_script) -- The DWS environment does not have a ruleset for - -- the BB_LUA directives, so we should expect an error. + -- the #DW directives, so we should expect an error. -- We'll look for only a small piece of the error -- message here. local result_wanted = "unable to find ruleset" From bf0bf6eee3521a9d7fcba40ae01fff498b135d87 Mon Sep 17 00:00:00 2001 From: Dean Roehrich Date: Wed, 7 Dec 2022 12:31:22 -0600 Subject: [PATCH 2/2] Typo Signed-off-by: Dean Roehrich --- src/burst_buffer/burst_buffer.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/burst_buffer/burst_buffer.conf b/src/burst_buffer/burst_buffer.conf index 2967ba0..67d41cc 100644 --- a/src/burst_buffer/burst_buffer.conf +++ b/src/burst_buffer/burst_buffer.conf @@ -1,5 +1,5 @@ # The string that must be used by a job to request a DWS workflow. This -# string must be immediately preceeded by a single '#' character. +# string must be immediately preceded by a single '#' character. # See https://slurm.schedmd.com/burst_buffer.conf.html Directive=DW