Skip to content

Commit

Permalink
[AUTO-BACKPORT 10160] fix: maxPoolSlotCapacity bug (#10195)
Browse files Browse the repository at this point in the history
Co-authored-by: John Kim <97752292+johnkim-det@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and johnkim-det authored Nov 4, 2024
1 parent 7db183e commit bb6f140
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
13 changes: 12 additions & 1 deletion webui/react/src/components/HyperparameterSearchModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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],
);

Expand Down
13 changes: 1 addition & 12 deletions webui/react/src/stores/cluster.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

/**
Expand Down

0 comments on commit bb6f140

Please sign in to comment.