@@ -503,7 +503,8 @@ def log_file(
503503 file_path : str ,
504504 name : Optional [str ] = None ,
505505 media_type : Optional [str ] = None ,
506- is_output : bool = True ,
506+ is_output : Optional [bool ] = True ,
507+ extra_args : Optional [dict ] = {},
507508 ):
508509 """Upload a file to s3 and store it as an input/output artifact in this run.
509510
@@ -516,11 +517,15 @@ def log_file(
516517 is_output (bool): Determines direction of association to the
517518 run. Defaults to True (output artifact).
518519 If set to False then represented as input association.
520+ extra_args (dict): Optional extra arguments that may be passed to the upload operation.
521+ Similar to ExtraArgs parameter in S3 upload_file function. Please refer to the
522+ ExtraArgs parameter documentation here:
523+ https://boto3.amazonaws.com/v1/documentation/api/latest/guide/s3-uploading-files.html#the-extraargs-parameter
519524 """
520525 self ._verify_trial_component_artifacts_length (is_output )
521526 media_type = media_type or guess_media_type (file_path )
522527 name = name or resolve_artifact_name (file_path )
523- s3_uri , _ = self ._artifact_uploader .upload_artifact (file_path )
528+ s3_uri , _ = self ._artifact_uploader .upload_artifact (file_path , extra_args = extra_args )
524529 if is_output :
525530 self ._trial_component .output_artifacts [name ] = TrialComponentArtifact (
526531 value = s3_uri , media_type = media_type
0 commit comments