Skip to content

Commit

Permalink
Fix #300 by sorting output targets before uploading
Browse files Browse the repository at this point in the history
  • Loading branch information
Nils Giordano committed May 21, 2021
1 parent 506afd8 commit fd40332
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions awsf3/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,16 @@ def upload_to_output_target(prj_out, encrypt_s3_upload=False):
output_argnames = prj_out.output_files.keys()
output_target = prj_out.alt_output_target(output_argnames)

# sorting outputs by mtime in order to upload in the right order.
# arbitrary order created issues with workflow managers (snakemake)
# because S3 does not save the modification time of uploaded objects
output_target = dict(
sorted(
output_target.items(),
key=lambda i: os.path.getmtime(i[0].replace('file://', ''))
)
)

for k in output_target:
target = Target(output_bucket)

Expand Down

0 comments on commit fd40332

Please sign in to comment.