Skip to content

Commit 1494507

Browse files
authored
Merge pull request #954 from minrk/py310
require Python 3.10
2 parents 40bd913 + b0d64ab commit 1494507

File tree

18 files changed

+303
-163
lines changed

18 files changed

+303
-163
lines changed

.github/workflows/test-docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ env:
1717

1818
jobs:
1919
test-docs:
20-
runs-on: ubuntu-22.04
20+
runs-on: ubuntu-24.04
2121
steps:
2222
- uses: actions/checkout@v5
2323
with:
@@ -27,7 +27,7 @@ jobs:
2727

2828
- uses: actions/setup-python@v6
2929
with:
30-
python-version: "3.10"
30+
python-version: "3.13"
3131

3232
- name: Install requirements
3333
run: |

.github/workflows/test-ssh.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
fail-fast: false
4444
matrix:
4545
include:
46-
- python: "3.9"
46+
- python: "3.10"
4747
- python: "3.12"
4848
runs_on: windows-2022
4949

.github/workflows/test.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,23 @@ jobs:
3030
fail-fast: false
3131
matrix:
3232
include:
33-
- python: "3.9"
33+
- python: "3.11"
3434
cluster_type: mpi
35-
- python: "3.10"
35+
- python: "3.12"
3636
cluster_type: slurm
3737
container: slurmctld
38-
- python: "3.8"
39-
runs_on: 22.04
4038
- python: "3.10"
4139
env:
4240
IPP_CONTROLLER_IP: "*"
43-
- python: "3.9"
41+
- python: "3.13"
4442
env:
4543
IPP_ENABLE_CURVE: "1"
46-
- python: "3.8"
47-
runs_on: windows-2019
48-
- python: "3.9"
44+
- python: "3.10"
45+
runs_on: windows-2025
46+
- python: "3.12"
4947
runs_on: macos-14
5048
- python: "3.11"
51-
- python: "3.12"
49+
- python: "3.14"
5250
pre: pre
5351

5452
steps:
@@ -108,6 +106,7 @@ jobs:
108106
uses: actions/setup-python@v6
109107
with:
110108
python-version: ${{ matrix.python }}
109+
allow-prereleases: true
111110

112111
- name: Install ipyparallel itself
113112
run: |

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ repos:
3232
- --fix
3333
# isort rules get confused in the temporary files
3434
- --ignore=I
35-
- repo: https://github.com/pre-commit/mirrors-prettier
36-
rev: v4.0.0-alpha.8
35+
- repo: https://github.com/rbubley/mirrors-prettier
36+
rev: v3.6.2
3737
hooks:
3838
- id: prettier
3939
- repo: https://github.com/pre-commit/pre-commit-hooks

benchmarks/benchmarks/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import datetime
22
import time
3-
from typing import Callable
3+
from collections.abc import Callable
44

55

66
def wait_for(condition: Callable):

benchmarks/gcloud_setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import sys
55
from subprocess import Popen, check_call
66
from time import sleep
7-
from typing import List
87

98
import googleapiclient.discovery as gcd
109

@@ -25,7 +24,7 @@ def generate_template_name(number_of_cores_and_ram):
2524
return f"{INSTANCE_NAME_PREFIX}{number_of_cores_and_ram}"
2625

2726

28-
def get_running_instance_names() -> List[str]:
27+
def get_running_instance_names() -> list[str]:
2928
result = compute.instances().list(project=PROJECT_NAME, zone=ZONE).execute()
3029
return [item["name"] for item in result["items"]] if "items" in result else []
3130

ci/slurm/Dockerfile

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,57 @@
1-
# syntax = docker/dockerfile:1.2.1
2-
FROM ubuntu:20.04
1+
FROM ubuntu:24.04
32

