|
27 | 27 | [metrics.timers :as timers]
|
28 | 28 | [opentracing-clj.core :as tracing])
|
29 | 29 | (:import (com.google.auth.oauth2 GoogleCredentials)
|
30 |
| - (com.twosigma.cook.kubernetes TokenRefreshingAuthenticator ParallelWatchQueue) |
| 30 | + (com.twosigma.cook.kubernetes TokenRefreshingAuthenticator) |
31 | 31 | (io.kubernetes.client.openapi ApiClient)
|
32 | 32 | (io.kubernetes.client.openapi.models V1Node V1Pod)
|
33 | 33 | (io.kubernetes.client.util ClientBuilder KubeConfig)
|
|
214 | 214 |
|
215 | 215 | (defn make-cook-pod-watch-callback
|
216 | 216 | "Make a callback function that is passed to the pod-watch callback. This callback forwards changes to the cook.kubernetes.controller."
|
217 |
| - [{:keys [^ParallelWatchQueue parallel-watch-queue] :as kcc}] |
| 217 | + [kcc] |
218 | 218 | (fn pod-watch-callback
|
219 |
| - [_ ^V1Pod prev-pod ^V1Pod pod] |
| 219 | + [_ prev-pod pod] |
220 | 220 | (try
|
221 |
| - (let [name (or (some-> prev-pod .getMetadata .getName) |
222 |
| - (some-> pod .getMetadata .getName)) |
223 |
| - shardNum (mod (.hashCode name) (.getShardCount parallel-watch-queue)) |
224 |
| - ^Runnable event (fn [] |
225 |
| - (try |
226 |
| - (if (nil? pod) |
227 |
| - (controller/pod-deleted kcc prev-pod) |
228 |
| - (controller/pod-update kcc pod)) |
229 |
| - (catch Exception e |
230 |
| - (log/error e "Error processing status update on" name))))] |
231 |
| - (.submitEvent parallel-watch-queue event shardNum)) |
| 221 | + (if (nil? pod) |
| 222 | + (controller/pod-deleted kcc prev-pod) |
| 223 | + (controller/pod-update kcc pod)) |
232 | 224 | (catch Exception e
|
233 |
| - (log/error e "Error submitting pod status update"))))) |
| 225 | + (log/error e "Error processing status update"))))) |
234 | 226 |
|
235 | 227 | (defn task-ents->map-by-task-id
|
236 | 228 | "Given seq of task entities from datomic, generate a map of task-id -> entity."
|
|
416 | 408 | compute-cluster-launch-rate-limiter cook-pool-taint-name cook-pool-taint-prefix
|
417 | 409 | cook-pool-taint2-name cook-pool-taint2-value
|
418 | 410 | cook-pool-label-name cook-pool-label-prefix
|
419 |
| - controller-lock-objects kill-lock-object |
420 |
| - parallel-watch-queue] |
| 411 | + controller-lock-objects kill-lock-object] |
421 | 412 | cc/ComputeCluster
|
422 | 413 | (launch-tasks [this pool-name matches process-task-post-launch-fn]
|
423 | 414 | (let [task-metadata-seq (mapcat :task-metadata-seq matches)]
|
|
895 | 886 | name
|
896 | 887 | namespace
|
897 | 888 | node-blocklist-labels
|
898 |
| - parallel-watch-max-outstanding |
899 |
| - parallel-watch-shards |
900 | 889 | read-timeout-seconds
|
901 | 890 | scan-frequency-seconds
|
902 | 891 | state
|
|
917 | 906 | state :running
|
918 | 907 | state-locked? false
|
919 | 908 | use-google-service-account? true
|
920 |
| - parallel-watch-max-outstanding 1000 |
921 |
| - parallel-watch-shards 200 |
922 | 909 | cook-pool-taint-prefix ""
|
923 | 910 | cook-pool-label-prefix ""
|
924 | 911 | use-token-refreshing-authenticator? false}
|
|
976 | 963 | (with-meta (vec (repeatedly lock-shard-count #(ReentrantLock.)))
|
977 | 964 | {:json-value (str "<count of " lock-shard-count " ReentrantLocks>")})
|
978 | 965 | ; cluster-level kill-lock. See cc/kill-lock-object
|
979 |
| - (ReentrantReadWriteLock. true) |
980 |
| - (ParallelWatchQueue. controller-executor-service parallel-watch-max-outstanding parallel-watch-shards))] |
| 966 | + (ReentrantReadWriteLock. true))] |
981 | 967 | (cc/register-compute-cluster! compute-cluster)
|
982 | 968 | compute-cluster))
|
0 commit comments