Skip to content

Commit 52e1ebe

Browse files
committed
support (rootless) podman container engine
1 parent 4ccbdde commit 52e1ebe

File tree

5 files changed

+18
-3
lines changed

5 files changed

+18
-3
lines changed

.github/workflows/ci-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ jobs:
123123
strategy:
124124
matrix:
125125
cwl-version: [v1.0, v1.1, v1.2]
126-
container: [docker, singularity]
126+
container: [docker, singularity, podman]
127127

128128
steps:
129129
- uses: actions/checkout@v2

conformance-test.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ if [ ! -d "${repo}-${spec_branch}" ]; then
4444
fi
4545

4646
if [ "${container}" == "docker" ]; then
47-
docker pull node:slim
47+
docker pull docker.io/node:slim
48+
fi
49+
50+
if [ "${container}" == "podman" ]; then
51+
podman pull docker.io/node:slim
4852
fi
4953

5054
venv cwltool-venv3
@@ -109,6 +113,8 @@ if [[ "$container" = "singularity" ]]; then
109113
# See issue #1440
110114
exclusions+=(stdin_shorcut)
111115
fi
116+
elif [[ "$container" = "podman" ]]; then
117+
EXTRA+=" --podman"
112118
fi
113119

114120
if [ -n "$EXTRA" ]

cwltool/argparser.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,12 @@ def arg_parser() -> argparse.ArgumentParser:
435435
"version v3.18+ or with overlayfs support "
436436
"backported.",
437437
)
438+
dockergroup.add_argument(
439+
"--podman",
440+
action="store_true",
441+
default=False,
442+
help="[experimental] Use " "Podman runtime for running containers. ",
443+
)
438444
dockergroup.add_argument(
439445
"--no-container",
440446
action="store_false",

cwltool/context.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ def __init__(self, kwargs: Optional[Dict[str, Any]] = None) -> None:
110110
self.streaming_allowed: bool = False
111111

112112
self.singularity = False # type: bool
113+
self.podman = False # type: bool
113114
self.debug = False # type: bool
114115
self.compute_checksum = True # type: bool
115116
self.name = "" # type: str

cwltool/docker.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Enables Docker software containers via the {u,}docker runtimes."""
1+
"""Enables Docker software containers via the {u,}docker or podman runtimes."""
22

33
import csv
44
import datetime
@@ -339,6 +339,8 @@ def create_runtime(
339339
# without this
340340
else:
341341
runtime = [user_space_docker_cmd, "run"]
342+
elif runtimeContext.podman:
343+
runtime = ["podman", "run", "-i", "--userns=keep-id"]
342344
else:
343345
runtime = ["docker", "run", "-i"]
344346
self.append_volume(

0 commit comments

Comments
 (0)