Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
wip spark testing
Browse files Browse the repository at this point in the history
  • Loading branch information
laurameng committed Apr 1, 2022
1 parent 2a6c7f6 commit d600c55
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions scheduler/src/cook/kubernetes/api.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1335,19 +1335,24 @@
(defn job-label->pod-annotations
"Given a job, return all pod annotations configured based on the job's labels"
[job]
(let [{:keys [job-label-to-pod-annotation-map job-label-to-pod-annotation-lookup-key]} (config/kubernetes)
requested-pod-annotations
(if job-label-to-pod-annotation-lookup-key
(-> job
(tools/job-ent->label)
(get job-label-to-pod-annotation-lookup-key "")
; the user can pass us multiple comma-separated values
(str/split #","))
"")]
(->> requested-pod-annotations
(select-keys job-label-to-pod-annotation-map)
(vals)
(into {}))))
({
"ad.datadog.com/required-cook-job-container.check_names" "spark"
"ad.datadog.com/required-cook-job-container.init_configs" "{}"
"ad.datadog.com/required-cook-job-container.instances" "{\"spark_url\": \"%%host%%:8080\", \"cluster_name\": \"test-spark-cluster\"}"
})
;(let [{:keys [job-label-to-pod-annotation-map job-label-to-pod-annotation-lookup-key]} (config/kubernetes)
; requested-pod-annotations
; (if job-label-to-pod-annotation-lookup-key
; (-> job
; (tools/job-ent->label)
; (get job-label-to-pod-annotation-lookup-key "")
; ; the user can pass us multiple comma-separated values
; (str/split #","))
; "")]
; (->> requested-pod-annotations
; (select-keys job-label-to-pod-annotation-map)
; (vals)
; (into {}))))

(defn ^V1Pod task-metadata->pod
"Given a task-request and other data generate the kubernetes V1Pod to launch that task."
Expand Down

0 comments on commit d600c55

Please sign in to comment.