     (async/go-loop [i 0]
       (if (>= i nmin)
         (let [rs->info (request-info-map rs)
-              rs-up    (filter rs->info rs)
-              rs-dn    (filter (complement rs->info) rs)]
+              pred     (partial really-up? rs->info)
+              rs-up    (filter pred rs)
+              rs-dn    (filter (complement pred) rs)]
           (close-notify-chan! id)
           (cancel-requests rs-dn)
           (map rs->info rs-up))

    (mseq->m sirs :request-id)))




(defn good-strings [vs]
  (and (sequential?  vs)
       (every? string? vs)
       (every? pos? (map count vs))))

(defn request-instances [rs]
  (let [d (describe-spot-instance-requests :spot-instance-request-ids rs)]
    (map :instance-id (:spot-instance-requests d))))

                      (cancel-requests rs)
                      nil)
           (= c cl) (recur (inc i))))))))

(defn bring-up-instances [is]
  (let [n  (count is)
        id (.toString (UUID/randomUUID))
        cl (notify-chan id)
        to (timeout (* 5 60 1000))]
    (doseq [i is]
            (modify-instance-attribute :instance-id i :user-data (s->b64 (send-up id))))
    (start is)
    (async/go-loop [i n]
      (if (zero? i)
        (instance-info-map is)
        (let [[v c] (async/alts! [cl to])]
          (cond
           (= c to) (do (info "Timeout on instance request:" is)
                        (close-notify-chan! id)
                        (stop is)
                        nil)
           (= c cl) (recur (dec i))))))))


(def ag (ssh/ssh-agent {}))
