@@ -75,7 +75,7 @@ async def create_remotes_and_export(dataset_path, public=False):
7575 await enableremote_tag_public (dataset_path )
7676 await export_dataset (dataset_path )
7777 if public :
78- await set_s3_access_tag (os .path .basename (dataset_path ), 'public' )
78+ await set_s3_access_tag . kiq (os .path .basename (dataset_path ))
7979
8080
8181def create_remotes (dataset_path ):
@@ -118,12 +118,8 @@ async def export_backup_and_drop(dataset_path):
118118 await s3_export (dataset_path , get_s3_remote (), tag .name )
119119 await fsck_and_drop (dataset_path , [tag .name for tag in tags ])
120120 logger .info (f'Exporting/dropping tags for { dataset_id } complete' )
121- if public_dataset :
122- logger .info (f'Setting public access tag for { dataset_id } ' )
123- await set_s3_access_tag (dataset_id , 'public' )
124- else :
125- logger .info (f'Setting private access tag for { dataset_id } ' )
126- await set_s3_access_tag (dataset_id , 'private' )
121+ logger .info (f'Queueing S3 access tag update for { dataset_id } ' )
122+ await set_s3_access_tag .kiq (dataset_id )
127123 logger .info (f'{ dataset_id } export_backup_and_drop complete' )
128124
129125
@@ -311,9 +307,15 @@ async def annex_drop(dataset_path, branches):
311307
312308
313309async def set_remote_public (dataset_path ):
314- """Configure x-amz-meta-access when a dataset is made public and update the S3 access tags."""
310+ """
311+ Configure x-amz-meta-access when a dataset is made public and update the S3 access tags.
312+
313+ Used by scripts/tag-public.py and runs the tag tasks without the broker.
314+ """
315315 await enableremote_tag_public (dataset_path )
316- await set_s3_access_tag (os .path .basename (dataset_path ), 'public' )
316+ await asyncio .to_thread (
317+ set_s3_access_tag_worker , os .path .basename (dataset_path ), 'public'
318+ )
317319
318320
319321async def enableremote_tag_public (dataset_path ):
@@ -370,8 +372,9 @@ def set_s3_access_tag_worker(dataset, value):
370372
371373
372374@broker .task
373- async def set_s3_access_tag (dataset , value = 'private' ):
375+ async def set_s3_access_tag (dataset ):
374376 """Set access tag on all versions of all files."""
377+ value = 'public' if is_public_dataset (dataset ) else 'private'
375378 loop = asyncio .get_running_loop ()
376379 # Use the default executor for the orchestration task to avoid deadlocking
377380 # the tags_executor which is used for the sub-tasks.
0 commit comments