Skip to content
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
4 changes: 2 additions & 2 deletions .github/workflows/test-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ env:

jobs:
test-docs:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
with:
Expand All @@ -27,7 +27,7 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.13"

- name: Install requirements
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-ssh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
fail-fast: false
matrix:
include:
- python: "3.9"
- python: "3.10"
- python: "3.12"
runs_on: windows-2022

Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,23 @@ jobs:
fail-fast: false
matrix:
include:
- python: "3.9"
- python: "3.11"
cluster_type: mpi
- python: "3.10"
- python: "3.12"
cluster_type: slurm
container: slurmctld
- python: "3.8"
runs_on: 22.04
- python: "3.10"
env:
IPP_CONTROLLER_IP: "*"
- python: "3.9"
- python: "3.13"
env:
IPP_ENABLE_CURVE: "1"
- python: "3.8"
runs_on: windows-2019
- python: "3.9"
- python: "3.10"
runs_on: windows-2025
- python: "3.12"
runs_on: macos-14
- python: "3.11"
- python: "3.12"
- python: "3.14"
pre: pre

steps:
Expand Down Expand Up @@ -108,6 +106,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
allow-prereleases: true

- name: Install ipyparallel itself
run: |
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ repos:
- --fix
# isort rules get confused in the temporary files
- --ignore=I
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
- repo: https://github.com/rbubley/mirrors-prettier
rev: v3.6.2
hooks:
- id: prettier
- repo: https://github.com/pre-commit/pre-commit-hooks
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmarks/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import datetime
import time
from typing import Callable
from collections.abc import Callable


def wait_for(condition: Callable):
Expand Down
3 changes: 1 addition & 2 deletions benchmarks/gcloud_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import sys
from subprocess import Popen, check_call
from time import sleep
from typing import List

import googleapiclient.discovery as gcd

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


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

Expand Down
55 changes: 46 additions & 9 deletions ci/slurm/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,57 @@
# syntax = docker/dockerfile:1.2.1
FROM ubuntu:20.04
FROM ubuntu:24.04

ENV DEBIAN_FRONTEND=noninteractive
RUN --mount=type=cache,target=/var/cache/apt \
rm -f /etc/apt/apt.conf.d/docker-clean \
&& apt-get update && apt-get -y install python3-pip slurm-wlm
ENV PIP_CACHE_DIR=/tmp/pip-cache
RUN --mount=type=cache,target=${PIP_CACHE_DIR} python3 -m pip install ipyparallel pytest-asyncio pytest-cov
RUN mkdir /var/spool/slurmctl \
&& mkdir /var/spool/slurmd
COPY slurm.conf /etc/slurm-llnl/slurm.conf
&& apt-get update && apt-get -y install \
gosu \
mysql-client \
python3-venv \
python3-pip \
slurm-wlm \
slurmdbd \
slurm

ENV PIP_CACHE_DIR=/tmp/pip-cache \
VIRTUAL_ENV=/srv/env \
PATH=/srv/env/bin:${PATH} \
IPP_DISABLE_JS=1

RUN --mount=type=cache,target=${PIP_CACHE_DIR} \
python3 -m venv $VIRTUAL_ENV \
&& $VIRTUAL_ENV/bin/python3 -m pip install ipyparallel pytest-asyncio pytest-cov

