Skip to content

Commit

Permalink
Merge 772d07a into 0e3d33c
Browse files Browse the repository at this point in the history
  • Loading branch information
adi611 authored Oct 21, 2023
2 parents 0e3d33c + 772d07a commit 993c039
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 7 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/testpsijflux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: PSI/J-Flux

on:
push:
branches:
- master
pull_request:

jobs:
test:
runs-on: ubuntu-latest
permissions:
packages: read

container:
image: fluxrm/flux-sched:focal-v0.28.0
options: "--platform=linux/amd64 --user root -it --init"

steps:
- name: Make Space
run: |
rm -rf /usr/share/dotnet
rm -rf /opt/ghc
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
run: |
apt-get update && apt-get install -y python3-venv && apt-get install less
export PATH=$PWD/bin:$PATH
ln -s /usr/bin/python3 /usr/bin/python
python -m pip install --upgrade pip && pip install -e ".[test]" && python -c 'import pydra; print(pydra.__version__)'
pip install -e "git+https://github.com/ExaWorks/psij-python.git@main#egg=psij-python"
- name: Run pytest
run: |
export PATH=$PWD/bin:$PATH
flux start python -V
flux start pytest --psij=flux --color=yes -vs --cov pydra --cov-config .coveragerc --cov-report xml:cov.xml --doctest-modules pydra/
2 changes: 1 addition & 1 deletion pydra/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def pytest_addoption(parser):
"--psij",
action="store",
help="run with psij subtype plugin",
choices=["local", "slurm"],
choices=["local", "slurm", "flux"],
)


Expand Down
12 changes: 6 additions & 6 deletions pydra/engine/workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,7 @@ def __init__(self, subtype, **kwargs):
self.psij = psij

# Check if the provided subtype is valid
valid_subtypes = ["local", "slurm"]
valid_subtypes = ["local", "slurm", "flux"]

Check warning on line 916 in pydra/engine/workers.py

View check run for this annotation

Codecov / codecov/patch

pydra/engine/workers.py#L916

Added line #L916 was not covered by tests
if subtype not in valid_subtypes:
raise ValueError(
f"Invalid 'subtype' provided. Available options: {', '.join(valid_subtypes)}"
Expand Down Expand Up @@ -992,7 +992,7 @@ async def exec_psij(self, runnable, rerun=False):
with open(file_path, "wb") as file:
pickle.dump(runnable._run, file)
func_path = absolute_path / "run_pickled.py"
spec = self.make_spec("python", [func_path, file_path])
spec = self.make_spec("python", [str(func_path), str(file_path)])

Check warning on line 995 in pydra/engine/workers.py

View check run for this annotation

Codecov / codecov/patch

pydra/engine/workers.py#L995

Added line #L995 was not covered by tests
else: # it could be tuple that includes pickle files with tasks and inputs
cache_dir = runnable[-1].cache_dir
file_path_1 = cache_dir / "taskmain.pkl"
Expand All @@ -1006,9 +1006,9 @@ async def exec_psij(self, runnable, rerun=False):
spec = self.make_spec(
"python",
[
func_path,
file_path_1,
file_path_2,
str(func_path),
str(file_path_1),
str(file_path_2),
],
)

Expand Down Expand Up @@ -1044,6 +1044,6 @@ def close(self):
"sge": SGEWorker,
**{
"psij-" + subtype: lambda subtype=subtype: PsijWorker(subtype=subtype)
for subtype in ["local", "slurm"]
for subtype in ["local", "slurm", "flux"]
},
}

0 comments on commit 993c039

Please sign in to comment.