workbench 0.8.170__py3-none-any.whl → 0.8.172__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.

Files changed (27) hide show
  1. workbench/api/feature_set.py +4 -4
  2. workbench/core/artifacts/artifact.py +11 -3
  3. workbench/core/artifacts/model_core.py +37 -14
  4. workbench/core/cloud_platform/aws/aws_account_clamp.py +4 -1
  5. workbench/core/cloud_platform/aws/aws_meta.py +11 -4
  6. workbench/core/transforms/features_to_model/features_to_model.py +4 -4
  7. workbench/model_scripts/custom_models/uq_models/generated_model_script.py +319 -210
  8. workbench/model_scripts/custom_models/uq_models/mapie.template +502 -0
  9. workbench/model_scripts/custom_models/uq_models/meta_uq.template +154 -41
  10. workbench/model_scripts/custom_models/uq_models/ngboost.template +15 -2
  11. workbench/model_scripts/custom_models/uq_models/requirements.txt +1 -3
  12. workbench/model_scripts/script_generation.py +5 -0
  13. workbench/model_scripts/xgb_model/generated_model_script.py +11 -11
  14. workbench/model_scripts/xgb_model/xgb_model.template +7 -7
  15. workbench/scripts/{ml_pipeline_launcher.py → ml_pipeline_batch.py} +1 -1
  16. workbench/scripts/ml_pipeline_sqs.py +139 -0
  17. workbench/utils/model_utils.py +13 -1
  18. workbench/utils/workbench_sqs.py +1 -1
  19. workbench/utils/xgboost_model_utils.py +1 -0
  20. workbench/web_interface/components/plugins/dashboard_status.py +3 -1
  21. {workbench-0.8.170.dist-info → workbench-0.8.172.dist-info}/METADATA +1 -1
  22. {workbench-0.8.170.dist-info → workbench-0.8.172.dist-info}/RECORD +26 -25
  23. {workbench-0.8.170.dist-info → workbench-0.8.172.dist-info}/entry_points.txt +2 -1
  24. workbench/model_scripts/custom_models/uq_models/mapie_xgb.template +0 -203
  25. {workbench-0.8.170.dist-info → workbench-0.8.172.dist-info}/WHEEL +0 -0
  26. {workbench-0.8.170.dist-info → workbench-0.8.172.dist-info}/licenses/LICENSE +0 -0
  27. {workbench-0.8.170.dist-info → workbench-0.8.172.dist-info}/top_level.txt +0 -0
@@ -87,8 +87,8 @@ class FeatureSet(FeatureSetCore):
87
87
  model_import_str: str = None,
88
88
  custom_script: Union[str, Path] = None,
89
89
  custom_args: dict = None,
90
- training_image: str = "xgb_training",
91
- inference_image: str = "xgb_inference",
90
+ training_image: str = "training",
91
+ inference_image: str = "inference",
92
92
  inference_arch: str = "x86_64",
93
93
  **kwargs,
94
94
  ) -> Union[Model, None]:
@@ -105,8 +105,8 @@ class FeatureSet(FeatureSetCore):
105
105
  model_class (str, optional): Model class to use (e.g. "KMeans", "PyTorch", default: None)
106
106
  model_import_str (str, optional): The import for the model (e.g. "from sklearn.cluster import KMeans")
107
107
  custom_script (str, optional): The custom script to use for the model (default: None)
108
- training_image (str, optional): The training image to use (default: "xgb_training")
109
- inference_image (str, optional): The inference image to use (default: "xgb_inference")
108
+ training_image (str, optional): The training image to use (default: "training")
109
+ inference_image (str, optional): The inference image to use (default: "inference")
110
110
  inference_arch (str, optional): The architecture to use for inference (default: "x86_64")
111
111
  kwargs (dict, optional): Additional keyword arguments to pass to the model
112
112
 
@@ -236,6 +236,12 @@ class Artifact(ABC):
236
236
  This functionality will work for FeatureSets, Models, and Endpoints
237
237
  but not for DataSources. The DataSource class overrides this method.
