@@ -485,44 +485,39 @@ def __init__(
485
485
outputs : List [ProcessingOutput ] = None ,
486
486
job_arguments : List [str ] = None ,
487
487
code : str = None ,
488
- source_dir : str = None ,
489
488
property_files : List [PropertyFile ] = None ,
490
489
cache_config : CacheConfig = None ,
491
490
depends_on : Union [List [str ], List [Step ]] = None ,
492
491
retry_policies : List [RetryPolicy ] = None ,
493
- kms_key = None ,
492
+ ** kwargs ,
494
493
):
495
494
"""Construct a ProcessingStep, given a `Processor` instance.
496
495
497
496
In addition to the processor instance, the other arguments are those that are supplied to
498
- the `process ` method of the ` sagemaker.processing.Processor`.
497
+ the `run() ` method of the :class:`~ sagemaker.processing.Processor`.
499
498
500
499
Args:
501
500
name (str): The name of the processing step.
502
- processor (Processor): A ` sagemaker.processing.Processor` instance.
501
+ processor (Processor): A :class:`~ sagemaker.processing.Processor` instance.
503
502
display_name (str): The display name of the processing step.
504
503
description (str): The description of the processing step.
505
- inputs (List[ProcessingInput]): A list of `sagemaker.processing.ProcessorInput`
506
- instances. Defaults to `None`.
507
- outputs (List[ProcessingOutput]): A list of `sagemaker.processing.ProcessorOutput`
508
- instances. Defaults to `None`.
509
- job_arguments (List[str]): A list of strings to be passed into the processing job.
510
- Defaults to `None`.
511
- code (str): S3 URI or local path to a file with the user script to run. If
512
- ``source_dir`` is specified (for ``processor``s that support it), then ``code``
513
- must be a path relative to the root of ``source_dir``. Defaults to `None`.
514
- source_dir (str): S3 URI or local path to a folder with any other containing processing
515
- source code dependencies aside from the entry point ``code`` file. This parameter
516
- is only supported when using a 'processor' based on ``FrameworkProcessor``. If
517
- an S3 URI is provided, it must point to a tar.gz file. Defaults to `None`.
504
+ inputs (List[ProcessingInput]): A list of inputs to the processing job. Defaults to
505
+ `None`.
506
+ outputs (List[ProcessingOutput]): A list of outputs from the processing job. Defaults
507
+ to `None`.
508
+ job_arguments (List[str]): A list of command line arguments to be passed into the
509
+ processing job. Defaults to `None`.
510
+ code (str): This can be an S3 URI or a local path to a file with the framework
511
+ script to run. Defaults to `None`.
518
512
property_files (List[PropertyFile]): A list of property files that workflow looks
519
513
for and resolves from the configured processing output list.
520
- cache_config (CacheConfig): A `sagemaker.workflow.steps.CacheConfig` instance .
521
- depends_on (List[str] or List[Step]): A list of step names or step instance
522
- this `sagemaker.workflow.steps.ProcessingStep` depends on
514
+ cache_config (CacheConfig): Step result caching configuration .
515
+ depends_on (List[str] or List[Step]): A list of step names or step instances this
516
+ `sagemaker.workflow.steps.ProcessingStep` depends on.
523
517
retry_policies (List[RetryPolicy]): A list of retry policy
524
- kms_key (str): The ARN of the KMS key that is used to encrypt the
525
- user code file. Defaults to `None`.
518
+ **kwargs: Additional arguments as per ``processor.run()``, depending on your processor
519
+ type. For example may include ``source_dir`` for processors based on
520
+ :class:`~sagemaker.processing.FrameworkProcessor`.
526
521
"""
527
522
super (ProcessingStep , self ).__init__ (
528
523
name , StepTypeEnum .PROCESSING , display_name , description , depends_on , retry_policies
@@ -534,11 +529,7 @@ def __init__(
534
529
self .code = code
535
530
self .property_files = property_files
536
531
self .job_name = None
537
-
538
- self .processor_kwargs = dict (kms_key = kms_key )
539
- # Optional args supported by only a subset of Processor classes:
540
- if source_dir is not None :
541
- self .processor_kwargs ["source_dir" ] = source_dir
532
+ self .processor_kwargs = kwargs
542
533
543
534
# Examine why run method in sagemaker.processing.Processor mutates the processor instance
544
535
# by setting the instance's arguments attribute. Refactor Processor.run, if possible.
0 commit comments