Skip to content

Commit a1d1fea

Browse files
author
Alan Christie
committed
refactor: Remove to/from project schema
1 parent 4fd2619 commit a1d1fea

9 files changed

+20
-64
lines changed

tests/workflow-definitions/example-smiles-to-file.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,3 @@ steps:
2020
- variable: smiles
2121
from-workflow:
2222
variable: smiles
23-
- variable: outputFile
24-
to-project:

tests/workflow-definitions/shortcut-example-1.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,3 @@ steps:
2424
from-step:
2525
name: example-1-step-1
2626
variable: outputFile
27-
- variable: outputFile
28-
to-project:

tests/workflow-definitions/simple-python-molprops-with-options.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,3 @@ steps:
4141
- variable: outputFile
4242
from-workflow:
4343
variable: clusteredMolecules
44-
- variable: outputFile
45-
to-project:

tests/workflow-definitions/simple-python-molprops.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,3 @@ steps:
3737
- variable: outputFile
3838
from-workflow:
3939
variable: clusteredMolecules
40-
- variable: outputFile
41-
to-project:

tests/workflow-definitions/simple-python-parallel.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,3 @@ steps:
6464
from:
6565
step: parallel-step-b
6666
variable: outputFile
67-
- variable: outputFile
68-
to-project:

tests/workflow-definitions/simple-python-split-combine.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ steps:
2020
- variable: inputFile
2121
from-workflow:
2222
variable: candidateMolecules
23-
- variable: inputFile
24-
from-project:
2523

2624
- name: parallel
2725
description: Add some params
@@ -58,5 +56,3 @@ steps:
5856
- variable: inputDirPrefix
5957
from-predefined:
6058
variable: instance-link-glob
61-
- variable: outputFile
62-
to-project:

workflow/workflow-schema.yaml

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -122,40 +122,6 @@ definitions:
122122
- variable
123123
- from-predefined
124124

125-
# A Step variable
126-
# (whose value (a file) is to be copied to the project directory)
127-
#
128-
# This will eventually be removed,
129-
# instead coming from 'ouput' variables in workflow 'variables' block.
130-
step-variable-to-project:
131-
type: object
132-
additionalProperties: false
133-
properties:
134-
variable:
135-
$ref: '#/definitions/variable-name'
136-
to-project:
137-
type: 'null'
138-
required:
139-
- variable
140-
- to-project
141-
142-
# A Step variable
143-
# (whose value (a file) is to be copied from project directory)
144-
#
145-
# This will eventually be removed,
146-
# instead coming from 'input' variables in workflow 'variables' block.
147-
step-variable-from-project:
148-
type: object
149-
additionalProperties: false
150-
properties:
151-
variable:
152-
$ref: '#/definitions/variable-name'
153-
from-project:
154-
type: 'null'
155-
required:
156-
- variable
157-
- from-project
158-
159125
# A step specification variable
160126
# (there must be at least one if a variables block is defined).
161127
# Typical variable syntax based on Python's definition of a variable
@@ -222,8 +188,6 @@ definitions:
222188
- $ref: "#/definitions/step-variable-from-step"
223189
- $ref: "#/definitions/step-variable-from-workflow"
224190
- $ref: "#/definitions/step-variable-from-predefined"
225-
- $ref: "#/definitions/step-variable-from-project"
226-
- $ref: "#/definitions/step-variable-to-project"
227191
minItems: 1
228192
required:
229193
- name

workflow/workflow_abc.py

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,17 @@ class LaunchParameters:
1919
project_id: str
2020
# A symbolic name of the Instance
2121
name: str
22-
# The user name of the person launching the Instance (Workflow step)
22+
# The user name of the person launching the Instance
2323
launching_user_name: str
2424
# The API Access token provided by the User
2525
launching_user_api_token: str
2626
# The specification, which can contain 'variables'
2727
specification: dict[str, Any]
28-
# An alternative way to pass variables to the specification.
29-
# If used it will replace any 'variables' already present in the specification.
28+
# The 'preferred' way to provide variables for the Job's specification.
29+
# If used it will replace any 'variables' already present in the specification
30+
# (values are no merged).
3031
variables: dict[str, Any] | None = None
31-
# A string. In DM v4 converted to a boolean and set in the
32+
# A string. In DM v4, if any value is set a corresponding boolean is set in the
3233
# instance Pod as a label. Setting this means the Instances
3334
# that are created will not be automatically removed by the Job operator.
3435
debug: str | None = None
@@ -39,19 +40,24 @@ class LaunchParameters:
3940
# Required if the Instance is part of a Workflow step.
4041
step_name: str | None = None
4142
# The step replication number.
42-
# If only one instance of the step is expected to run
43-
# this value can be left at 0 (zero). If this step's launch
44-
# is expected to be executed more than once the value should be
45-
# 1..'N'.
43+
# A numeric vale expected to be in the range 0 to total_number_of_replicas - 1.
44+
# If a step is laucnhed 5 times the values used when laucnhing each instance
45+
# must be 0, 1, 2, 3, and 4.
4646
step_replication_number: int = 0
4747
# The total number of replicas of this instance that are expected to be laucnhed.
4848
# This cannot be less than 1 and must be grater than any value of
49-
# 'step_replication_number' that will be used fo rthe same step.
49+
# 'step_replication_number' that will be used for the same step.
5050
total_number_of_replicas: int = 1
51-
# A set of dependent (prior step) instances that are expected to be hard-linked
52-
# into the instance directory the launcher will create. These are required
53-
# so that the step can access the dependent step's files.
54-
dependent_instances: set[str] | None = None
51+
# A set of dependent (prior step) instance directroies that are expected to be
52+
# hard-linked into the instance directory the launcher will create.
53+
# These are required so that the step can access the dependent step's files.
54+
# It is a set of instance UUIDs.
55+
step_dependent_instances: set[str] | None = None
56+
# A set of dependent project files that are expected to be hard-linked
57+
# into the instance directory the launcher will create.
58+
# These are required so that the step can access project files.
59+
# It is a set project-relative filenames (or directroies).
60+
step_project_inputs: set[str] | None = None
5561
# The application ID (a custom resource name)
5662
# used to identify the 'type' of Instance to create.
5763
# For DM Jobs this will be 'datamanagerjobs.squonk.it'

workflow/workflow_engine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ def _launch(
671671
step_name=step_name,
672672
step_replication_number=replica,
673673
total_number_of_replicas=total_replicas,
674-
dependent_instances=step_preparation_response.dependent_instances,
674+
step_dependent_instances=step_preparation_response.dependent_instances,
675675
)
676676
lr: LaunchResult = self._instance_launcher.launch(launch_parameters=lp)
677677
rwfs_id = lr.running_workflow_step_id

0 commit comments

Comments
 (0)