simpleflow 0.33.3__tar.gz → 0.34.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {simpleflow-0.33.3 → simpleflow-0.34.1}/PKG-INFO +3 -28
- {simpleflow-0.33.3 → simpleflow-0.34.1}/pyproject.toml +44 -33
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/__init__.py +1 -1
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/command.py +245 -48
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/dispatch/dynamic_dispatcher.py +3 -3
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/history.py +126 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/local/executor.py +5 -6
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/metrology.py +23 -31
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/process/_supervisor.py +2 -2
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/signal.py +1 -1
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/executor.py +20 -17
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/helpers.py +26 -5
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/core.py +23 -13
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/models/base.py +8 -10
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/models/event/base.py +2 -1
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/models/event/factory.py +10 -55
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/models/event/workflow.py +34 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/models/workflow.py +42 -34
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/querysets/activity.py +1 -1
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/querysets/workflow.py +26 -8
- simpleflow-0.34.1/simpleflow/swf/process/decider/helpers.py +111 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/process/worker/base.py +4 -4
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/stats/pretty.py +7 -3
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/task.py +1 -2
- simpleflow-0.33.3/simpleflow/swf/process/decider/helpers.py +0 -154
- {simpleflow-0.33.3 → simpleflow-0.34.1}/.gitignore +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/LICENSE +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/README.md +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/__main__.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/_decorators.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/activity.py +2 -2
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/base.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/boto3_utils.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/canvas.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/constants.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/dispatch/__init__.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/dispatch/by_module.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/dispatch/dry_run.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/dispatch/exceptions.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/dispatch/from_task_registry.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/download.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/exceptions.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/execute.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/executor.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/format.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/futures.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/job/__init__.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/local/__init__.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/log.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/logging_context.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/marker.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/process/__init__.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/process/_named_mixin.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/registry.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/runtime/__init__.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/settings/__init__.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/settings/base.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/settings/default.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/step/__init__.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/step/constants.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/step/submittable.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/step/tasks.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/step/utils.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/step/workflow.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/storage.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/__init__.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/constants.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/__init__.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/actors/__init__.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/actors/core.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/actors/decider.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/actors/worker.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/constants.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/exceptions.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/models/__init__.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/models/activity.py +9 -9
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/models/decision/__init__.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/models/decision/base.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/models/decision/marker.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/models/decision/task.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/models/decision/timer.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/models/decision/workflow.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/models/domain.py +2 -2
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/models/event/__init__.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/models/event/compiler.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/models/event/marker.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/models/event/task.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/models/event/timer.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/models/history/__init__.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/models/history/base.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/models/history/builder.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/querysets/__init__.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/querysets/base.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/querysets/domain.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/querysets/history.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/responses/__init__.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/responses/_base.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/settings.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/mapper/utils.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/process/__init__.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/process/decider/__init__.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/process/decider/base.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/process/decider/command.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/process/poller.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/process/worker/__init__.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/process/worker/command.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/stats/__init__.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/stats/base.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/task.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/swf/utils.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/utils/__init__.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/utils/_dict.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/utils/_json.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/utils/retry.py +0 -0
- {simpleflow-0.33.3 → simpleflow-0.34.1}/simpleflow/workflow.py +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: simpleflow
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.34.1
|
|
4
4
|
Summary: Python library for dataflow programming with Amazon SWF
|
|
5
5
|
Project-URL: documentation, https://botify-labs.github.io/simpleflow
|
|
6
6
|
Project-URL: repository, https://github.com/botify-labs/simpleflow
|
|
7
7
|
Project-URL: changelog, https://github.com/botify-labs/simpleflow/blob/main/CHANGELOG.md
|
|
8
8
|
Author: Greg Leclercq
|
|
9
9
|
Maintainer-email: tech@botify.com
|
|
10
|
-
License: MIT
|
|
10
|
+
License-Expression: MIT
|
|
11
11
|
License-File: LICENSE
|
|
12
12
|
Keywords: amazon swf,simple workflow,simpleflow
|
|
13
13
|
Classifier: Development Status :: 4 - Beta
|
|
@@ -37,31 +37,6 @@ Requires-Dist: psutil
|
|
|
37
37
|
Requires-Dist: pytz
|
|
38
38
|
Requires-Dist: setproctitle
|
|
39
39
|
Requires-Dist: tabulate<1.0.0,>=0.8.2
|
|
40
|
-
Provides-Extra: dev
|
|
41
|
-
Requires-Dist: boto3-stubs[s3,swf]; extra == 'dev'
|
|
42
|
-
Requires-Dist: cffi==v1.17.0rc1; python_full_version == '3.13.0b4' and extra == 'dev'
|
|
43
|
-
Requires-Dist: flaky; extra == 'dev'
|
|
44
|
-
Requires-Dist: hatch==1.7.0; extra == 'dev'
|
|
45
|
-
Requires-Dist: invoke; extra == 'dev'
|
|
46
|
-
Requires-Dist: moto<5.0.0,>=4.2.8; extra == 'dev'
|
|
47
|
-
Requires-Dist: packaging; extra == 'dev'
|
|
48
|
-
Requires-Dist: pre-commit; extra == 'dev'
|
|
49
|
-
Requires-Dist: pytest; extra == 'dev'
|
|
50
|
-
Requires-Dist: pytest-xdist>=3.2.0; extra == 'dev'
|
|
51
|
-
Requires-Dist: ruff; extra == 'dev'
|
|
52
|
-
Requires-Dist: setuptools<72; extra == 'dev'
|
|
53
|
-
Requires-Dist: sphinx; extra == 'dev'
|
|
54
|
-
Requires-Dist: sphinx-rtd-theme; extra == 'dev'
|
|
55
|
-
Requires-Dist: sure; extra == 'dev'
|
|
56
|
-
Requires-Dist: twine; extra == 'dev'
|
|
57
|
-
Requires-Dist: typing-extensions; extra == 'dev'
|
|
58
|
-
Requires-Dist: vcrpy; extra == 'dev'
|
|
59
|
-
Provides-Extra: doc
|
|
60
|
-
Requires-Dist: markdown-include; extra == 'doc'
|
|
61
|
-
Requires-Dist: mkdocs; extra == 'doc'
|
|
62
|
-
Requires-Dist: mkdocs-material; extra == 'doc'
|
|
63
|
-
Requires-Dist: pygments; extra == 'doc'
|
|
64
|
-
Requires-Dist: pymdown-extensions; extra == 'doc'
|
|
65
40
|
Description-Content-Type: text/markdown
|
|
66
41
|
|
|
67
42
|
Simpleflow
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["hatchling
|
|
2
|
+
requires = ["hatchling"]
|
|
3
3
|
build-backend = "hatchling.build"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
@@ -7,7 +7,7 @@ name = "simpleflow"
|
|
|
7
7
|
description = "Python library for dataflow programming with Amazon SWF"
|
|
8
8
|
readme = "README.md"
|
|
9
9
|
requires-python = ">=3.7"
|
|
10
|
-
license =
|
|
10
|
+
license = "MIT"
|
|
11
11
|
authors = [
|
|
12
12
|
{ name = "Greg Leclercq" },
|
|
13
13
|
]
|
|
@@ -48,36 +48,6 @@ dependencies = [
|
|
|
48
48
|
"pytz",
|
|
49
49
|
]
|
|
50
50
|
|
|
51
|
-
[project.optional-dependencies]
|
|
52
|
-
dev = [
|
|
53
|
-
"boto3-stubs[s3,swf]",
|
|
54
|
-
"cffi==v1.17.0rc1; python_full_version=='3.13.0b4'", # via cryptography via moto, secretstorage
|
|
55
|
-
"flaky",
|
|
56
|
-
"hatch==1.7.0",
|
|
57
|
-
"invoke",
|
|
58
|
-
"moto>=4.2.8,<5.0.0",
|
|
59
|
-
"packaging",
|
|
60
|
-
"pre-commit",
|
|
61
|
-
"pytest",
|
|
62
|
-
"pytest-xdist>=3.2.0",
|
|
63
|
-
"ruff",
|
|
64
|
-
"setuptools<72", # See https://github.com/pypa/setuptools/issues/4519
|
|
65
|
-
"sphinx",
|
|
66
|
-
"sphinx_rtd_theme",
|
|
67
|
-
"sure",
|
|
68
|
-
"typing-extensions",
|
|
69
|
-
"vcrpy",
|
|
70
|
-
"twine",
|
|
71
|
-
]
|
|
72
|
-
|
|
73
|
-
doc = [
|
|
74
|
-
"mkdocs",
|
|
75
|
-
"mkdocs-material",
|
|
76
|
-
"pygments",
|
|
77
|
-
"pymdown-extensions",
|
|
78
|
-
"markdown-include",
|
|
79
|
-
]
|
|
80
|
-
|
|
81
51
|
[project.urls]
|
|
82
52
|
documentation = "https://botify-labs.github.io/simpleflow"
|
|
83
53
|
repository = "https://github.com/botify-labs/simpleflow"
|
|
@@ -97,10 +67,11 @@ extend-select = [
|
|
|
97
67
|
"W", # pycodestyle warnings
|
|
98
68
|
"RUF", # ruff
|
|
99
69
|
]
|
|
100
|
-
fixable = ["ALL"]
|
|
101
70
|
allowed-confusables = ["‘", "’"]
|
|
102
71
|
extend-ignore = [
|
|
103
72
|
]
|
|
73
|
+
ignore = ["E501"]
|
|
74
|
+
|
|
104
75
|
[tool.ruff.lint.isort]
|
|
105
76
|
required-imports = ["from __future__ import annotations"]
|
|
106
77
|
|
|
@@ -117,3 +88,43 @@ path = "simpleflow/__init__.py"
|
|
|
117
88
|
[tool.hatch.build]
|
|
118
89
|
include = ["/simpleflow"]
|
|
119
90
|
exclude = ["*~"]
|
|
91
|
+
|
|
92
|
+
[dependency-groups]
|
|
93
|
+
dev = [
|
|
94
|
+
"boto3-stubs[s3,swf]",
|
|
95
|
+
"cffi==v1.17.0rc1; python_full_version=='3.13.0b4'", # via cryptography via moto, secretstorage
|
|
96
|
+
"flaky",
|
|
97
|
+
"hatch",
|
|
98
|
+
"invoke",
|
|
99
|
+
"moto>=4.2.8,<5.0.0",
|
|
100
|
+
"packaging",
|
|
101
|
+
"pre-commit",
|
|
102
|
+
"pytest",
|
|
103
|
+
"pytest-xdist>=3.2.0",
|
|
104
|
+
"ruff",
|
|
105
|
+
"setuptools<72", # See https://github.com/pypa/setuptools/issues/4519
|
|
106
|
+
"sphinx",
|
|
107
|
+
"sphinx_rtd_theme",
|
|
108
|
+
"sure",
|
|
109
|
+
"typing-extensions",
|
|
110
|
+
"vcrpy",
|
|
111
|
+
"twine",
|
|
112
|
+
]
|
|
113
|
+
|
|
114
|
+
doc = [
|
|
115
|
+
"mkdocs",
|
|
116
|
+
"mkdocs-material",
|
|
117
|
+
"pygments",
|
|
118
|
+
"pymdown-extensions",
|
|
119
|
+
"markdown-include",
|
|
120
|
+
]
|
|
121
|
+
|
|
122
|
+
[[tool.uv.index]]
|
|
123
|
+
name = "pypi"
|
|
124
|
+
url = "https://pypi.org/simple/"
|
|
125
|
+
publish-url = "https://pypi.org/legacy/"
|
|
126
|
+
|
|
127
|
+
[[tool.uv.index]]
|
|
128
|
+
name = "testpypi"
|
|
129
|
+
url = "https://test.pypi.org/simple/"
|
|
130
|
+
publish-url = "https://test.pypi.org/legacy/"
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import json
|
|
3
4
|
import os
|
|
4
5
|
import platform
|
|
5
6
|
import signal
|
|
6
7
|
import sys
|
|
7
8
|
import time
|
|
8
9
|
from contextlib import contextmanager
|
|
10
|
+
from datetime import datetime
|
|
9
11
|
from typing import TYPE_CHECKING
|
|
12
|
+
from urllib.parse import unquote
|
|
10
13
|
from uuid import uuid4
|
|
11
14
|
|
|
12
15
|
import click
|
|
@@ -24,7 +27,7 @@ from simpleflow.swf.process import decider, worker
|
|
|
24
27
|
from simpleflow.swf.stats import pretty
|
|
25
28
|
from simpleflow.swf.task import ActivityTask
|
|
26
29
|
from simpleflow.swf.utils import get_workflow_execution, set_workflow_class_name
|
|
27
|
-
from simpleflow.utils import import_from_module, json_dumps
|
|
30
|
+
from simpleflow.utils import import_from_module, json_dumps, serialize_complex_object
|
|
28
31
|
from simpleflow.workflow import Workflow
|
|
29
32
|
|
|
30
33
|
if TYPE_CHECKING:
|
|
@@ -32,16 +35,39 @@ if TYPE_CHECKING:
|
|
|
32
35
|
|
|
33
36
|
from simpleflow.swf.mapper.models.workflow import WorkflowType
|
|
34
37
|
|
|
38
|
+
TIMESTAMP_FORMATS = [
|
|
39
|
+
"%Y-%m-%d",
|
|
40
|
+
"%Y-%m-%dT%H:%M:%S%z",
|
|
41
|
+
"%Y-%m-%d %H:%M:%S%z",
|
|
42
|
+
"%Y-%m-%dT%H:%M:%S",
|
|
43
|
+
"%Y-%m-%d %H:%M:%S",
|
|
44
|
+
]
|
|
35
45
|
|
|
36
|
-
|
|
46
|
+
|
|
47
|
+
def comma_separated_list(value: str) -> list[str]:
|
|
37
48
|
"""
|
|
38
49
|
Transforms a comma-separated list into a list of strings.
|
|
39
50
|
"""
|
|
40
51
|
return value.split(",")
|
|
41
52
|
|
|
42
53
|
|
|
43
|
-
|
|
44
|
-
|
|
54
|
+
class RunIdParamType(click.ParamType):
|
|
55
|
+
name = "str"
|
|
56
|
+
|
|
57
|
+
def convert(self, value: Any, param: click.Parameter | None, ctx: click.Context | None) -> str:
|
|
58
|
+
if "%" not in value:
|
|
59
|
+
return value
|
|
60
|
+
return unquote(value)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
RUN_ID = RunIdParamType()
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
CONTEXT_SETTINGS = dict(help_option_names=["--help", "-h"])
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
@click.group(context_settings=CONTEXT_SETTINGS)
|
|
70
|
+
@click.option("--format", envvar="SIMPLEFLOW_FORMAT")
|
|
45
71
|
@click.option("--header/--no-header", default=False)
|
|
46
72
|
@click.option(
|
|
47
73
|
"--color",
|
|
@@ -50,9 +76,11 @@ def comma_separated_list(value):
|
|
|
50
76
|
)
|
|
51
77
|
@click.version_option(version=__version__)
|
|
52
78
|
@click.pass_context
|
|
53
|
-
def cli(ctx, header, format, color):
|
|
54
|
-
|
|
55
|
-
|
|
79
|
+
def cli(ctx, header: bool, format: str, color: str) -> None:
|
|
80
|
+
if format == "prettyjson":
|
|
81
|
+
format, header = "json", True
|
|
82
|
+
ctx.params["format"] = format
|
|
83
|
+
ctx.params["header"] = header
|
|
56
84
|
log.color_mode = color
|
|
57
85
|
|
|
58
86
|
|
|
@@ -145,18 +173,18 @@ def run_workflow_locally(workflow_class, wf_input, middlewares):
|
|
|
145
173
|
@click.argument("workflow")
|
|
146
174
|
@cli.command("workflow.start", help="Start the workflow defined in the WORKFLOW module.")
|
|
147
175
|
def start_workflow(
|
|
148
|
-
workflow,
|
|
149
|
-
domain,
|
|
150
|
-
workflow_id,
|
|
151
|
-
task_list,
|
|
152
|
-
execution_timeout,
|
|
153
|
-
tags,
|
|
154
|
-
decision_tasks_timeout,
|
|
155
|
-
input,
|
|
156
|
-
input_file,
|
|
157
|
-
local,
|
|
158
|
-
middleware_pre_execution,
|
|
159
|
-
middleware_post_execution,
|
|
176
|
+
workflow: str,
|
|
177
|
+
domain: str | None,
|
|
178
|
+
workflow_id: str | None,
|
|
179
|
+
task_list: str | None,
|
|
180
|
+
execution_timeout: str | None,
|
|
181
|
+
tags: str | None,
|
|
182
|
+
decision_tasks_timeout: str | None,
|
|
183
|
+
input: str | None,
|
|
184
|
+
input_file: str | None,
|
|
185
|
+
local: bool,
|
|
186
|
+
middleware_pre_execution: str | None,
|
|
187
|
+
middleware_post_execution: str | None,
|
|
160
188
|
):
|
|
161
189
|
workflow_class = import_from_module(workflow)
|
|
162
190
|
|
|
@@ -192,7 +220,7 @@ def start_workflow(
|
|
|
192
220
|
return execution
|
|
193
221
|
|
|
194
222
|
|
|
195
|
-
@click.argument("run_id", required=False)
|
|
223
|
+
@click.argument("run_id", type=RUN_ID, required=False)
|
|
196
224
|
@click.argument("workflow_id")
|
|
197
225
|
@click.argument(
|
|
198
226
|
"domain",
|
|
@@ -202,12 +230,19 @@ def start_workflow(
|
|
|
202
230
|
"workflow.terminate",
|
|
203
231
|
help="Workflow associated with WORKFLOW and optionally RUN_ID.",
|
|
204
232
|
)
|
|
205
|
-
def terminate_workflow(
|
|
233
|
+
def terminate_workflow(
|
|
234
|
+
domain: str,
|
|
235
|
+
workflow_id: str,
|
|
236
|
+
run_id: str | None,
|
|
237
|
+
):
|
|
206
238
|
ex = helpers.get_workflow_execution(domain, workflow_id, run_id)
|
|
239
|
+
if not ex:
|
|
240
|
+
print(f"Execution {workflow_id} {run_id} not found" if run_id else f"Workflow {workflow_id} not found")
|
|
241
|
+
sys.exit(1)
|
|
207
242
|
ex.terminate()
|
|
208
243
|
|
|
209
244
|
|
|
210
|
-
@click.argument("run_id", required=False)
|
|
245
|
+
@click.argument("run_id", type=RUN_ID, required=False)
|
|
211
246
|
@click.argument("workflow_id")
|
|
212
247
|
@click.argument(
|
|
213
248
|
"domain",
|
|
@@ -217,8 +252,11 @@ def terminate_workflow(domain, workflow_id, run_id):
|
|
|
217
252
|
"workflow.restart",
|
|
218
253
|
help="Workflow associated with WORKFLOW_ID and optionally RUN_ID.",
|
|
219
254
|
)
|
|
220
|
-
def restart_workflow(domain, workflow_id, run_id):
|
|
255
|
+
def restart_workflow(domain: str, workflow_id: str, run_id: str | None):
|
|
221
256
|
ex = helpers.get_workflow_execution(domain, workflow_id, run_id)
|
|
257
|
+
if not ex:
|
|
258
|
+
print(f"Execution {workflow_id} {run_id} not found" if run_id else f"Workflow {workflow_id} not found")
|
|
259
|
+
sys.exit(1)
|
|
222
260
|
history = ex.history()
|
|
223
261
|
ex.terminate(reason="workflow.restart")
|
|
224
262
|
new_ex = ex.workflow_type.start_execution(
|
|
@@ -239,7 +277,7 @@ def with_format(ctx):
|
|
|
239
277
|
)
|
|
240
278
|
|
|
241
279
|
|
|
242
|
-
@click.argument("run_id", required=False)
|
|
280
|
+
@click.argument("run_id", type=RUN_ID, required=False)
|
|
243
281
|
@click.argument("workflow_id")
|
|
244
282
|
@click.argument(
|
|
245
283
|
"domain",
|
|
@@ -247,7 +285,7 @@ def with_format(ctx):
|
|
|
247
285
|
)
|
|
248
286
|
@cli.command("workflow.info", help="Info about a workflow execution.")
|
|
249
287
|
@click.pass_context
|
|
250
|
-
def workflow_info(ctx, domain, workflow_id, run_id):
|
|
288
|
+
def workflow_info(ctx, domain: str, workflow_id: str, run_id: str | None):
|
|
251
289
|
print(
|
|
252
290
|
with_format(ctx)(helpers.show_workflow_info)(
|
|
253
291
|
domain,
|
|
@@ -264,7 +302,7 @@ def workflow_info(ctx, domain, workflow_id, run_id):
|
|
|
264
302
|
type=int,
|
|
265
303
|
help="Maximum number of tasks to display.",
|
|
266
304
|
)
|
|
267
|
-
@click.argument("run_id", required=False)
|
|
305
|
+
@click.argument("run_id", type=RUN_ID, required=False)
|
|
268
306
|
@click.argument("workflow_id")
|
|
269
307
|
@click.argument(
|
|
270
308
|
"domain",
|
|
@@ -283,6 +321,7 @@ def profile(ctx, domain, workflow_id, run_id, nb_tasks):
|
|
|
283
321
|
)
|
|
284
322
|
|
|
285
323
|
|
|
324
|
+
# FIXME superseded by history
|
|
286
325
|
@click.option(
|
|
287
326
|
"--nb-tasks",
|
|
288
327
|
"-n",
|
|
@@ -290,7 +329,7 @@ def profile(ctx, domain, workflow_id, run_id, nb_tasks):
|
|
|
290
329
|
type=int,
|
|
291
330
|
help="Maximum number of tasks to display.",
|
|
292
331
|
)
|
|
293
|
-
@click.argument("run_id", required=False)
|
|
332
|
+
@click.argument("run_id", type=RUN_ID, required=False)
|
|
294
333
|
@click.argument("workflow_id")
|
|
295
334
|
@click.argument(
|
|
296
335
|
"domain",
|
|
@@ -298,7 +337,13 @@ def profile(ctx, domain, workflow_id, run_id, nb_tasks):
|
|
|
298
337
|
)
|
|
299
338
|
@cli.command("workflow.tasks", help="Tasks of a workflow execution.")
|
|
300
339
|
@click.pass_context
|
|
301
|
-
def
|
|
340
|
+
def workflow_tasks(
|
|
341
|
+
ctx,
|
|
342
|
+
domain: str,
|
|
343
|
+
workflow_id: str,
|
|
344
|
+
run_id: str | None,
|
|
345
|
+
nb_tasks: int | None,
|
|
346
|
+
) -> None:
|
|
302
347
|
print(
|
|
303
348
|
with_format(ctx)(helpers.show_workflow_status)(
|
|
304
349
|
domain,
|
|
@@ -309,6 +354,7 @@ def status(ctx, domain, workflow_id, run_id, nb_tasks):
|
|
|
309
354
|
)
|
|
310
355
|
|
|
311
356
|
|
|
357
|
+
# FIXME superseded by filter
|
|
312
358
|
@click.argument(
|
|
313
359
|
"domain",
|
|
314
360
|
envvar="SWF_DOMAIN",
|
|
@@ -324,7 +370,7 @@ def status(ctx, domain, workflow_id, run_id, nb_tasks):
|
|
|
324
370
|
)
|
|
325
371
|
@click.option("--started-since", "-d", default=30, show_default=True, help="Started since N days.")
|
|
326
372
|
@click.pass_context
|
|
327
|
-
def list_workflows(ctx, domain, status, started_since):
|
|
373
|
+
def list_workflows(ctx, domain: str, status: str, started_since: int):
|
|
328
374
|
print(
|
|
329
375
|
with_format(ctx)(helpers.list_workflow_executions)(
|
|
330
376
|
domain, status=status.upper(), start_oldest_date=started_since
|
|
@@ -332,6 +378,86 @@ def list_workflows(ctx, domain, status, started_since):
|
|
|
332
378
|
)
|
|
333
379
|
|
|
334
380
|
|
|
381
|
+
_NOTSET = object()
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
@cli.command(
|
|
385
|
+
"workflow.history",
|
|
386
|
+
help="Workflow history from workflow WORKFLOW_ID [RUN_ID].",
|
|
387
|
+
)
|
|
388
|
+
@click.argument("workflow_id")
|
|
389
|
+
@click.argument("run_id", type=RUN_ID, required=False)
|
|
390
|
+
@click.option(
|
|
391
|
+
"--domain",
|
|
392
|
+
envvar="SWF_DOMAIN",
|
|
393
|
+
)
|
|
394
|
+
@click.option(
|
|
395
|
+
"--output-format",
|
|
396
|
+
"--of",
|
|
397
|
+
"-o",
|
|
398
|
+
required=False,
|
|
399
|
+
type=click.Choice(["events", "raw", "cooked"]),
|
|
400
|
+
default="raw",
|
|
401
|
+
help="Output format.",
|
|
402
|
+
)
|
|
403
|
+
@click.option("--reverse-order", required=False, type=bool, default=False, help="Reverse order.")
|
|
404
|
+
@click.pass_context
|
|
405
|
+
def workflow_history(
|
|
406
|
+
ctx,
|
|
407
|
+
domain: str,
|
|
408
|
+
workflow_id: str,
|
|
409
|
+
run_id: str | None,
|
|
410
|
+
output_format: str,
|
|
411
|
+
reverse_order: bool = False,
|
|
412
|
+
) -> None:
|
|
413
|
+
if ctx.parent.params["format"] != "json" or not ctx.parent.params["header"]:
|
|
414
|
+
raise NotImplementedError("Only pretty JSON mode is implemented")
|
|
415
|
+
|
|
416
|
+
from simpleflow.swf.mapper.models.history.base import History as BaseHistory
|
|
417
|
+
|
|
418
|
+
ex = helpers.get_workflow_execution(domain, workflow_id, run_id)
|
|
419
|
+
if not ex:
|
|
420
|
+
print(f"Execution {workflow_id} {run_id} not found" if run_id else f"Workflow {workflow_id} not found")
|
|
421
|
+
sys.exit(1)
|
|
422
|
+
events = ex.history_events(
|
|
423
|
+
callback=get_progression_callback("events"),
|
|
424
|
+
reverse_order=reverse_order,
|
|
425
|
+
)
|
|
426
|
+
if output_format == "events":
|
|
427
|
+
pass
|
|
428
|
+
else:
|
|
429
|
+
raw_history = BaseHistory.from_event_list(events)
|
|
430
|
+
history = History(raw_history)
|
|
431
|
+
if output_format == "raw":
|
|
432
|
+
events = []
|
|
433
|
+
for event in history.events[:10]:
|
|
434
|
+
e = {}
|
|
435
|
+
for k in ["id", "type", "state", "timestamp", "input", "control", *event.__dict__]:
|
|
436
|
+
if k.startswith("_") or k == "raw":
|
|
437
|
+
continue
|
|
438
|
+
v = getattr(event, k, _NOTSET)
|
|
439
|
+
if v is _NOTSET:
|
|
440
|
+
continue
|
|
441
|
+
e[k] = v
|
|
442
|
+
events.append(e)
|
|
443
|
+
elif output_format == "cooked":
|
|
444
|
+
history.parse()
|
|
445
|
+
events = {
|
|
446
|
+
"workflow": history.workflow,
|
|
447
|
+
"activities": history.activities,
|
|
448
|
+
"child_workflows": history.child_workflows,
|
|
449
|
+
"markers": history.markers,
|
|
450
|
+
"timers": history.timers,
|
|
451
|
+
"signals": history.signals,
|
|
452
|
+
"signal_lists": history.signal_lists,
|
|
453
|
+
"external_workflows_signaling": history.external_workflows_signaling,
|
|
454
|
+
"signaled_workflows": history.signaled_workflows,
|
|
455
|
+
}
|
|
456
|
+
else:
|
|
457
|
+
raise NotImplementedError
|
|
458
|
+
print(json.dumps(events, separators=(",", ":"), default=serialize_complex_object))
|
|
459
|
+
|
|
460
|
+
|
|
335
461
|
@click.argument(
|
|
336
462
|
"domain",
|
|
337
463
|
envvar="SWF_DOMAIN",
|
|
@@ -345,28 +471,59 @@ def list_workflows(ctx, domain, status, started_since):
|
|
|
345
471
|
type=click.Choice(["open", "closed"]),
|
|
346
472
|
help="Open/Closed",
|
|
347
473
|
)
|
|
348
|
-
@click.option("--tag", default=None, help="
|
|
474
|
+
@click.option("--tag", default=None, help="Tags (comma-separated).") # , multiple=True
|
|
349
475
|
@click.option("--workflow-id", default=None, help="Workflow ID.")
|
|
350
476
|
@click.option("--workflow-type-name", default=None, help="Workflow Name.")
|
|
351
477
|
@click.option("--workflow-type-version", default=None, help="Workflow Version (name needed).")
|
|
478
|
+
@click.option(
|
|
479
|
+
"--close-status",
|
|
480
|
+
"-c",
|
|
481
|
+
type=click.Choice(
|
|
482
|
+
[
|
|
483
|
+
case
|
|
484
|
+
for state in ["COMPLETED", "FAILED", "CANCELED", "TERMINATED", "CONTINUED_AS_NEW", "TIMED_OUT"]
|
|
485
|
+
for case in [state, state.lower()]
|
|
486
|
+
]
|
|
487
|
+
),
|
|
488
|
+
help="Started since N days.",
|
|
489
|
+
)
|
|
352
490
|
@click.option("--started-since", "-d", default=30, show_default=True, help="Started since N days.")
|
|
491
|
+
@click.option("--from-date", default=None, type=click.DateTime(formats=TIMESTAMP_FORMATS), help="From datetime.")
|
|
492
|
+
@click.option("--to-date", default=None, type=click.DateTime(formats=TIMESTAMP_FORMATS), help="To datetime.")
|
|
353
493
|
@click.pass_context
|
|
354
494
|
def filter_workflows(
|
|
355
495
|
ctx,
|
|
356
|
-
domain,
|
|
357
|
-
status,
|
|
358
|
-
tag,
|
|
359
|
-
workflow_id,
|
|
360
|
-
workflow_type_name,
|
|
361
|
-
workflow_type_version,
|
|
362
|
-
|
|
496
|
+
domain: str,
|
|
497
|
+
status: str,
|
|
498
|
+
tag: str | None,
|
|
499
|
+
workflow_id: str | None,
|
|
500
|
+
workflow_type_name: str | None,
|
|
501
|
+
workflow_type_version: str | None,
|
|
502
|
+
close_status: str | None,
|
|
503
|
+
started_since: int | None,
|
|
504
|
+
from_date: datetime | None,
|
|
505
|
+
to_date: datetime | None,
|
|
363
506
|
):
|
|
364
507
|
status = status.upper()
|
|
365
|
-
kwargs = {}
|
|
508
|
+
kwargs: dict[str, Any] = {}
|
|
366
509
|
if status == simpleflow.swf.mapper.models.workflow.WorkflowExecution.STATUS_OPEN:
|
|
367
|
-
|
|
510
|
+
if from_date:
|
|
511
|
+
kwargs["oldest_date"] = from_date
|
|
512
|
+
kwargs["latest_date"] = to_date
|
|
513
|
+
else:
|
|
514
|
+
kwargs["oldest_date"] = started_since
|
|
368
515
|
else:
|
|
369
|
-
|
|
516
|
+
if from_date:
|
|
517
|
+
kwargs["start_oldest_date"] = from_date
|
|
518
|
+
kwargs["start_latest_date"] = to_date
|
|
519
|
+
else:
|
|
520
|
+
kwargs["start_oldest_date"] = started_since
|
|
521
|
+
|
|
522
|
+
if close_status and status != simpleflow.swf.mapper.models.workflow.WorkflowExecution.STATUS_CLOSED:
|
|
523
|
+
raise Exception("Closed status not supported for non-closed workflows.")
|
|
524
|
+
elif close_status:
|
|
525
|
+
kwargs["close_status"] = close_status.upper()
|
|
526
|
+
|
|
370
527
|
print(
|
|
371
528
|
with_format(ctx)(helpers.filter_workflow_executions)(
|
|
372
529
|
domain,
|
|
@@ -375,11 +532,35 @@ def filter_workflows(
|
|
|
375
532
|
workflow_id=workflow_id,
|
|
376
533
|
workflow_type_name=workflow_type_name,
|
|
377
534
|
workflow_type_version=workflow_type_version,
|
|
535
|
+
callback=get_progression_callback("executionInfos"),
|
|
378
536
|
**kwargs,
|
|
379
537
|
)
|
|
380
538
|
)
|
|
381
539
|
|
|
382
540
|
|
|
541
|
+
def get_progression_callback(key: str):
|
|
542
|
+
if os.isatty(sys.stderr.fileno()):
|
|
543
|
+
spin_marks = ["⠏", "⠛", "⠹", "⠼", "⠶", "⠧"] # from Google's googlecloudsdk.core
|
|
544
|
+
success = f"{log.GREEN}✓{log.END}" if log.color_mode != log.ColorModes.NEVER else "✓"
|
|
545
|
+
|
|
546
|
+
class Counter:
|
|
547
|
+
def __init__(self):
|
|
548
|
+
self.total = 0
|
|
549
|
+
|
|
550
|
+
counter = Counter()
|
|
551
|
+
|
|
552
|
+
def cb(*_args, loop_number: int, response: dict[str, Any] | None, **_kwargs):
|
|
553
|
+
if response:
|
|
554
|
+
executions = len(response.get(key, []))
|
|
555
|
+
print(f"\r{spin_marks[loop_number % len(spin_marks)]} {counter.total}", file=sys.stderr, end="")
|
|
556
|
+
counter.total += executions
|
|
557
|
+
else:
|
|
558
|
+
print(f"\r{success} {counter.total}", file=sys.stderr)
|
|
559
|
+
else:
|
|
560
|
+
cb = None
|
|
561
|
+
return cb
|
|
562
|
+
|
|
563
|
+
|
|
383
564
|
@click.argument("task_id")
|
|
384
565
|
@click.argument("workflow_id")
|
|
385
566
|
@click.argument(
|
|
@@ -387,9 +568,15 @@ def filter_workflows(
|
|
|
387
568
|
envvar="SWF_DOMAIN",
|
|
388
569
|
)
|
|
389
570
|
@click.option("--details/--no-details", default=False, help="Display details.")
|
|
390
|
-
@cli.command("task.info", help="
|
|
571
|
+
@cli.command("task.info", help="Information on a task.")
|
|
391
572
|
@click.pass_context
|
|
392
|
-
def task_info(
|
|
573
|
+
def task_info(
|
|
574
|
+
ctx,
|
|
575
|
+
domain: str,
|
|
576
|
+
workflow_id: str,
|
|
577
|
+
task_id: str,
|
|
578
|
+
details: bool,
|
|
579
|
+
) -> None:
|
|
393
580
|
print(with_format(ctx)(helpers.get_task)(domain, workflow_id, task_id, details))
|
|
394
581
|
|
|
395
582
|
|
|
@@ -399,7 +586,13 @@ def task_info(ctx, domain, workflow_id, task_id, details):
|
|
|
399
586
|
@click.option("--domain", "-d", envvar="SWF_DOMAIN", required=True, help="SWF Domain")
|
|
400
587
|
@click.argument("workflows", nargs=-1, required=False)
|
|
401
588
|
@cli.command("decider.start", help="Start a decider process to manage workflow executions.")
|
|
402
|
-
def start_decider(
|
|
589
|
+
def start_decider(
|
|
590
|
+
workflows: list[str],
|
|
591
|
+
domain: str,
|
|
592
|
+
task_list: str,
|
|
593
|
+
log_level: str,
|
|
594
|
+
nb_processes: int,
|
|
595
|
+
) -> None:
|
|
403
596
|
if log_level:
|
|
404
597
|
logger.warning("Deprecated: --log-level will be removed, use LOG_LEVEL environment variable instead")
|
|
405
598
|
decider.command.start(
|
|
@@ -576,7 +769,7 @@ def standalone(
|
|
|
576
769
|
# get the previous execution history, it will serve as "default history"
|
|
577
770
|
# for activities that succeeded in the previous execution
|
|
578
771
|
logger.info(
|
|
579
|
-
f"retrieving history of previous execution: domain={domain}
|
|
772
|
+
f"retrieving history of previous execution: domain={domain} workflow_id={repair} run_id={repair_run_id}"
|
|
580
773
|
)
|
|
581
774
|
workflow_execution = get_workflow_execution(domain, repair, run_id=repair_run_id)
|
|
582
775
|
previous_history = History(workflow_execution.history())
|
|
@@ -662,6 +855,11 @@ def standalone(
|
|
|
662
855
|
ex.workflow_id,
|
|
663
856
|
ex.run_id,
|
|
664
857
|
)
|
|
858
|
+
if not ex:
|
|
859
|
+
print(
|
|
860
|
+
f"Execution {workflow_id} {ex.run_id} not found" if ex.run_id else f"Workflow {workflow_id} not found"
|
|
861
|
+
)
|
|
862
|
+
sys.exit(1)
|
|
665
863
|
if display_status:
|
|
666
864
|
print(f"status: {ex.status}", file=sys.stderr)
|
|
667
865
|
if ex.status == ex.STATUS_CLOSED:
|
|
@@ -677,7 +875,7 @@ def standalone(
|
|
|
677
875
|
@click.option("--domain", envvar="SWF_DOMAIN", required=False, help="Amazon SWF Domain.")
|
|
678
876
|
@click.option("--workflow-id", required=True, help="ID of the workflow execution.")
|
|
679
877
|
@click.option("--input", "-i", required=False, help="JSON input of the workflow.")
|
|
680
|
-
@click.option("--run-id", required=False, help="Run ID of the workflow execution.")
|
|
878
|
+
@click.option("--run-id", type=RUN_ID, required=False, help="Run ID of the workflow execution.")
|
|
681
879
|
@click.option(
|
|
682
880
|
"--scheduled-id",
|
|
683
881
|
required=False,
|
|
@@ -727,7 +925,7 @@ def activity_rerun(domain, workflow_id, run_id, input, scheduled_id, activity_id
|
|
|
727
925
|
for line in json_dumps(params, pretty=True).split("\n"):
|
|
728
926
|
logger.debug(line)
|
|
729
927
|
if input_override:
|
|
730
|
-
logger.info("NB: input will be
|
|
928
|
+
logger.info("NB: input will be overridden with the passed one!")
|
|
731
929
|
logger.info(f"Will re-run: {task}(*{args}, **{kwargs}) [+meta={meta}]")
|
|
732
930
|
|
|
733
931
|
# download binaries if needed
|
|
@@ -749,8 +947,7 @@ def activity_rerun(domain, workflow_id, run_id, input, scheduled_id, activity_id
|
|
|
749
947
|
)
|
|
750
948
|
@cli.command(
|
|
751
949
|
"info",
|
|
752
|
-
help="Display versions, settings, and environment variables. "
|
|
753
|
-
"Available sections: versions, settings, environment.",
|
|
950
|
+
help="Display versions, settings, and environment variables. Available sections: versions, settings, environment.",
|
|
754
951
|
)
|
|
755
952
|
def info(sections):
|
|
756
953
|
@contextmanager
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from simpleflow.activity import Activity
|
|
4
|
-
from simpleflow.utils import import_object_from_module
|
|
4
|
+
from simpleflow.utils import format_exc, import_object_from_module
|
|
5
5
|
|
|
6
6
|
from .exceptions import DispatchError
|
|
7
7
|
|
|
@@ -25,9 +25,9 @@ class Dispatcher:
|
|
|
25
25
|
module_name, activity_name = name.rsplit(".", 1)
|
|
26
26
|
try:
|
|
27
27
|
activity = import_object_from_module(module_name, activity_name)
|
|
28
|
-
except ImportError:
|
|
28
|
+
except ImportError as e:
|
|
29
29
|
# We were not able to import a function at all.
|
|
30
|
-
raise DispatchError(f"unable to import '{name}'")
|
|
30
|
+
raise DispatchError(f"unable to import '{name}': {format_exc(e)}")
|
|
31
31
|
if not isinstance(activity, Activity):
|
|
32
32
|
# We managed to import a function (or callable) but it's not an
|
|
33
33
|
# "Activity". We will transform it into an Activity now. That way
|