Skip to content

Commit 993c039

Browse files
authored
Merge 772d07a into 0e3d33c
2 parents 0e3d33c + 772d07a commit 993c039

File tree

3 files changed

+45
-7
lines changed

3 files changed

+45
-7
lines changed

.github/workflows/testpsijflux.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: PSI/J-Flux
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
packages: read
14+
15+
container:
16+
image: fluxrm/flux-sched:focal-v0.28.0
17+
options: "--platform=linux/amd64 --user root -it --init"
18+
19+
steps:
20+
- name: Make Space
21+
run: |
22+
rm -rf /usr/share/dotnet
23+
rm -rf /opt/ghc
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Setup Python
28+
run: |
29+
apt-get update && apt-get install -y python3-venv && apt-get install less
30+
export PATH=$PWD/bin:$PATH
31+
ln -s /usr/bin/python3 /usr/bin/python
32+
python -m pip install --upgrade pip && pip install -e ".[test]" && python -c 'import pydra; print(pydra.__version__)'
33+
pip install -e "git+https://github.com/ExaWorks/psij-python.git@main#egg=psij-python"
34+
- name: Run pytest
35+
run: |
36+
export PATH=$PWD/bin:$PATH
37+
flux start python -V
38+
flux start pytest --psij=flux --color=yes -vs --cov pydra --cov-config .coveragerc --cov-report xml:cov.xml --doctest-modules pydra/

pydra/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def pytest_addoption(parser):
1111
"--psij",
1212
action="store",
1313
help="run with psij subtype plugin",
14-
choices=["local", "slurm"],
14+
choices=["local", "slurm", "flux"],
1515
)
1616

1717

pydra/engine/workers.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ def __init__(self, subtype, **kwargs):
913913
self.psij = psij
914914

915915
# Check if the provided subtype is valid
916-
valid_subtypes = ["local", "slurm"]
916+
valid_subtypes = ["local", "slurm", "flux"]
917917
if subtype not in valid_subtypes:
918918
raise ValueError(
919919
f"Invalid 'subtype' provided. Available options: {', '.join(valid_subtypes)}"
@@ -992,7 +992,7 @@ async def exec_psij(self, runnable, rerun=False):
992992
with open(file_path, "wb") as file:
993993
pickle.dump(runnable._run, file)
994994
func_path = absolute_path / "run_pickled.py"
995-
spec = self.make_spec("python", [func_path, file_path])
995+
spec = self.make_spec("python", [str(func_path), str(file_path)])
996996
else: # it could be tuple that includes pickle files with tasks and inputs
997997
cache_dir = runnable[-1].cache_dir
998998
file_path_1 = cache_dir / "taskmain.pkl"
@@ -1006,9 +1006,9 @@ async def exec_psij(self, runnable, rerun=False):
10061006
spec = self.make_spec(
10071007
"python",
10081008
[
1009-
func_path,
1010-
file_path_1,
1011-
file_path_2,
1009+
str(func_path),
1010+
str(file_path_1),
1011+
str(file_path_2),
10121012
],
10131013
)
10141014

@@ -1044,6 +1044,6 @@ def close(self):
10441044
"sge": SGEWorker,
10451045
**{
10461046
"psij-" + subtype: lambda subtype=subtype: PsijWorker(subtype=subtype)
1047-
for subtype in ["local", "slurm"]
1047+
for subtype in ["local", "slurm", "flux"]
10481048
},
10491049
}

0 commit comments

Comments
 (0)