diff --git a/instill/helpers/const.py b/instill/helpers/const.py index 490e8f0..644ba03 100644 --- a/instill/helpers/const.py +++ b/instill/helpers/const.py @@ -120,3 +120,4 @@ class VisualQuestionAnsweringInput: ENV_NUM_OF_CPUS = "RAY_NUM_OF_CPUS" ENV_NUM_OF_MIN_REPLICAS = "RAY_NUM_OF_MIN_REPLICAS" ENV_NUM_OF_MAX_REPLICAS = "RAY_NUM_OF_MAX_REPLICAS" +ENV_IS_TEST_MODEL = "RAY_IS_TEST_MODEL" diff --git a/instill/helpers/ray_config.py b/instill/helpers/ray_config.py index 8fd0d9f..1aa0bd6 100644 --- a/instill/helpers/ray_config.py +++ b/instill/helpers/ray_config.py @@ -10,6 +10,7 @@ DEFAULT_MAX_ONGOING_REQUESTS, DEFAULT_MAX_QUEUED_REQUESTS, DEFAULT_RAY_ACTOR_OPTIONS, + ENV_IS_TEST_MODEL, ENV_MEMORY, ENV_NUM_OF_CPUS, ENV_NUM_OF_GPUS, @@ -35,6 +36,10 @@ def __init__(self, deployable: Deployment) -> None: if num_of_cpus is not None and num_of_cpus != "": self._update_num_cpus(float(num_of_cpus)) + is_test_model = os.getenv(ENV_IS_TEST_MODEL) + if is_test_model is not None and is_test_model.lower() == "true": + self._update_num_cpus(float(0.001)) + memory = os.getenv(ENV_MEMORY) if memory is not None and memory != "": self._update_memory(float(memory))