Skip to content
Draft
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
6 changes: 2 additions & 4 deletions examples/mpi/streamflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ workflows:
bindings:
- step: /compile
target:
deployment: k8s-mpi
deployment: helm-mpi
service: openmpi
- step: /execute
target:
deployment: k8s-mpi
deployment: helm-mpi
locations: 2
service: openmpi
deployments:
Expand All @@ -28,7 +28,6 @@ deployments:
type: helm
config:
chart: environment/helm/openmpi
kubeconfig: ~/.kube/config-streamflow
releaseName: openmpi-rel
workdir: /tmp
k8s-mpi:
Expand All @@ -37,5 +36,4 @@ deployments:
files:
- environment/k8s/secrets.yaml
- environment/k8s/deployment.yaml
kubeconfig: ~/.kube/config-streamflow
workdir: /tmp
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ dependencies = [
"referencing==0.37.0",
"rdflib==7.5.0",
"typing-extensions==4.15.0",
"uvloop==0.22.1",
"yattag==1.16.1"
]
version = "0.2.0.dev14"
Expand Down
20 changes: 14 additions & 6 deletions streamflow/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
import asyncio
import logging
import os
import platform
import sys
import uuid
from collections.abc import MutableMapping, Sequence
from pathlib import Path
from typing import TYPE_CHECKING, Any

import uvloop

from streamflow import report
from streamflow.config.config import WorkflowConfig
from streamflow.config.schema import SfSchema
Expand Down Expand Up @@ -253,17 +256,22 @@ def build_context(config: MutableMapping[str, Any]) -> StreamFlowContext:
def main(args: Sequence[str]) -> int:
try:
parsed_args = parser.parse_args(args)
if sys.platform != "win32" and platform.python_implementation() == "CPython":
logger.info("CPython detected: using uvloop EventLoop implementation")
engine = uvloop
else:
engine = asyncio
match parsed_args.context:
case "ext":
asyncio.run(_async_ext(parsed_args))
engine.run(_async_ext(parsed_args))
case "list":
asyncio.run(_async_list(parsed_args))
engine.run(_async_list(parsed_args))
case "plugin":
asyncio.run(_async_plugin(parsed_args))
engine.run(_async_plugin(parsed_args))
case "prov":
asyncio.run(_async_prov(parsed_args))
engine.run(_async_prov(parsed_args))
case "report":
asyncio.run(_async_report(parsed_args))
engine.run(_async_report(parsed_args))
case "run":
if parsed_args.quiet:
logger.setLevel(logging.WARNING)
Expand All @@ -279,7 +287,7 @@ def main(args: Sequence[str]) -> int:
logger.handlers = []
logger.addHandler(colored_stream_handler)
logger.addFilter(HighlitingFilter())
asyncio.run(_async_run(parsed_args))
engine.run(_async_run(parsed_args))
case "schema":
load_extensions()
print(SfSchema().dump(parsed_args.version, parsed_args.pretty))
Expand Down
46 changes: 46 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading