workflow.core 1.7.0__tar.gz → 1.8.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.
- {workflow_core-1.7.0 → workflow_core-1.8.1}/PKG-INFO +1 -1
- {workflow_core-1.7.0 → workflow_core-1.8.1}/pyproject.toml +1 -1
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/daemons/transfer.py +17 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/definitions/config.py +7 -1
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/definitions/work.py +6 -7
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/lifecycle/execute.py +6 -1
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/utils/validate.py +1 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/workspaces/chimefrb.yml +11 -5
- {workflow_core-1.7.0 → workflow_core-1.8.1}/README.md +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/__init__.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/cli/__init__.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/cli/buckets.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/cli/configs.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/cli/main.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/cli/pipelines.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/cli/results.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/cli/run.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/cli/schedules.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/cli/workspace.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/daemons/__init__.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/daemons/audit.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/definitions/__init__.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/definitions/jsonschema.md +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/definitions/notify.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/definitions/workspace.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/examples/function.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/examples/sample.svg +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/examples/sample.workflow.yml +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/exceptions.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/helpers/__init__.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/helpers/date.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/http/__init__.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/http/buckets.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/http/client.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/http/configs.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/http/context.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/http/pipelines.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/http/results.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/http/schedules.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/lifecycle/__init__.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/lifecycle/archive/__init__.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/lifecycle/archive/http.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/lifecycle/archive/posix.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/lifecycle/archive/s3.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/lifecycle/attempt.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/lifecycle/configure.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/utils/__init__.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/utils/decorators.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/utils/logger.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/utils/prompt.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/utils/read.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/utils/renderers.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/utils/tmate.sh +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/utils/variables.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/utils/write.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/workspaces/__init__.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/workspaces/development.yml +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.1}/workflow/workspaces/site-dev.yml +0 -0
|
@@ -109,6 +109,22 @@ def transfer(
|
|
|
109
109
|
time.sleep(sleep)
|
|
110
110
|
|
|
111
111
|
|
|
112
|
+
def check(payload: List[Dict[str, Any]]) -> List[Dict[str, Any]]:
|
|
113
|
+
"""Check payload for existing work in results backend.
|
|
114
|
+
|
|
115
|
+
Args:
|
|
116
|
+
payload (List[Dict[str, Any]]): list of work to check.
|
|
117
|
+
|
|
118
|
+
Returns:
|
|
119
|
+
List[Dict[str, Any]]: list of work that does not exist in results.
|
|
120
|
+
"""
|
|
121
|
+
for data in payload:
|
|
122
|
+
for key in ["products", "plots", "logs"]:
|
|
123
|
+
if data["config"]["archive"][key] == "pass":
|
|
124
|
+
data["config"]["archive"][key] = "bypass"
|
|
125
|
+
return payload
|
|
126
|
+
|
|
127
|
+
|
|
112
128
|
def perform(
|
|
113
129
|
archive: bool,
|
|
114
130
|
limit: int,
|
|
@@ -190,6 +206,7 @@ def perform(
|
|
|
190
206
|
payload = http.buckets.view(
|
|
191
207
|
query={"id": {"$in": transfer}}, projection={}, skip=0, limit=limit * 3
|
|
192
208
|
)
|
|
209
|
+
payload = check(payload)
|
|
193
210
|
try:
|
|
194
211
|
logger.debug(f"tx {len(payload)} works to results")
|
|
195
212
|
response = http.results.deposit(payload)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Work Object Configuration."""
|
|
2
2
|
|
|
3
|
-
from typing import List, Optional
|
|
3
|
+
from typing import List, Literal, Optional
|
|
4
4
|
|
|
5
5
|
from pydantic import Field, field_validator
|
|
6
6
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
@@ -122,3 +122,9 @@ class Config(BaseSettings):
|
|
|
122
122
|
""",
|
|
123
123
|
examples=[["developers", "admins"]],
|
|
124
124
|
)
|
|
125
|
+
strategy: Literal["strict", "relaxed"] = Field(
|
|
126
|
+
default="strict",
|
|
127
|
+
description="Validation strategy for the work.",
|
|
128
|
+
examples=["strict"],
|
|
129
|
+
exclude=True,
|
|
130
|
+
)
|
|
@@ -360,13 +360,12 @@ class Work(BaseSettings):
|
|
|
360
360
|
Work: The current work object.
|
|
361
361
|
"""
|
|
362
362
|
# Validate if the site provided is allowed in the workspace.
|
|
363
|
-
config
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
f"site
|
|
368
|
-
|
|
369
|
-
raise ValueError(error)
|
|
363
|
+
if self.config.strategy == "strict":
|
|
364
|
+
config: Dict[str, Any] = read.workspace(self.workspace)
|
|
365
|
+
sites: List[str] = config.get("sites", [])
|
|
366
|
+
if self.site not in sites:
|
|
367
|
+
error = f"site {self.site} not in workspace: {sites}."
|
|
368
|
+
raise ValueError(error)
|
|
370
369
|
return self
|
|
371
370
|
|
|
372
371
|
###########################################################################
|
|
@@ -95,11 +95,16 @@ def command(work: Work) -> Work:
|
|
|
95
95
|
try:
|
|
96
96
|
assert isinstance(work.command, list), "missing command to execute"
|
|
97
97
|
validate.command(work.command[0])
|
|
98
|
+
to_run: Union[str, List[str]] = work.command
|
|
99
|
+
if len(to_run) == 1:
|
|
100
|
+
to_run = to_run[0]
|
|
101
|
+
is_shell = isinstance(to_run, str)
|
|
98
102
|
process = subprocess.run(
|
|
99
|
-
|
|
103
|
+
to_run,
|
|
100
104
|
stdout=subprocess.PIPE,
|
|
101
105
|
stderr=subprocess.PIPE,
|
|
102
106
|
timeout=work.timeout,
|
|
107
|
+
shell=is_shell, # nosec
|
|
103
108
|
)
|
|
104
109
|
# Check return code
|
|
105
110
|
process.check_returncode()
|
|
@@ -13,12 +13,18 @@ sites:
|
|
|
13
13
|
|
|
14
14
|
http:
|
|
15
15
|
baseurls:
|
|
16
|
-
buckets:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
buckets:
|
|
17
|
+
- http://frb-vsop.chime:8004
|
|
18
|
+
- https://frb.chimenet.ca/buckets
|
|
19
|
+
results:
|
|
20
|
+
- http://frb-vsop.chime:8005
|
|
21
|
+
- https://frb.chimenet.ca/results
|
|
22
|
+
pipelines:
|
|
23
|
+
- http://frb-vsop.chime:8007
|
|
24
|
+
- https://frb.chimenet.ca/pipelines
|
|
25
|
+
loki: https://frb.chimenet.ca/loki/loki/api/v1/push
|
|
20
26
|
# This is the prefix url to make a output data plot or product accessible to the user
|
|
21
|
-
products:
|
|
27
|
+
products: https://frb.chimenet.ca/frb-master/v1/events/query-file?filename=
|
|
22
28
|
|
|
23
29
|
archive:
|
|
24
30
|
posix:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|