From 8257f483789916a5125610f40f4e8a8783ec07da Mon Sep 17 00:00:00 2001 From: Nick Tyler Date: Sun, 18 Aug 2024 16:04:45 -0700 Subject: [PATCH 01/11] First pass at slurm tests --- .github/workflows/parsl+slurm.yaml | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/parsl+slurm.yaml diff --git a/.github/workflows/parsl+slurm.yaml b/.github/workflows/parsl+slurm.yaml new file mode 100644 index 0000000000..74e50a8f47 --- /dev/null +++ b/.github/workflows/parsl+slurm.yaml @@ -0,0 +1,37 @@ +name: Test Slurm Scheduler +on: push +jobs: + build: + runs-on: ubuntu-22.04 + permissions: + packages: read + strategy: + fail-fast: false + matrix: + container: ["hcr.io/tylern4/slurm-standalone:slurm-24-05-0-1"] + timeout-minutes: 30 + + container: + image: ${{ matrix.container }} + options: "--platform=linux/amd64 --rm -h node01" + + name: ${{ matrix.container }} + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install Dependencies and Parsl + run: | + pip3 install . -r test-requirements.txt + + - name: Verify Parsl Installation + run: | + pytest parsl/tests/ -k "not cleannet and not unix_filesystem_permissions_required" --config parsl/tests/configs/local_threads.py --random-order --durations 10 + + # - name: Test Parsl with Slurm + # run: | + # pytest parsl/tests/test_slurm.py --config local --random-order + + # - name: Test Parsl with Slurm Config + # run: | + # pytest parsl/tests/ -k "not cleannet and not unix_filesystem_permissions_required" --config parsl/tests/configs/slurm_local.py --random-order --durations 10 From c34bae4ebfc886d51a3771a7a8c674940ea026f5 Mon Sep 17 00:00:00 2001 From: Nick Tyler Date: Sun, 18 Aug 2024 16:44:04 -0700 Subject: [PATCH 02/11] First pass at slurm tests --- .github/workflows/parsl+slurm.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/parsl+slurm.yaml b/.github/workflows/parsl+slurm.yaml index 74e50a8f47..86fa87c8fe 100644 --- a/.github/workflows/parsl+slurm.yaml +++ b/.github/workflows/parsl+slurm.yaml @@ -8,7 +8,7 @@ jobs: strategy: fail-fast: false matrix: - container: ["hcr.io/tylern4/slurm-standalone:slurm-24-05-0-1"] + container: ["ghcr.io/tylern4/slurm-standalone:slurm-24-05-0-1"] timeout-minutes: 30 container: From f9c7175573edc2736a2803f1c34c0effed408be6 Mon Sep 17 00:00:00 2001 From: Nick Tyler Date: Sun, 18 Aug 2024 18:33:18 -0700 Subject: [PATCH 03/11] Get mpi4py working --- .github/workflows/parsl+slurm.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/parsl+slurm.yaml b/.github/workflows/parsl+slurm.yaml index 86fa87c8fe..12053ce14f 100644 --- a/.github/workflows/parsl+slurm.yaml +++ b/.github/workflows/parsl+slurm.yaml @@ -22,7 +22,7 @@ jobs: - name: Install Dependencies and Parsl run: | - pip3 install . -r test-requirements.txt + CC=/usr/lib64/openmpi/bin/mpicc pip3 install . -r test-requirements.txt - name: Verify Parsl Installation run: | From a6955217fc876de664f083cc08c71e0e9c347502 Mon Sep 17 00:00:00 2001 From: Nick Tyler Date: Thu, 29 Aug 2024 19:00:36 -0700 Subject: [PATCH 04/11] trying slurm tests --- .github/workflows/parsl+slurm.yaml | 12 ++++-------- parsl/tests/configs/slurm_local.py | 29 +++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 8 deletions(-) create mode 100644 parsl/tests/configs/slurm_local.py diff --git a/.github/workflows/parsl+slurm.yaml b/.github/workflows/parsl+slurm.yaml index 12053ce14f..eac30a3345 100644 --- a/.github/workflows/parsl+slurm.yaml +++ b/.github/workflows/parsl+slurm.yaml @@ -26,12 +26,8 @@ jobs: - name: Verify Parsl Installation run: | - pytest parsl/tests/ -k "not cleannet and not unix_filesystem_permissions_required" --config parsl/tests/configs/local_threads.py --random-order --durations 10 + /usr/local/bin/docker-entrypoint.sh pytest parsl/tests/ -k "not cleannet and not unix_filesystem_permissions_required" --config parsl/tests/configs/local_threads.py --random-order --durations 10 - # - name: Test Parsl with Slurm - # run: | - # pytest parsl/tests/test_slurm.py --config local --random-order - - # - name: Test Parsl with Slurm Config - # run: | - # pytest parsl/tests/ -k "not cleannet and not unix_filesystem_permissions_required" --config parsl/tests/configs/slurm_local.py --random-order --durations 10 + - name: Test Parsl with Slurm Config + run: | + pytest parsl/tests/ -k "not cleannet and not unix_filesystem_permissions_required" --config parsl/tests/configs/slurm_local.py --random-order --durations 10 diff --git a/parsl/tests/configs/slurm_local.py b/parsl/tests/configs/slurm_local.py new file mode 100644 index 0000000000..afee724c7b --- /dev/null +++ b/parsl/tests/configs/slurm_local.py @@ -0,0 +1,29 @@ +from parsl.channels import LocalChannel +from parsl.config import Config +from parsl.executors import HighThroughputExecutor +from parsl.launchers import SrunLauncher +from parsl.providers import SlurmProvider + + +def fresh_config(): + return Config( + executors=[ + HighThroughputExecutor( + label="docker_slurm", + encrypted=True, + provider=SlurmProvider( + cmd_timeout=60, # Add extra time for slow scheduler responses + channel=LocalChannel(), + nodes_per_block=1, + init_blocks=1, + min_blocks=1, + max_blocks=1, + walltime='00:10:00', + launcher=SrunLauncher(), + ), + ) + ], + ) + + +config = fresh_config() From 5d84dfaa0ef6581524f9a005dc123d5bf57fe577 Mon Sep 17 00:00:00 2001 From: Nick Tyler Date: Thu, 29 Aug 2024 19:02:14 -0700 Subject: [PATCH 05/11] Use entrypoint to run --- .github/workflows/parsl+slurm.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/parsl+slurm.yaml b/.github/workflows/parsl+slurm.yaml index eac30a3345..c43b283802 100644 --- a/.github/workflows/parsl+slurm.yaml +++ b/.github/workflows/parsl+slurm.yaml @@ -30,4 +30,4 @@ jobs: - name: Test Parsl with Slurm Config run: | - pytest parsl/tests/ -k "not cleannet and not unix_filesystem_permissions_required" --config parsl/tests/configs/slurm_local.py --random-order --durations 10 + /usr/local/bin/docker-entrypoint.sh pytest parsl/tests/ -k "not cleannet and not unix_filesystem_permissions_required" --config parsl/tests/configs/slurm_local.py --random-order --durations 10 From 56e017f07aa4cfe17e5471cda88fdb48cac29214 Mon Sep 17 00:00:00 2001 From: Nick Tyler Date: Thu, 29 Aug 2024 19:07:31 -0700 Subject: [PATCH 06/11] Wihtout entrypoint --- .github/workflows/parsl+slurm.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/parsl+slurm.yaml b/.github/workflows/parsl+slurm.yaml index c43b283802..f2c1871d39 100644 --- a/.github/workflows/parsl+slurm.yaml +++ b/.github/workflows/parsl+slurm.yaml @@ -26,7 +26,7 @@ jobs: - name: Verify Parsl Installation run: | - /usr/local/bin/docker-entrypoint.sh pytest parsl/tests/ -k "not cleannet and not unix_filesystem_permissions_required" --config parsl/tests/configs/local_threads.py --random-order --durations 10 + pytest parsl/tests/ -k "not cleannet and not unix_filesystem_permissions_required" --config parsl/tests/configs/local_threads.py --random-order --durations 10 - name: Test Parsl with Slurm Config run: | From c8d43a78af144c958be136e4b0b69ebbff56f9ae Mon Sep 17 00:00:00 2001 From: Nick Tyler Date: Thu, 29 Aug 2024 19:15:34 -0700 Subject: [PATCH 07/11] Add different entrypoint --- .github/workflows/parsl+slurm.yaml | 2 +- parsl/tests/slurm-entrypoint.sh | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 parsl/tests/slurm-entrypoint.sh diff --git a/.github/workflows/parsl+slurm.yaml b/.github/workflows/parsl+slurm.yaml index f2c1871d39..e921f49fe8 100644 --- a/.github/workflows/parsl+slurm.yaml +++ b/.github/workflows/parsl+slurm.yaml @@ -13,7 +13,7 @@ jobs: container: image: ${{ matrix.container }} - options: "--platform=linux/amd64 --rm -h node01" + options: "--platform=linux/amd64 --rm -h node01 -v $PWD/parsl/tests/slurm-entrypoint.sh:/usr/local/bin/docker-entrypoint.sh" name: ${{ matrix.container }} steps: diff --git a/parsl/tests/slurm-entrypoint.sh b/parsl/tests/slurm-entrypoint.sh new file mode 100644 index 0000000000..418db8419e --- /dev/null +++ b/parsl/tests/slurm-entrypoint.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -e + +echo "---> Starting the MUNGE Authentication service (munged) ..." +gosu munge /usr/sbin/munged + +echo "---> Starting the slurmctld ..." +exec gosu slurm /usr/sbin/slurmctld -i -Dvvv & + +echo "---> Waiting for slurmctld to become active before starting slurmd..." + +echo "---> Starting the Slurm Node Daemon (slurmd) ..." +exec /usr/sbin/slurmd -Dvvv & + +echo "---> Running user command '${@}'" +exec "$@" From 6b20cfc6604750dca764e73734c9d3fd99cf70c7 Mon Sep 17 00:00:00 2001 From: Nick Tyler Date: Thu, 29 Aug 2024 19:18:35 -0700 Subject: [PATCH 08/11] Add different entrypoint --- .github/workflows/parsl+slurm.yaml | 4 ++-- parsl/tests/slurm-entrypoint.sh | 0 2 files changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 parsl/tests/slurm-entrypoint.sh diff --git a/.github/workflows/parsl+slurm.yaml b/.github/workflows/parsl+slurm.yaml index e921f49fe8..28b026bafd 100644 --- a/.github/workflows/parsl+slurm.yaml +++ b/.github/workflows/parsl+slurm.yaml @@ -13,7 +13,7 @@ jobs: container: image: ${{ matrix.container }} - options: "--platform=linux/amd64 --rm -h node01 -v $PWD/parsl/tests/slurm-entrypoint.sh:/usr/local/bin/docker-entrypoint.sh" + options: "--platform=linux/amd64 --rm -h node01" name: ${{ matrix.container }} steps: @@ -30,4 +30,4 @@ jobs: - name: Test Parsl with Slurm Config run: | - /usr/local/bin/docker-entrypoint.sh pytest parsl/tests/ -k "not cleannet and not unix_filesystem_permissions_required" --config parsl/tests/configs/slurm_local.py --random-order --durations 10 + ./parsl/tests/slurm-entrypoint.sh pytest parsl/tests/ -k "not cleannet and not unix_filesystem_permissions_required" --config parsl/tests/configs/slurm_local.py --random-order --durations 10 diff --git a/parsl/tests/slurm-entrypoint.sh b/parsl/tests/slurm-entrypoint.sh old mode 100644 new mode 100755 From 2c1561f0344d3c6e93cbcda0b1a909d0256f5c53 Mon Sep 17 00:00:00 2001 From: Nick Tyler Date: Mon, 2 Sep 2024 16:32:36 -0700 Subject: [PATCH 09/11] Only run on pull requests --- .github/workflows/parsl+slurm.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/parsl+slurm.yaml b/.github/workflows/parsl+slurm.yaml index 28b026bafd..0828a6cabb 100644 --- a/.github/workflows/parsl+slurm.yaml +++ b/.github/workflows/parsl+slurm.yaml @@ -1,5 +1,7 @@ name: Test Slurm Scheduler -on: push +on: + pull_request: + jobs: build: runs-on: ubuntu-22.04 From e55201019d7998ce65d376b5e6270419683ab573 Mon Sep 17 00:00:00 2001 From: Nick Tyler Date: Thu, 5 Sep 2024 20:21:22 +0000 Subject: [PATCH 10/11] remove config line --- parsl/tests/configs/slurm_local.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/parsl/tests/configs/slurm_local.py b/parsl/tests/configs/slurm_local.py index afee724c7b..baf8ec5e35 100644 --- a/parsl/tests/configs/slurm_local.py +++ b/parsl/tests/configs/slurm_local.py @@ -25,5 +25,3 @@ def fresh_config(): ], ) - -config = fresh_config() From 3cd110c4a8151e2f549be12d67234b0f87df4fda Mon Sep 17 00:00:00 2001 From: Nick Tyler Date: Thu, 5 Sep 2024 21:22:55 +0000 Subject: [PATCH 11/11] Fix flake8 for config file --- parsl/tests/configs/slurm_local.py | 1 - 1 file changed, 1 deletion(-) diff --git a/parsl/tests/configs/slurm_local.py b/parsl/tests/configs/slurm_local.py index baf8ec5e35..2a63f68e51 100644 --- a/parsl/tests/configs/slurm_local.py +++ b/parsl/tests/configs/slurm_local.py @@ -24,4 +24,3 @@ def fresh_config(): ) ], ) -