workbench 0.8.186__py3-none-any.whl → 0.8.187__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.
Potentially problematic release.
This version of workbench might be problematic. Click here for more details.
- workbench/scripts/lambda_launcher.py +39 -0
- workbench/scripts/ml_pipeline_sqs.py +6 -1
- workbench/utils/config_manager.py +2 -6
- workbench/utils/license_manager.py +2 -6
- {workbench-0.8.186.dist-info → workbench-0.8.187.dist-info}/METADATA +2 -1
- {workbench-0.8.186.dist-info → workbench-0.8.187.dist-info}/RECORD +10 -10
- {workbench-0.8.186.dist-info → workbench-0.8.187.dist-info}/entry_points.txt +1 -0
- workbench/utils/resource_utils.py +0 -39
- {workbench-0.8.186.dist-info → workbench-0.8.187.dist-info}/WHEEL +0 -0
- {workbench-0.8.186.dist-info → workbench-0.8.187.dist-info}/licenses/LICENSE +0 -0
- {workbench-0.8.186.dist-info → workbench-0.8.187.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
import os
|
|
3
|
+
import importlib.util
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def main():
|
|
7
|
+
if len(sys.argv) != 2:
|
|
8
|
+
print("Usage: lambda_launcher <handler_module_name>")
|
|
9
|
+
sys.exit(1)
|
|
10
|
+
|
|
11
|
+
handler_file = sys.argv[1]
|
|
12
|
+
|
|
13
|
+
# Add .py if not present
|
|
14
|
+
if not handler_file.endswith(".py"):
|
|
15
|
+
handler_file += ".py"
|
|
16
|
+
|
|
17
|
+
# Check if file exists
|
|
18
|
+
if not os.path.exists(handler_file):
|
|
19
|
+
print(f"Error: File '{handler_file}' not found")
|
|
20
|
+
sys.exit(1)
|
|
21
|
+
|
|
22
|
+
# Load the module dynamically
|
|
23
|
+
spec = importlib.util.spec_from_file_location("lambda_module", handler_file)
|
|
24
|
+
lambda_module = importlib.util.module_from_spec(spec)
|
|
25
|
+
spec.loader.exec_module(lambda_module)
|
|
26
|
+
|
|
27
|
+
# Call the lambda_handler
|
|
28
|
+
print(f"Invoking lambda_handler from {handler_file}...")
|
|
29
|
+
print("-" * 50)
|
|
30
|
+
|
|
31
|
+
result = lambda_module.lambda_handler({}, {})
|
|
32
|
+
|
|
33
|
+
print("-" * 50)
|
|
34
|
+
print("Result:")
|
|
35
|
+
print(result)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
if __name__ == "__main__":
|
|
39
|
+
main()
|
|
@@ -158,9 +158,14 @@ def main():
|
|
|
158
158
|
action="store_true",
|
|
159
159
|
help="Set DT=True (models and endpoints will have '-dt' suffix)",
|
|
160
160
|
)
|
|
161
|
+
parser.add_argument(
|
|
162
|
+
"--promote",
|
|
163
|
+
action="store_true",
|
|
164
|
+
help="Set Promote=True (models and endpoints will use promoted naming",
|
|
165
|
+
)
|
|
161
166
|
args = parser.parse_args()
|
|
162
167
|
try:
|
|
163
|
-
submit_to_sqs(args.script_file, args.size, realtime=args.realtime, dt=args.dt)
|
|
168
|
+
submit_to_sqs(args.script_file, args.size, realtime=args.realtime, dt=args.dt, promote=args.promote)
|
|
164
169
|
except Exception as e:
|
|
165
170
|
print(f"\n❌ ERROR: {e}")
|
|
166
171
|
log.error(f"Error: {e}")
|
|
@@ -4,16 +4,13 @@ import os
|
|
|
4
4
|
import sys
|
|
5
5
|
import platform
|
|
6
6
|
import logging
|
|
7
|
-
import importlib.resources as resources # noqa: F401 Python 3.9 compatibility
|
|
8
7
|
from typing import Any, Dict
|
|
8
|
+
from importlib.resources import files, as_file
|
|
9
9
|
|
|
10
10
|
# Workbench imports
|
|
11
11
|
from workbench.utils.license_manager import LicenseManager
|
|
12
12
|
from workbench_bridges.utils.execution_environment import running_as_service
|
|
13
13
|
|
|
14
|
-
# Python 3.9 compatibility
|
|
15
|
-
from workbench.utils.resource_utils import get_resource_path
|
|
16
|
-
|
|
17
14
|
|
|
18
15
|
class FatalConfigError(Exception):
|
|
19
16
|
"""Exception raised for errors in the configuration."""
|
|
@@ -172,8 +169,7 @@ class ConfigManager:
|
|
|
172
169
|
Returns:
|
|
173
170
|
str: The open source API key.
|
|
174
171
|
"""
|
|
175
|
-
|
|
176
|
-
with get_resource_path("workbench.resources", "open_source_api.key") as open_source_key_path:
|
|
172
|
+
with as_file(files("workbench.resources").joinpath("open_source_api.key")) as open_source_key_path:
|
|
177
173
|
with open(open_source_key_path, "r") as key_file:
|
|
178
174
|
return key_file.read().strip()
|
|
179
175
|
|
|
@@ -6,15 +6,12 @@ import json
|
|
|
6
6
|
import logging
|
|
7
7
|
import requests
|
|
8
8
|
from typing import Union
|
|
9
|
-
import importlib.resources as resources # noqa: F401 Python 3.9 compatibility
|
|
10
9
|
from datetime import datetime
|
|
11
10
|
from cryptography.hazmat.primitives import hashes
|
|
12
11
|
from cryptography.hazmat.primitives.asymmetric import padding
|
|
13
12
|
from cryptography.hazmat.primitives import serialization
|
|
14
13
|
from cryptography.hazmat.backends import default_backend
|
|
15
|
-
|
|
16
|
-
# Python 3.9 compatibility
|
|
17
|
-
from workbench.utils.resource_utils import get_resource_path
|
|
14
|
+
from importlib.resources import files, as_file
|
|
18
15
|
|
|
19
16
|
|
|
20
17
|
class FatalLicenseError(Exception):
|
|
@@ -140,8 +137,7 @@ class LicenseManager:
|
|
|
140
137
|
Returns:
|
|
141
138
|
The public key as an object.
|
|
142
139
|
"""
|
|
143
|
-
|
|
144
|
-
with get_resource_path("workbench.resources", "signature_verify_pub.pem") as public_key_path:
|
|
140
|
+
with as_file(files("workbench.resources").joinpath("signature_verify_pub.pem")) as public_key_path:
|
|
145
141
|
with open(public_key_path, "rb") as key_file:
|
|
146
142
|
public_key_data = key_file.read()
|
|
147
143
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: workbench
|
|
3
|
-
Version: 0.8.
|
|
3
|
+
Version: 0.8.187
|
|
4
4
|
Summary: Workbench: A Dashboard and Python API for creating and deploying AWS SageMaker Model Pipelines
|
|
5
5
|
Author-email: SuperCowPowers LLC <support@supercowpowers.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -10,6 +10,7 @@ Classifier: Development Status :: 4 - Beta
|
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.10
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.11
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
13
14
|
Classifier: Topic :: Scientific/Engineering
|
|
14
15
|
Requires-Python: >=3.10
|
|
15
16
|
Description-Content-Type: text/markdown
|
|
@@ -168,8 +168,9 @@ workbench/resources/open_source_api.key,sha256=3S0OTblsmC0msUPdE_dbBmI83xJNmYscu
|
|
|
168
168
|
workbench/resources/signature_verify_pub.pem,sha256=V3-u-3_z2PH-805ybkKvzDOBwAbvHxcKn0jLBImEtzM,272
|
|
169
169
|
workbench/scripts/check_double_bond_stereo.py,sha256=p5hnL54Weq77ES0HCELq9JeoM-PyUGkvVSeWYF2dKyo,7776
|
|
170
170
|
workbench/scripts/glue_launcher.py,sha256=bIKQvfGxpAhzbeNvTnHfRW_5kQhY-169_868ZnCejJk,10692
|
|
171
|
+
workbench/scripts/lambda_launcher.py,sha256=U5HevvWdwN0SUrN2kpbkf0doY-5Ih_LzjJTH-45LBJ8,925
|
|
171
172
|
workbench/scripts/ml_pipeline_batch.py,sha256=1T5JnLlUJR7bwAGBLHmLPOuj1xFRqVIQX8PsuDhHy8o,4907
|
|
172
|
-
workbench/scripts/ml_pipeline_sqs.py,sha256=
|
|
173
|
+
workbench/scripts/ml_pipeline_sqs.py,sha256=ebe8clE6dMONF43_JiX5Qx1WESPfGlF2-AifvJOde50,6578
|
|
173
174
|
workbench/scripts/monitor_cloud_watch.py,sha256=s7MY4bsHts0nup9G0lWESCvgJZ9Mw1Eo-c8aKRgLjMw,9235
|
|
174
175
|
workbench/scripts/redis_expire.py,sha256=DxI_RKSNlrW2BsJZXcsSbaWGBgPZdPhtzHjV9SUtElE,1120
|
|
175
176
|
workbench/scripts/redis_report.py,sha256=iaJSuGPyLCs6e0TMcZDoT0YyJ43xJ1u74YD8FLnnUg4,990
|
|
@@ -202,7 +203,7 @@ workbench/utils/cache.py,sha256=0R5RXYEz_XHARK3anmQC4VRMawMks_cJ8S4vwC2roAE,5524
|
|
|
202
203
|
workbench/utils/cloudwatch_handler.py,sha256=t0L280Qa1nMq95dwnf8lB5g8FHrQAyGY5S4JwP3yIa8,5165
|
|
203
204
|
workbench/utils/cloudwatch_utils.py,sha256=wXSqKcJlSnHyC0D6d4RsH8wwmx_0CsffcetUgXlZ_78,4828
|
|
204
205
|
workbench/utils/color_utils.py,sha256=TmDGLK44t975lkfjt_1O-ee02QxrKfke7vPuXb-V-Uo,11779
|
|
205
|
-
workbench/utils/config_manager.py,sha256=
|
|
206
|
+
workbench/utils/config_manager.py,sha256=UPP9SHTLfPyPKEfsgH2YXp9WlImmVZ5zqFft4BxRdlo,17499
|
|
206
207
|
workbench/utils/dashboard_metrics.py,sha256=cNFI0GIAjd_IiDzM1oebsJ2QkRZuW068W_66ZC3J100,7398
|
|
207
208
|
workbench/utils/datetime_utils.py,sha256=r3G_KB2euu26lwVbDXYXPJEpJCZwin2Iph7BiBIoybg,4454
|
|
208
209
|
workbench/utils/deprecated_utils.py,sha256=qniHVpDGuwOnhxn65LofDQ_EA2OhSUcZLPxAXtx7FgA,3540
|
|
@@ -216,7 +217,7 @@ workbench/utils/graph_utils.py,sha256=T4aslYVbzPmFe0_qKCQP6PZnaw1KATNXQNVO-yDGBx
|
|
|
216
217
|
workbench/utils/ipython_utils.py,sha256=skbdbBwUT-iuY3FZwy3ACS7-FWSe9M2qVXfLlQWnikE,700
|
|
217
218
|
workbench/utils/json_utils.py,sha256=FSxzcD88TbIEJDw0FHue5-ZGny94wm5NeLs4zYlLLpU,4881
|
|
218
219
|
workbench/utils/lambda_utils.py,sha256=7GhGRPyXn9o-toWb9HBGSnI8-DhK9YRkwhCSk_mNKMI,1893
|
|
219
|
-
workbench/utils/license_manager.py,sha256=
|
|
220
|
+
workbench/utils/license_manager.py,sha256=lNE9zZIglmX3zqqCKBdN1xqTgHCEZgJDxavF6pdG7fc,6825
|
|
220
221
|
workbench/utils/log_utils.py,sha256=7n1NJXO_jUX82e6LWAQug6oPo3wiPDBYsqk9gsYab_A,3167
|
|
221
222
|
workbench/utils/markdown_utils.py,sha256=4lEqzgG4EVmLcvvKKNUwNxVCySLQKJTJmWDiaDroI1w,8306
|
|
222
223
|
workbench/utils/model_utils.py,sha256=5z4E_F_uDUhuz5_0ZNqNXvretImF1c49LX158RP6yfI,13588
|
|
@@ -229,7 +230,6 @@ workbench/utils/plugin_manager.py,sha256=JWfyFHQih_J_MMtAT1cgjGVnNVPk9bM917LkfH8
|
|
|
229
230
|
workbench/utils/prox_utils.py,sha256=V0YSxI6lboZl8Bed1GUobFqfMhfpehn2FtgqHpkuhDQ,6170
|
|
230
231
|
workbench/utils/redis_cache.py,sha256=39LFSWmOlNNcah02D3sBnmibc-DPeKC3SNq71K4HaB4,12893
|
|
231
232
|
workbench/utils/repl_utils.py,sha256=rWOMv2HiEIp8ZL6Ps6DlwiJlGr-pOhv9OZQhm3aR-1A,4668
|
|
232
|
-
workbench/utils/resource_utils.py,sha256=EM4SrMmRUQnG80aR5M7hmzw86hYdP_S7fRPuqhpDSVo,1435
|
|
233
233
|
workbench/utils/s3_utils.py,sha256=Xme_o_cftC_jWnw6R9YKS6-6C11zaCBAoQDlY3dZb5o,7337
|
|
234
234
|
workbench/utils/shap_utils.py,sha256=dtjSIwSyvYSaQjjvIp5A9LGS7pr-5Vt907rvVKOrqNY,12651
|
|
235
235
|
workbench/utils/shapley_values.py,sha256=3DvQz4HIPnxW42idgtuQ5vtzU-oF4_lToaWzLRjU-E4,3673
|
|
@@ -287,9 +287,9 @@ workbench/web_interface/page_views/main_page.py,sha256=X4-KyGTKLAdxR-Zk2niuLJB2Y
|
|
|
287
287
|
workbench/web_interface/page_views/models_page_view.py,sha256=M0bdC7bAzLyIaE2jviY12FF4abdMFZmg6sFuOY_LaGI,2650
|
|
288
288
|
workbench/web_interface/page_views/page_view.py,sha256=Gh6YnpOGlUejx-bHZAf5pzqoQ1H1R0OSwOpGhOBO06w,455
|
|
289
289
|
workbench/web_interface/page_views/pipelines_page_view.py,sha256=v2pxrIbsHBcYiblfius3JK766NZ7ciD2yPx0t3E5IJo,2656
|
|
290
|
-
workbench-0.8.
|
|
291
|
-
workbench-0.8.
|
|
292
|
-
workbench-0.8.
|
|
293
|
-
workbench-0.8.
|
|
294
|
-
workbench-0.8.
|
|
295
|
-
workbench-0.8.
|
|
290
|
+
workbench-0.8.187.dist-info/licenses/LICENSE,sha256=z4QMMPlLJkZjU8VOKqJkZiQZCEZ--saIU2Z8-p3aVc0,1080
|
|
291
|
+
workbench-0.8.187.dist-info/METADATA,sha256=1lRWJw94dqcolsHhaAxcUbu0JdeJB2ETVOoMxhJqpcI,9261
|
|
292
|
+
workbench-0.8.187.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
293
|
+
workbench-0.8.187.dist-info/entry_points.txt,sha256=o7ohD4D2oygnHp7i9-C0LfcHDuPW5Tv0JXGAg97DpGk,413
|
|
294
|
+
workbench-0.8.187.dist-info/top_level.txt,sha256=Dhy72zTxaA_o_yRkPZx5zw-fwumnjGaeGf0hBN3jc_w,10
|
|
295
|
+
workbench-0.8.187.dist-info/RECORD,,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
[console_scripts]
|
|
2
2
|
cloud_watch = workbench.scripts.monitor_cloud_watch:main
|
|
3
3
|
glue_launcher = workbench.scripts.glue_launcher:main
|
|
4
|
+
lambda_launcher = workbench.scripts.lambda_launcher:main
|
|
4
5
|
ml_pipeline_batch = workbench.scripts.ml_pipeline_batch:main
|
|
5
6
|
ml_pipeline_sqs = workbench.scripts.ml_pipeline_sqs:main
|
|
6
7
|
workbench = workbench.repl.workbench_shell:launch_shell
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"""Resource utilities for Workbench"""
|
|
2
|
-
|
|
3
|
-
import sys
|
|
4
|
-
import importlib.resources as resources
|
|
5
|
-
import pathlib
|
|
6
|
-
import pkg_resources
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def get_resource_path(package: str, resource: str) -> pathlib.Path:
|
|
10
|
-
"""Get the path to a resource file, compatible with Python 3.9 and higher.
|
|
11
|
-
|
|
12
|
-
Args:
|
|
13
|
-
package (str): The package where the resource is located.
|
|
14
|
-
resource (str): The name of the resource file.
|
|
15
|
-
|
|
16
|
-
Returns:
|
|
17
|
-
pathlib.Path: The path to the resource file.
|
|
18
|
-
"""
|
|
19
|
-
if sys.version_info >= (3, 10):
|
|
20
|
-
# Python 3.10 and higher: use importlib.resources.path
|
|
21
|
-
with resources.path(package, resource) as path:
|
|
22
|
-
return path
|
|
23
|
-
else:
|
|
24
|
-
# Python 3.9 and lower: manually construct the path based on package location
|
|
25
|
-
# Get the location of the installed package
|
|
26
|
-
package_location = pathlib.Path(pkg_resources.get_distribution(package.split(".")[0]).location)
|
|
27
|
-
resource_path = package_location / package.replace(".", "/") / resource
|
|
28
|
-
|
|
29
|
-
if resource_path.exists():
|
|
30
|
-
return resource_path
|
|
31
|
-
else:
|
|
32
|
-
raise FileNotFoundError(f"Resource '{resource}' not found in package '{package}'.")
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if __name__ == "__main__":
|
|
36
|
-
# Test the resource utilities
|
|
37
|
-
with get_resource_path("workbench.resources", "open_source_api.key") as open_source_key_path:
|
|
38
|
-
with open(open_source_key_path, "r") as key_file:
|
|
39
|
-
print(key_file.read().strip())
|
|
File without changes
|
|
File without changes
|
|
File without changes
|