238
238
  """
239
+
240
+ # Check for ReadOnly Role
241
+ if self.aws_account_clamp.read_only_role:
242
+ self.log.info("Cannot add metadata with a ReadOnly Role...")
243
+ return
244
+
239
245
  # Sanity check
240
246
  aws_arn = self.arn()
241
247
  if aws_arn is None:
@@ -444,10 +450,12 @@ class Artifact(ABC):
444
450
 
445
451
  if __name__ == "__main__":
446
452
  """Exercise the Artifact Class"""
447
- from workbench.api.data_source import DataSource
448
- from workbench.api.feature_set import FeatureSet
453
+ from workbench.api import DataSource, FeatureSet, Endpoint
454
+
455
+ # Grab an Endpoint (which is a subclass of Artifact)
456
+ end = Endpoint("wine-classification")
449
457
 
450
- # Create a DataSource (which is a subclass of Artifact)
458
+ # Grab a DataSource (which is a subclass of Artifact)
451
459
  data_source = DataSource("test_data")
452
460
 
453
461
  # Just some random tests
@@ -37,16 +37,45 @@ class ModelType(Enum):
37
37
  UNKNOWN = "unknown"
38
38
 
39
39
 
40
+ # Deprecated Images
41
+ """
42
+ # US East 1 images
43
+ "py312-general-ml-training"
44
+ ("us-east-1", "training", "0.1", "x86_64"): (
45
+ "507740646243.dkr.ecr.us-east-1.amazonaws.com/aws-ml-images/py312-sklearn-xgb-training:0.1"
46
+ ),
47
+ ("us-east-1", "inference", "0.1", "x86_64"): (
48
+ "507740646243.dkr.ecr.us-east-1.amazonaws.com/aws-ml-images/py312-sklearn-xgb-inference:0.1"
49
+ ),
50
+
51
+ # US West 2 images
52
+ ("us-west-2", "training", "0.1", "x86_64"): (
53
+ "507740646243.dkr.ecr.us-west-2.amazonaws.com/aws-ml-images/py312-sklearn-xgb-training:0.1"
54
+ ),
55
+ ("us-west-2", "inference", "0.1", "x86_64"): (
56
+ "507740646243.dkr.ecr.us-west-2.amazonaws.com/aws-ml-images/py312-sklearn-xgb-inference:0.1"
57
+ ),
58
+
59
+ # ARM64 images
60
+ ("us-east-1", "inference", "0.1", "arm64"): (
61
+ "507740646243.dkr.ecr.us-east-1.amazonaws.com/aws-ml-images/py312-sklearn-xgb-inference:0.1-arm64"
62
+ ),
63
+ ("us-west-2", "inference", "0.1", "arm64"): (
64
+ "507740646243.dkr.ecr.us-west-2.amazonaws.com/aws-ml-images/py312-sklearn-xgb-inference:0.1-arm64"
65
+ ),
66
+ """
67
+
68
+
40
69
  class ModelImages:
41
70
  """Class for retrieving workbench inference images"""
42
71
 
43
72
  image_uris = {
44
73
  # US East 1 images
45
- ("us-east-1", "xgb_training", "0.1", "x86_64"): (
46
- "507740646243.dkr.ecr.us-east-1.amazonaws.com/aws-ml-images/py312-sklearn-xgb-training:0.1"
74
+ ("us-east-1", "training", "0.1", "x86_64"): (
75
+ "507740646243.dkr.ecr.us-east-1.amazonaws.com/aws-ml-images/py312-general-ml-training:0.1"
47
76
  ),
48
- ("us-east-1", "xgb_inference", "0.1", "x86_64"): (
49
- "507740646243.dkr.ecr.us-east-1.amazonaws.com/aws-ml-images/py312-sklearn-xgb-inference:0.1"
77
+ ("us-east-1", "inference", "0.1", "x86_64"): (
78
+ "507740646243.dkr.ecr.us-east-1.amazonaws.com/aws-ml-images/py312-general-ml-inference:0.1"
50
79
  ),
51
80
  ("us-east-1", "pytorch_training", "0.1", "x86_64"): (
52
81
  "507740646243.dkr.ecr.us-east-1.amazonaws.com/aws-ml-images/py312-pytorch-training:0.1"
@@ -55,11 +84,11 @@ class ModelImages:
55
84
  "507740646243.dkr.ecr.us-east-1.amazonaws.com/aws-ml-images/py312-pytorch-inference:0.1"
56
85
  ),
57
86
  # US West 2 images
58
- ("us-west-2", "xgb_training", "0.1", "x86_64"): (
59
- "507740646243.dkr.ecr.us-west-2.amazonaws.com/aws-ml-images/py312-sklearn-xgb-training:0.1"
87
+ ("us-west-2", "training", "0.1", "x86_64"): (
88
+ "507740646243.dkr.ecr.us-west-2.amazonaws.com/aws-ml-images/py312-general-ml-training:0.1"
60
89
  ),
61
- ("us-west-2", "xgb_inference", "0.1", "x86_64"): (
62
- "507740646243.dkr.ecr.us-west-2.amazonaws.com/aws-ml-images/py312-sklearn-xgb-inference:0.1"
90
+ ("us-west-2", "inference", "0.1", "x86_64"): (
91
+ "507740646243.dkr.ecr.us-west-2.amazonaws.com/aws-ml-images/py312-general-ml-inference:0.1"
63
92
  ),
64
93
  ("us-west-2", "pytorch_training", "0.1", "x86_64"): (
65
94
  "507740646243.dkr.ecr.us-west-2.amazonaws.com/aws-ml-images/py312-pytorch-training:0.1"
@@ -68,12 +97,6 @@ class ModelImages:
68
97
  "507740646243.dkr.ecr.us-west-2.amazonaws.com/aws-ml-images/py312-pytorch-inference:0.1"
69
98
  ),
70
99
  # ARM64 images
71
- ("us-east-1", "xgb_inference", "0.1", "arm64"): (
72
- "507740646243.dkr.ecr.us-east-1.amazonaws.com/aws-ml-images/py312-sklearn-xgb-inference:0.1-arm64"
73
- ),
74
- ("us-west-2", "xgb_inference", "0.1", "arm64"): (
75
- "507740646243.dkr.ecr.us-west-2.amazonaws.com/aws-ml-images/py312-sklearn-xgb-inference:0.1-arm64"
76
- ),
77
100
  # Meta Endpoint inference images
78
101
  ("us-east-1", "meta-endpoint", "0.1", "x86_64"): (
79
102
  "507740646243.dkr.ecr.us-east-1.amazonaws.com/aws-ml-images/py312-meta-endpoint:0.1"
@@ -54,7 +54,10 @@ class AWSAccountClamp:
54
54
 
55
55
  # Check our Assume Role
56
56
  self.log.info("Checking Workbench Assumed Role...")
57
- self.aws_session.assumed_role_info()
57
+ role_info = self.aws_session.assumed_role_info()
58
+
59
+ # Check if the Role is a 'ReadOnly' role
60
+ self.read_only_role = "readonly" in role_info["AssumedRoleArn"].lower()
58
61
 
59
62
  # Check our Workbench API Key and Load the License
60
63
  self.log.info("Checking Workbench API License...")
@@ -196,7 +196,9 @@ class AWSMeta:
196
196
 
197
197
  # Return the summary as a DataFrame
198
198
  df = pd.DataFrame(data_summary).convert_dtypes()
199
- return df.sort_values(by="Created", ascending=False)
199
+ if not df.empty:
200
+ df.sort_values(by="Created", ascending=False, inplace=True)
201
+ return df
200
202
 
201
203
  def models(self, details: bool = False) -> pd.DataFrame:
202
204
  """Get a summary of the Models in AWS.
