From 66544b8e8fca71030e10b38877997743fad9df4d Mon Sep 17 00:00:00 2001 From: rhoadesScholar Date: Sat, 9 Mar 2024 17:35:59 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Add=20sys.executable=20as?= =?UTF-8?q?=20the=20Python=20interpreter=20in=20worker=20scripts.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dacapo/blockwise/argmax_worker.py | 4 +++- dacapo/blockwise/predict_worker.py | 4 +++- dacapo/blockwise/relabel_worker.py | 4 +++- dacapo/blockwise/segment_worker.py | 4 +++- dacapo/blockwise/threshold_worker.py | 4 +++- tests/fixtures/db.py | 5 ++++- 6 files changed, 19 insertions(+), 6 deletions(-) diff --git a/dacapo/blockwise/argmax_worker.py b/dacapo/blockwise/argmax_worker.py index e42dd0299..59a17d752 100644 --- a/dacapo/blockwise/argmax_worker.py +++ b/dacapo/blockwise/argmax_worker.py @@ -1,4 +1,5 @@ from pathlib import Path +import sys from dacapo.experiments.datasplits.datasets.arrays.zarr_array import ZarrArray from dacapo.store.array_store import LocalArrayIdentifier from dacapo.compute_context import create_compute_context @@ -87,7 +88,8 @@ def spawn_worker( # Make the command for the worker to run command = [ - "python", + # "python", + sys.executable, path, "start-worker", "--input_container", diff --git a/dacapo/blockwise/predict_worker.py b/dacapo/blockwise/predict_worker.py index acf5ace0f..6a85b25a5 100644 --- a/dacapo/blockwise/predict_worker.py +++ b/dacapo/blockwise/predict_worker.py @@ -1,3 +1,4 @@ +import sys from pathlib import Path import torch @@ -208,7 +209,8 @@ def spawn_worker( # Make the command for the worker to run command = [ - "python", + # "python", + sys.executable, path, "start-worker", "--run-name", diff --git a/dacapo/blockwise/relabel_worker.py b/dacapo/blockwise/relabel_worker.py index 3c348a3b9..654be6bd8 100644 --- a/dacapo/blockwise/relabel_worker.py +++ b/dacapo/blockwise/relabel_worker.py @@ -1,5 +1,6 @@ from glob import glob import os +import sys import daisy from dacapo.compute_context import create_compute_context from dacapo.store.array_store import LocalArrayIdentifier @@ -101,7 +102,8 @@ def spawn_worker( # Make the command for the worker to run command = [ - "python", + # "python", + sys.executable, path, "start-worker", "--output_container", diff --git a/dacapo/blockwise/segment_worker.py b/dacapo/blockwise/segment_worker.py index 86a10ae72..08adcb0cb 100644 --- a/dacapo/blockwise/segment_worker.py +++ b/dacapo/blockwise/segment_worker.py @@ -2,6 +2,7 @@ import logging import os from pathlib import Path +import sys import click import daisy from funlib.persistence import Array @@ -191,7 +192,8 @@ def spawn_worker( # Make the command for the worker to run command = [ - "python", + # "python", + sys.executable, path, "start-worker", "--input_container", diff --git a/dacapo/blockwise/threshold_worker.py b/dacapo/blockwise/threshold_worker.py index 60fa0198e..3ff08c1e6 100644 --- a/dacapo/blockwise/threshold_worker.py +++ b/dacapo/blockwise/threshold_worker.py @@ -1,4 +1,5 @@ from pathlib import Path +import sys from dacapo.experiments.datasplits.datasets.arrays.zarr_array import ZarrArray from dacapo.store.array_store import LocalArrayIdentifier from dacapo.compute_context import create_compute_context @@ -89,7 +90,8 @@ def spawn_worker( # Make the command for the worker to run command = [ - "python", + # "python", + sys.executable, path, "start-worker", "--input_container", diff --git a/tests/fixtures/db.py b/tests/fixtures/db.py index ef70565e1..c1730e39a 100644 --- a/tests/fixtures/db.py +++ b/tests/fixtures/db.py @@ -36,7 +36,10 @@ def mongo_db_available(): def options(request, tmp_path): # read the options from the users config file locally options = Options.instance( - type=request.param, runs_base_dir="tests", mongo_db_name="dacapo_tests" + type=request.param, + runs_base_dir="tests", + mongo_db_name="dacapo_tests", + compute_context={"type": "LocalTorch", "config": {}}, ) # change to a temporary directory for this test only