Skip to content

Commit b7b2395

Browse files
feat(workflow): support for workflow definition files (#3176)
1 parent a814af0 commit b7b2395

File tree

89 files changed

+5458
-653
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+5458
-653
lines changed

conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242

4343
GLOBAL_FIXTURE_LOCATIONS = [
4444
"tests.fixtures.common",
45+
"tests.fixtures.communication",
4546
"tests.fixtures.config",
4647
"tests.fixtures.domain_models",
4748
"tests.fixtures.repository",

docs/cheatsheet/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@
196196
("py:class", "OID_TYPE"),
197197
("py:class", "Path"),
198198
("py:class", "Persistent"),
199+
("py:class", "WorkflowFileCompositePlan"),
199200
("py:class", "optional"),
200201
("py:class", '"ValueResolver"'),
201202
("py:exc", "errors.ParameterError"),

docs/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,12 +363,15 @@
363363
("py:class", "OID_TYPE"),
364364
("py:class", "Path"),
365365
("py:class", "Persistent"),
366+
("py:class", "WorkflowFileCompositePlan"),
367+
("py:class", "itertools.count"),
366368
("py:class", "optional"),
367369
("py:class", '"ValueResolver"'),
368370
("py:exc", "errors.ParameterError"),
369371
]
370372

371373
nitpick_ignore_regex = [
374+
("py:class", r"bashlex.*"),
372375
("py:class", r"calamus.*"),
373376
("py:class", r"docker.*"),
374377
("py:class", r"marshmallow.*"),

docs/reference/core.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ Schema classes used to serialize domain models to JSON-LD.
7777
:members:
7878
:show-inheritance:
7979

80+
.. automodule:: renku.command.schema.workflow_file
81+
:members:
82+
:show-inheritance:
83+
8084

8185
Datasets
8286
--------
@@ -178,7 +182,11 @@ Workflows
178182
:members:
179183
:show-inheritance:
180184

181-
.. automodule:: renku.core.workflow.concrete_execution_graph
185+
.. automodule:: renku.core.workflow.model.concrete_execution_graph
186+
:members:
187+
:show-inheritance:
188+
189+
.. automodule:: renku.core.workflow.model.workflow_file
182190
:members:
183191
:show-inheritance:
184192

@@ -193,6 +201,10 @@ Workflows
193201
:members:
194202
:show-inheritance:
195203

204+
.. automodule:: renku.core.workflow.workflow_file
205+
:members:
206+
:show-inheritance:
207+
196208

197209
Sessions
198210
--------

docs/reference/models/workflow.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ parameter
4444
:members:
4545
:show-inheritance:
4646

47+
workflow\_file
48+
---------------------------------------------------
49+
50+
.. automodule:: renku.domain_model.workflow.workflow_file
51+
:members:
52+
:show-inheritance:
53+
4754

4855
Renku Workflow Conversion
4956
=========================

docs/spelling_wordlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ typesystem
263263
Ubuntu
264264
Unmount
265265
ui
266+
Unescape
266267
unhandled
267268
unicode
268269
unlink

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ apispec = { version = ">=4.0.0,<5.3.0", optional = true }
5555
apispec-webframeworks = { version = "<0.6,>=0.5.2", optional = true }
5656
appdirs = "<=1.4.4,>=1.4.3"
5757
attrs = ">=21.1.0,<22.2.0"
58+
bashlex = ">=0.16,<0.17"
5859
black = { version = "==22.6.0", optional = true }
5960
calamus = ">=0.3.13,<0.5"
6061
circus = { version = "==0.17.1", optional = true }
@@ -322,7 +323,7 @@ addopts = "--flake8 --black --doctest-glob=\"*.rst\" --doctest-modules --cov --c
322323
doctest_optionflags = "ALLOW_UNICODE"
323324
flake8-ignore = ["*.py", "E121", "E126", "E203", "E226", "E231", "W503", "W504", "docs/conf.py", "docs/cheatsheet/conf.py", "ALL"]
324325
flake8-max-line-length = 120
325-
testpaths = ["docs", "tests", "conftest.py"]
326+
testpaths = ["docs", "tests", "renku", "conftest.py"]
326327
markers = [
327328
"integration: mark a test as a integration.",
328329
"jobs: mark a test as a job test.",
@@ -353,6 +354,7 @@ module = [
353354
"apispec_webframeworks.*",
354355
"appdirs",
355356
"BTrees.*",
357+
"bashlex.*",
356358
"calamus.*",
357359
"deepdiff",
358360
"deepmerge",

renku/command/checks/activities.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ def check_migrated_activity_ids(fix, activity_gateway: IActivityGateway, **_):
4848
activity._p_oid = current_database.hash_id(activity.id)
4949
activity.freeze()
5050

51-
for attribute in itertools.chain(activity.usages, activity.generations, activity.parameters):
51+
for attribute in itertools.chain(
52+
activity.usages, activity.hidden_usages, activity.generations, activity.parameters
53+
):
5254
object.__setattr__(attribute, "id", f"/activities/{attribute.id}") # type: ignore
5355

5456
activity.association.id = f"/activities/{activity.association.id}"

renku/command/command_builder/command.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ def with_commit(
404404
raise_if_empty: bool = False,
405405
commit_only: Optional[Union[str, List[Union[str, Path]]]] = None,
406406
skip_staging: bool = False,
407+
skip_dirty_checks: bool = False,
407408
) -> "Command":
408409
"""Create a commit.
409410
@@ -413,10 +414,20 @@ def with_commit(
413414
raise_if_empty(bool, optional): Whether to raise an exception if there are no modified files
414415
(Default value = False).
415416
commit_only(bool, optional): Only commit the supplied paths (Default value = None).
417+
skip_staging(bool): Don't commit staged files.
418+
skip_dirty_checks(bool): Don't check if paths are dirty or staged.
416419
"""
417420
from renku.command.command_builder.repo import Commit
418421

419-
return Commit(self, message, commit_if_empty, raise_if_empty, commit_only, skip_staging)
422+
return Commit(
423+
self,
424+
message=message,
425+
commit_if_empty=commit_if_empty,
426+
raise_if_empty=raise_if_empty,
427+
commit_only=commit_only,
428+
skip_staging=skip_staging,
429+
skip_dirty_checks=skip_dirty_checks,
430+
)
420431

421432
@check_finalized
422433
def lock_project(self) -> "Command":

renku/command/command_builder/repo.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def __init__(
3939
raise_if_empty: Optional[bool] = False,
4040
commit_only: Optional[Union[str, List[Union[str, Path]]]] = None,
4141
skip_staging: bool = False,
42+
skip_dirty_checks: bool = False,
4243
) -> None:
4344
"""__init__ of Commit.
4445
@@ -47,13 +48,16 @@ def __init__(
4748
commit_if_empty (bool): Whether to commit if there are no modified files (Default value = None).
4849
raise_if_empty (bool): Whether to raise an exception if there are no modified files (Default value = None).
4950
commit_only (bool): Only commit the supplied paths (Default value = None).
51+
skip_staging(bool): Don't commit staged files.
52+
skip_dirty_checks(bool): Don't check if paths are dirty or staged.
5053
"""
5154
self._builder = builder
5255
self._message = message
5356
self._commit_if_empty = commit_if_empty
5457
self._raise_if_empty = raise_if_empty
5558
self._commit_filter_paths = commit_only
5659
self._skip_staging: bool = skip_staging
60+
self._skip_dirty_checks: bool = skip_dirty_checks
5761

5862
def _pre_hook(self, builder: Command, context: dict, *args, **kwargs) -> None:
5963
"""Hook to create a commit transaction.
@@ -71,6 +75,7 @@ def _pre_hook(self, builder: Command, context: dict, *args, **kwargs) -> None:
7175
repository=project_context.repository,
7276
commit_only=self._commit_filter_paths,
7377
skip_staging=self._skip_staging,
78+
skip_dirty_checks=self._skip_dirty_checks,
7479
)
7580

7681
def _post_hook(self, builder: Command, context: dict, result: CommandResult, *args, **kwargs):

0 commit comments

Comments
 (0)