sagemaker-core 1.0.62__py3-none-any.whl → 2.3.1__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.
Files changed (358) hide show
  1. sagemaker/__init__.py +2 -0
  2. sagemaker/core/__init__.py +16 -0
  3. sagemaker/core/_studio.py +116 -0
  4. sagemaker/core/_version.py +11 -0
  5. sagemaker/core/accept_types.py +131 -0
  6. sagemaker/core/analytics.py +744 -0
  7. sagemaker/core/apiutils/__init__.py +13 -0
  8. sagemaker/core/apiutils/_base_types.py +228 -0
  9. sagemaker/core/apiutils/_boto_functions.py +130 -0
  10. sagemaker/core/apiutils/_utils.py +34 -0
  11. sagemaker/core/base_deserializers.py +35 -0
  12. sagemaker/core/base_serializers.py +35 -0
  13. sagemaker/core/clarify/__init__.py +2898 -0
  14. sagemaker/core/collection.py +467 -0
  15. sagemaker/core/common_utils.py +2399 -0
  16. sagemaker/core/compute_resource_requirements/__init__.py +18 -0
  17. sagemaker/core/compute_resource_requirements/resource_requirements.py +94 -0
  18. sagemaker/core/config/__init__.py +181 -0
  19. sagemaker/core/config/config.py +238 -0
  20. sagemaker/core/config/config_manager.py +595 -0
  21. sagemaker/core/config/config_schema.py +1220 -0
  22. sagemaker/core/config/config_utils.py +297 -0
  23. {sagemaker_core/main → sagemaker/core}/config_schema.py +408 -3
  24. sagemaker/core/constants.py +73 -0
  25. sagemaker/core/content_types.py +137 -0
  26. sagemaker/core/debugger/__init__.py +39 -0
  27. sagemaker/core/debugger/debugger.py +945 -0
  28. sagemaker/core/debugger/framework_profile.py +292 -0
  29. sagemaker/core/debugger/metrics_config.py +468 -0
  30. sagemaker/core/debugger/profiler.py +42 -0
  31. sagemaker/core/debugger/profiler_config.py +190 -0
  32. sagemaker/core/debugger/profiler_constants.py +40 -0
  33. sagemaker/core/debugger/utils.py +148 -0
  34. sagemaker/core/deprecations.py +254 -0
  35. sagemaker/core/deserializers/__init__.py +10 -0
  36. sagemaker/core/deserializers/base.py +424 -0
  37. sagemaker/core/deserializers/implementations.py +157 -0
  38. sagemaker/core/drift_check_baselines.py +106 -0
  39. sagemaker/core/enums.py +51 -0
  40. sagemaker/core/environment_variables.py +101 -0
  41. sagemaker/core/exceptions.py +108 -0
  42. sagemaker/core/experiments/__init__.py +53 -0
  43. sagemaker/core/experiments/_api_types.py +251 -0
  44. sagemaker/core/experiments/_environment.py +124 -0
  45. sagemaker/core/experiments/_helper.py +294 -0
  46. sagemaker/core/experiments/_metrics.py +333 -0
  47. sagemaker/core/experiments/_run_context.py +58 -0
  48. sagemaker/core/experiments/_utils.py +216 -0
  49. sagemaker/core/experiments/experiment.py +247 -0
  50. sagemaker/core/experiments/run.py +970 -0
  51. sagemaker/core/experiments/trial.py +296 -0
  52. sagemaker/core/experiments/trial_component.py +387 -0
  53. sagemaker/core/explainer/__init__.py +24 -0
  54. sagemaker/core/explainer/clarify_explainer_config.py +298 -0
  55. sagemaker/core/explainer/explainer_config.py +44 -0
  56. sagemaker/core/fw_utils.py +1220 -0
  57. sagemaker/core/git_utils.py +415 -0
  58. sagemaker/core/helper/pipeline_variable.py +82 -0
  59. sagemaker/core/helper/session_helper.py +2977 -0
  60. sagemaker/core/hyperparameters.py +172 -0
  61. sagemaker/core/image_retriever/__init__.py +3 -0
  62. sagemaker/core/image_retriever/image_retriever.py +640 -0
  63. sagemaker/core/image_retriever/image_retriever_utils.py +509 -0
  64. sagemaker/core/image_retriever/test.py +7 -0
  65. sagemaker/core/image_uri_config/autogluon.json +1335 -0
  66. sagemaker/core/image_uri_config/blazingtext.json +50 -0
  67. sagemaker/core/image_uri_config/chainer.json +104 -0
  68. sagemaker/core/image_uri_config/clarify.json +39 -0
  69. sagemaker/core/image_uri_config/coach-mxnet.json +70 -0
  70. sagemaker/core/image_uri_config/coach-tensorflow.json +186 -0
  71. sagemaker/core/image_uri_config/data-wrangler.json +91 -0
  72. sagemaker/core/image_uri_config/debugger.json +34 -0
  73. sagemaker/core/image_uri_config/detailed-profiler.json +18 -0
  74. sagemaker/core/image_uri_config/djl-deepspeed.json +385 -0
  75. sagemaker/core/image_uri_config/djl-fastertransformer.json +167 -0
  76. sagemaker/core/image_uri_config/djl-lmi.json +136 -0
  77. sagemaker/core/image_uri_config/djl-neuronx.json +258 -0
  78. sagemaker/core/image_uri_config/djl-tensorrtllm.json +262 -0
  79. sagemaker/core/image_uri_config/factorization-machines.json +50 -0
  80. sagemaker/core/image_uri_config/forecasting-deepar.json +50 -0
  81. sagemaker/core/image_uri_config/huggingface-llm-neuronx.json +770 -0
  82. sagemaker/core/image_uri_config/huggingface-llm.json +1267 -0
  83. sagemaker/core/image_uri_config/huggingface-neuron.json +52 -0
  84. sagemaker/core/image_uri_config/huggingface-neuronx.json +686 -0
  85. sagemaker/core/image_uri_config/huggingface-tei-cpu.json +298 -0
  86. sagemaker/core/image_uri_config/huggingface-tei.json +298 -0
  87. sagemaker/core/image_uri_config/huggingface-training-compiler.json +195 -0
  88. sagemaker/core/image_uri_config/huggingface-vllm-neuronx.json +38 -0
  89. sagemaker/core/image_uri_config/huggingface.json +2287 -0
  90. sagemaker/core/image_uri_config/hyperpod-recipes-neuron.json +52 -0
  91. sagemaker/core/image_uri_config/image-classification-neo.json +43 -0
  92. sagemaker/core/image_uri_config/image-classification.json +50 -0
  93. sagemaker/core/image_uri_config/inferentia-mxnet.json +88 -0
  94. sagemaker/core/image_uri_config/inferentia-pytorch.json +127 -0
  95. sagemaker/core/image_uri_config/inferentia-tensorflow.json +88 -0
  96. sagemaker/core/image_uri_config/instance_gpu_info.json +782 -0
  97. sagemaker/core/image_uri_config/ipinsights.json +50 -0
  98. sagemaker/core/image_uri_config/kmeans.json +50 -0
  99. sagemaker/core/image_uri_config/knn.json +50 -0
  100. sagemaker/core/image_uri_config/lda.json +26 -0
  101. sagemaker/core/image_uri_config/linear-learner.json +50 -0
  102. sagemaker/core/image_uri_config/model-monitor.json +42 -0
  103. sagemaker/core/image_uri_config/mxnet.json +1154 -0
  104. sagemaker/core/image_uri_config/neo-mxnet.json +64 -0
  105. sagemaker/core/image_uri_config/neo-pytorch.json +341 -0
  106. sagemaker/core/image_uri_config/neo-tensorflow.json +109 -0
  107. sagemaker/core/image_uri_config/ntm.json +50 -0
  108. sagemaker/core/image_uri_config/object-detection.json +50 -0
  109. sagemaker/core/image_uri_config/object2vec.json +50 -0
  110. sagemaker/core/image_uri_config/pca.json +50 -0
  111. sagemaker/core/image_uri_config/pytorch-neuron.json +43 -0
  112. sagemaker/core/image_uri_config/pytorch-smp.json +218 -0
  113. sagemaker/core/image_uri_config/pytorch-training-compiler.json +80 -0
  114. sagemaker/core/image_uri_config/pytorch.json +3101 -0
  115. sagemaker/core/image_uri_config/randomcutforest.json +50 -0
  116. sagemaker/core/image_uri_config/ray-pytorch.json +46 -0
  117. sagemaker/core/image_uri_config/ray-tensorflow.json +194 -0
  118. sagemaker/core/image_uri_config/sagemaker-base-python.json +46 -0
  119. sagemaker/core/image_uri_config/sagemaker-distribution.json +37 -0
  120. sagemaker/core/image_uri_config/sagemaker-geospatial.json +13 -0
  121. sagemaker/core/image_uri_config/sagemaker-tritonserver.json +252 -0
  122. sagemaker/core/image_uri_config/semantic-segmentation.json +50 -0
  123. sagemaker/core/image_uri_config/seq2seq.json +50 -0
  124. sagemaker/core/image_uri_config/sklearn.json +494 -0
  125. sagemaker/core/image_uri_config/spark.json +280 -0
  126. sagemaker/core/image_uri_config/sparkml-serving.json +97 -0
  127. sagemaker/core/image_uri_config/stabilityai.json +53 -0
  128. sagemaker/core/image_uri_config/tensorflow.json +5086 -0
  129. sagemaker/core/image_uri_config/vw.json +25 -0
  130. sagemaker/core/image_uri_config/xgboost-neo.json +43 -0
  131. sagemaker/core/image_uri_config/xgboost.json +972 -0
  132. sagemaker/core/image_uris.py +816 -0
  133. sagemaker/core/inference_config.py +144 -0
  134. sagemaker/core/inference_recommender/__init__.py +18 -0
  135. sagemaker/core/inference_recommender/inference_recommender_mixin.py +622 -0
  136. sagemaker/core/inputs.py +366 -0
  137. sagemaker/core/instance_group.py +61 -0
  138. sagemaker/core/instance_types.py +164 -0
  139. sagemaker/core/instance_types_gpu_info.py +43 -0
  140. sagemaker/core/interactive_apps/__init__.py +41 -0
  141. sagemaker/core/interactive_apps/base_interactive_app.py +204 -0
  142. sagemaker/core/interactive_apps/detail_profiler_app.py +139 -0
  143. sagemaker/core/interactive_apps/tensorboard.py +149 -0
  144. sagemaker/core/iterators.py +197 -0
  145. sagemaker/core/job.py +380 -0
  146. sagemaker/core/jumpstart/__init__.py +156 -0
  147. sagemaker/core/jumpstart/accessors.py +390 -0
  148. sagemaker/core/jumpstart/artifacts/__init__.py +69 -0
  149. sagemaker/core/jumpstart/artifacts/environment_variables.py +252 -0
  150. sagemaker/core/jumpstart/artifacts/hyperparameters.py +120 -0
  151. sagemaker/core/jumpstart/artifacts/image_uris.py +139 -0
  152. sagemaker/core/jumpstart/artifacts/incremental_training.py +87 -0
  153. sagemaker/core/jumpstart/artifacts/instance_types.py +223 -0
  154. sagemaker/core/jumpstart/artifacts/kwargs.py +289 -0
  155. sagemaker/core/jumpstart/artifacts/metric_definitions.py +117 -0
  156. sagemaker/core/jumpstart/artifacts/model_packages.py +202 -0
  157. sagemaker/core/jumpstart/artifacts/model_uris.py +252 -0
  158. sagemaker/core/jumpstart/artifacts/payloads.py +96 -0
  159. sagemaker/core/jumpstart/artifacts/predictors.py +540 -0
  160. sagemaker/core/jumpstart/artifacts/resource_names.py +86 -0
  161. sagemaker/core/jumpstart/artifacts/resource_requirements.py +162 -0
  162. sagemaker/core/jumpstart/artifacts/script_uris.py +172 -0
  163. sagemaker/core/jumpstart/cache.py +663 -0
  164. sagemaker/core/jumpstart/configs.py +50 -0
  165. sagemaker/core/jumpstart/constants.py +198 -0
  166. sagemaker/core/jumpstart/deserializers.py +81 -0
  167. sagemaker/core/jumpstart/document.py +76 -0
  168. sagemaker/core/jumpstart/enums.py +168 -0
  169. sagemaker/core/jumpstart/exceptions.py +236 -0
  170. sagemaker/core/jumpstart/factory/utils.py +833 -0
  171. sagemaker/core/jumpstart/filters.py +597 -0
  172. sagemaker/core/jumpstart/hub/constants.py +16 -0
  173. sagemaker/core/jumpstart/hub/hub.py +291 -0
  174. sagemaker/core/jumpstart/hub/interfaces.py +936 -0
  175. sagemaker/core/jumpstart/hub/parser_utils.py +70 -0
  176. sagemaker/core/jumpstart/hub/parsers.py +288 -0
  177. sagemaker/core/jumpstart/hub/types.py +35 -0
  178. sagemaker/core/jumpstart/hub/utils.py +260 -0
  179. sagemaker/core/jumpstart/models.py +501 -0
  180. sagemaker/core/jumpstart/notebook_utils.py +575 -0
  181. sagemaker/core/jumpstart/parameters.py +20 -0
  182. sagemaker/core/jumpstart/payload_utils.py +239 -0
  183. sagemaker/core/jumpstart/region_config.json +171 -0
  184. sagemaker/core/jumpstart/search.py +171 -0
  185. sagemaker/core/jumpstart/serializers.py +81 -0
  186. sagemaker/core/jumpstart/session_utils.py +234 -0
  187. sagemaker/core/jumpstart/types.py +3044 -0
  188. sagemaker/core/jumpstart/utils.py +1731 -0
  189. sagemaker/core/jumpstart/validators.py +257 -0
  190. sagemaker/core/lambda_helper.py +312 -0
  191. sagemaker/core/lineage/__init__.py +42 -0
  192. sagemaker/core/lineage/_api_types.py +239 -0
  193. sagemaker/core/lineage/_utils.py +49 -0
  194. sagemaker/core/lineage/action.py +345 -0
  195. sagemaker/core/lineage/artifact.py +646 -0
  196. sagemaker/core/lineage/association.py +190 -0
  197. sagemaker/core/lineage/context.py +505 -0
  198. sagemaker/core/lineage/lineage_trial_component.py +191 -0
  199. sagemaker/core/lineage/query.py +732 -0
  200. sagemaker/core/lineage/visualizer.py +346 -0
  201. sagemaker/core/local/__init__.py +18 -0
  202. sagemaker/core/local/data.py +423 -0
  203. sagemaker/core/local/entities.py +678 -0
  204. sagemaker/core/local/exceptions.py +17 -0
  205. sagemaker/core/local/image.py +1243 -0
  206. sagemaker/core/local/local_session.py +739 -0
  207. sagemaker/core/local/utils.py +246 -0
  208. sagemaker/core/logs.py +181 -0
  209. sagemaker/core/metadata_properties.py +56 -0
  210. sagemaker/core/metric_definitions.py +91 -0
  211. sagemaker/core/mlflow/__init__.py +38 -0
  212. sagemaker/core/mlflow/forward_sagemaker_metrics.py +44 -0
  213. sagemaker/core/model_card/__init__.py +26 -0
  214. sagemaker/core/model_life_cycle.py +51 -0
  215. sagemaker/core/model_metrics.py +160 -0
  216. sagemaker/core/model_monitor/__init__.py +66 -0
  217. sagemaker/core/model_monitor/clarify_model_monitoring.py +1497 -0
  218. sagemaker/core/model_monitor/cron_expression_generator.py +82 -0
  219. sagemaker/core/model_monitor/data_capture_config.py +115 -0
  220. sagemaker/core/model_monitor/data_quality_monitoring_config.py +66 -0
  221. sagemaker/core/model_monitor/dataset_format.py +102 -0
  222. sagemaker/core/model_monitor/model_monitoring.py +4266 -0
  223. sagemaker/core/model_monitor/monitoring_alert.py +76 -0
  224. sagemaker/core/model_monitor/monitoring_files.py +506 -0
  225. sagemaker/core/model_monitor/utils.py +793 -0
  226. sagemaker/core/model_registry.py +480 -0
  227. sagemaker/core/model_uris.py +97 -0
  228. sagemaker/core/modules/__init__.py +19 -0
  229. sagemaker/core/modules/configs.py +239 -0
  230. sagemaker/core/modules/constants.py +37 -0
  231. sagemaker/core/modules/distributed.py +182 -0
  232. sagemaker/core/modules/local_core/local_container.py +605 -0
  233. sagemaker/core/modules/templates.py +83 -0
  234. sagemaker/core/modules/train/__init__.py +14 -0
  235. sagemaker/core/modules/train/container_drivers/__init__.py +14 -0
  236. sagemaker/core/modules/train/container_drivers/common/__init__.py +14 -0
  237. sagemaker/core/modules/train/container_drivers/common/utils.py +205 -0
  238. sagemaker/core/modules/train/container_drivers/distributed_drivers/__init__.py +14 -0
  239. sagemaker/core/modules/train/container_drivers/distributed_drivers/basic_script_driver.py +81 -0
  240. sagemaker/core/modules/train/container_drivers/distributed_drivers/mpi_driver.py +123 -0
  241. sagemaker/core/modules/train/container_drivers/distributed_drivers/mpi_utils.py +302 -0
  242. sagemaker/core/modules/train/container_drivers/distributed_drivers/torchrun_driver.py +129 -0
  243. sagemaker/core/modules/train/container_drivers/scripts/__init__.py +14 -0
  244. sagemaker/core/modules/train/container_drivers/scripts/environment.py +305 -0
  245. sagemaker/core/modules/train/sm_recipes/__init__.py +0 -0
  246. sagemaker/core/modules/train/sm_recipes/utils.py +330 -0
  247. sagemaker/core/modules/types.py +19 -0
  248. sagemaker/core/modules/utils.py +194 -0
  249. sagemaker/core/network.py +185 -0
  250. sagemaker/core/parameter.py +173 -0
  251. sagemaker/core/payloads.py +185 -0
  252. sagemaker/core/processing.py +1599 -0
  253. sagemaker/core/remote_function/__init__.py +19 -0
  254. sagemaker/core/remote_function/checkpoint_location.py +47 -0
  255. sagemaker/core/remote_function/client.py +1310 -0
  256. sagemaker/core/remote_function/core/__init__.py +0 -0
  257. sagemaker/core/remote_function/core/_custom_dispatch_table.py +72 -0
  258. sagemaker/core/remote_function/core/pipeline_variables.py +347 -0
  259. sagemaker/core/remote_function/core/serialization.py +410 -0
  260. sagemaker/core/remote_function/core/stored_function.py +223 -0
  261. sagemaker/core/remote_function/custom_file_filter.py +128 -0
  262. sagemaker/core/remote_function/errors.py +102 -0
  263. sagemaker/core/remote_function/invoke_function.py +167 -0
  264. sagemaker/core/remote_function/job.py +2121 -0
  265. sagemaker/core/remote_function/logging_config.py +38 -0
  266. sagemaker/core/remote_function/runtime_environment/__init__.py +14 -0
  267. sagemaker/core/remote_function/runtime_environment/bootstrap_runtime_environment.py +605 -0
  268. sagemaker/core/remote_function/runtime_environment/mpi_utils_remote.py +252 -0
  269. sagemaker/core/remote_function/runtime_environment/runtime_environment_manager.py +554 -0
  270. sagemaker/core/remote_function/runtime_environment/spark_app.py +18 -0
  271. sagemaker/core/remote_function/spark_config.py +149 -0
  272. sagemaker/core/resource_requirements.py +168 -0
  273. {sagemaker_core/main → sagemaker/core}/resources.py +19098 -10895
  274. sagemaker/core/s3/__init__.py +41 -0
  275. sagemaker/core/s3/client.py +367 -0
  276. sagemaker/core/s3/utils.py +175 -0
  277. sagemaker/core/script_uris.py +93 -0
  278. sagemaker/core/serializers/__init__.py +11 -0
  279. sagemaker/core/serializers/base.py +510 -0
  280. sagemaker/core/serializers/implementations.py +159 -0
  281. sagemaker/core/serializers/utils.py +223 -0
  282. sagemaker/core/serverless_inference_config.py +63 -0
  283. sagemaker/core/session_settings.py +55 -0
  284. sagemaker/core/shapes/__init__.py +3 -0
  285. sagemaker/core/shapes/model_card_shapes.py +159 -0
  286. {sagemaker_core/main → sagemaker/core/shapes}/shapes.py +5810 -1806
  287. sagemaker/core/spark/__init__.py +16 -0
  288. sagemaker/core/spark/defaults.py +16 -0
  289. sagemaker/core/spark/processing.py +1380 -0
  290. sagemaker/core/telemetry/__init__.py +23 -0
  291. sagemaker/core/telemetry/constants.py +82 -0
  292. sagemaker/core/telemetry/telemetry_logging.py +285 -0
  293. sagemaker/core/tools/__init__.py +1 -0
  294. {sagemaker_core → sagemaker/core}/tools/codegen.py +4 -4
  295. {sagemaker_core → sagemaker/core}/tools/constants.py +23 -15
  296. {sagemaker_core → sagemaker/core}/tools/data_extractor.py +1 -1
  297. {sagemaker_core → sagemaker/core}/tools/method.py +1 -1
  298. sagemaker/core/tools/model_card/generate_model_card_from_schema.py +562 -0
  299. {sagemaker_core → sagemaker/core}/tools/resources_codegen.py +165 -98
  300. {sagemaker_core → sagemaker/core}/tools/resources_extractor.py +5 -13
  301. {sagemaker_core → sagemaker/core}/tools/shapes_codegen.py +16 -17
  302. {sagemaker_core → sagemaker/core}/tools/shapes_extractor.py +29 -67
  303. {sagemaker_core → sagemaker/core}/tools/templates.py +39 -17
  304. sagemaker/core/training/__init__.py +14 -0
  305. sagemaker/core/training/configs.py +345 -0
  306. sagemaker/core/training/constants.py +37 -0
  307. sagemaker/core/training/utils.py +77 -0
  308. sagemaker/core/training_compiler/__init__.py +16 -0
  309. sagemaker/core/training_compiler/config.py +197 -0
  310. sagemaker/core/training_compiler_config.py +197 -0
  311. sagemaker/core/transformer.py +793 -0
  312. sagemaker/core/user_agent.py +76 -0
  313. sagemaker/core/utilities/__init__.py +24 -0
  314. sagemaker/core/utilities/cache.py +169 -0
  315. sagemaker/core/utilities/search_expression.py +133 -0
  316. sagemaker/core/utils/__init__.py +48 -0
  317. sagemaker/core/utils/code_injection/__init__.py +0 -0
  318. {sagemaker_core/main → sagemaker/core/utils}/code_injection/codec.py +2 -2
  319. {sagemaker_core/main → sagemaker/core/utils}/code_injection/shape_dag.py +5979 -176
  320. {sagemaker_core/main → sagemaker/core/utils}/exceptions.py +8 -8
  321. sagemaker_core/main/default_configs_helper.py → sagemaker/core/utils/intelligent_defaults_helper.py +5 -6
  322. {sagemaker_core/main → sagemaker/core/utils}/logs.py +1 -2
  323. {sagemaker_core/main → sagemaker/core/utils}/utils.py +27 -22
  324. sagemaker/core/workflow/__init__.py +152 -0
  325. sagemaker/core/workflow/conditions.py +313 -0
  326. sagemaker/core/workflow/entities.py +58 -0
  327. sagemaker/core/workflow/execution_variables.py +89 -0
  328. sagemaker/core/workflow/functions.py +193 -0
  329. sagemaker/core/workflow/parameters.py +222 -0
  330. sagemaker/core/workflow/pipeline_context.py +394 -0
  331. sagemaker/core/workflow/pipeline_definition_config.py +31 -0
  332. sagemaker/core/workflow/properties.py +285 -0
  333. sagemaker/core/workflow/step_outputs.py +65 -0
  334. sagemaker/core/workflow/utilities.py +514 -0
  335. sagemaker/lineage/__init__.py +33 -0
  336. sagemaker/lineage/action.py +28 -0
  337. sagemaker/lineage/artifact.py +28 -0
  338. sagemaker/lineage/context.py +28 -0
  339. sagemaker/lineage/lineage_trial_component.py +28 -0
  340. {sagemaker_core-1.0.62.dist-info → sagemaker_core-2.3.1.dist-info}/METADATA +28 -9
  341. sagemaker_core-2.3.1.dist-info/RECORD +351 -0
  342. sagemaker_core-2.3.1.dist-info/top_level.txt +1 -0
  343. sagemaker_core/_version.py +0 -3
  344. sagemaker_core/helper/session_helper.py +0 -769
  345. sagemaker_core/resources/__init__.py +0 -1
  346. sagemaker_core/shapes/__init__.py +0 -1
  347. sagemaker_core/tools/__init__.py +0 -1
  348. sagemaker_core-1.0.62.dist-info/RECORD +0 -35
  349. sagemaker_core-1.0.62.dist-info/top_level.txt +0 -1
  350. {sagemaker_core → sagemaker/core/helper}/__init__.py +0 -0
  351. {sagemaker_core/helper → sagemaker/core/jumpstart/factory}/__init__.py +0 -0
  352. {sagemaker_core/main → sagemaker/core/jumpstart/hub}/__init__.py +0 -0
  353. {sagemaker_core/main/code_injection → sagemaker/core/modules/local_core}/__init__.py +0 -0
  354. {sagemaker_core/main → sagemaker/core/utils}/code_injection/base.py +0 -0
  355. {sagemaker_core/main → sagemaker/core/utils}/code_injection/constants.py +0 -0
  356. {sagemaker_core/main → sagemaker/core/utils}/user_agent.py +0 -0
  357. {sagemaker_core-1.0.62.dist-info → sagemaker_core-2.3.1.dist-info}/WHEEL +0 -0
  358. {sagemaker_core-1.0.62.dist-info → sagemaker_core-2.3.1.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,514 @@
1
+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
4
+ # may not use this file except in compliance with the License. A copy of
5
+ # the License is located at
6
+ #
7
+ # http://aws.amazon.com/apache2.0/
8
+ #
9
+ # or in the "license" file accompanying this file. This file is
10
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
+ # ANY KIND, either express or implied. See the License for the specific
12
+ # language governing permissions and limitations under the License.
13
+ """Utilities to support workflow."""
14
+ from __future__ import absolute_import
15
+
16
+ import inspect
17
+ import logging
18
+ from functools import wraps
19
+ from pathlib import Path
20
+ from typing import List, Sequence, Union, Set, TYPE_CHECKING, Optional
21
+ import hashlib
22
+ from urllib.parse import unquote, urlparse
23
+ from contextlib import contextmanager
24
+
25
+ try:
26
+ # _hashlib is an internal python module, and is not present in
27
+ # statically linked interpreters.
28
+ from _hashlib import HASH as Hash
29
+ except ImportError:
30
+ import typing
31
+ Hash = typing.Any
32
+
33
+ from sagemaker.core.common_utils import base_from_name
34
+ from sagemaker.core.workflow.parameters import Parameter
35
+ from sagemaker.core.workflow.pipeline_context import _StepArguments, _PipelineConfig
36
+ from sagemaker.core.workflow.entities import Entity
37
+ from sagemaker.core.helper.pipeline_variable import RequestType
38
+ from sagemaker.core.workflow.pipeline_definition_config import PipelineDefinitionConfig
39
+
40
+ logger = logging.getLogger(__name__)
41
+
42
+ DEF_CONFIG_WARN_MSG_TEMPLATE = (
43
+ "Popping out '%s' from the pipeline definition by default "
44
+ "since it will be overridden at pipeline execution time. Please utilize "
45
+ "the PipelineDefinitionConfig to persist this field in the pipeline definition "
46
+ "if desired."
47
+ )
48
+
49
+ JOB_KEY_NONE_WARN_MSG_TEMPLATE = (
50
+ "Invalid input: use_custom_job_prefix flag is set but the name field [{}] has not been "
51
+ "specified. Please refer to the AWS Docs to identify which field should be set to enable the "
52
+ "custom-prefixing feature for jobs created via a pipeline execution. "
53
+ "https://docs.aws.amazon.com/sagemaker/latest/dg/"
54
+ "build-and-manage-access.html#build-and-manage-step-permissions-prefix"
55
+ )
56
+
57
+ if TYPE_CHECKING:
58
+ from sagemaker.mlops.workflow.step_collections import StepCollection
59
+
60
+ BUF_SIZE = 65536 # 64KiB
61
+ _pipeline_config: _PipelineConfig = None
62
+
63
+
64
+ def list_to_request(entities: Sequence[Union[Entity, "StepCollection"]]) -> List[RequestType]:
65
+ """Get the request structure for list of entities.
66
+
67
+ Args:
68
+ entities (Sequence[Entity]): A list of entities.
69
+ Returns:
70
+ list: A request structure for a workflow service call.
71
+ """
72
+ from sagemaker.mlops.workflow.step_collections import StepCollection
73
+
74
+ request_dicts = []
75
+ for entity in entities:
76
+ if isinstance(entity, Entity):
77
+ request_dicts.append(entity.to_request())
78
+ elif isinstance(entity, StepCollection):
79
+ request_dicts.extend(entity.request_dicts())
80
+ return request_dicts
81
+
82
+
83
+ @contextmanager
84
+ def step_compilation_context_manager(
85
+ pipeline_name: str,
86
+ step_name: str,
87
+ sagemaker_session,
88
+ code_hash: str,
89
+ config_hash: str,
90
+ pipeline_definition_config: PipelineDefinitionConfig,
91
+ upload_runtime_scripts: bool,
92
+ upload_workspace: bool,
93
+ pipeline_build_time: str,
94
+ function_step_secret_token: Optional[str] = None,
95
+ ):
96
+ """Expose static _pipeline_config variable to other modules
97
+
98
+ Args:
99
+ pipeline_name (str): pipeline name
100
+ step_name (str): step name
101
+ sagemaker_session (sagemaker.core.helper.session.Session): a sagemaker session
102
+ code_hash (str): a hash of the code artifact for the particular step
103
+ config_hash (str): a hash of the config artifact for the particular step (Processing)
104
+ pipeline_definition_config (PipelineDefinitionConfig): a configuration used to toggle
105
+ feature flags persistent in a pipeline definition
106
+ upload_runtime_scripts (bool): flag used to manage upload of runtime scripts to s3 for
107
+ a _FunctionStep in pipeline
108
+ upload_workspace (bool): flag used to manage the upload of workspace to s3 for a
109
+ _FunctionStep in pipeline
110
+ pipeline_build_time (str): timestamp when the pipeline is being built
111
+ function_step_secret_token (str): secret token used for the function step checksum
112
+ """
113
+
114
+ # pylint: disable=W0603
115
+ global _pipeline_config
116
+ _pipeline_config = _PipelineConfig(
117
+ pipeline_name=pipeline_name,
118
+ step_name=step_name,
119
+ sagemaker_session=sagemaker_session,
120
+ code_hash=code_hash,
121
+ config_hash=config_hash,
122
+ pipeline_definition_config=pipeline_definition_config,
123
+ upload_runtime_scripts=upload_runtime_scripts,
124
+ upload_workspace=upload_workspace,
125
+ pipeline_build_time=pipeline_build_time,
126
+ function_step_secret_token=function_step_secret_token,
127
+ )
128
+ try:
129
+ yield _pipeline_config
130
+ finally:
131
+ _pipeline_config = None
132
+
133
+
134
+ def load_step_compilation_context():
135
+ """Load the step compilation context from the static _pipeline_config variable
136
+
137
+ Returns:
138
+ _PipelineConfig: a context object containing information about the current step
139
+ """
140
+ return _pipeline_config
141
+
142
+
143
+ def get_code_hash(step: Entity) -> str:
144
+ """Get the hash of the code artifact(s) for the given step
145
+
146
+ Args:
147
+ step (Entity): A pipeline step object (Entity type because Step causes circular import)
148
+ Returns:
149
+ str: A hash string representing the unique code artifact(s) for the step
150
+ """
151
+ from sagemaker.mlops.workflow.steps import ProcessingStep, TrainingStep
152
+
153
+ if isinstance(step, ProcessingStep) and step.step_args:
154
+ kwargs = step.step_args.func_kwargs
155
+ source_dir = kwargs.get("source_dir")
156
+ submit_class = kwargs.get("submit_class")
157
+ dependencies = get_processing_dependencies(
158
+ [
159
+ kwargs.get("dependencies"),
160
+ kwargs.get("submit_py_files"),
161
+ [submit_class] if submit_class else None,
162
+ kwargs.get("submit_jars"),
163
+ kwargs.get("submit_files"),
164
+ ]
165
+ )
166
+ code = kwargs.get("submit_app") or kwargs.get("code")
167
+
168
+ return get_processing_code_hash(code, source_dir, dependencies)
169
+
170
+ if isinstance(step, TrainingStep) and step.step_args:
171
+ model_trainer = step.step_args.func_args[0]
172
+ source_code = model_trainer.source_code
173
+ if source_code:
174
+ source_dir = source_code.source_dir
175
+ requirements = source_code.requirements
176
+ entry_point = source_code.entry_script
177
+ return get_training_code_hash(entry_point, source_dir, requirements)
178
+ return None
179
+
180
+
181
+ def get_processing_dependencies(dependency_args: List[List[str]]) -> List[str]:
182
+ """Get the Processing job dependencies from the processor run kwargs
183
+
184
+ Args:
185
+ dependency_args: A list of dependency args from processor.run()
186
+ Returns:
187
+ List[str]: A list of code dependencies for the job
188
+ """
189
+
190
+ dependencies = []
191
+ for arg in dependency_args:
192
+ if arg:
193
+ dependencies += arg
194
+
195
+ return dependencies
196
+
197
+
198
+ def get_processing_code_hash(code: str, source_dir: str, dependencies: List[str]) -> str:
199
+ """Get the hash of a processing step's code artifact(s).
200
+
201
+ Args:
202
+ code (str): Path to a file with the processing script to run
203
+ source_dir (str): Path to a directory with any other processing
204
+ source code dependencies aside from the entry point file
205
+ dependencies (str): A list of paths to directories (absolute
206
+ or relative) with any additional libraries that will be exported
207
+ to the container
208
+ Returns:
209
+ str: A hash string representing the unique code artifact(s) for the step
210
+ """
211
+
212
+ # FrameworkProcessor
213
+ if source_dir:
214
+ source_dir_url = urlparse(source_dir)
215
+ if source_dir_url.scheme == "" or source_dir_url.scheme == "file":
216
+ # Include code in the hash when possible
217
+ if code:
218
+ code_url = urlparse(code)
219
+ if code_url.scheme == "" or code_url.scheme == "file":
220
+ return hash_files_or_dirs([code, source_dir] + dependencies)
221
+ return hash_files_or_dirs([source_dir] + dependencies)
222
+ # Other Processors - Spark, Script, Base, etc.
223
+ if code:
224
+ code_url = urlparse(code)
225
+ if code_url.scheme == "" or code_url.scheme == "file":
226
+ return hash_files_or_dirs([code] + dependencies)
227
+ return None
228
+
229
+
230
+ def get_training_code_hash(entry_point: str, source_dir: str, dependencies: List[str]) -> str:
231
+ """Get the hash of a training step's code artifact(s).
232
+
233
+ Args:
234
+ entry_point (str): The absolute or relative path to the local Python
235
+ source file that should be executed as the entry point to
236
+ training
237
+ source_dir (str): Path to a directory with any other training source
238
+ code dependencies aside from the entry point file
239
+ dependencies (str): A list of paths to directories (absolute
240
+ or relative) with any additional libraries that will be exported
241
+ to the container
242
+ Returns:
243
+ str: A hash string representing the unique code artifact(s) for the step
244
+ """
245
+ from sagemaker.core.workflow import is_pipeline_variable
246
+
247
+ if not is_pipeline_variable(source_dir) and not is_pipeline_variable(entry_point):
248
+ if source_dir:
249
+ source_dir_url = urlparse(source_dir)
250
+ if source_dir_url.scheme == "" or source_dir_url.scheme == "file":
251
+ return hash_files_or_dirs([source_dir] + dependencies)
252
+ elif entry_point:
253
+ entry_point_url = urlparse(entry_point)
254
+ if entry_point_url.scheme == "" or entry_point_url.scheme == "file":
255
+ return hash_files_or_dirs([entry_point] + dependencies)
256
+ return None
257
+
258
+
259
+ def get_config_hash(step: Entity):
260
+ """Get the hash of the config artifact(s) for the given step
261
+
262
+ Args:
263
+ step (Entity): A pipeline step object (Entity type because Step causes circular import)
264
+ Returns:
265
+ str: A hash string representing the unique config artifact(s) for the step
266
+ """
267
+ from sagemaker.mlops.workflow.steps import ProcessingStep
268
+
269
+ if isinstance(step, ProcessingStep) and step.step_args:
270
+ config = step.step_args.func_kwargs.get("configuration")
271
+ if config:
272
+ return hash_object(config)
273
+ return None
274
+
275
+
276
+ def hash_object(obj) -> str:
277
+ """Get the SHA256 hash of an object.
278
+
279
+ Args:
280
+ obj (dict): The object
281
+ Returns:
282
+ str: The SHA256 hash of the object
283
+ """
284
+ return hashlib.sha256(str(obj).encode()).hexdigest()
285
+
286
+
287
+ def hash_file(path: str) -> str:
288
+ """Get the SHA256 hash of a file.
289
+
290
+ Args:
291
+ path (str): The local path for the file.
292
+ Returns:
293
+ str: The SHA256 hash of the file.
294
+ """
295
+ return _hash_file(path, hashlib.sha256()).hexdigest()
296
+
297
+
298
+ def hash_files_or_dirs(paths: List[str]) -> str:
299
+ """Get the SHA256 hash of the contents of a list of files or directories.
300
+
301
+ Hash is changed if:
302
+ * input list is changed
303
+ * new nested directories/files are added to any directory in the input list
304
+ * nested directory/file names are changed for any of the inputted directories
305
+ * content of files is edited
306
+
307
+ Args:
308
+ paths: List of file or directory paths
309
+ Returns:
310
+ str: The SHA256 hash of the list of files or directories.
311
+ """
312
+ sha256 = hashlib.sha256()
313
+ for path in sorted(paths):
314
+ sha256 = _hash_file_or_dir(path, sha256)
315
+ return sha256.hexdigest()
316
+
317
+
318
+ def _hash_file_or_dir(path: str, sha256: Hash) -> Hash:
319
+ """Updates the inputted Hash with the contents of the current path.
320
+
321
+ Args:
322
+ path: path of file or directory
323
+ Returns:
324
+ str: The SHA256 hash of the file or directory
325
+ """
326
+ if isinstance(path, str) and path.lower().startswith("file://"):
327
+ path = unquote(urlparse(path).path)
328
+ sha256.update(path.encode())
329
+ if Path(path).is_dir():
330
+ sha256 = _hash_dir(path, sha256)
331
+ elif Path(path).is_file():
332
+ sha256 = _hash_file(path, sha256)
333
+ return sha256
334
+
335
+
336
+ def _hash_dir(directory: Union[str, Path], sha256: Hash) -> Hash:
337
+ """Updates the inputted Hash with the contents of the current path.
338
+
339
+ Args:
340
+ directory: path of the directory
341
+ Returns:
342
+ str: The SHA256 hash of the directory
343
+ """
344
+ if not Path(directory).is_dir():
345
+ raise ValueError(str(directory) + " is not a valid directory")
346
+ for path in sorted(Path(directory).iterdir()):
347
+ sha256.update(path.name.encode())
348
+ if path.is_file():
349
+ sha256 = _hash_file(path, sha256)
350
+ elif path.is_dir():
351
+ sha256 = _hash_dir(path, sha256)
352
+ return sha256
353
+
354
+
355
+ def _hash_file(file: Union[str, Path], sha256: Hash) -> Hash:
356
+ """Updates the inputted Hash with the contents of the current path.
357
+
358
+ Args:
359
+ file: path of the file
360
+ Returns:
361
+ str: The SHA256 hash of the file
362
+ """
363
+ if isinstance(file, str) and file.lower().startswith("file://"):
364
+ file = unquote(urlparse(file).path)
365
+ if not Path(file).is_file():
366
+ raise ValueError(str(file) + " is not a valid file")
367
+ with open(file, "rb") as f:
368
+ while True:
369
+ data = f.read(BUF_SIZE)
370
+ if not data:
371
+ break
372
+ sha256.update(data)
373
+ return sha256
374
+
375
+
376
+ def validate_step_args_input(
377
+ step_args: _StepArguments, expected_caller: Set[str], error_message: str
378
+ ):
379
+ """Validate the `_StepArguments` object which is passed into a pipeline step
380
+
381
+ Args:
382
+ step_args (_StepArguments): A `_StepArguments` object to be used for composing
383
+ a pipeline step.
384
+ expected_caller (Set[str]): The expected name of the caller function which is
385
+ intercepted by the PipelineSession to get the step arguments.
386
+ error_message (str): The error message to be thrown if the validation fails.
387
+ """
388
+ if not isinstance(step_args, _StepArguments):
389
+ raise TypeError(error_message)
390
+ if step_args.caller_name not in expected_caller:
391
+ raise ValueError(error_message)
392
+
393
+
394
+ def override_pipeline_parameter_var(func):
395
+ """A decorator to override pipeline Parameters passed into a function
396
+
397
+ This is a temporary decorator to override pipeline Parameter objects with their default value
398
+ and display warning information to instruct users to update their code.
399
+
400
+ This decorator can help to give a grace period for users to update their code when
401
+ we make changes to explicitly prevent passing any pipeline variables to a function.
402
+
403
+ We should remove this decorator after the grace period.
404
+ """
405
+ warning_msg_template = (
406
+ "The input argument %s of function (%s) is a pipeline variable (%s), "
407
+ "which is interpreted in pipeline execution time only. "
408
+ "As the function needs to evaluate the argument value in SDK compile time, "
409
+ "the default_value of this Parameter object will be used to override it. "
410
+ "Please make sure the default_value is valid."
411
+ )
412
+
413
+ @wraps(func)
414
+ def wrapper(*args, **kwargs):
415
+ func_name = "{}.{}".format(func.__module__, func.__name__)
416
+ params = inspect.signature(func).parameters
417
+ args = list(args)
418
+ for i, (arg_name, _) in enumerate(params.items()):
419
+ if i >= len(args):
420
+ break
421
+ if isinstance(args[i], Parameter):
422
+ logger.warning(warning_msg_template, arg_name, func_name, type(args[i]))
423
+ args[i] = args[i].default_value
424
+ args = tuple(args)
425
+
426
+ for arg_name, value in kwargs.items():
427
+ if isinstance(value, Parameter):
428
+ logger.warning(warning_msg_template, arg_name, func_name, type(value))
429
+ kwargs[arg_name] = value.default_value
430
+ return func(*args, **kwargs)
431
+
432
+ return wrapper
433
+
434
+
435
+ def execute_job_functions(step_args: _StepArguments):
436
+ """Execute the job class functions during pipeline definition construction
437
+
438
+ Executes the job functions such as run(), fit(), or transform() that have been
439
+ delayed until the pipeline gets built, for steps built with a PipelineSession.
440
+
441
+ Handles multiple functions in instances where job functions are chained
442
+ together from the inheritance of different job classes (e.g. PySparkProcessor,
443
+ ScriptProcessor, and Processor).
444
+
445
+ Args:
446
+ step_args (_StepArguments): A `_StepArguments` object to be used for composing
447
+ a pipeline step, contains the necessary function information
448
+ """
449
+
450
+ chained_args = step_args.func(*step_args.func_args, **step_args.func_kwargs)
451
+ if isinstance(chained_args, _StepArguments):
452
+ execute_job_functions(chained_args)
453
+
454
+
455
+ def trim_request_dict(request_dict, job_key, config):
456
+ """Trim request_dict for unwanted fields to not persist them in step arguments
457
+
458
+ Trim the job_name field off request_dict in cases where we do not want to include it
459
+ in the pipeline definition.
460
+
461
+ Args:
462
+ request_dict (dict): A dictionary used to build the arguments for a pipeline step,
463
+ containing fields that will be passed to job client during orchestration.
464
+ job_key (str): The key in a step's arguments to look up the base_job_name if it
465
+ exists
466
+ config (_pipeline_config) The config intercepted and set for a pipeline via the
467
+ context manager
468
+ """
469
+
470
+ if not config or not config.pipeline_definition_config.use_custom_job_prefix:
471
+ logger.warning(DEF_CONFIG_WARN_MSG_TEMPLATE, job_key)
472
+ request_dict.pop(job_key, None) # safely return null in case of KeyError
473
+ else:
474
+ if job_key in request_dict:
475
+ if request_dict[job_key] is None or len(request_dict[job_key]) == 0:
476
+ raise ValueError(JOB_KEY_NONE_WARN_MSG_TEMPLATE.format(job_key))
477
+ request_dict[job_key] = base_from_name(request_dict[job_key]) # trim timestamp
478
+
479
+ return request_dict
480
+
481
+
482
+ def _collect_parameters(func):
483
+ """The decorator function is to collect all the params passed into an invoked function of class.
484
+
485
+ These parameters are set as properties of the class instance. The use case is to simplify
486
+ parameter collecting when they are passed into the step __init__ method.
487
+
488
+ Usage:
489
+ class A:
490
+ @collect_parameters
491
+ def __init__(a, b='', c=None)
492
+ pass
493
+
494
+ In above case, the A instance would have a, b, c set as instance properties.
495
+ None value will be set as well. If the property exists, it will be overridden.
496
+ """
497
+
498
+ @wraps(func)
499
+ def wrapper(self, *args, **kwargs):
500
+ # Get the parameters and values
501
+ signature = inspect.signature(func)
502
+ bound_args = signature.bind(self, *args, **kwargs)
503
+ bound_args.apply_defaults()
504
+
505
+ # Create a dictionary of parameters and their values
506
+ parameters_and_values = dict(bound_args.arguments)
507
+
508
+ for param, value in parameters_and_values.items():
509
+ if param not in ("self", "depends_on"):
510
+ setattr(self, param, value)
511
+
512
+ func(self, *args, **kwargs)
513
+
514
+ return wrapper
@@ -0,0 +1,33 @@
1
+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
4
+ # may not use this file except in compliance with the License. A copy of
5
+ # the License is located at
6
+ #
7
+ # http://aws.amazon.com/apache2.0/
8
+ #
9
+ # or in the "license" file accompanying this file. This file is
10
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
+ # ANY KIND, either express or implied. See the License for the specific
12
+ # language governing permissions and limitations under the License.
13
+ """Legacy lineage module - compatibility shim.
14
+
15
+ This module provides backward compatibility for code using the old
16
+ `sagemaker.lineage` import path. All functionality has been moved to
17
+ `sagemaker.core.lineage`.
18
+
19
+ DEPRECATED: This module is deprecated. Use `sagemaker.core.lineage` instead.
20
+ """
21
+ from __future__ import absolute_import
22
+
23
+ import warnings
24
+
25
+ # Show deprecation warning
26
+ warnings.warn(
27
+ "The 'sagemaker.lineage' module is deprecated. " "Please use 'sagemaker.core.lineage' instead.",
28
+ DeprecationWarning,
29
+ stacklevel=2,
30
+ )
31
+
32
+ # Re-export from core.lineage for backward compatibility
33
+ from sagemaker.core.lineage import * # noqa: F401, F403
@@ -0,0 +1,28 @@
1
+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
4
+ # may not use this file except in compliance with the License. A copy of
5
+ # the License is located at
6
+ #
7
+ # http://aws.amazon.com/apache2.0/
8
+ #
9
+ # or in the "license" file accompanying this file. This file is
10
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
+ # ANY KIND, either express or implied. See the License for the specific
12
+ # language governing permissions and limitations under the License.
13
+ """Legacy lineage.action module - compatibility shim.
14
+
15
+ DEPRECATED: Use `sagemaker.core.lineage.action` instead.
16
+ """
17
+ from __future__ import absolute_import
18
+
19
+ import warnings
20
+
21
+ warnings.warn(
22
+ "The 'sagemaker.lineage.action' module is deprecated. "
23
+ "Please use 'sagemaker.core.lineage.action' instead.",
24
+ DeprecationWarning,
25
+ stacklevel=2,
26
+ )
27
+
28
+ from sagemaker.core.lineage.action import * # noqa: F401, F403
@@ -0,0 +1,28 @@
1
+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
4
+ # may not use this file except in compliance with the License. A copy of
5
+ # the License is located at
6
+ #
7
+ # http://aws.amazon.com/apache2.0/
8
+ #
9
+ # or in the "license" file accompanying this file. This file is
10
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
+ # ANY KIND, either express or implied. See the License for the specific
12
+ # language governing permissions and limitations under the License.
13
+ """Legacy lineage.artifact module - compatibility shim.
14
+
15
+ DEPRECATED: Use `sagemaker.core.lineage.artifact` instead.
16
+ """
17
+ from __future__ import absolute_import
18
+
19
+ import warnings
20
+
21
+ warnings.warn(
22
+ "The 'sagemaker.lineage.artifact' module is deprecated. "
23
+ "Please use 'sagemaker.core.lineage.artifact' instead.",
24
+ DeprecationWarning,
25
+ stacklevel=2,
26
+ )
27
+
28
+ from sagemaker.core.lineage.artifact import * # noqa: F401, F403
@@ -0,0 +1,28 @@
1
+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
4
+ # may not use this file except in compliance with the License. A copy of
5
+ # the License is located at
6
+ #
7
+ # http://aws.amazon.com/apache2.0/
8
+ #
9
+ # or in the "license" file accompanying this file. This file is
10
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
+ # ANY KIND, either express or implied. See the License for the specific
12
+ # language governing permissions and limitations under the License.
13
+ """Legacy lineage.context module - compatibility shim.
14
+
15
+ DEPRECATED: Use `sagemaker.core.lineage.context` instead.
16
+ """
17
+ from __future__ import absolute_import
18
+
19
+ import warnings
20
+
21
+ warnings.warn(
22
+ "The 'sagemaker.lineage.context' module is deprecated. "
23
+ "Please use 'sagemaker.core.lineage.context' instead.",
24
+ DeprecationWarning,
25
+ stacklevel=2,
26
+ )
27
+
28
+ from sagemaker.core.lineage.context import * # noqa: F401, F403
@@ -0,0 +1,28 @@
1
+ # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
4
+ # may not use this file except in compliance with the License. A copy of
5
+ # the License is located at
6
+ #
7
+ # http://aws.amazon.com/apache2.0/
8
+ #
9
+ # or in the "license" file accompanying this file. This file is
10
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
+ # ANY KIND, either express or implied. See the License for the specific
12
+ # language governing permissions and limitations under the License.
13
+ """Legacy lineage.lineage_trial_component module - compatibility shim.
14
+
15
+ DEPRECATED: Use `sagemaker.core.lineage.lineage_trial_component` instead.
16
+ """
17
+ from __future__ import absolute_import
18
+
19
+ import warnings
20
+
21
+ warnings.warn(
22
+ "The 'sagemaker.lineage.lineage_trial_component' module is deprecated. "
23
+ "Please use 'sagemaker.core.lineage.lineage_trial_component' instead.",
24
+ DeprecationWarning,
25
+ stacklevel=2,
26
+ )
27
+
28
+ from sagemaker.core.lineage.lineage_trial_component import * # noqa: F401, F403