UncountablePythonSDK 0.0.68__py3-none-any.whl → 0.0.70__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.
- {UncountablePythonSDK-0.0.68.dist-info → UncountablePythonSDK-0.0.70.dist-info}/METADATA +3 -1
- {UncountablePythonSDK-0.0.68.dist-info → UncountablePythonSDK-0.0.70.dist-info}/RECORD +47 -19
- docs/requirements.txt +1 -1
- examples/integration-server/jobs/materials_auto/example_cron.py +18 -0
- examples/integration-server/jobs/materials_auto/profile.yaml +19 -0
- examples/integration-server/pyproject.toml +224 -0
- examples/set_recipe_metadata_file.py +40 -0
- examples/set_recipe_output_file_sdk.py +26 -0
- uncountable/core/environment.py +5 -1
- uncountable/integration/cli.py +1 -0
- uncountable/integration/cron.py +12 -28
- uncountable/integration/db/connect.py +12 -2
- uncountable/integration/db/session.py +25 -0
- uncountable/integration/entrypoint.py +6 -6
- uncountable/integration/executors/generic_upload_executor.py +5 -1
- uncountable/integration/job.py +44 -17
- uncountable/integration/queue_runner/__init__.py +0 -0
- uncountable/integration/queue_runner/command_server/__init__.py +24 -0
- uncountable/integration/queue_runner/command_server/command_client.py +68 -0
- uncountable/integration/queue_runner/command_server/command_server.py +64 -0
- uncountable/integration/queue_runner/command_server/protocol/__init__.py +0 -0
- uncountable/integration/queue_runner/command_server/protocol/command_server.proto +22 -0
- uncountable/integration/queue_runner/command_server/protocol/command_server_pb2.py +40 -0
- uncountable/integration/queue_runner/command_server/protocol/command_server_pb2.pyi +38 -0
- uncountable/integration/queue_runner/command_server/protocol/command_server_pb2_grpc.py +129 -0
- uncountable/integration/queue_runner/command_server/types.py +52 -0
- uncountable/integration/queue_runner/datastore/__init__.py +3 -0
- uncountable/integration/queue_runner/datastore/datastore_sqlite.py +93 -0
- uncountable/integration/queue_runner/datastore/interface.py +19 -0
- uncountable/integration/queue_runner/datastore/model.py +17 -0
- uncountable/integration/queue_runner/job_scheduler.py +119 -0
- uncountable/integration/queue_runner/queue_runner.py +26 -0
- uncountable/integration/queue_runner/types.py +7 -0
- uncountable/integration/queue_runner/worker.py +109 -0
- uncountable/integration/scan_profiles.py +2 -0
- uncountable/integration/scheduler.py +144 -0
- uncountable/integration/webhook_server/entrypoint.py +45 -45
- uncountable/types/__init__.py +4 -0
- uncountable/types/api/recipes/get_recipes_data.py +1 -0
- uncountable/types/api/recipes/set_recipe_output_file.py +46 -0
- uncountable/types/client_base.py +20 -0
- uncountable/types/entity_t.py +2 -0
- uncountable/types/queued_job.py +16 -0
- uncountable/types/queued_job_t.py +107 -0
- uncountable/types/recipe_metadata_t.py +1 -0
- {UncountablePythonSDK-0.0.68.dist-info → UncountablePythonSDK-0.0.70.dist-info}/WHEEL +0 -0
- {UncountablePythonSDK-0.0.68.dist-info → UncountablePythonSDK-0.0.70.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: UncountablePythonSDK
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.70
|
|
4
4
|
Summary: Uncountable SDK
|
|
5
5
|
Project-URL: Homepage, https://github.com/uncountableinc/uncountable-python-sdk
|
|
6
6
|
Project-URL: Repository, https://github.com/uncountableinc/uncountable-python-sdk.git
|
|
@@ -35,6 +35,8 @@ Requires-Dist: paramiko ==3.*
|
|
|
35
35
|
Requires-Dist: boto3 ==1.*
|
|
36
36
|
Requires-Dist: flask ==3.*
|
|
37
37
|
Requires-Dist: simplejson ==3.*
|
|
38
|
+
Requires-Dist: grpcio ==1.*
|
|
39
|
+
Requires-Dist: protobuf ==4.*
|
|
38
40
|
Provides-Extra: test
|
|
39
41
|
Requires-Dist: mypy ==1.* ; extra == 'test'
|
|
40
42
|
Requires-Dist: ruff ==0.* ; extra == 'test'
|
|
@@ -3,7 +3,7 @@ docs/conf.py,sha256=YF5J-9g_Wg8wXmyHsGaE8xYlDEzqocNl3UWUmP0CwBg,1702
|
|
|
3
3
|
docs/index.md,sha256=eEdirX_Ds6ICTRtIS5iT4irCquHcQyKN7E4M5QP9T8A,257
|
|
4
4
|
docs/justfile,sha256=cvNcpb-ByPOF2aCrFlg3DDZBoYMx5W8xGdr13m9HcnI,215
|
|
5
5
|
docs/quickstart.md,sha256=3GuJ0MB1O5kjlsrgAmdSkDq0rYqATrYy-tzEHDy8H-c,422
|
|
6
|
-
docs/requirements.txt,sha256=
|
|
6
|
+
docs/requirements.txt,sha256=pHca02KQbB3qx4V6MUrwtctgvIheT--jGQvs6OVqaUg,138
|
|
7
7
|
docs/static/logo_blue.png,sha256=SyYpMTVhhBbhF5Wl8lWaVwz-_p1MIR6dW6bVhufQRME,46708
|
|
8
8
|
docs/static/favicons/android-chrome-192x192.png,sha256=XoF-AhD55JlSBDGsEPJKfT_VeXT-awhwKyZnxLhrwvk,1369
|
|
9
9
|
docs/static/favicons/android-chrome-512x512.png,sha256=1S4xwY9YtJQ5ifFsZ-DOzssoyBYs0t9uwdOUmYx0Xso,3888
|
|
@@ -18,7 +18,12 @@ examples/async_batch.py,sha256=CffQ8O9drJ-Mdd6S5DnMIOBsHv5aVkTZrD3l3xBnB4s,1094
|
|
|
18
18
|
examples/create_entity.py,sha256=t6WBZsWRDbWZgFCWXKGgKL5LAB6-38oaiNYGxMAa2No,686
|
|
19
19
|
examples/edit_recipe_inputs.py,sha256=mtk_oSkN-OT2hKkb1XKXrRiUaGYTJstXuOKyTR51Fjo,1663
|
|
20
20
|
examples/invoke_uploader.py,sha256=rEvmVY5TjigN_-4PTQdkjY-bC5DrYMcJgquyZ4Tt5FM,748
|
|
21
|
+
examples/set_recipe_metadata_file.py,sha256=oPBhMo9T17zj4YpJRkmVH9lknYcT8livph0KssxYtg4,1048
|
|
22
|
+
examples/set_recipe_output_file_sdk.py,sha256=Lz1amqppnWTX83z-C090wCJ4hcKmCD3kb-4v0uBRi0Y,782
|
|
21
23
|
examples/upload_files.py,sha256=tUfKFqiqwnw08OL5Y8_e4j5pSRhp94cFex8XTuVa_ig,487
|
|
24
|
+
examples/integration-server/pyproject.toml,sha256=yVYpx5VG3bKQCYjmCSKN_MRjxoOoF2xF2KzkCcvDHh4,9134
|
|
25
|
+
examples/integration-server/jobs/materials_auto/example_cron.py,sha256=7VVQ-UJsq3DbGpN3XPnorRVZYo-vCwbfSU3VVDluIzA,699
|
|
26
|
+
examples/integration-server/jobs/materials_auto/profile.yaml,sha256=WZTNlgc8uH412oRmWHWWuenYo_6LnrIL11V0HMkGsB0,352
|
|
22
27
|
pkgs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
23
28
|
pkgs/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
29
|
pkgs/argument_parser/__init__.py,sha256=CsQ6QoPKSLLRVl-z6URAmPkiUL9ZPZoV4rJHgy_-RjA,385
|
|
@@ -76,28 +81,48 @@ uncountable/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
76
81
|
uncountable/core/__init__.py,sha256=RFv0kO6rKFf1PtBPu83hCGmxqkJamRtsgQ9_-ztw7tA,341
|
|
77
82
|
uncountable/core/async_batch.py,sha256=Gur0VOS0AH2ugwvk65hwoX-iqwQAAyJaejY_LyAZZPo,1210
|
|
78
83
|
uncountable/core/client.py,sha256=KUJN3XcbawMg_GuJ5DvmDsmhRzsnafCjyq27vOD4jC4,10640
|
|
79
|
-
uncountable/core/environment.py,sha256=
|
|
84
|
+
uncountable/core/environment.py,sha256=n46mWvG5uBOy6H_aetu_iuaYmO_d23uSbQBRgb6xStw,677
|
|
80
85
|
uncountable/core/file_upload.py,sha256=qR7BBBWVxFNrb1_WICreo3dkZygE9lcE1fmZCQrDZU0,3469
|
|
81
86
|
uncountable/core/types.py,sha256=s2CjqYJpsmbC7xMwxxT7kJ_V9bwokrjjWVVjpMcQpKI,333
|
|
82
87
|
uncountable/integration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
83
|
-
uncountable/integration/cli.py,sha256=
|
|
88
|
+
uncountable/integration/cli.py,sha256=wv9XHXujO0Zop-R4jmjNQttPOjEDQlXPfvmfZ5HW9QE,2898
|
|
84
89
|
uncountable/integration/construct_client.py,sha256=I2XTamht13vs-JYkV4PpNS_Pc4FJm-KVYqNNvxI4qNk,1916
|
|
85
|
-
uncountable/integration/cron.py,sha256=
|
|
86
|
-
uncountable/integration/entrypoint.py,sha256=
|
|
87
|
-
uncountable/integration/job.py,sha256=
|
|
88
|
-
uncountable/integration/scan_profiles.py,sha256=
|
|
90
|
+
uncountable/integration/cron.py,sha256=6eH-kIs3sdYPCyb62_L2M7U_uQTdMTdwY5hreEJb0hw,887
|
|
91
|
+
uncountable/integration/entrypoint.py,sha256=EjJdTmED80MrVcNoQ5BhFP3bAYHdU6CzRGiPSZF9y8w,802
|
|
92
|
+
uncountable/integration/job.py,sha256=af197JUceIKzpIN5C2z8zeZOPhIQ16ipyC6qVt1WXv0,2386
|
|
93
|
+
uncountable/integration/scan_profiles.py,sha256=ro4u5_1ClUeyW4vcWJ9epf2UQaJrjtc7S1R5bZpuHTM,1430
|
|
94
|
+
uncountable/integration/scheduler.py,sha256=sVe7V5zlUbSzSMyC30rAlWR30w0jurhrYYCgK8-lVRo,4546
|
|
89
95
|
uncountable/integration/server.py,sha256=-ALtXNlBDnDbeSJcqAHHJzl46mGuq43aIM9RLzG-ZWA,4701
|
|
90
96
|
uncountable/integration/telemetry.py,sha256=MwQLmgCoxpmA_UTp3e2ZB37wcDzKM0qzm5MrmaiJWhU,7142
|
|
91
97
|
uncountable/integration/db/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
92
|
-
uncountable/integration/db/connect.py,sha256=
|
|
98
|
+
uncountable/integration/db/connect.py,sha256=mE3bdV0huclH2iT_dXCQdRL4LkjIuf_myAR64RTWXEs,498
|
|
99
|
+
uncountable/integration/db/session.py,sha256=96cGQXpe6IugBTdSsjdP0S5yhJ6toSmbVB6qhc3FJzE,693
|
|
93
100
|
uncountable/integration/executors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
94
101
|
uncountable/integration/executors/executors.py,sha256=CbwatKkHrLhnqYr_nsBjr0KYeOn8KqijxrZPHbxChBY,1961
|
|
95
|
-
uncountable/integration/executors/generic_upload_executor.py,sha256=
|
|
102
|
+
uncountable/integration/executors/generic_upload_executor.py,sha256=NlW5WcYePPA7_fwp5uW_2afAiQLKK7rCkKF06wQ948E,10375
|
|
96
103
|
uncountable/integration/executors/script_executor.py,sha256=OmSBOtU48G3mqza9c2lCm84pGGyaDk-ZBJCx3RsdJXc,846
|
|
104
|
+
uncountable/integration/queue_runner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
105
|
+
uncountable/integration/queue_runner/job_scheduler.py,sha256=4AdI_89mPNAgO-WSJvqRaN3HbKlzlVRh9aIkwfQvL7o,4679
|
|
106
|
+
uncountable/integration/queue_runner/queue_runner.py,sha256=0BmYu5zHdothTevGsB-nXg6MBd1UD-WkP3h1WCKMdQg,710
|
|
107
|
+
uncountable/integration/queue_runner/types.py,sha256=8qTq29BTSa5rmW6CBlBntP0pNIiDcwu1wHa78pjroS0,219
|
|
108
|
+
uncountable/integration/queue_runner/worker.py,sha256=GNz8PmPUBMLA-R2VWkC_86WOaeHjHFI2mvBlNRcI3wE,4238
|
|
109
|
+
uncountable/integration/queue_runner/command_server/__init__.py,sha256=gQPVILGpWzCr2i5GJyoqna7AOSFvtn4tav69gB78mTQ,571
|
|
110
|
+
uncountable/integration/queue_runner/command_server/command_client.py,sha256=DJb0TUVFkiiLBEQzHSN94sTRnuEbutNEgdN39XmnOXI,2046
|
|
111
|
+
uncountable/integration/queue_runner/command_server/command_server.py,sha256=yyXryhiEC2eGS0yFElLGsVzSKwOuYvj-zp22jQorkv0,2138
|
|
112
|
+
uncountable/integration/queue_runner/command_server/types.py,sha256=A9FpGplHxoSkmi8dn4oGFN7bkstQjY1DoTXypbicHpk,991
|
|
113
|
+
uncountable/integration/queue_runner/command_server/protocol/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
114
|
+
uncountable/integration/queue_runner/command_server/protocol/command_server.proto,sha256=pf7FAT2eGuao0VYCFrgTAsM-tiPi1Bhz19XN5So1WFk,439
|
|
115
|
+
uncountable/integration/queue_runner/command_server/protocol/command_server_pb2.py,sha256=-lBTc5Tz48agqNSeOSpBE69e2kRmWF59sUaowCl8p7U,2207
|
|
116
|
+
uncountable/integration/queue_runner/command_server/protocol/command_server_pb2.pyi,sha256=9viBn6PHvtfMSRwam57ke5O2D_k8LapWYVfBRjknIYg,1281
|
|
117
|
+
uncountable/integration/queue_runner/command_server/protocol/command_server_pb2_grpc.py,sha256=ZVHkuLDjEbXMCxBsw1UrRhT3EEF8CDDqEvmE3Kbp1H4,5359
|
|
118
|
+
uncountable/integration/queue_runner/datastore/__init__.py,sha256=6BefApqN8D2zlVOH14QAeVzwQ8j5NIb41-njT02Za0k,88
|
|
119
|
+
uncountable/integration/queue_runner/datastore/datastore_sqlite.py,sha256=UZQABTrM3HxVaojCnI1pTU3v1GsbE3G-OCgXP5ekcxI,3801
|
|
120
|
+
uncountable/integration/queue_runner/datastore/interface.py,sha256=j4D-zVvLq-48VTVwHVei82UVUJ_P3cxiseyiTl0MoNw,534
|
|
121
|
+
uncountable/integration/queue_runner/datastore/model.py,sha256=8-RI5A2yPZVGBLWINVmMd6VOl_oHtqGtnaNXcapAChw,577
|
|
97
122
|
uncountable/integration/secret_retrieval/__init__.py,sha256=3QXVj35w8rRMxVvmmsViFYDi3lcb3g70incfalOEm6o,87
|
|
98
123
|
uncountable/integration/secret_retrieval/retrieve_secret.py,sha256=eoPWbkUtCn_63A4TFlK_nvEDvfm4u2fiOoglmAkBG3U,3004
|
|
99
|
-
uncountable/integration/webhook_server/entrypoint.py,sha256=
|
|
100
|
-
uncountable/types/__init__.py,sha256=
|
|
124
|
+
uncountable/integration/webhook_server/entrypoint.py,sha256=hgbEtdVo3QU3odlHSygxmrsxR9g7rgU0yKt-o9nVAHE,5686
|
|
125
|
+
uncountable/types/__init__.py,sha256=KSsSEBnGhn88NPex5q9MZtY4kj8PRqVTbaKtko4hxUU,8561
|
|
101
126
|
uncountable/types/async_batch.py,sha256=_OhT25_dEVts_z_n1kqfJH3xlZg3btLqR6TNkfFLlXE,609
|
|
102
127
|
uncountable/types/async_batch_processor.py,sha256=obVzN-PcYLV2pHScszfCGjSq6-Xc34WM1ysx6Fv6tZk,11293
|
|
103
128
|
uncountable/types/async_batch_t.py,sha256=ipSGz93O1KB-WE2dvlvflTKS51rJrf3bJkUojyxos7I,2193
|
|
@@ -107,13 +132,13 @@ uncountable/types/calculations.py,sha256=FFO_D3BbKoGDZnqWvTKpW4KF359i2vrKjpdFCLY
|
|
|
107
132
|
uncountable/types/calculations_t.py,sha256=7GTSi2L8NYjzjUJJx3cmtVkK9uD-uhfYvIFK-ffQj-8,556
|
|
108
133
|
uncountable/types/chemical_structure.py,sha256=E-LnikTFDoVQ1b2zKaVUIO_PAKm-7aZZYJi8I8SDSic,302
|
|
109
134
|
uncountable/types/chemical_structure_t.py,sha256=aFsTkkbzy6Gvyde3qrrEYD95gcYhxkgKMiDRaRE0o-Y,760
|
|
110
|
-
uncountable/types/client_base.py,sha256=
|
|
135
|
+
uncountable/types/client_base.py,sha256=wgAU6xbOmY9oiKN54JYoJmA3UzJSXewCI2YBWzweuHs,67232
|
|
111
136
|
uncountable/types/client_config.py,sha256=4h5Liko9uKCo9_0gdbPhoK6Jr2Kv7tioLiQ8iKeq-_4,301
|
|
112
137
|
uncountable/types/client_config_t.py,sha256=_HdS37gMSTIiD4qLnW9dIgt8_Rt5A6xhwMGGga7vnLg,625
|
|
113
138
|
uncountable/types/curves.py,sha256=W6uMpG5SyW1MS82szNpxkFEn1MnxNpBFyFbQb2Ysfng,366
|
|
114
139
|
uncountable/types/curves_t.py,sha256=TDpsThz4lKmiBmS9b4ItUSCp64TGv8-qDkxb4B2RoTo,1314
|
|
115
140
|
uncountable/types/entity.py,sha256=3XhLteFDRDZvHejDuYh-KvB65hpwrBygljFfiUcOAM8,315
|
|
116
|
-
uncountable/types/entity_t.py,sha256=
|
|
141
|
+
uncountable/types/entity_t.py,sha256=YXwFnscd4ivJOSH9IpYvCxeHhZob29ZvkGFgkypYAlo,14705
|
|
117
142
|
uncountable/types/experiment_groups.py,sha256=_0OXcPzSAbkE-rfKt5tPx178YJ4pcEKZvrCxUHgDnvw,309
|
|
118
143
|
uncountable/types/experiment_groups_t.py,sha256=0IGAXwkYiwdjj6aFjLMihxwauACQTyuRU_1usJTeUg4,593
|
|
119
144
|
uncountable/types/field_values.py,sha256=uuIWX-xmfvcinYPdfkWJeb56zzQY01mc9rmotMPMh24,503
|
|
@@ -142,6 +167,8 @@ uncountable/types/phases.py,sha256=YCsU77DdjRJJWdLTwLuOZNG4e9ML82NIBI1xTWr3ggA,2
|
|
|
142
167
|
uncountable/types/phases_t.py,sha256=21_4-O5MlO1AzsZijSlSUeEHknY0T9KCPilFMG8GMEo,544
|
|
143
168
|
uncountable/types/post_base.py,sha256=GES5_IhXFAjpzI6ChbVP4zTkX6f3tPUIHST1sxsRN6Q,279
|
|
144
169
|
uncountable/types/post_base_t.py,sha256=2et3TDnFChZcx0RWU-18RJHw9Yiyj2TJz-2tByHXwaI,770
|
|
170
|
+
uncountable/types/queued_job.py,sha256=67exX5vfpewKzvFKxuxTLsSJTDKlE3JqKfWnnYx2Jos,842
|
|
171
|
+
uncountable/types/queued_job_t.py,sha256=yd3FhtcbfMxPjBq_ykLY2ASx_EJvQ4kW3MKIL2gdPWc,3049
|
|
145
172
|
uncountable/types/recipe_identifiers.py,sha256=Pi5KX64kzoBp_t_tjb3uVk9Ef1WPIIXGtUdINXi5vcY,654
|
|
146
173
|
uncountable/types/recipe_identifiers_t.py,sha256=suumLdp_8SZD7oqIxSEaV9D1irMeLJ5_-pJqqUrQ5k8,1786
|
|
147
174
|
uncountable/types/recipe_inputs.py,sha256=5ThNFEOGbADqqfj1V3hNvZUcO5pn1Gm17LmzQkWDrtI,351
|
|
@@ -149,7 +176,7 @@ uncountable/types/recipe_inputs_t.py,sha256=t5nFzuF1AU6SUHpya6xKHSlcckmt3XxAuk9o
|
|
|
149
176
|
uncountable/types/recipe_links.py,sha256=YRiu6t7FWr7ZWycIaOPXBtQFqbY_q5unaP6KQzh1LzE,343
|
|
150
177
|
uncountable/types/recipe_links_t.py,sha256=ZaTeP8AsIT9-gDRi_uQreDsAzEmqF34YTesh9uydYa0,1417
|
|
151
178
|
uncountable/types/recipe_metadata.py,sha256=Zpcrupq_mlT2UhXpMJup5XjtubmvgZ8SbJNq7da2pCs,441
|
|
152
|
-
uncountable/types/recipe_metadata_t.py,sha256=
|
|
179
|
+
uncountable/types/recipe_metadata_t.py,sha256=3gcspWc7CYCoLtoDLhhthPg3o5NaZZTF4NZvH8xTufk,1521
|
|
153
180
|
uncountable/types/recipe_output_metadata.py,sha256=83jKZCvogG9QjZeJpQptdSam_MnnUj-tqh9EVIrTWjE,322
|
|
154
181
|
uncountable/types/recipe_output_metadata_t.py,sha256=jazuYonhY0FklLy2jWoS51LM6Mc_1ZBHvPu7-6btJd0,607
|
|
155
182
|
uncountable/types/recipe_tags.py,sha256=eyYa_rox00a1JQ0lOQv9STnJI04ksCL_3kHSDx5w7rM,291
|
|
@@ -235,12 +262,13 @@ uncountable/types/api/recipes/get_recipe_calculations.py,sha256=Hq9hmIUBdZ5KRb9F
|
|
|
235
262
|
uncountable/types/api/recipes/get_recipe_links.py,sha256=zD4dEIQVAV5wv0NirBldwMEROgvOf7mXT-pWlaSiuN4,975
|
|
236
263
|
uncountable/types/api/recipes/get_recipe_names.py,sha256=abBQoZ5JRek0UDOE6ETn6NLUQp9stZ5XhCNFdc5kM3U,1004
|
|
237
264
|
uncountable/types/api/recipes/get_recipe_output_metadata.py,sha256=ORokvA6vvLkkuUHZjY1ym2voxovljMrA48qjt8RD7mU,1456
|
|
238
|
-
uncountable/types/api/recipes/get_recipes_data.py,sha256=
|
|
265
|
+
uncountable/types/api/recipes/get_recipes_data.py,sha256=s8LE8VQSYgGXEUYpbVJYCOBelrrwMCwXKqiBvvLx9pE,5511
|
|
239
266
|
uncountable/types/api/recipes/lock_recipes.py,sha256=hdxqn5gOk80Rbw05J9RWi1dPMiW-4wJwkVT_fmKiDUw,1356
|
|
240
267
|
uncountable/types/api/recipes/remove_recipe_from_project.py,sha256=3lqSU9UQIPMmOIvrdD9H--6QIdolYD0SadIuKxtObaE,872
|
|
241
268
|
uncountable/types/api/recipes/set_recipe_inputs.py,sha256=yCGFQoguzsSK_weOK4kcvqnUSkRJV1rzKxWnanIZbko,1444
|
|
242
269
|
uncountable/types/api/recipes/set_recipe_metadata.py,sha256=J2F1FDgFLKjlbGw29TW1Xefy38Zt-C7V1WDK70gRiuY,914
|
|
243
270
|
uncountable/types/api/recipes/set_recipe_output_annotations.py,sha256=ayG9vnCroYGQ3mmNBALLlQhf9otrR-q0QiNLnWgmIsw,2930
|
|
271
|
+
uncountable/types/api/recipes/set_recipe_output_file.py,sha256=8s0oxgjhv_hIyV3EoAjIBb970TrJJbKTFaSdNvbgU78,1225
|
|
244
272
|
uncountable/types/api/recipes/set_recipe_outputs.py,sha256=I7NUDO_QrKt1rZB7zHr6WWS2FdXCK8Bqc0BxFkDfjyQ,1729
|
|
245
273
|
uncountable/types/api/recipes/set_recipe_tags.py,sha256=kYX13RvHyUOlzL6LbBKDQ8yNvpvNobbnF2WDtgZsKRc,2493
|
|
246
274
|
uncountable/types/api/recipes/unarchive_recipes.py,sha256=KZKzw0fbQdOBUR3YBunFrHFcex4qPMiA8mDgsB6n24k,814
|
|
@@ -249,7 +277,7 @@ uncountable/types/api/triggers/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr
|
|
|
249
277
|
uncountable/types/api/triggers/run_trigger.py,sha256=_Rpha9nxXI3Xr17CrGDtofg4HZ81x2lt0rMZ6As0qfE,893
|
|
250
278
|
uncountable/types/api/uploader/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
|
|
251
279
|
uncountable/types/api/uploader/invoke_uploader.py,sha256=Rc77y5q-3R9-SNQgm8P35zKaW2D1Hbtm7PDixnOn1G0,1025
|
|
252
|
-
UncountablePythonSDK-0.0.
|
|
253
|
-
UncountablePythonSDK-0.0.
|
|
254
|
-
UncountablePythonSDK-0.0.
|
|
255
|
-
UncountablePythonSDK-0.0.
|
|
280
|
+
UncountablePythonSDK-0.0.70.dist-info/METADATA,sha256=_GI0ixHy91cpiMAMQfwyE-Sfvowp982PEBAw6-emnM0,2051
|
|
281
|
+
UncountablePythonSDK-0.0.70.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
|
282
|
+
UncountablePythonSDK-0.0.70.dist-info/top_level.txt,sha256=1UVGjAU-6hJY9qw2iJ7nCBeEwZ793AEN5ZfKX9A1uj4,31
|
|
283
|
+
UncountablePythonSDK-0.0.70.dist-info/RECORD,,
|
docs/requirements.txt
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from uncountable.integration.job import CronJob, JobArguments, register_job
|
|
2
|
+
from uncountable.types import entity_t
|
|
3
|
+
from uncountable.types.job_definition_t import JobResult
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@register_job
|
|
7
|
+
class MyCronJob(CronJob):
|
|
8
|
+
def run(self, args: JobArguments) -> JobResult:
|
|
9
|
+
matfam = args.client.get_entities_data(
|
|
10
|
+
entity_ids=[1],
|
|
11
|
+
entity_type=entity_t.EntityType.MATERIAL_FAMILY,
|
|
12
|
+
).entity_details[0]
|
|
13
|
+
name = None
|
|
14
|
+
for field_val in matfam.field_values:
|
|
15
|
+
if field_val.field_ref_name == "name":
|
|
16
|
+
name = field_val.value
|
|
17
|
+
args.logger.log_info(f"material family found with name: {name}")
|
|
18
|
+
return JobResult(success=True)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
base_url: http://0.0.0.0:5000
|
|
2
|
+
auth_retrieval:
|
|
3
|
+
type: basic
|
|
4
|
+
api_id_secret:
|
|
5
|
+
type: env
|
|
6
|
+
env_key: API_ID
|
|
7
|
+
api_key_secret:
|
|
8
|
+
type: env
|
|
9
|
+
env_key: API_SECRET_KEY
|
|
10
|
+
jobs:
|
|
11
|
+
- id: example_cron
|
|
12
|
+
enabled: true
|
|
13
|
+
type: cron
|
|
14
|
+
name: MyCron - Example
|
|
15
|
+
cron_spec: "* * * * *"
|
|
16
|
+
executor:
|
|
17
|
+
type: script
|
|
18
|
+
import_path: example_cron
|
|
19
|
+
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
# begin_project_name
|
|
3
|
+
# DO NOT MODIFY
|
|
4
|
+
name = "integration-server-testing"
|
|
5
|
+
# end_project_name
|
|
6
|
+
dynamic = ["version"]
|
|
7
|
+
dependencies = [
|
|
8
|
+
"mypy == 1.*",
|
|
9
|
+
"ruff == 0.*",
|
|
10
|
+
"openpyxl == 3.*",
|
|
11
|
+
"more_itertools == 10.*",
|
|
12
|
+
"types-paramiko == 3.4.0.20240423",
|
|
13
|
+
"types-openpyxl == 3.*",
|
|
14
|
+
"types-pysftp == 0.*",
|
|
15
|
+
"types-pytz == 2024.*",
|
|
16
|
+
"types-requests == 2.*",
|
|
17
|
+
"types-simplejson == 3.*",
|
|
18
|
+
"pandas-stubs",
|
|
19
|
+
"xlrd == 2.*"
|
|
20
|
+
]
|
|
21
|
+
|
|
22
|
+
[tool.mypy]
|
|
23
|
+
strict = true
|
|
24
|
+
show_error_codes = true
|
|
25
|
+
check_untyped_defs = true
|
|
26
|
+
disallow_any_generics = false
|
|
27
|
+
disallow_incomplete_defs = true
|
|
28
|
+
disallow_subclassing_any = false
|
|
29
|
+
disallow_untyped_calls = false
|
|
30
|
+
disallow_untyped_decorators = true
|
|
31
|
+
disallow_untyped_defs = true
|
|
32
|
+
implicit_reexport = true
|
|
33
|
+
no_implicit_optional = true
|
|
34
|
+
no_implicit_reexport = true
|
|
35
|
+
strict_equality = true
|
|
36
|
+
warn_redundant_casts = true
|
|
37
|
+
warn_unused_ignores = false
|
|
38
|
+
warn_no_return = true
|
|
39
|
+
warn_return_any = true
|
|
40
|
+
local_partial_types = true
|
|
41
|
+
warn_unreachable = false
|
|
42
|
+
warn_unused_configs = true
|
|
43
|
+
exclude = [
|
|
44
|
+
"env"
|
|
45
|
+
]
|
|
46
|
+
|
|
47
|
+
[tool.ruff]
|
|
48
|
+
preview = true
|
|
49
|
+
lint.select = ['ALL']
|
|
50
|
+
lint.ignore = [
|
|
51
|
+
"A001", # Variable shadows python built-in. Nice to have
|
|
52
|
+
"A002", # Variable shadows python built-in. Nice to have
|
|
53
|
+
"A003", # Class attribute shadows python built-in. Nice to have
|
|
54
|
+
"ANN", # Missing type annotations. Skip in favor of mypy
|
|
55
|
+
"ARG", # Unused arguments. Skip
|
|
56
|
+
"B006", # Do not use mutable data structures for argument defaults. Priority.
|
|
57
|
+
"B023", # Function doesn't bind loop variable. Priority
|
|
58
|
+
"B904", # Exception handling raise from. Skip
|
|
59
|
+
"BLE", # Blind exception. Should Add
|
|
60
|
+
"C401", # Unecessary generator. Skip
|
|
61
|
+
"C403", # Unnecessary list comprehension. Skip
|
|
62
|
+
"C405", # Unnecessary list. rewrite as set. Skip
|
|
63
|
+
"C408", # Unnecessary dict call. Skip
|
|
64
|
+
"C416", # Unnecessary list comprehension. Skip
|
|
65
|
+
"C417", # Unnecessary use of map. Should Add
|
|
66
|
+
"COM812", # Trailing comma. Too opinionated. Skip
|
|
67
|
+
"CPY", # Copyright notices. Skip
|
|
68
|
+
"D", # Docstrings. Skip
|
|
69
|
+
"DOC", # Docstrings. Skip
|
|
70
|
+
"DTZ001", # Missing tzinfo. Should add
|
|
71
|
+
"DTZ002", # Use of today instead of now. Should add
|
|
72
|
+
"DTZ003", # Use of utcnow not allowed. Should add
|
|
73
|
+
"DTZ004", # Use of utcfrom timestamp not allowed. Should add
|
|
74
|
+
"DTZ005", # now without tz not allowed. Should add
|
|
75
|
+
"DTZ006", # use of from timestamp without tz not allowed. Should add
|
|
76
|
+
"DTZ007", # replace timezone after strptime. Should add
|
|
77
|
+
"DTZ011", # Use of today not allowed. Should add
|
|
78
|
+
"E501", # Line length. Skip
|
|
79
|
+
"EM101", # exception must not use a string literal. skip
|
|
80
|
+
"EM102", # exception must not use an f string. skip
|
|
81
|
+
"EM103", # exception must not use a format string. skip
|
|
82
|
+
"ERA", # Rules around commented code. Skip
|
|
83
|
+
"EXE002", # Executable files need shebang. Skip
|
|
84
|
+
"F841", # TEMPORARY DISABLE TO CLEAR UP BUILD. Unused variables. Prioritize.
|
|
85
|
+
"FBT001", # boolean positional args. Skip
|
|
86
|
+
"FBT002", # boolean default positional. Skip
|
|
87
|
+
"FBT003", # boolean positional. Skip
|
|
88
|
+
"FIX001", # Fixme comment. Skip
|
|
89
|
+
"FIX002", # todo comment. Skip
|
|
90
|
+
"FIX004", # hack comment. Skip
|
|
91
|
+
"FLY002", # Use F-String instead of join. Should Add
|
|
92
|
+
"FURB101", # replace read function. Skip
|
|
93
|
+
"FURB103", # opinionated file opening. Skip
|
|
94
|
+
"FURB113", # extend vs append. Skip
|
|
95
|
+
"FURB118", # opinionated rules about lambdas. skip
|
|
96
|
+
"FURB140", # starmap vs generator. Skip
|
|
97
|
+
"G004", # avoid f strings in log statements. Should add
|
|
98
|
+
"INP001", # implicit imports. use __init__. Skip
|
|
99
|
+
"ISC001", # rule conflicts with formatter. Skip
|
|
100
|
+
"ISC003", # Explicitly concatenated string should be implicitly concatenated. Skip
|
|
101
|
+
"N801", # class name case. Skip
|
|
102
|
+
"N802", # function name lower case. Skip
|
|
103
|
+
"N803", # argument name lower cas. Skip
|
|
104
|
+
"N804", # cls_ first variable. Should add
|
|
105
|
+
"N806", # lower case variable. Skip
|
|
106
|
+
"N812", # case consistency on import. Skip
|
|
107
|
+
"N815", # mix casing, skip
|
|
108
|
+
"N817", # don't use acronym. Should add
|
|
109
|
+
"N818", # exception override should be named with error. should add
|
|
110
|
+
"N999", # module naming. Should add
|
|
111
|
+
"PD002", # avoid inplace. Skip
|
|
112
|
+
"PD004", # .notna. Should add
|
|
113
|
+
"PD010", # .pivottable. Should add
|
|
114
|
+
"PD011", # use .to_numpy. Skip
|
|
115
|
+
"PD015", # use .merge. Should add
|
|
116
|
+
"PD901", # avoid generic df name. Skip
|
|
117
|
+
"PERF203", # avoid try except in loop. Skip
|
|
118
|
+
"PERF401", # use list comprehension. Skip
|
|
119
|
+
"PERF402", # use list.copy. Skip
|
|
120
|
+
"PERF403", # use dictionary comprehension. Skip
|
|
121
|
+
"S307", # avoid eval. Should add
|
|
122
|
+
"PGH003", # ignore specific rules. Skip
|
|
123
|
+
"PGH004", # ignore specific rules. Skip
|
|
124
|
+
"PLC0414", # import alias doesn't rename. Skip
|
|
125
|
+
"PLC0415", # import at top level. Skip
|
|
126
|
+
"PLC1901", # falsy empty string. Skip
|
|
127
|
+
"PLR0124", # self comparison. Skip
|
|
128
|
+
"PLR0402", # alias import. Skip
|
|
129
|
+
"PLR0911", # too many return statements. Skip
|
|
130
|
+
"PLR0912", # too many branches. Skip
|
|
131
|
+
"PLR0913", # too many arguments. Skip
|
|
132
|
+
"PLR0915", # too many statements. Skip
|
|
133
|
+
"PLR0916", # too many expressions. Skip
|
|
134
|
+
"PLR0917", # too many positional arguments. Skip
|
|
135
|
+
"PLR1714", # multiple comparisons. Skip
|
|
136
|
+
"PLR2004", # magic values. skip
|
|
137
|
+
"PLR5501", # use elif instead of else if. skip
|
|
138
|
+
"PLR6104", # use augmented assignment. confuses strings, wait for fix. skip
|
|
139
|
+
"PLR6201", # use a set literal for membership test. skip
|
|
140
|
+
"PLR6301", # method inference. skip
|
|
141
|
+
"PLW0108", # inline lambda. skip
|
|
142
|
+
"PLW0120", # else without break. skip
|
|
143
|
+
"PLW0602", # global withotu assignment. consider
|
|
144
|
+
"PLW0603", # discourage global. skip
|
|
145
|
+
"PLW1510", # subprocess run without check arg. skip
|
|
146
|
+
"PLW1514", # open without encoding. skip
|
|
147
|
+
"PLW2901", # for loop variable overwritten. skip
|
|
148
|
+
"PT001", # change ficture decorator. should add
|
|
149
|
+
"PT011", # use more specific raises decorator. should add
|
|
150
|
+
"PT018", # break down complex assertsions. skip
|
|
151
|
+
"PTH", # enforces new python path library usage. skip
|
|
152
|
+
"PYI030", # turn union of literals to just literal with multiple. should add
|
|
153
|
+
"PYI041", # use float instead of int | float. should remove floats
|
|
154
|
+
"RET", # enforces return semantics. break up and re-evaluate later
|
|
155
|
+
"RSE102", # unnecessary parens on exception. skip.
|
|
156
|
+
"RUF001", # ambiguous characters. skip
|
|
157
|
+
"RUF005", # prefer star to concatenation. skip
|
|
158
|
+
"RUF010", # use explicit conversion flag. skip
|
|
159
|
+
"RUF012", # type with class var. should add
|
|
160
|
+
"RUF015", # prefer next for single element. skip
|
|
161
|
+
"RUF100", # unused noqa. should add
|
|
162
|
+
"S", # should split up
|
|
163
|
+
"S101", # allow asserts. skip
|
|
164
|
+
"SIM102", # use single if instead of nested. skip
|
|
165
|
+
"SIM105", # use exception supress. skip
|
|
166
|
+
"SIM108", # use ternary. skip
|
|
167
|
+
"SIM110", # use any/all. should add
|
|
168
|
+
"SIM112", # case of env variable. skip
|
|
169
|
+
"SIM114", # combine if branches. skip
|
|
170
|
+
"SIM115", # use context handler for files. should add
|
|
171
|
+
"SIM117", # use single with. should add
|
|
172
|
+
"SLF001", # private member access. should add
|
|
173
|
+
"SLOT000", # subclass of string should define slot. should add
|
|
174
|
+
"T201", # print. skip
|
|
175
|
+
"T203", # pprint. skip
|
|
176
|
+
"TCH001", # move application import into type checking. skip
|
|
177
|
+
"TCH002", # move third party import into type checking. consider
|
|
178
|
+
"TCH003", # move library into type checking lbock. consider
|
|
179
|
+
"TD", # todo comments. skip
|
|
180
|
+
"TID252", # eliminate relative imports from parents. skip
|
|
181
|
+
"TRY002", # create your own exception. skip
|
|
182
|
+
"TRY003", # avoid long messages. skip
|
|
183
|
+
"TRY004", # prefer type error. should add
|
|
184
|
+
"TRY201", # raise without exception name. consider
|
|
185
|
+
"TRY300", # move statement to else block. consider
|
|
186
|
+
"TRY301", # move raise to inner function. skip
|
|
187
|
+
"UP007", # use union for type annotations. should add
|
|
188
|
+
"UP013", # eliminate typeddict. should add
|
|
189
|
+
"UP031", # use format specifiers. should add
|
|
190
|
+
"B905", # zip strict. we have a deprecated pattern here, consider
|
|
191
|
+
"UP036", # outdated version block, consider
|
|
192
|
+
"RUF007", # prefer itertools.pairwise over zip, consider
|
|
193
|
+
"RUF022", # __all__ is not sorted. skip due to isort complication
|
|
194
|
+
"UP017", # use datetime.UTC, TODO add back in
|
|
195
|
+
"UP035", # replacing List with list, TODO add back in
|
|
196
|
+
"UP038", # isinstance X | Y instead of (X, Y), TODO add back in
|
|
197
|
+
# ## FROM RUFF UPGRADE
|
|
198
|
+
"PLC2701", # private name imports. should add
|
|
199
|
+
"PLR1702", # too many nested blocks -- add with config. skip
|
|
200
|
+
"RUF025", # unnecessary dict comprehension. skip
|
|
201
|
+
"SIM113", # index variable should use enumerate. should add.
|
|
202
|
+
"PLR0914" # too many local variables. configure below. should add with config
|
|
203
|
+
]
|
|
204
|
+
line-length = 90
|
|
205
|
+
target-version = "py311"
|
|
206
|
+
|
|
207
|
+
exclude = [
|
|
208
|
+
'env'
|
|
209
|
+
]
|
|
210
|
+
[tool.ruff.lint.per-file-ignores]
|
|
211
|
+
"__init__.py" = ["F401"]
|
|
212
|
+
|
|
213
|
+
[tool.ruff.lint.isort]
|
|
214
|
+
split-on-trailing-comma = true
|
|
215
|
+
|
|
216
|
+
[tool.ruff.lint.mccabe]
|
|
217
|
+
max-complexity = 130 # goal would be to bring this down to ~50 or so
|
|
218
|
+
|
|
219
|
+
[tool.ruff.lint.pylint]
|
|
220
|
+
max-locals=50
|
|
221
|
+
|
|
222
|
+
[tool.setuptools]
|
|
223
|
+
py-modules = []
|
|
224
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
from uncountable.core import (
|
|
4
|
+
AsyncBatchProcessor,
|
|
5
|
+
AuthDetailsApiKey,
|
|
6
|
+
Client,
|
|
7
|
+
MediaFileUpload,
|
|
8
|
+
)
|
|
9
|
+
from uncountable.types import recipe_metadata_t
|
|
10
|
+
from uncountable.types.identifier_t import IdentifierKeyBatchReference
|
|
11
|
+
|
|
12
|
+
client = Client(
|
|
13
|
+
base_url="http://localhost:5000",
|
|
14
|
+
auth_details=AuthDetailsApiKey(
|
|
15
|
+
api_id=os.environ["UNC_API_ID"],
|
|
16
|
+
api_secret_key=os.environ["UNC_API_SECRET_KEY"],
|
|
17
|
+
),
|
|
18
|
+
)
|
|
19
|
+
uploaded_file = client.upload_files(
|
|
20
|
+
file_uploads=[
|
|
21
|
+
MediaFileUpload(path="/home/logan/Downloads/my_file_to_upload.csv"),
|
|
22
|
+
]
|
|
23
|
+
)[0]
|
|
24
|
+
|
|
25
|
+
batch_processor = AsyncBatchProcessor(client=client)
|
|
26
|
+
|
|
27
|
+
recipe_batch_identifier = batch_processor.create_recipe(
|
|
28
|
+
material_family_id=1, workflow_id=1
|
|
29
|
+
).batch_reference
|
|
30
|
+
|
|
31
|
+
batch_processor.set_recipe_metadata(
|
|
32
|
+
recipe_key=IdentifierKeyBatchReference(reference=recipe_batch_identifier),
|
|
33
|
+
recipe_metadata=[
|
|
34
|
+
recipe_metadata_t.MetadataValue(
|
|
35
|
+
metadata_id=102, value_file_ids=[uploaded_file.file_id]
|
|
36
|
+
)
|
|
37
|
+
],
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
batch_processor.send()
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
import uncountable.types.api.recipes.set_recipe_output_file as set_recipe_output_file_t
|
|
5
|
+
from uncountable.core import AuthDetailsApiKey, Client, MediaFileUpload
|
|
6
|
+
|
|
7
|
+
client = Client(
|
|
8
|
+
base_url="http://localhost:5000",
|
|
9
|
+
auth_details=AuthDetailsApiKey(
|
|
10
|
+
api_id=os.environ["UNC_API_ID"],
|
|
11
|
+
api_secret_key=os.environ["UNC_API_SECRET_KEY"],
|
|
12
|
+
),
|
|
13
|
+
)
|
|
14
|
+
uploaded_file = client.upload_files(
|
|
15
|
+
file_uploads=[
|
|
16
|
+
MediaFileUpload(
|
|
17
|
+
path=str((Path.home() / "Downloads" / "my_file_to_upload.csv").absolute())
|
|
18
|
+
),
|
|
19
|
+
]
|
|
20
|
+
)[0]
|
|
21
|
+
|
|
22
|
+
client.set_recipe_output_file(
|
|
23
|
+
output_file_data=set_recipe_output_file_t.RecipeOutputFileValue(
|
|
24
|
+
recipe_id=58070, output_id=148, file_id=uploaded_file.file_id, experiment_num=1
|
|
25
|
+
)
|
|
26
|
+
)
|
uncountable/core/environment.py
CHANGED
|
@@ -17,7 +17,11 @@ def get_integration_env() -> str | None:
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
def get_webhook_server_port() -> int:
|
|
20
|
-
return int(os.environ.get("UNC_WEBHOOK_SERVER_PORT"
|
|
20
|
+
return int(os.environ.get("UNC_WEBHOOK_SERVER_PORT", 5001))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def get_local_admin_server_port() -> int:
|
|
24
|
+
return int(os.environ.get("UNC_ADMIN_SERVER_PORT", 50051))
|
|
21
25
|
|
|
22
26
|
|
|
23
27
|
def get_otel_enabled() -> bool:
|
uncountable/integration/cli.py
CHANGED
uncountable/integration/cron.py
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
2
|
|
|
3
3
|
from pkgs.argument_parser import CachedParser
|
|
4
|
-
from uncountable.core.
|
|
5
|
-
from uncountable.integration.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
from uncountable.
|
|
4
|
+
from uncountable.core.environment import get_local_admin_server_port
|
|
5
|
+
from uncountable.integration.queue_runner.command_server.command_client import (
|
|
6
|
+
send_job_queue_message,
|
|
7
|
+
)
|
|
8
|
+
from uncountable.types import queued_job_t
|
|
9
9
|
from uncountable.types.job_definition_t import JobDefinition, ProfileMetadata
|
|
10
10
|
|
|
11
11
|
|
|
@@ -20,26 +20,10 @@ cron_args_parser = CachedParser(CronJobArgs)
|
|
|
20
20
|
|
|
21
21
|
def cron_job_executor(**kwargs: dict) -> None:
|
|
22
22
|
args_passed = cron_args_parser.parse_storage(kwargs)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
profile_meta=args_passed.profile_metadata, job_logger=job_logger
|
|
31
|
-
)
|
|
32
|
-
batch_processor = AsyncBatchProcessor(client=client)
|
|
33
|
-
args = CronJobArguments(
|
|
34
|
-
job_definition=args_passed.definition,
|
|
35
|
-
client=client,
|
|
36
|
-
batch_processor=batch_processor,
|
|
37
|
-
profile_metadata=args_passed.profile_metadata,
|
|
38
|
-
logger=job_logger,
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
execute_job(
|
|
42
|
-
args=args,
|
|
43
|
-
profile_metadata=args_passed.profile_metadata,
|
|
44
|
-
job_definition=args_passed.definition,
|
|
45
|
-
)
|
|
23
|
+
send_job_queue_message(
|
|
24
|
+
job_ref_name=args_passed.definition.id,
|
|
25
|
+
payload=queued_job_t.QueuedJobPayload(
|
|
26
|
+
invocation_context=queued_job_t.InvocationContextCron()
|
|
27
|
+
),
|
|
28
|
+
port=get_local_admin_server_port(),
|
|
29
|
+
)
|
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
import os
|
|
2
|
+
from enum import StrEnum
|
|
2
3
|
|
|
3
4
|
from sqlalchemy import create_engine
|
|
4
5
|
from sqlalchemy.engine.base import Engine
|
|
5
6
|
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
class IntegrationDBService(StrEnum):
|
|
9
|
+
CRON = "cron"
|
|
10
|
+
RUNNER = "runner"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def create_db_engine(service: IntegrationDBService) -> Engine:
|
|
14
|
+
match service:
|
|
15
|
+
case IntegrationDBService.CRON:
|
|
16
|
+
return create_engine(os.environ["UNC_CRON_SQLITE_URI"])
|
|
17
|
+
case IntegrationDBService.RUNNER:
|
|
18
|
+
return create_engine(os.environ["UNC_RUNNER_SQLITE_URI"])
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from contextlib import _GeneratorContextManager, contextmanager
|
|
2
|
+
from typing import Callable, Generator
|
|
3
|
+
|
|
4
|
+
from sqlalchemy.engine import Engine
|
|
5
|
+
from sqlalchemy.orm import Session, sessionmaker
|
|
6
|
+
|
|
7
|
+
DBSessionMaker = Callable[[], _GeneratorContextManager[Session]]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def get_session_maker(engine: Engine) -> DBSessionMaker:
|
|
11
|
+
session_maker = sessionmaker(bind=engine)
|
|
12
|
+
|
|
13
|
+
@contextmanager
|
|
14
|
+
def session_manager() -> Generator[Session, None, None]:
|
|
15
|
+
session = session_maker()
|
|
16
|
+
try:
|
|
17
|
+
yield session
|
|
18
|
+
session.commit()
|
|
19
|
+
except Exception:
|
|
20
|
+
session.rollback()
|
|
21
|
+
raise
|
|
22
|
+
finally:
|
|
23
|
+
session.close()
|
|
24
|
+
|
|
25
|
+
return session_manager
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
from uncountable.integration.db.connect import create_db_engine
|
|
1
|
+
from uncountable.integration.db.connect import IntegrationDBService, create_db_engine
|
|
2
2
|
from uncountable.integration.scan_profiles import load_profiles
|
|
3
3
|
from uncountable.integration.server import IntegrationServer
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
def main(
|
|
7
|
-
with IntegrationServer(create_db_engine()) as server:
|
|
6
|
+
def main() -> None:
|
|
7
|
+
with IntegrationServer(create_db_engine(IntegrationDBService.CRON)) as server:
|
|
8
8
|
for profile_details in load_profiles():
|
|
9
9
|
server.register_profile(
|
|
10
10
|
profile_name=profile_details.name,
|
|
@@ -14,8 +14,8 @@ def main(blocking: bool) -> None:
|
|
|
14
14
|
client_options=profile_details.definition.client_options,
|
|
15
15
|
)
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
server.serve_forever()
|
|
17
|
+
server.serve_forever()
|
|
19
18
|
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
if __name__ == "__main__":
|
|
21
|
+
main()
|