Skip to content
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Fix NodeJS retrieval when Docker is unavailable ([#1054](https://github.com/alpha-unito/streamflow/pull/1054)
- Fix bind mount inspection in `SingularityConnector` ([#1058](https://github.com/alpha-unito/streamflow/pull/1058))
- Fix `--wait` flag in `Helm4Connector` for Cobra parser ([#1050](https://github.com/alpha-unito/streamflow/pull/1050))
- Fix shell reuse collision across execution locations ([#1045](https://github.com/alpha-unito/streamflow/pull/1045))
Expand Down
11 changes: 11 additions & 0 deletions streamflow/cwl/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
from collections.abc import MutableMapping, MutableSequence
from enum import Enum
from pathlib import PurePath
from shutil import which
from types import ModuleType
from typing import Any, cast

import cwl_utils.expression
import cwl_utils.parser
import cwl_utils.parser.utils
import cwl_utils.types
from cachebox import FIFOCache, cached
from cwl_utils.parser.cwl_v1_2_utils import CONTENT_LIMIT
from typing_extensions import Self, TypeIs

Expand Down Expand Up @@ -113,6 +115,14 @@ async def _create_remote_directory(
)


@cached(cache=FIFOCache(1))
def _get_container_engine() -> str:
for engine in ("docker", "singularity", "podman", "udocker"):
if which(engine) is not None:
return engine
return "docker"


async def _get_contents(
path: StreamFlowPath,
size: int,
Expand Down Expand Up @@ -740,6 +750,7 @@ def eval_expression(
fullJS=full_js,
strip_whitespace=strip_whitespace,
timeout=timeout,
container_engine=_get_container_engine(),
)
if is_expression(expression)
else expression
Expand Down