Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BugFix: storm pre 0.9.0 requires lein1.

We test which branch is being used - if it is <0.9.0 we use lein2
(currently 2.3.2), otherwise we use lein1 (currently 1.5.2). This
addresses a bug reported by Ryan Ebanks on the mailing list:
https://groups.google.com/forum/#!topic/storm-user/5qOUkMfXkj4
  • Loading branch information...
commit c93b0f459c13c680f06f52853602176371f524a6 1 parent a662621
@lorcan lorcan authored
View
11 src/clj/backtype/storm/crate/leiningen.clj
@@ -4,12 +4,13 @@
[pallet.action.exec-script :as exec-script]))
;; this is 1.5.2. freezing version to ensure deploy is stable
-;; (def download-url "https://raw.github.com/technomancy/leiningen/a1fa43400295d57a9acfed10735c1235904a9407/bin/lein")
+(def download-lein1-url "https://raw.github.com/technomancy/leiningen/a1fa43400295d57a9acfed10735c1235904a9407/bin/lein")
;; this is 2.3.2. freezing version to ensure deploy is stable
-(def download-url "https://raw.github.com/technomancy/leiningen/7d7426b14326fc5257d82d97c314e2ea8455597e/bin/lein")
+(def download-lein2-url "https://raw.github.com/technomancy/leiningen/7d7426b14326fc5257d82d97c314e2ea8455597e/bin/lein")
-(defn install [request]
- (-> request
+(defn install [request version]
+ (let [download-url (if (= version 1) download-lein1-url download-lein2-url)]
+ (-> request
(remote-file/remote-file
"/usr/local/bin/lein"
:url download-url
@@ -17,4 +18,4 @@
:mode 755)
(exec-script/exec-script
(export "LEIN_ROOT=1")
- ("/usr/local/bin/lein"))))
+ ("/usr/local/bin/lein")))))
View
12 src/clj/backtype/storm/crate/storm.clj
@@ -3,8 +3,8 @@
[pallet.compute :only [running? primary-ip private-ip]]
[pallet.compute.jclouds]
[org.jclouds.compute2 :only [nodes-in-group]]
-
- [pallet.configure :only [compute-service-properties pallet-config]])
+ [pallet.configure :only [compute-service-properties pallet-config]]
+ [backtype.storm.branch :only [branch>]])
(:require
[backtype.storm.crate.zeromq :as zeromq]
[backtype.storm.crate.leiningen :as leiningen]
@@ -41,12 +41,12 @@
(map (partial jclouds-node->node compute) (nodes-in-group compute (str "supervisor-" name))))]
(map primary-ip running-nodes)))
-(defn- install-dependencies [request]
+(defn- install-dependencies [request branch]
(->
request
(java/java :openjdk)
(git/git)
- (leiningen/install)
+ (leiningen/install (if (or (not branch) (= branch "master") (branch> branch "0.9.0")) 2 1))
(zeromq/install :version "2.1.4")
(zeromq/install-jzmq :version "2.1.0")
(package/package "daemontools")
@@ -107,7 +107,7 @@
(defn install-supervisor [request branch commit local-dir-path]
(->
request
- (install-dependencies)
+ (install-dependencies branch)
(directory/directory local-dir-path :owner "storm" :mode "700")
(make branch commit)))
@@ -160,7 +160,7 @@
(->
request
(directory/directory local-dir-path :owner "storm" :mode "700")
- (install-dependencies)
+ (install-dependencies branch)
(make branch commit)))
(defn exec-daemon [request]
Please sign in to comment.
Something went wrong with that request. Please try again.