@@ -503,7 +503,8 @@ def log_file(
503
503
file_path : str ,
504
504
name : Optional [str ] = None ,
505
505
media_type : Optional [str ] = None ,
506
- is_output : bool = True ,
506
+ is_output : Optional [bool ] = True ,
507
+ extra_args : Optional [dict ] = {},
507
508
):
508
509
"""Upload a file to s3 and store it as an input/output artifact in this run.
509
510
@@ -516,11 +517,15 @@ def log_file(
516
517
is_output (bool): Determines direction of association to the
517
518
run. Defaults to True (output artifact).
518
519
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
519
524
"""
520
525
self ._verify_trial_component_artifacts_length (is_output )
521
526
media_type = media_type or guess_media_type (file_path )
522
527
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 )
524
529
if is_output :
525
530
self ._trial_component .output_artifacts [name ] = TrialComponentArtifact (
526
531
value = s3_uri , media_type = media_type
0 commit comments