Skip to content

Commit

Permalink
Merge pull request #268 from ianmcorvidae/revert-condor-maxvals
Browse files Browse the repository at this point in the history
Only set the default maximums for interactive jobs
  • Loading branch information
slr71 authored Mar 15, 2024
2 parents ccc16a2 + dea1edb commit 57cce89
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/apps/service/apps/de/job_view.clj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
[slingshot.slingshot :only [try+ throw+]])
(:require [apps.clients.data-info :as data-info]
[apps.metadata.params :as mp]
[apps.constants :as ac]
[apps.persistence.app-metadata :as amp]
[apps.service.apps.de.constants :as c]
[apps.service.apps.de.limits :as limits]
Expand All @@ -16,16 +17,19 @@
[clojure-commons.exception-util :as cxu]))

(defn- format-step-resource-requirements
[requirements step-number]
(merge {:max_cpu_cores (config/default-cpu-limit)
:memory_limit (config/default-memory-limit)
:step_number step-number}
requirements))

(defn get-step-resource-requirements
[{task-id :task_id step-number :step_number}]
(let [requirements (amp/get-resource-requirements-for-task task-id)]
(format-step-resource-requirements requirements step-number)))
[requirements step-number add-defaults?]
(if add-defaults?
(merge {:max_cpu_cores (config/default-cpu-limit)
:memory_limit (config/default-memory-limit)
:step_number step-number}
requirements)
(assoc requirements :step_number step-number)))

(defn- get-step-resource-requirements
[app {task-id :task_id step-number :step_number}]
(let [requirements (amp/get-resource-requirements-for-task task-id)
add-defaults? (= (:overall_job_type app) ac/interactive-tool-type)]
(format-step-resource-requirements requirements step-number add-defaults?)))

(defn- mapped-input-subselect
[step-id]
Expand Down Expand Up @@ -119,7 +123,7 @@
(-> (select-keys app [:id :name :description :disabled :deleted :version :version_id])
(assoc :label name
:versions (amp/list-app-versions id)
:requirements (map get-step-resource-requirements app-steps)
:requirements (map (partial get-step-resource-requirements app) app-steps)
:groups (remove (comp empty? :parameters) (format-steps user include-hidden-params? app-steps))
:app_type "DE"
:system_id c/system-id
Expand Down

0 comments on commit 57cce89

Please sign in to comment.