# initialize some filesystem
RUN mkdir -p /etc/sysconfig/slurm \
/var/spool/slurmd \
/var/run/slurmd \
/var/run/slurmdbd \
/var/lib/slurmd \
/data \
&& touch /var/lib/slurmd/node_state \
/var/lib/slurmd/front_end_state \
/var/lib/slurmd/job_state \
/var/lib/slurmd/resv_state \
/var/lib/slurmd/trigger_state \
/var/lib/slurmd/assoc_mgr_state \
/var/lib/slurmd/assoc_usage \
/var/lib/slurmd/qos_usage \
/var/lib/slurmd/fed_mgr_state \
&& chown -R slurm:slurm /var/*/slurm* \
&& mkdir /run/munge \
&& chown munge:munge /run/munge \
&& chmod a+rwxt /run/munge
# && mungekey -c

COPY --chown=slurm:slurm --chmod=0600 etc_slurm/ /etc/slurm/


COPY entrypoint.sh /entrypoint
ENV IPP_DISABLE_JS=1
ENTRYPOINT ["/entrypoint"]

# the mounted directory
RUN mkdir /io
ENV PYTHONPATH=/io
WORKDIR "/io"

CMD [ "tail", "-f", "/var/log/slurm/slurmd.log" ]
5 changes: 5 additions & 0 deletions ci/slurm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Slurm cluster example for testing

adapted and simplified from https://github.com/giovtorres/slurm-docker-cluster/

License: MIT
81 changes: 30 additions & 51 deletions ci/slurm/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,84 +1,63 @@
version: "2.2"

services:
slurmctld:
mysql:
image: mariadb:10.11
hostname: mysql
container_name: mysql
environment:
MYSQL_RANDOM_ROOT_PASSWORD: "yes"
MYSQL_DATABASE: slurm_acct_db
MYSQL_USER: slurm
MYSQL_PASSWORD: password
volumes:
- var_lib_mysql:/var_lib/mysql

slurmdbd:
image: ipp-cluster:slurm
build: .
container_name: slurmctld
hostname: slurmctld
command:
- tail
- "-f"
- /var/log/slurm-llnl/slurmctld.log
- slurmdbd
container_name: slurmdbd
hostname: slurmdbd
volumes:
- etc_munge:/etc/munge
- etc_slurm:/etc/slurm
- slurm_jobdir:/data
- var_log_slurm:/var/log/slurm
- ../..:/io
expose:
- "6817"
networks:
common-network:
ipv4_address: 10.1.1.10
depends_on:
- mysql

c1:
slurmctld:
image: ipp-cluster:slurm
build: .
hostname: c1
command:
- tail
- "-f"
- /var/log/slurm-llnl/slurmd.log
container_name: c1

- slurmctld
container_name: slurmctld
hostname: slurmctld
volumes:
- etc_munge:/etc/munge
- etc_slurm:/etc/slurm
- slurm_jobdir:/data
- var_log_slurm:/var/log/slurm
- ../..:/io
expose:
- "6818"
depends_on:
- "slurmctld"
networks:
common-network:
ipv4_address: 10.1.1.11
- slurmdbd

c2:
compute:
image: ipp-cluster:slurm
build: .
command:
- tail
- "-f"
- /var/log/slurm-llnl/slurmd.log
hostname: c2
container_name: c2
- slurmd
deploy:
replicas: 2

volumes:
- etc_munge:/etc/munge
- etc_slurm:/etc/slurm
- slurm_jobdir:/data
- var_log_slurm:/var/log/slurm
- ../..:/io
expose:
- "6818"
depends_on:
- "slurmctld"
networks:
common-network:
ipv4_address: 10.1.1.12

volumes:
etc_munge:
etc_slurm:
# etc_slurm:
slurm_jobdir:
var_lib_mysql:
var_log_slurm:

networks:
common-network:
driver: bridge
ipam:
driver: default
config:
- subnet: 10.1.1.0/24
72 changes: 59 additions & 13 deletions ci/slurm/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,64 @@
#!/bin/bash
set -ex
# set permissions on munge dir, may be mounted
chown -R munge:munge /etc/munge

echo "starting munge"
service munge start

echo "hostname=$(hostname)"
if [[ "$(hostname)" == *"slurmctl"* ]]; then
echo "starting slurmctld"
service slurmctld start
else
echo "starting slurmd"
service slurmd start

if [ "$1" = "slurmdbd" ]
then
echo "---> Starting the MUNGE Authentication service (munged) ..."
gosu munge /usr/sbin/munged

echo "---> Starting the Slurm Database Daemon (slurmdbd) ..."

{
. /etc/slurm/slurmdbd.conf
until echo "SELECT 1" | mysql -h $StorageHost -u$StorageUser -p$StoragePass 2>&1 > /dev/null
do
echo "-- Waiting for database to become active ..."
sleep 2
done
}
echo "-- Database is now active ..."

exec gosu slurm /usr/sbin/slurmdbd -Dvvv
fi

if [ "$1" = "slurmctld" ]
then
echo "---> Starting the MUNGE Authentication service (munged) ..."
gosu munge /usr/sbin/munged

echo "---> Waiting for slurmdbd to become active before starting slurmctld ..."

until 2>/dev/null >/dev/tcp/slurmdbd/6819
do
echo "-- slurmdbd is not available. Sleeping ..."
sleep 2
done
echo "-- slurmdbd is now active ..."

echo "---> Starting the Slurm Controller Daemon (slurmctld) ..."
if /usr/sbin/slurmctld -V | grep -q '17.02' ; then
exec gosu slurm /usr/sbin/slurmctld -Dvvv
else
exec gosu slurm /usr/sbin/slurmctld -i -Dvvv
fi
fi

if [ "$1" = "slurmd" ]
then
echo "---> Starting the MUNGE Authentication service (munged) ..."
gosu munge /usr/sbin/munged

echo "---> Waiting for slurmctld to become active before starting slurmd..."

until 2>/dev/null >/dev/tcp/slurmctld/6817
do
echo "-- slurmctld is not available. Sleeping ..."
sleep 2
done
echo "-- slurmctld is now active ..."

echo "---> Starting the Slurm Node Daemon (slurmd) ..."
exec /usr/sbin/slurmd -Z --conf "CPUs=2 RealMemory=1000 Feature=compute" -Dvvv
fi

exec "$@"
1 change: 1 addition & 0 deletions ci/slurm/etc_slurm/cgroup.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CgroupPlugin=cgroup/v1
Loading