streamflow-postgresql 0.0.8__tar.gz → 0.0.10__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.
- streamflow_postgresql-0.0.10/MANIFEST.in +2 -0
- {streamflow_postgresql-0.0.8 → streamflow_postgresql-0.0.10}/PKG-INFO +7 -19
- {streamflow_postgresql-0.0.8 → streamflow_postgresql-0.0.10}/pyproject.toml +31 -12
- {streamflow_postgresql-0.0.8 → streamflow_postgresql-0.0.10}/streamflow/plugins/unito/postgresql/database.py +123 -47
- {streamflow_postgresql-0.0.8 → streamflow_postgresql-0.0.10}/streamflow/plugins/unito/postgresql/schemas/postgresql.sql +20 -9
- streamflow_postgresql-0.0.10/streamflow/plugins/unito/postgresql/version.py +3 -0
- {streamflow_postgresql-0.0.8 → streamflow_postgresql-0.0.10}/streamflow_postgresql.egg-info/PKG-INFO +7 -19
- {streamflow_postgresql-0.0.8 → streamflow_postgresql-0.0.10}/streamflow_postgresql.egg-info/SOURCES.txt +0 -4
- streamflow_postgresql-0.0.10/streamflow_postgresql.egg-info/requires.txt +2 -0
- streamflow_postgresql-0.0.10/tests/test_cwl_persistence.py +811 -0
- {streamflow_postgresql-0.0.8 → streamflow_postgresql-0.0.10}/tests/test_persistence.py +160 -121
- streamflow_postgresql-0.0.8/MANIFEST.in +0 -6
- streamflow_postgresql-0.0.8/bandit-requirements.txt +0 -1
- streamflow_postgresql-0.0.8/lint-requirements.txt +0 -5
- streamflow_postgresql-0.0.8/requirements.txt +0 -2
- streamflow_postgresql-0.0.8/streamflow/plugins/unito/postgresql/version.py +0 -1
- streamflow_postgresql-0.0.8/streamflow_postgresql.egg-info/requires.txt +0 -18
- streamflow_postgresql-0.0.8/test-requirements.txt +0 -4
- streamflow_postgresql-0.0.8/tests/test_cwl_persistence.py +0 -796
- {streamflow_postgresql-0.0.8 → streamflow_postgresql-0.0.10}/LICENSE +0 -0
- {streamflow_postgresql-0.0.8 → streamflow_postgresql-0.0.10}/README.md +0 -0
- {streamflow_postgresql-0.0.8 → streamflow_postgresql-0.0.10}/setup.cfg +0 -0
- {streamflow_postgresql-0.0.8 → streamflow_postgresql-0.0.10}/streamflow/plugins/unito/postgresql/__init__.py +0 -0
- {streamflow_postgresql-0.0.8 → streamflow_postgresql-0.0.10}/streamflow/plugins/unito/postgresql/plugin.py +0 -0
- {streamflow_postgresql-0.0.8 → streamflow_postgresql-0.0.10}/streamflow/plugins/unito/postgresql/schemas/postgresql.json +0 -0
- {streamflow_postgresql-0.0.8 → streamflow_postgresql-0.0.10}/streamflow_postgresql.egg-info/dependency_links.txt +0 -0
- {streamflow_postgresql-0.0.8 → streamflow_postgresql-0.0.10}/streamflow_postgresql.egg-info/entry_points.txt +0 -0
- {streamflow_postgresql-0.0.8 → streamflow_postgresql-0.0.10}/streamflow_postgresql.egg-info/top_level.txt +0 -0
- {streamflow_postgresql-0.0.8 → streamflow_postgresql-0.0.10}/streamflow_postgresql.egg-info/zip-safe +0 -0
- {streamflow_postgresql-0.0.8 → streamflow_postgresql-0.0.10}/tests/test_database.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: streamflow-postgresql
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.10
|
|
4
4
|
Summary: StreamFlow PostgreSQL plugin
|
|
5
5
|
Author-email: Iacopo Colonnelli <iacopo.colonnelli@unito.it>
|
|
6
6
|
License: LGPL-3.0-or-later
|
|
@@ -14,31 +14,19 @@ Classifier: Operating System :: POSIX
|
|
|
14
14
|
Classifier: Operating System :: MacOS
|
|
15
15
|
Classifier: Programming Language :: Python
|
|
16
16
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
18
17
|
Classifier: Programming Language :: Python :: 3.10
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.11
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.12
|
|
21
20
|
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
22
|
Classifier: Topic :: Scientific/Engineering
|
|
23
23
|
Classifier: Topic :: System :: Distributed Computing
|
|
24
|
-
Requires-Python: >=3.
|
|
24
|
+
Requires-Python: >=3.10
|
|
25
25
|
Description-Content-Type: text/markdown
|
|
26
26
|
License-File: LICENSE
|
|
27
|
-
Requires-Dist: asyncpg==0.
|
|
28
|
-
Requires-Dist: streamflow==0.2.0.
|
|
29
|
-
|
|
30
|
-
Requires-Dist: bandit==1.8.3; extra == "bandit"
|
|
31
|
-
Provides-Extra: lint
|
|
32
|
-
Requires-Dist: black==25.1.0; extra == "lint"
|
|
33
|
-
Requires-Dist: codespell==2.4.1; extra == "lint"
|
|
34
|
-
Requires-Dist: flake8-bugbear==24.12.12; extra == "lint"
|
|
35
|
-
Requires-Dist: isort==6.0.1; extra == "lint"
|
|
36
|
-
Requires-Dist: pyupgrade==3.19.1; extra == "lint"
|
|
37
|
-
Provides-Extra: test
|
|
38
|
-
Requires-Dist: pytest==8.3.4; extra == "test"
|
|
39
|
-
Requires-Dist: pytest-asyncio==0.25.3; extra == "test"
|
|
40
|
-
Requires-Dist: pytest-cov==6.0.0; extra == "test"
|
|
41
|
-
Requires-Dist: pytest-xdist==3.6.1; extra == "test"
|
|
27
|
+
Requires-Dist: asyncpg==0.31.0
|
|
28
|
+
Requires-Dist: streamflow==0.2.0.dev14
|
|
29
|
+
Dynamic: license-file
|
|
42
30
|
|
|
43
31
|
# PostgreSQL Plugin for StreamFlow
|
|
44
32
|
|
|
@@ -9,7 +9,7 @@ authors = [
|
|
|
9
9
|
]
|
|
10
10
|
description = "StreamFlow PostgreSQL plugin"
|
|
11
11
|
readme = "README.md"
|
|
12
|
-
requires-python = ">=3.
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
13
|
license = {text = "LGPL-3.0-or-later"}
|
|
14
14
|
classifiers = [
|
|
15
15
|
"Development Status :: 3 - Alpha",
|
|
@@ -20,15 +20,19 @@ classifiers = [
|
|
|
20
20
|
"Operating System :: MacOS",
|
|
21
21
|
"Programming Language :: Python",
|
|
22
22
|
"Programming Language :: Python :: 3 :: Only",
|
|
23
|
-
"Programming Language :: Python :: 3.9",
|
|
24
23
|
"Programming Language :: Python :: 3.10",
|
|
25
24
|
"Programming Language :: Python :: 3.11",
|
|
26
25
|
"Programming Language :: Python :: 3.12",
|
|
27
26
|
"Programming Language :: Python :: 3.13",
|
|
27
|
+
"Programming Language :: Python :: 3.14",
|
|
28
28
|
"Topic :: Scientific/Engineering",
|
|
29
29
|
"Topic :: System :: Distributed Computing",
|
|
30
30
|
]
|
|
31
|
-
|
|
31
|
+
dependencies = [
|
|
32
|
+
"asyncpg==0.31.0",
|
|
33
|
+
"streamflow==0.2.0.dev14"
|
|
34
|
+
]
|
|
35
|
+
version = "0.0.10"
|
|
32
36
|
|
|
33
37
|
[project.urls]
|
|
34
38
|
Package = "https://pypi.org/project/streamflow-postgresql"
|
|
@@ -37,6 +41,30 @@ Repository = "https://github.com/alpha-unito/streamflow-postgresql"
|
|
|
37
41
|
[project.entry-points]
|
|
38
42
|
"unito.streamflow.plugin" = {"unito.postgresql" = "streamflow.plugins.unito.postgresql.plugin:PostgreSQLStreamFlowPlugin"}
|
|
39
43
|
|
|
44
|
+
[dependency-groups]
|
|
45
|
+
dev = [
|
|
46
|
+
{include-group = "bandit"},
|
|
47
|
+
{include-group = "lint"},
|
|
48
|
+
{include-group = "test"}
|
|
49
|
+
]
|
|
50
|
+
bandit = [
|
|
51
|
+
"bandit==1.9.3"
|
|
52
|
+
]
|
|
53
|
+
lint = [
|
|
54
|
+
"black==26.1.0",
|
|
55
|
+
"codespell==2.4.1",
|
|
56
|
+
"flake8-bugbear==25.11.29",
|
|
57
|
+
"isort==7.0.0",
|
|
58
|
+
"pyupgrade==3.21.2"
|
|
59
|
+
]
|
|
60
|
+
test = [
|
|
61
|
+
"cwltest==2.6.20251216093331",
|
|
62
|
+
"pytest==9.0.2",
|
|
63
|
+
"pytest-asyncio==1.3.0",
|
|
64
|
+
"pytest-cov==7.0.0",
|
|
65
|
+
"pytest-xdist==3.8.0"
|
|
66
|
+
]
|
|
67
|
+
|
|
40
68
|
[tool.setuptools]
|
|
41
69
|
packages = [
|
|
42
70
|
"streamflow.plugins.unito.postgresql"
|
|
@@ -46,14 +74,5 @@ zip-safe = true
|
|
|
46
74
|
[tool.setuptools.package-data]
|
|
47
75
|
"streamflow.plugins.unito.postgresql" = ["schemas/*.json", "schemas/*.sql"]
|
|
48
76
|
|
|
49
|
-
[tool.setuptools.dynamic]
|
|
50
|
-
dependencies = {file = "requirements.txt"}
|
|
51
|
-
version = {attr = "streamflow.plugins.unito.postgresql.version.VERSION"}
|
|
52
|
-
|
|
53
|
-
[tool.setuptools.dynamic.optional-dependencies]
|
|
54
|
-
bandit = {file = "bandit-requirements.txt"}
|
|
55
|
-
lint = {file = "lint-requirements.txt"}
|
|
56
|
-
test = {file = "test-requirements.txt"}
|
|
57
|
-
|
|
58
77
|
[tool.isort]
|
|
59
78
|
profile = "black"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import hashlib
|
|
3
4
|
import json
|
|
4
5
|
from collections.abc import MutableMapping, MutableSequence
|
|
5
6
|
from importlib.resources import files
|
|
@@ -16,6 +17,14 @@ from streamflow.core.workflow import Port, Status, Step, Token, Workflow
|
|
|
16
17
|
from streamflow.persistence.base import CachedDatabase
|
|
17
18
|
|
|
18
19
|
|
|
20
|
+
def _load_keys(
|
|
21
|
+
row: MutableMapping[str, Any], keys: MutableSequence[str] | None = None
|
|
22
|
+
) -> MutableMapping[str, Any]:
|
|
23
|
+
for key in keys or ["params"]:
|
|
24
|
+
row[key] = json.loads(row[key])
|
|
25
|
+
return row
|
|
26
|
+
|
|
27
|
+
|
|
19
28
|
class PostgreSQLConnectionPool:
|
|
20
29
|
def __init__(
|
|
21
30
|
self,
|
|
@@ -46,12 +55,17 @@ class PostgreSQLConnectionPool:
|
|
|
46
55
|
)
|
|
47
56
|
async with self._pool.acquire() as conn:
|
|
48
57
|
async with conn.transaction():
|
|
49
|
-
|
|
58
|
+
schema = (
|
|
50
59
|
files(__package__)
|
|
51
60
|
.joinpath("schemas")
|
|
52
61
|
.joinpath("postgresql.sql")
|
|
53
62
|
.read_text("utf-8")
|
|
54
63
|
)
|
|
64
|
+
schema_checksum = hashlib.new("sha1", usedforsecurity=False)
|
|
65
|
+
schema_checksum.update(schema.encode("utf-8"))
|
|
66
|
+
lock_key = int(schema_checksum.hexdigest(), 16) % (2**63 - 1)
|
|
67
|
+
await conn.execute(f"SELECT pg_advisory_xact_lock({lock_key})")
|
|
68
|
+
await conn.execute(schema)
|
|
55
69
|
return self._pool
|
|
56
70
|
|
|
57
71
|
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
|
@@ -116,9 +130,10 @@ class PostgreSQLDatabase(CachedDatabase):
|
|
|
116
130
|
self,
|
|
117
131
|
name: str,
|
|
118
132
|
type: str,
|
|
119
|
-
config: str,
|
|
133
|
+
config: MutableMapping[str, Any],
|
|
120
134
|
external: bool,
|
|
121
135
|
lazy: bool,
|
|
136
|
+
scheduling_policy: MutableMapping[str, Any],
|
|
122
137
|
workdir: str | None,
|
|
123
138
|
wraps: MutableMapping[str, Any] | None,
|
|
124
139
|
) -> int:
|
|
@@ -126,32 +141,35 @@ class PostgreSQLDatabase(CachedDatabase):
|
|
|
126
141
|
async with pool.acquire() as conn:
|
|
127
142
|
async with conn.transaction():
|
|
128
143
|
return await conn.fetchval(
|
|
129
|
-
"INSERT INTO deployment(name, type, config, external, lazy, workdir, wraps) "
|
|
130
|
-
"VALUES ($1, $2, $3, $4, $5, $6, $7) "
|
|
144
|
+
"INSERT INTO deployment(name, type, config, external, lazy, scheduling_policy, workdir, wraps) "
|
|
145
|
+
"VALUES ($1, $2, $3, $4, $5, $6, $7, $8) "
|
|
131
146
|
"RETURNING id",
|
|
132
147
|
name,
|
|
133
148
|
type,
|
|
134
|
-
config,
|
|
149
|
+
json.dumps(config),
|
|
135
150
|
external,
|
|
136
151
|
lazy,
|
|
152
|
+
json.dumps(scheduling_policy),
|
|
137
153
|
workdir,
|
|
138
|
-
json.dumps(wraps),
|
|
154
|
+
json.dumps(wraps) if wraps else None,
|
|
139
155
|
)
|
|
140
156
|
|
|
141
|
-
async def add_execution(self, step_id: int,
|
|
157
|
+
async def add_execution(self, step_id: int, job_token_id: int, cmd: str) -> int:
|
|
142
158
|
async with self.pool as pool:
|
|
143
159
|
async with pool.acquire() as conn:
|
|
144
160
|
async with conn.transaction():
|
|
145
161
|
return await conn.fetchval(
|
|
146
|
-
"INSERT INTO execution(step,
|
|
162
|
+
"INSERT INTO execution(step, job_token, cmd) "
|
|
147
163
|
"VALUES($1, $2, $3) "
|
|
148
164
|
"RETURNING id",
|
|
149
165
|
step_id,
|
|
150
|
-
|
|
151
|
-
cmd
|
|
166
|
+
job_token_id,
|
|
167
|
+
cmd,
|
|
152
168
|
)
|
|
153
169
|
|
|
154
|
-
async def add_filter(
|
|
170
|
+
async def add_filter(
|
|
171
|
+
self, name: str, type: str, config: MutableMapping[str, Any]
|
|
172
|
+
) -> int:
|
|
155
173
|
async with self.pool as pool:
|
|
156
174
|
async with pool.acquire() as conn:
|
|
157
175
|
async with conn.transaction():
|
|
@@ -161,7 +179,7 @@ class PostgreSQLDatabase(CachedDatabase):
|
|
|
161
179
|
"RETURNING id",
|
|
162
180
|
name,
|
|
163
181
|
type,
|
|
164
|
-
config,
|
|
182
|
+
json.dumps(config),
|
|
165
183
|
)
|
|
166
184
|
|
|
167
185
|
async def add_port(
|
|
@@ -242,20 +260,30 @@ class PostgreSQLDatabase(CachedDatabase):
|
|
|
242
260
|
)
|
|
243
261
|
|
|
244
262
|
async def add_token(
|
|
245
|
-
self,
|
|
263
|
+
self,
|
|
264
|
+
tag: str,
|
|
265
|
+
type: type[Token],
|
|
266
|
+
value: Any,
|
|
267
|
+
port: int | None = None,
|
|
268
|
+
recoverable: bool = False,
|
|
246
269
|
) -> int:
|
|
247
270
|
async with self.pool as pool:
|
|
248
271
|
async with pool.acquire() as conn:
|
|
249
272
|
async with conn.transaction():
|
|
250
|
-
|
|
273
|
+
token_id = await conn.fetchval(
|
|
251
274
|
"INSERT INTO token(port, type, tag, value) "
|
|
252
275
|
"VALUES($1, $2, $3, $4) "
|
|
253
276
|
"RETURNING id",
|
|
254
277
|
port,
|
|
255
278
|
utils.get_class_fullname(type),
|
|
256
279
|
tag,
|
|
257
|
-
bytearray(value, "utf-8"),
|
|
280
|
+
bytearray(json.dumps(value), "utf-8"),
|
|
258
281
|
)
|
|
282
|
+
if recoverable:
|
|
283
|
+
await conn.fetchval(
|
|
284
|
+
"INSERT INTO recoverable(id) VALUES($1)", token_id
|
|
285
|
+
)
|
|
286
|
+
return token_id
|
|
259
287
|
|
|
260
288
|
async def add_workflow(
|
|
261
289
|
self,
|
|
@@ -301,10 +329,17 @@ class PostgreSQLDatabase(CachedDatabase):
|
|
|
301
329
|
async def get_deployment(self, deployment_id: int) -> MutableMapping[str, Any]:
|
|
302
330
|
async with self.pool as pool:
|
|
303
331
|
async with pool.acquire() as conn:
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
332
|
+
row = _load_keys(
|
|
333
|
+
dict(
|
|
334
|
+
await conn.fetchrow(
|
|
335
|
+
"SELECT * FROM deployment WHERE id = $1",
|
|
336
|
+
deployment_id,
|
|
337
|
+
)
|
|
338
|
+
),
|
|
339
|
+
["config", "scheduling_policy"],
|
|
307
340
|
)
|
|
341
|
+
row["wraps"] = json.loads(row["wraps"]) if row["wraps"] else None
|
|
342
|
+
return row
|
|
308
343
|
|
|
309
344
|
async def get_execution(self, execution_id: int) -> MutableMapping[str, Any]:
|
|
310
345
|
async with self.pool as pool:
|
|
@@ -337,9 +372,14 @@ class PostgreSQLDatabase(CachedDatabase):
|
|
|
337
372
|
async def get_filter(self, filter_id: int) -> MutableMapping[str, Any]:
|
|
338
373
|
async with self.pool as pool:
|
|
339
374
|
async with pool.acquire() as conn:
|
|
340
|
-
return
|
|
341
|
-
|
|
342
|
-
|
|
375
|
+
return _load_keys(
|
|
376
|
+
dict(
|
|
377
|
+
await conn.fetchrow(
|
|
378
|
+
"SELECT * FROM filter WHERE id = $1",
|
|
379
|
+
filter_id,
|
|
380
|
+
)
|
|
381
|
+
),
|
|
382
|
+
["config"],
|
|
343
383
|
)
|
|
344
384
|
|
|
345
385
|
async def get_input_ports(
|
|
@@ -390,16 +430,24 @@ class PostgreSQLDatabase(CachedDatabase):
|
|
|
390
430
|
async def get_port(self, port_id: int) -> MutableMapping[str, Any]:
|
|
391
431
|
async with self.pool as pool:
|
|
392
432
|
async with pool.acquire() as conn:
|
|
393
|
-
return
|
|
433
|
+
return _load_keys(
|
|
434
|
+
dict(
|
|
435
|
+
await conn.fetchrow("SELECT * FROM port WHERE id = $1", port_id)
|
|
436
|
+
)
|
|
437
|
+
)
|
|
394
438
|
|
|
395
439
|
async def get_port_from_token(self, token_id: int) -> MutableMapping[str, Any]:
|
|
396
440
|
async with self.pool as pool:
|
|
397
441
|
async with pool.acquire() as conn:
|
|
398
|
-
return
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
442
|
+
return _load_keys(
|
|
443
|
+
dict(
|
|
444
|
+
await conn.fetchrow(
|
|
445
|
+
"SELECT port.* "
|
|
446
|
+
"FROM token JOIN port ON token.port = port.id"
|
|
447
|
+
"WHERE token.id = $1",
|
|
448
|
+
token_id,
|
|
449
|
+
)
|
|
450
|
+
)
|
|
403
451
|
)
|
|
404
452
|
|
|
405
453
|
async def get_port_tokens(self, port_id: int) -> MutableSequence[int]:
|
|
@@ -446,31 +494,50 @@ class PostgreSQLDatabase(CachedDatabase):
|
|
|
446
494
|
async def get_step(self, step_id: int) -> MutableMapping[str, Any]:
|
|
447
495
|
async with self.pool as pool:
|
|
448
496
|
async with pool.acquire() as conn:
|
|
449
|
-
return
|
|
497
|
+
return _load_keys(
|
|
498
|
+
dict(
|
|
499
|
+
await conn.fetchrow("SELECT * FROM step WHERE id = $1", step_id)
|
|
500
|
+
)
|
|
501
|
+
)
|
|
450
502
|
|
|
451
503
|
@cachedmethod(lambda self: self.target_cache)
|
|
452
504
|
async def get_target(self, target_id: int) -> MutableMapping[str, Any]:
|
|
453
505
|
async with self.pool as pool:
|
|
454
506
|
async with pool.acquire() as conn:
|
|
455
|
-
return
|
|
456
|
-
|
|
507
|
+
return _load_keys(
|
|
508
|
+
dict(
|
|
509
|
+
await conn.fetchrow(
|
|
510
|
+
"SELECT * FROM target WHERE id = $1", target_id
|
|
511
|
+
)
|
|
512
|
+
)
|
|
457
513
|
)
|
|
458
514
|
|
|
459
515
|
@cachedmethod(lambda self: self.token_cache)
|
|
460
516
|
async def get_token(self, token_id: int) -> MutableMapping[str, Any]:
|
|
461
517
|
async with self.pool as pool:
|
|
462
518
|
async with pool.acquire() as conn:
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
519
|
+
return _load_keys(
|
|
520
|
+
dict(
|
|
521
|
+
await conn.fetchrow(
|
|
522
|
+
"SELECT *, "
|
|
523
|
+
"EXISTS(SELECT 1 FROM recoverable AS r WHERE r.id =$1) AS recoverable "
|
|
524
|
+
"FROM token "
|
|
525
|
+
"WHERE id =$1",
|
|
526
|
+
token_id,
|
|
527
|
+
)
|
|
528
|
+
),
|
|
529
|
+
["value"],
|
|
530
|
+
)
|
|
468
531
|
|
|
469
532
|
async def get_workflow(self, workflow_id: int) -> MutableMapping[str, Any]:
|
|
470
533
|
async with self.pool as pool:
|
|
471
534
|
async with pool.acquire() as conn:
|
|
472
|
-
return
|
|
473
|
-
|
|
535
|
+
return _load_keys(
|
|
536
|
+
dict(
|
|
537
|
+
await conn.fetchrow(
|
|
538
|
+
"SELECT * FROM workflow WHERE id = $1", workflow_id
|
|
539
|
+
)
|
|
540
|
+
)
|
|
474
541
|
)
|
|
475
542
|
|
|
476
543
|
async def get_workflow_ports(
|
|
@@ -478,20 +545,26 @@ class PostgreSQLDatabase(CachedDatabase):
|
|
|
478
545
|
) -> MutableSequence[MutableMapping[str, Any]]:
|
|
479
546
|
async with self.pool as pool:
|
|
480
547
|
async with pool.acquire() as conn:
|
|
481
|
-
return
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
548
|
+
return [
|
|
549
|
+
_load_keys(dict(r))
|
|
550
|
+
for r in await conn.fetch(
|
|
551
|
+
"SELECT * FROM port WHERE workflow = $1",
|
|
552
|
+
workflow_id,
|
|
553
|
+
)
|
|
554
|
+
]
|
|
485
555
|
|
|
486
556
|
async def get_workflow_steps(
|
|
487
557
|
self, workflow_id: int
|
|
488
558
|
) -> MutableSequence[MutableMapping[str, Any]]:
|
|
489
559
|
async with self.pool as pool:
|
|
490
560
|
async with pool.acquire() as conn:
|
|
491
|
-
return
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
561
|
+
return [
|
|
562
|
+
_load_keys(dict(r))
|
|
563
|
+
for r in await conn.fetch(
|
|
564
|
+
"SELECT * FROM step WHERE workflow = $1",
|
|
565
|
+
workflow_id,
|
|
566
|
+
)
|
|
567
|
+
]
|
|
495
568
|
|
|
496
569
|
async def get_workflows_by_name(
|
|
497
570
|
self, workflow_name: str, last_only: bool = False
|
|
@@ -500,9 +573,12 @@ class PostgreSQLDatabase(CachedDatabase):
|
|
|
500
573
|
async with pool.acquire() as conn:
|
|
501
574
|
query = "SELECT * FROM workflow WHERE name = $1 ORDER BY id desc"
|
|
502
575
|
return (
|
|
503
|
-
[conn.fetchrow(query, workflow_name)]
|
|
576
|
+
[_load_keys(dict(await conn.fetchrow(query, workflow_name)))]
|
|
504
577
|
if last_only
|
|
505
|
-
else
|
|
578
|
+
else [
|
|
579
|
+
_load_keys(dict(r))
|
|
580
|
+
for r in await conn.fetch(query, workflow_name)
|
|
581
|
+
]
|
|
506
582
|
)
|
|
507
583
|
|
|
508
584
|
async def get_workflows_list(
|
|
@@ -9,6 +9,7 @@ CREATE TABLE IF NOT EXISTS workflow
|
|
|
9
9
|
end_time BIGINT
|
|
10
10
|
);
|
|
11
11
|
|
|
12
|
+
|
|
12
13
|
CREATE TABLE IF NOT EXISTS step
|
|
13
14
|
(
|
|
14
15
|
id SERIAL PRIMARY KEY,
|
|
@@ -20,6 +21,7 @@ CREATE TABLE IF NOT EXISTS step
|
|
|
20
21
|
FOREIGN KEY (workflow) REFERENCES workflow (id)
|
|
21
22
|
);
|
|
22
23
|
|
|
24
|
+
|
|
23
25
|
CREATE TABLE IF NOT EXISTS port
|
|
24
26
|
(
|
|
25
27
|
id SERIAL PRIMARY KEY,
|
|
@@ -47,7 +49,7 @@ CREATE TABLE IF NOT EXISTS execution
|
|
|
47
49
|
(
|
|
48
50
|
id SERIAL PRIMARY KEY,
|
|
49
51
|
step INTEGER,
|
|
50
|
-
|
|
52
|
+
job_token INTEGER,
|
|
51
53
|
cmd TEXT,
|
|
52
54
|
status INTEGER,
|
|
53
55
|
start_time BIGINT,
|
|
@@ -67,6 +69,13 @@ CREATE TABLE IF NOT EXISTS token
|
|
|
67
69
|
);
|
|
68
70
|
|
|
69
71
|
|
|
72
|
+
CREATE TABLE IF NOT EXISTS recoverable
|
|
73
|
+
(
|
|
74
|
+
id SERIAL PRIMARY KEY,
|
|
75
|
+
FOREIGN KEY (id) REFERENCES token (id)
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
|
|
70
79
|
CREATE TABLE IF NOT EXISTS provenance
|
|
71
80
|
(
|
|
72
81
|
dependee INTEGER,
|
|
@@ -79,14 +88,15 @@ CREATE TABLE IF NOT EXISTS provenance
|
|
|
79
88
|
|
|
80
89
|
CREATE TABLE IF NOT EXISTS deployment
|
|
81
90
|
(
|
|
82
|
-
id
|
|
83
|
-
name
|
|
84
|
-
type
|
|
85
|
-
config
|
|
86
|
-
external
|
|
87
|
-
lazy
|
|
88
|
-
|
|
89
|
-
|
|
91
|
+
id SERIAL PRIMARY KEY,
|
|
92
|
+
name TEXT,
|
|
93
|
+
type TEXT,
|
|
94
|
+
config TEXT,
|
|
95
|
+
external BOOLEAN,
|
|
96
|
+
lazy BOOLEAN,
|
|
97
|
+
scheduling_policy TEXT,
|
|
98
|
+
workdir TEXT,
|
|
99
|
+
wraps TEXT
|
|
90
100
|
);
|
|
91
101
|
|
|
92
102
|
|
|
@@ -102,6 +112,7 @@ CREATE TABLE IF NOT EXISTS target
|
|
|
102
112
|
FOREIGN KEY (deployment) REFERENCES deployment (id)
|
|
103
113
|
);
|
|
104
114
|
|
|
115
|
+
|
|
105
116
|
CREATE TABLE IF NOT EXISTS filter
|
|
106
117
|
(
|
|
107
118
|
id SERIAL PRIMARY KEY,
|
{streamflow_postgresql-0.0.8 → streamflow_postgresql-0.0.10}/streamflow_postgresql.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: streamflow-postgresql
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.10
|
|
4
4
|
Summary: StreamFlow PostgreSQL plugin
|
|
5
5
|
Author-email: Iacopo Colonnelli <iacopo.colonnelli@unito.it>
|
|
6
6
|
License: LGPL-3.0-or-later
|
|
@@ -14,31 +14,19 @@ Classifier: Operating System :: POSIX
|
|
|
14
14
|
Classifier: Operating System :: MacOS
|
|
15
15
|
Classifier: Programming Language :: Python
|
|
16
16
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
18
17
|
Classifier: Programming Language :: Python :: 3.10
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.11
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.12
|
|
21
20
|
Classifier: Programming Language :: Python :: 3.13
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
22
22
|
Classifier: Topic :: Scientific/Engineering
|
|
23
23
|
Classifier: Topic :: System :: Distributed Computing
|
|
24
|
-
Requires-Python: >=3.
|
|
24
|
+
Requires-Python: >=3.10
|
|
25
25
|
Description-Content-Type: text/markdown
|
|
26
26
|
License-File: LICENSE
|
|
27
|
-
Requires-Dist: asyncpg==0.
|
|
28
|
-
Requires-Dist: streamflow==0.2.0.
|
|
29
|
-
|
|
30
|
-
Requires-Dist: bandit==1.8.3; extra == "bandit"
|
|
31
|
-
Provides-Extra: lint
|
|
32
|
-
Requires-Dist: black==25.1.0; extra == "lint"
|
|
33
|
-
Requires-Dist: codespell==2.4.1; extra == "lint"
|
|
34
|
-
Requires-Dist: flake8-bugbear==24.12.12; extra == "lint"
|
|
35
|
-
Requires-Dist: isort==6.0.1; extra == "lint"
|
|
36
|
-
Requires-Dist: pyupgrade==3.19.1; extra == "lint"
|
|
37
|
-
Provides-Extra: test
|
|
38
|
-
Requires-Dist: pytest==8.3.4; extra == "test"
|
|
39
|
-
Requires-Dist: pytest-asyncio==0.25.3; extra == "test"
|
|
40
|
-
Requires-Dist: pytest-cov==6.0.0; extra == "test"
|
|
41
|
-
Requires-Dist: pytest-xdist==3.6.1; extra == "test"
|
|
27
|
+
Requires-Dist: asyncpg==0.31.0
|
|
28
|
+
Requires-Dist: streamflow==0.2.0.dev14
|
|
29
|
+
Dynamic: license-file
|
|
42
30
|
|
|
43
31
|
# PostgreSQL Plugin for StreamFlow
|
|
44
32
|
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
LICENSE
|
|
2
2
|
MANIFEST.in
|
|
3
3
|
README.md
|
|
4
|
-
bandit-requirements.txt
|
|
5
|
-
lint-requirements.txt
|
|
6
4
|
pyproject.toml
|
|
7
|
-
requirements.txt
|
|
8
|
-
test-requirements.txt
|
|
9
5
|
streamflow/plugins/unito/postgresql/__init__.py
|
|
10
6
|
streamflow/plugins/unito/postgresql/database.py
|
|
11
7
|
streamflow/plugins/unito/postgresql/plugin.py
|