diff --git a/webui/react/src/components/HyperparameterSearchModal.tsx b/webui/react/src/components/HyperparameterSearchModal.tsx index 5a71cc5b5ba..b8157f6653c 100644 --- a/webui/react/src/components/HyperparameterSearchModal.tsx +++ b/webui/react/src/components/HyperparameterSearchModal.tsx @@ -291,7 +291,18 @@ const HyperparameterSearchModal = ({ closeModal, experiment, trial }: Props): JS ); const maxSlots = useMemo( - () => (resourcePool ? maxPoolSlotCapacity(resourcePool) : 0), + /** + * On-premise deployments don't have dynamic agents and we don't know how many + * agents might connect. + * + * This is a work around for dynamic agents such as Kubernetes where `slotsAvailable`, + * `slotsPerAgents` and `maxAgents` are all zero. This value is used for form + * validation and it is too strict to allow anything to run experiments. Intentially + * generalized and not matching against Kubernetes, in case other schedulers return + * zeroes, and this would at least unblock experiments, and the backend would be able + * to return capacity issues. + */ + () => (resourcePool ? maxPoolSlotCapacity(resourcePool) || Infinity : 0), [resourcePool], ); diff --git a/webui/react/src/stores/cluster.tsx b/webui/react/src/stores/cluster.tsx index f07cf45408f..333f529ac99 100644 --- a/webui/react/src/stores/cluster.tsx +++ b/webui/react/src/stores/cluster.tsx @@ -49,18 +49,7 @@ export const maxPoolSlotCapacity = (pool: ResourcePool): number => { if (pool.maxAgents > 0 && pool.slotsPerAgent && pool.slotsPerAgent > 0) { return pool.maxAgents * pool.slotsPerAgent; } - /** - * On-premise deployments don't have dynamic agents and we don't know how many - * agents might connect. - * - * This is a work around for dynamic agents such as Kubernetes where `slotsAvailable`, - * `slotsPerAgents` and `maxAgents` are all zero. This value is used for form - * validation and it is too strict to allow anything to run experiments. Intentially - * generalized and not matching against Kubernetes, in case other schedulers return - * zeroes, and this would at least unblock experiments, and the backend would be able - * to return capacity issues. - */ - return pool.slotsAvailable || Infinity; + return pool.slotsAvailable; }; /**