@@ -256,7 +258,9 @@ class AWSMeta:
256
258
 
257
259
  # Return the summary as a DataFrame
258
260
  df = pd.DataFrame(model_summary).convert_dtypes()
259
- return df.sort_values(by="Created", ascending=False)
261
+ if not df.empty:
262
+ df.sort_values(by="Created", ascending=False, inplace=True)
263
+ return df
260
264
 
261
265
  def endpoints(self, details: bool = False) -> pd.DataFrame:
262
266
  """Get a summary of the Endpoints in AWS.
@@ -317,7 +321,9 @@ class AWSMeta:
317
321
 
318
322
  # Return the summary as a DataFrame
319
323
  df = pd.DataFrame(data_summary).convert_dtypes()
320
- return df.sort_values(by="Created", ascending=False)
324
+ if not df.empty:
325
+ df.sort_values(by="Created", ascending=False, inplace=True)
326
+ return df
321
327
 
322
328
  def _endpoint_config_info(self, endpoint_config_name: str) -> dict:
323
329
  """Internal: Get the Endpoint Configuration information for the given endpoint config name.
@@ -657,7 +663,8 @@ class AWSMeta:
657
663
  df = pd.DataFrame(data_summary).convert_dtypes()
658
664
 
659
665
  # Sort by the Modified column
660
- df = df.sort_values(by="Modified", ascending=False)
666
+ if not df.empty:
667
+ df = df.sort_values(by="Modified", ascending=False)
661
668
  return df
662
669
 
663
670
  def _aws_pipelines(self) -> pd.DataFrame:
@@ -37,8 +37,8 @@ class FeaturesToModel(Transform):
37
37
  model_import_str=None,
38
38
  custom_script=None,
39
39
  custom_args=None,
40
- training_image="xgb_training",
41
- inference_image="xgb_inference",
40
+ training_image="training",
41
+ inference_image="inference",
42
42
  inference_arch="x86_64",
43
43
  ):
44
44
  """FeaturesToModel Initialization
@@ -50,8 +50,8 @@ class FeaturesToModel(Transform):
50
50
  model_import_str (str, optional): The import string for the model (default None)
51
51
  custom_script (str, optional): Custom script to use for the model (default None)
52
52
  custom_args (dict, optional): Custom arguments to pass to custom model scripts (default None)
53
- training_image (str, optional): Training image (default "xgb_training")
54
- inference_image (str, optional): Inference image (default "xgb_inference")
53
+ training_image (str, optional): Training image (default "training")
54
+ inference_image (str, optional): Inference image (default "inference")
55
55
  inference_arch (str, optional): Inference architecture (default "x86_64")
56
56
  """
57
57