Skip to content

Commit

Permalink
CORE-2011 Update setting max CPUs in app launch form
Browse files Browse the repository at this point in the history
If no default_max_cpu_cores setting is returned from the API,
then set a reasonable default so the max is not automatically selected
in the launch form.
  • Loading branch information
psarando committed Sep 28, 2024
1 parent 77e8b40 commit f406be6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/apps/launch/formatters.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,27 @@ const initAppLaunchValues = (
notify,
notifyPeriodic,
periodicPeriod,
defaultMaxCpuCores = 4,
defaultOutputDir,
app: { id, version_id, system_id, name, requirements, groups },
}
) => {
// If no default_max_cpu_cores is returned from the API,
// then use the default from params (if it's less than the actual max)
// so the max is not automatically selected in the launch form.
const reqInitValues = requirements?.map(
({
step_number,
max_cpu_cores,
default_max_cpu_cores = 0,
default_max_cpu_cores = max_cpu_cores < defaultMaxCpuCores
? max_cpu_cores
: defaultMaxCpuCores,
default_cpu_cores = 0,
default_memory = 0,
default_disk_space = 0,
}) => ({
step_number,
max_cpu_cores: default_max_cpu_cores || max_cpu_cores,
max_cpu_cores: default_max_cpu_cores,
min_cpu_cores: default_cpu_cores,
min_memory_limit: default_memory,
min_disk_space: default_disk_space,
Expand Down

0 comments on commit f406be6

Please sign in to comment.