43
ENV DEBIAN_FRONTEND=noninteractive
54
RUN --mount=type=cache,target=/var/cache/apt \
65
rm -f /etc/apt/apt.conf.d/docker-clean \
7-
&& apt-get update && apt-get -y install python3-pip slurm-wlm
8-
ENV PIP_CACHE_DIR=/tmp/pip-cache
9-
RUN --mount=type=cache,target=${PIP_CACHE_DIR} python3 -m pip install ipyparallel pytest-asyncio pytest-cov
10-
RUN mkdir /var/spool/slurmctl \
11-
&& mkdir /var/spool/slurmd
12-
COPY slurm.conf /etc/slurm-llnl/slurm.conf
6+
&& apt-get update && apt-get -y install \
7+
gosu \
8+
mysql-client \
9+
python3-venv \
10+
python3-pip \
11+
slurm-wlm \
12+
slurmdbd \
13+
slurm
14+
15+
ENV PIP_CACHE_DIR=/tmp/pip-cache \
16+
VIRTUAL_ENV=/srv/env \
17+
PATH=/srv/env/bin:${PATH} \
18+
IPP_DISABLE_JS=1
19+
20+
RUN --mount=type=cache,target=${PIP_CACHE_DIR} \
21+
python3 -m venv $VIRTUAL_ENV \
22+
&& $VIRTUAL_ENV/bin/python3 -m pip install ipyparallel pytest-asyncio pytest-cov
23+
24+
# initialize some filesystem
25+
RUN mkdir -p /etc/sysconfig/slurm \
26+
/var/spool/slurmd \
27+
/var/run/slurmd \
28+
/var/run/slurmdbd \
29+
/var/lib/slurmd \
30+
/data \
31+
&& touch /var/lib/slurmd/node_state \
32+
/var/lib/slurmd/front_end_state \
33+
/var/lib/slurmd/job_state \
34+
/var/lib/slurmd/resv_state \
35+
/var/lib/slurmd/trigger_state \
36+
/var/lib/slurmd/assoc_mgr_state \
37+
/var/lib/slurmd/assoc_usage \
38+
/var/lib/slurmd/qos_usage \
39+
/var/lib/slurmd/fed_mgr_state \
40+
&& chown -R slurm:slurm /var/*/slurm* \
41+
&& mkdir /run/munge \
42+
&& chown munge:munge /run/munge \
43+
&& chmod a+rwxt /run/munge
44+
# && mungekey -c
45+
46+
COPY --chown=slurm:slurm --chmod=0600 etc_slurm/ /etc/slurm/
47+
48+
1349
COPY entrypoint.sh /entrypoint
14-
ENV IPP_DISABLE_JS=1
1550
ENTRYPOINT ["/entrypoint"]
1651

1752
# the mounted directory
1853
RUN mkdir /io
1954
ENV PYTHONPATH=/io
2055
WORKDIR "/io"
56+
57+
CMD [ "tail", "-f", "/var/log/slurm/slurmd.log" ]

ci/slurm/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Slurm cluster example for testing
2+
3+
adapted and simplified from https://github.com/giovtorres/slurm-docker-cluster/
4+
5+
License: MIT

ci/slurm/docker-compose.yaml

Lines changed: 30 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,63 @@
1-
version: "2.2"
2-
31
services:
4-
slurmctld:
2+
mysql:
3+
image: mariadb:10.11
4+
hostname: mysql
5+
container_name: mysql
6+
environment:
7+
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
8+
MYSQL_DATABASE: slurm_acct_db
9+
MYSQL_USER: slurm
10+
MYSQL_PASSWORD: password
11+
volumes:
12+
- var_lib_mysql:/var_lib/mysql
13+
14+
slurmdbd:
515
image: ipp-cluster:slurm
616
build: .
7-
container_name: slurmctld
8-
hostname: slurmctld
917
command:
10-
- tail
11-
- "-f"
12-
- /var/log/slurm-llnl/slurmctld.log
18+
- slurmdbd
19+
container_name: slurmdbd
20+
hostname: slurmdbd
1321
volumes:
1422
- etc_munge:/etc/munge
15-
- etc_slurm:/etc/slurm
16-
- slurm_jobdir:/data
1723
- var_log_slurm:/var/log/slurm
18-
- ../..:/io
19-
expose:
20-
- "6817"
21-
networks:
22-
common-network:
23-
ipv4_address: 10.1.1.10
24+
depends_on:
25+
- mysql
2426

25-
c1:
27+
slurmctld:
2628
image: ipp-cluster:slurm
2729
build: .
28-
hostname: c1
2930
command:
30-
- tail
31-
- "-f"
32-
- /var/log/slurm-llnl/slurmd.log
33-
container_name: c1
34-
31+
- slurmctld
32+
container_name: slurmctld
33+
hostname: slurmctld
3534
volumes:
3635
- etc_munge:/etc/munge
37-
- etc_slurm:/etc/slurm
3836
- slurm_jobdir:/data
3937
- var_log_slurm:/var/log/slurm
4038
- ../..:/io
41-
expose:
42-
- "6818"
4339
depends_on:
44-
- "slurmctld"
45-
networks:
46-
common-network:
47-
ipv4_address: 10.1.1.11
40+
- slurmdbd
4841

49-
c2:
42+
compute:
5043
image: ipp-cluster:slurm
5144
build: .
5245
command:
53-
- tail
54-
- "-f"
55-
- /var/log/slurm-llnl/slurmd.log
56-
hostname: c2
57-
container_name: c2
46+
- slurmd
47+
deploy:
48+
replicas: 2
49+
5850
volumes:
5951
- etc_munge:/etc/munge
60-
- etc_slurm:/etc/slurm
6152
- slurm_jobdir:/data
6253
- var_log_slurm:/var/log/slurm
6354
- ../..:/io
64-
expose:
65-
- "6818"
6655
depends_on:
6756
- "slurmctld"
68-
networks:
69-
common-network:
70-
ipv4_address: 10.1.1.12
7157

7258
volumes:
7359
etc_munge:
74-
etc_slurm:
60+
# etc_slurm:
7561
slurm_jobdir:
62+
var_lib_mysql:
7663
var_log_slurm:
77-
78-
networks:
79-
common-network:
80-
driver: bridge
81-
ipam:
82-
driver: default
83-
config:
84-
- subnet: 10.1.1.0/24

ci/slurm/entrypoint.sh

Lines changed: 59 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,64 @@
11
#!/bin/bash
22
set -ex
3-
# set permissions on munge dir, may be mounted
4-
chown -R munge:munge /etc/munge
5-
6-
echo "starting munge"
7-
service munge start
8-
9-
echo "hostname=$(hostname)"
10-
if [[ "$(hostname)" == *"slurmctl"* ]]; then
11-
echo "starting slurmctld"
12-
service slurmctld start
13-
else
14-
echo "starting slurmd"
15-
service slurmd start
3+
4+
if [ "$1" = "slurmdbd" ]
5+
then
6+
echo "---> Starting the MUNGE Authentication service (munged) ..."
7+
gosu munge /usr/sbin/munged
8+
9+
echo "---> Starting the Slurm Database Daemon (slurmdbd) ..."
10+
11+
{
12+
. /etc/slurm/slurmdbd.conf
13+
until echo "SELECT 1" | mysql -h $StorageHost -u$StorageUser -p$StoragePass 2>&1 > /dev/null
14+
do
15+
echo "-- Waiting for database to become active ..."
16+
sleep 2
17+
done
18+
}
19+
echo "-- Database is now active ..."
20+
21+
exec gosu slurm /usr/sbin/slurmdbd -Dvvv
22+
fi
23+
24+
if [ "$1" = "slurmctld" ]
25+
then
26+
echo "---> Starting the MUNGE Authentication service (munged) ..."
27+
gosu munge /usr/sbin/munged
28+
29+
echo "---> Waiting for slurmdbd to become active before starting slurmctld ..."
30+
31+
until 2>/dev/null >/dev/tcp/slurmdbd/6819
32+
do
33+
echo "-- slurmdbd is not available. Sleeping ..."
34+
sleep 2
35+
done
36+
echo "-- slurmdbd is now active ..."
37+
38+
echo "---> Starting the Slurm Controller Daemon (slurmctld) ..."
39+
if /usr/sbin/slurmctld -V | grep -q '17.02' ; then
40+
exec gosu slurm /usr/sbin/slurmctld -Dvvv
41+
else
42+
exec gosu slurm /usr/sbin/slurmctld -i -Dvvv
43+
fi
44+
fi
45+
46+
if [ "$1" = "slurmd" ]
47+
then
48+
echo "---> Starting the MUNGE Authentication service (munged) ..."
49+
gosu munge /usr/sbin/munged
50+
51+
echo "---> Waiting for slurmctld to become active before starting slurmd..."
52+
53+
until 2>/dev/null >/dev/tcp/slurmctld/6817
54+
do
55+
echo "-- slurmctld is not available. Sleeping ..."
56+
sleep 2
57+
done
58+
echo "-- slurmctld is now active ..."
59+
60+
echo "---> Starting the Slurm Node Daemon (slurmd) ..."
61+
exec /usr/sbin/slurmd -Z --conf "CPUs=2 RealMemory=1000 Feature=compute" -Dvvv
1662
fi
1763

1864
exec "$@"

0 commit comments

Comments
 (0)