runnable 0.36.1__py3-none-any.whl → 0.37.0__py3-none-any.whl
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.
- extensions/catalog/any_path.py +13 -2
- extensions/job_executor/__init__.py +4 -1
- extensions/pipeline_executor/__init__.py +3 -1
- runnable/catalog.py +5 -2
- runnable/context.py +1 -0
- runnable/nodes.py +2 -0
- runnable/sdk.py +8 -0
- {runnable-0.36.1.dist-info → runnable-0.37.0.dist-info}/METADATA +1 -1
- {runnable-0.36.1.dist-info → runnable-0.37.0.dist-info}/RECORD +12 -12
- {runnable-0.36.1.dist-info → runnable-0.37.0.dist-info}/WHEEL +0 -0
- {runnable-0.36.1.dist-info → runnable-0.37.0.dist-info}/entry_points.txt +0 -0
- {runnable-0.36.1.dist-info → runnable-0.37.0.dist-info}/licenses/LICENSE +0 -0
extensions/catalog/any_path.py
CHANGED
@@ -95,7 +95,10 @@ class AnyPathCatalog(BaseCatalog):
|
|
95
95
|
return data_catalogs
|
96
96
|
|
97
97
|
def put(
|
98
|
-
self,
|
98
|
+
self,
|
99
|
+
name: str,
|
100
|
+
allow_file_not_found_exc: bool = False,
|
101
|
+
store_copy: bool = True,
|
99
102
|
) -> List[DataCatalog]:
|
100
103
|
"""
|
101
104
|
Put the files matching the glob pattern into the catalog.
|
@@ -154,7 +157,15 @@ class AnyPathCatalog(BaseCatalog):
|
|
154
157
|
data_catalogs.append(data_catalog)
|
155
158
|
|
156
159
|
# TODO: Think about syncing only if the file is changed
|
157
|
-
|
160
|
+
if store_copy:
|
161
|
+
logger.debug(
|
162
|
+
f"Copying file {file} to the catalog location for run_id: {run_id}"
|
163
|
+
)
|
164
|
+
self.upload_to_catalog(file)
|
165
|
+
else:
|
166
|
+
logger.debug(
|
167
|
+
f"Not copying file {file} to the catalog location for run_id: {run_id}"
|
168
|
+
)
|
158
169
|
|
159
170
|
if not data_catalogs and not allow_file_not_found_exc:
|
160
171
|
raise Exception(f"Did not find any files matching {name} in {copy_from}")
|
@@ -29,6 +29,7 @@ class GenericJobExecutor(BaseJobExecutor):
|
|
29
29
|
@property
|
30
30
|
def _context(self):
|
31
31
|
assert context.run_context
|
32
|
+
assert isinstance(context.run_context, context.JobContext)
|
32
33
|
return context.run_context
|
33
34
|
|
34
35
|
def _get_parameters(self) -> Dict[str, JsonParameter]:
|
@@ -147,7 +148,9 @@ class GenericJobExecutor(BaseJobExecutor):
|
|
147
148
|
data_catalogs = []
|
148
149
|
for name_pattern in catalog_settings:
|
149
150
|
data_catalog = self._context.catalog.put(
|
150
|
-
name=name_pattern,
|
151
|
+
name=name_pattern,
|
152
|
+
allow_file_not_found_exc=allow_file_not_found_exc,
|
153
|
+
store_copy=self._context.catalog_store_copy,
|
151
154
|
)
|
152
155
|
|
153
156
|
logger.debug(f"Added data catalog: {data_catalog} to job log")
|
@@ -160,7 +160,9 @@ class GenericPipelineExecutor(BasePipelineExecutor):
|
|
160
160
|
|
161
161
|
elif stage == "put":
|
162
162
|
data_catalog = self._context.catalog.put(
|
163
|
-
name=name_pattern,
|
163
|
+
name=name_pattern,
|
164
|
+
allow_file_not_found_exc=allow_file_no_found_exc,
|
165
|
+
store_copy=node_catalog_settings.get("store_copy", True),
|
164
166
|
)
|
165
167
|
else:
|
166
168
|
raise Exception(f"Stage {stage} not supported")
|
runnable/catalog.py
CHANGED
@@ -57,7 +57,7 @@ class BaseCatalog(ABC, BaseModel):
|
|
57
57
|
|
58
58
|
@abstractmethod
|
59
59
|
def put(
|
60
|
-
self, name: str, allow_file_not_found_exc: bool = False
|
60
|
+
self, name: str, allow_file_not_found_exc: bool = False, store_copy: bool = True
|
61
61
|
) -> List[DataCatalog]:
|
62
62
|
"""
|
63
63
|
Put the file by 'name' from the 'compute_data_folder' in the catalog for the run_id.
|
@@ -120,7 +120,10 @@ class DoNothingCatalog(BaseCatalog):
|
|
120
120
|
return []
|
121
121
|
|
122
122
|
def put(
|
123
|
-
self,
|
123
|
+
self,
|
124
|
+
name: str,
|
125
|
+
allow_file_not_found_exc: bool = False,
|
126
|
+
store_copy: bool = True,
|
124
127
|
) -> List[DataCatalog]:
|
125
128
|
"""
|
126
129
|
Does nothing
|
runnable/context.py
CHANGED
@@ -475,6 +475,7 @@ class JobContext(RunnableContext):
|
|
475
475
|
default=None,
|
476
476
|
description="Catalog settings to be used for the job.",
|
477
477
|
)
|
478
|
+
catalog_store_copy: bool = Field(default=True, alias="catalog_store_copy")
|
478
479
|
|
479
480
|
@computed_field # type: ignore
|
480
481
|
@cached_property
|
runnable/nodes.py
CHANGED
@@ -411,11 +411,13 @@ class TraversalNode(BaseNode):
|
|
411
411
|
return self.overrides.get(executor_type) or ""
|
412
412
|
|
413
413
|
|
414
|
+
# Unfortunately, this is defined in 2 places. Look in SDK
|
414
415
|
class CatalogStructure(BaseModel):
|
415
416
|
model_config = ConfigDict(extra="forbid") # Need to forbid
|
416
417
|
|
417
418
|
get: List[str] = Field(default_factory=list)
|
418
419
|
put: List[str] = Field(default_factory=list)
|
420
|
+
store_copy: bool = Field(default=True, alias="store_copy")
|
419
421
|
|
420
422
|
|
421
423
|
class ExecutableNode(TraversalNode):
|
runnable/sdk.py
CHANGED
@@ -60,6 +60,7 @@ class Catalog(BaseModel):
|
|
60
60
|
Attributes:
|
61
61
|
get (List[str]): List of glob patterns to get from central catalog to the compute data folder.
|
62
62
|
put (List[str]): List of glob patterns to put into central catalog from the compute data folder.
|
63
|
+
store_copy (bool): Whether to store a copy of the data in the central catalog.
|
63
64
|
|
64
65
|
Examples:
|
65
66
|
>>> from runnable import Catalog
|
@@ -74,6 +75,7 @@ class Catalog(BaseModel):
|
|
74
75
|
# compute_data_folder: str = Field(default="", alias="compute_data_folder")
|
75
76
|
get: List[str] = Field(default_factory=list, alias="get")
|
76
77
|
put: List[str] = Field(default_factory=list, alias="put")
|
78
|
+
store_copy: bool = Field(default=True, alias="store_copy")
|
77
79
|
|
78
80
|
|
79
81
|
class BaseTraversal(ABC, BaseModel):
|
@@ -845,6 +847,11 @@ class BaseJob(BaseModel):
|
|
845
847
|
return []
|
846
848
|
return self.catalog.put
|
847
849
|
|
850
|
+
def return_bool_catalog_store_copy(self) -> bool:
|
851
|
+
if self.catalog is None:
|
852
|
+
return True
|
853
|
+
return self.catalog.store_copy
|
854
|
+
|
848
855
|
def _is_called_for_definition(self) -> bool:
|
849
856
|
"""
|
850
857
|
If the run context is set, we are coming in only to get the pipeline definition.
|
@@ -888,6 +895,7 @@ class BaseJob(BaseModel):
|
|
888
895
|
}
|
889
896
|
|
890
897
|
run_context = context.JobContext.model_validate(configurations)
|
898
|
+
run_context.catalog_store_copy = self.return_bool_catalog_store_copy()
|
891
899
|
|
892
900
|
assert isinstance(run_context.job_executor, BaseJobExecutor)
|
893
901
|
|
@@ -1,13 +1,13 @@
|
|
1
1
|
extensions/README.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
2
|
extensions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
extensions/catalog/README.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
-
extensions/catalog/any_path.py,sha256=
|
4
|
+
extensions/catalog/any_path.py,sha256=NUZjXwOE-osR9RIpi59UC_16GZPCbkjshJL6X6hPmYw,7725
|
5
5
|
extensions/catalog/file_system.py,sha256=T_qFPFfrmykoAMc1rjNi_DBb437me8WPRcFglwAK744,1767
|
6
6
|
extensions/catalog/minio.py,sha256=R3GvfCxN1GTcs4bQIAWh79_GHDTVd14gnpKlzwFeKUI,2363
|
7
7
|
extensions/catalog/pyproject.toml,sha256=lLNxY6v04c8I5QK_zKw_E6sJTArSJRA_V-79ktaA3Hk,279
|
8
8
|
extensions/catalog/s3.py,sha256=Sw5t8_kVRprn3uGGJCiHn7M9zw1CLaCOFj6YErtfG0o,287
|
9
9
|
extensions/job_executor/README.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
|
-
extensions/job_executor/__init__.py,sha256=
|
10
|
+
extensions/job_executor/__init__.py,sha256=9n2V4cLgwNuci0_62BvJTGA3Gf9h-aMUlAO-mKIOqYA,5958
|
11
11
|
extensions/job_executor/emulate.py,sha256=d9KI4If0DeRkKv9iCSKyZCziK_3ARsJvs5RUFo9yigc,3220
|
12
12
|
extensions/job_executor/k8s.py,sha256=W14u1xwJDtb-gyGdNl62IwWIs49AUO2oTAAxQCm6YT0,16456
|
13
13
|
extensions/job_executor/k8s_job_spec.yaml,sha256=7aFpxHdO_p6Hkc3YxusUOuAQTD1Myu0yTPX9DrhxbOg,1158
|
@@ -25,7 +25,7 @@ extensions/nodes/stub.py,sha256=o9DjBekNa9O4b0VQOiNOA9eNjJ3C2a9Sn9d2fX7KaWg,2715
|
|
25
25
|
extensions/nodes/success.py,sha256=yT4WkUI-1YN6qy4Ji6zSoZFXI9jOl6Ond4WxZRq-33k,2179
|
26
26
|
extensions/nodes/task.py,sha256=m5_s5u7lQDoTmeO6CG94btrG5If9AKm2-RvOzvm0fDc,3147
|
27
27
|
extensions/pipeline_executor/README.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
28
|
-
extensions/pipeline_executor/__init__.py,sha256=
|
28
|
+
extensions/pipeline_executor/__init__.py,sha256=JqJFGgLOUaDINUi4_xC3zoDSZxDrUYLNuHQVzr8-ByE,24620
|
29
29
|
extensions/pipeline_executor/argo.py,sha256=5nEItAv-gNVi2sylZA4spKLWfcKuJ3zyQx3RekoLb28,38240
|
30
30
|
extensions/pipeline_executor/emulate.py,sha256=ziaIzEpYgVOm2PPCY8bnRdoevMwS8OY9aEUXpwCFQR0,3547
|
31
31
|
extensions/pipeline_executor/local.py,sha256=_8dtj88mI3xeZT4UPwtHNtbyi_VVzz_lpIxvC0UZS-g,1887
|
@@ -48,9 +48,9 @@ extensions/secrets/README.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,
|
|
48
48
|
extensions/secrets/dotenv.py,sha256=nADHXI6KJ_LUYOIe5EbtYH-21OBebSNVr0Pjb1GlZ7w,1573
|
49
49
|
extensions/secrets/pyproject.toml,sha256=mLJNImNcBlbLKHh-0ugVWT9V83R4RibyyYDtBCSqVF4,282
|
50
50
|
runnable/__init__.py,sha256=MN9x2jmQb2eOr-rap1DXLzNSC926U-aad_YwENzG52w,509
|
51
|
-
runnable/catalog.py,sha256=
|
51
|
+
runnable/catalog.py,sha256=6l0tT0jwHi40aE6fhQMgYtYe_-2As-bRKztAKiFvy3o,3842
|
52
52
|
runnable/cli.py,sha256=CziCKBoL-dklSEo_x-YO1AysrG2eaf2LMQZbcNTeCbM,7283
|
53
|
-
runnable/context.py,sha256=
|
53
|
+
runnable/context.py,sha256=mLpq5rtMsPawjnaN9Woq7HWZ1FAppeudZtYMT5vf6Fo,17594
|
54
54
|
runnable/datastore.py,sha256=2pYg4i1JRMzw_CUUIsPOWt7wYPiGBamfo-CPVAkEH54,32375
|
55
55
|
runnable/defaults.py,sha256=4UYuShnjEyWP529UlFnubvkBpOcczKIdE4jEOhPBwl4,3076
|
56
56
|
runnable/entrypoints.py,sha256=46prgr3_FYtBMlRbUXIDSpgZUBgaxcdJAekXhgEIj7M,6578
|
@@ -58,15 +58,15 @@ runnable/exceptions.py,sha256=t5tSlYqe_EjU5liXu32yLLh_yrnXeFL93BuXfmQzV98,3268
|
|
58
58
|
runnable/executor.py,sha256=CwzHkeGVpocACZLzfFS94TzKeiaPLv4NtXtvT3eoocY,15222
|
59
59
|
runnable/graph.py,sha256=poQz5zcvq89ju_u5sYlunQLPbHnXTaUmjcvstPwvT4U,16536
|
60
60
|
runnable/names.py,sha256=A9ldUyULXuWjJ1MoXihHqlg-xeTVX-oWYTO5Ah0trmo,8128
|
61
|
-
runnable/nodes.py,sha256=
|
61
|
+
runnable/nodes.py,sha256=JHBxJib7SSQXY51bLHBXUvb0DlNSLNvyqz3JNEDLt8c,16926
|
62
62
|
runnable/parameters.py,sha256=zEehAliVvCOLOnNZ4ExJvSDJM_2PWY0URZ0bmZUgCQA,5289
|
63
63
|
runnable/pickler.py,sha256=ydJ_eti_U1F4l-YacFp7BWm6g5vTn04UXye25S1HVok,2684
|
64
|
-
runnable/sdk.py,sha256=
|
64
|
+
runnable/sdk.py,sha256=blLBWzXV2x7jxKQXWpjmeJ9k22jt5CKBQBqQpnt4agk,32587
|
65
65
|
runnable/secrets.py,sha256=4L_dBFxTgr8r_hHUD6RlZEtqaOHDRsFG5PXO5wlvMI0,2324
|
66
66
|
runnable/tasks.py,sha256=7yuoeG4ZqfxFUmN4mPS4i6kbQmzEpAwbPQweAUWY-ic,31366
|
67
67
|
runnable/utils.py,sha256=amHW3KR_NGTDysGHcSafhh5WJUX7GPBSxqdPyzAIhao,11350
|
68
|
-
runnable-0.
|
69
|
-
runnable-0.
|
70
|
-
runnable-0.
|
71
|
-
runnable-0.
|
72
|
-
runnable-0.
|
68
|
+
runnable-0.37.0.dist-info/METADATA,sha256=nD9ezWOwkWw3Yi5_NBE_xqjRGKxqf_FnSsYb8P9oqxo,10047
|
69
|
+
runnable-0.37.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
70
|
+
runnable-0.37.0.dist-info/entry_points.txt,sha256=KkxihZ0LLEiwvFl7RquyqZ0tp2fJDIs7DgzHYDlmc3U,2018
|
71
|
+
runnable-0.37.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
72
|
+
runnable-0.37.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|