Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix s3fs bybass
  • Loading branch information
ErinWeisbart committed Aug 4, 2022
commit f7919b87390523492d317125122b243dc054992b
9 changes: 6 additions & 3 deletions worker/cp-worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,11 @@ def runCellProfiler(message):
if DOWNLOAD_FILES.lower() == 'true':
printandlog('Figuring which files to download', logger)
import pandas
s3 = boto3.resource('s3')
s3client = boto3.client('s3')
if not os.path.exists(localIn):
os.mkdir(localIn)
csv_in = pandas.read_csv(os.path.join(DATA_ROOT,message['data_file']))
s3client.download_file(SOURCE_BUCKET, message['data_file'], os.path.join(localIn,'load_data.csv'))
csv_in = pandas.read_csv(os.path.join(localIn,'load_data.csv'))
csv_in=csv_in.astype('str')
#Figure out what metadata fields we need in this experiment, as a dict
if type(message['Metadata'])==dict:
Expand All @@ -212,7 +213,9 @@ def runCellProfiler(message):
os.makedirs(os.path.split(new_file_name)[0])
printandlog('made directory '+os.path.split(new_file_name)[0],logger)
if not os.path.exists(new_file_name):
s3.meta.client.download_file(INPUT_BUCKET,prefix_on_bucket,new_file_name)
printandlog(prefix_on_bucket, logger)
printandlog(new_file_name, logger)
s3client.download_file(SOURCE_BUCKET,prefix_on_bucket,new_file_name)
downloaded_files.append(new_file_name)
printandlog('Downloaded '+str(len(downloaded_files))+' files',logger)
import random
Expand Down