@@ -636,7 +636,7 @@ def _get_train_request( # noqa: C901
636
636
(default: ``None``).
637
637
638
638
Returns:
639
- Dict: a training request dictionary
639
+ Dict: a training request dict
640
640
"""
641
641
train_request = {
642
642
"AlgorithmSpecification" : {"TrainingInputMode" : input_mode },
@@ -756,6 +756,71 @@ def process(
756
756
three optional keys, 'ExperimentName', 'TrialName', and 'TrialComponentDisplayName'.
757
757
(default: ``None``)
758
758
"""
759
+ process_request = self ._get_process_request (
760
+ inputs = inputs ,
761
+ output_config = output_config ,
762
+ job_name = job_name ,
763
+ resources = resources ,
764
+ stopping_condition = stopping_condition ,
765
+ app_specification = app_specification ,
766
+ environment = environment ,
767
+ network_config = network_config ,
768
+ role_arn = role_arn ,
769
+ tags = tags ,
770
+ experiment_config = experiment_config ,
771
+ )
772
+ LOGGER .info ("Creating processing-job with name %s" , job_name )
773
+ LOGGER .debug ("process request: %s" , json .dumps (process_request , indent = 4 ))
774
+ self .sagemaker_client .create_processing_job (** process_request )
775
+
776
+ def _get_process_request (
777
+ self ,
778
+ inputs ,
779
+ output_config ,
780
+ job_name ,
781
+ resources ,
782
+ stopping_condition ,
783
+ app_specification ,
784
+ environment ,
785
+ network_config ,
786
+ role_arn ,
787
+ tags ,
788
+ experiment_config = None ,
789
+ ):
790
+ """Constructs a request compatible for an Amazon SageMaker processing job.
791
+
792
+ Args:
793
+ inputs ([dict]): List of up to 10 ProcessingInput dictionaries.
794
+ output_config (dict): A config dictionary, which contains a list of up
795
+ to 10 ProcessingOutput dictionaries, as well as an optional KMS key ID.
796
+ job_name (str): The name of the processing job. The name must be unique
797
+ within an AWS Region in an AWS account. Names should have minimum
798
+ length of 1 and maximum length of 63 characters.
799
+ resources (dict): Encapsulates the resources, including ML instances
800
+ and storage, to use for the processing job.
801
+ stopping_condition (dict[str,int]): Specifies a limit to how long
802
+ the processing job can run, in seconds.
803
+ app_specification (dict[str,str]): Configures the processing job to
804
+ run the given image. Details are in the processing container
805
+ specification.
806
+ environment (dict): Environment variables to start the processing
807
+ container with.
808
+ network_config (dict): Specifies networking options, such as network
809
+ traffic encryption between processing containers, whether to allow
810
+ inbound and outbound network calls to and from processing containers,
811
+ and VPC subnets and security groups to use for VPC-enabled processing
812
+ jobs.
813
+ role_arn (str): The Amazon Resource Name (ARN) of an IAM role that
814
+ Amazon SageMaker can assume to perform tasks on your behalf.
815
+ tags ([dict[str,str]]): A list of dictionaries containing key-value
816
+ pairs.
817
+ experiment_config (dict): Experiment management configuration. Dictionary contains
818
+ three optional keys, 'ExperimentName', 'TrialName', and 'TrialComponentDisplayName'.
819
+ (default: ``None``)
820
+
821
+ Returns:
822
+ Dict: a processing job request dict
823
+ """
759
824
process_request = {
760
825
"ProcessingJobName" : job_name ,
761
826
"ProcessingResources" : resources ,
@@ -784,9 +849,7 @@ def process(
784
849
if experiment_config :
785
850
process_request ["ExperimentConfig" ] = experiment_config
786
851
787
- LOGGER .info ("Creating processing-job with name %s" , job_name )
788
- LOGGER .debug ("process request: %s" , json .dumps (process_request , indent = 4 ))
789
- self .sagemaker_client .create_processing_job (** process_request )
852
+ return process_request
790
853
791
854
def create_monitoring_schedule (
792
855
self ,
0 commit comments