Skip to content

Commit

Permalink
update and fix workers for simularium
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPatrie committed Aug 16, 2024
1 parent f2a46d5 commit 0318eea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion compose_worker/.CONTAINER_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.0
1.2.1
11 changes: 7 additions & 4 deletions compose_worker/workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,15 +476,18 @@ async def run(self):

# is a job related to a client file upload
if input_path is not None:
# is a smoldyn output file and thus a simularium job
# download the input file
dest = tempfile.mkdtemp()
local_input_path = await download_file(source_blob_path=input_path, bucket_name=BUCKET_NAME, out_dir=dest)

# case: is a smoldyn output file and thus a simularium job
if input_path.endswith('.txt'):
await self._run_simularium(job_id=job_id, input_path=input_path)
await self._run_simularium(job_id=job_id, input_path=local_input_path, dest=dest)

return self.job_result

async def _run_simularium(self, job_id: str, input_path: str):
async def _run_simularium(self, job_id: str, input_path: str, dest: str):
box_size = self.job_params['box_size']
dest = tempfile.mkdtemp()
result = await generate_simularium_file(input_fp=input_path, dest_dir=dest, box_size=box_size)

results_file = result.get('simularium_file')
Expand Down

0 comments on commit 0318eea

Please sign in to comment.