help using postgres-crate

38 views
Skip to first unread message

upgrad...@gmail.com

unread,
Jan 6, 2015, 8:16:02 AM1/6/15
to palle...@googlegroups.com
Hi all, I'm new to pallet really excited at the potential, it looks really powerful.

I'd like to use the postgres-crate to install postgres on ubuntu in virtualbox (via vmfest). I've written some simple crates to install httpd and tomcat and it's worked great, but I'm struggling to figure out how to get this postgres-crate to work. 

I'm attempting to use com.palletops/postgres-crate "0.8.0-313-SNAPSHOT". (I think the corresponding source code is here: https://github.com/pallet/postgres-crate/tree/feature/update-to-0.8)

I used `lein pallet new` to create a new pallet project, included the dependency to the postgres-crate and then I added the pallet-crate server-spec like so: 

(def
 
^{:doc "Defines a group spec that can be passed to converge or lift."}
  postgres
 
(group-spec
   
"postgres"
   
:extends [base-server
             
(postgres/server-spec (postgres/settings-map {}))]
   
:node-spec default-node-spec))

When I try to run converge like this: 

(def s (pallet.api/converge {postgres 1} :compute vmfest))

I get this error: 

CompilerException clojure.lang.ExceptionInfo: a-plan-fn16575 : Unknown base-distribution for null - target is {:image-id :ubuntu-14.04} {:context ("a-plan-fn16575"), :type :runtime-exception}, compiling:(form-init364259134432793299.clj:1)

I'm sure I'm missing something simple, any hints/ideas on what I'm doing wrong?

Thanks, 
Dave

upgrad...@gmail.com

unread,
Jan 8, 2015, 2:16:07 PM1/8/15
to palle...@googlegroups.com
I figured this out, for some reason I didn't think :os-family was required, but realized that's the way the crate figures out how to install postgres.

Here's what I had before:  

(def default-node-spec
 
(node-spec
   
:image {:image-id :ubuntu-14.04}
   
;; :image {:os-family :ubuntu}
   
:hardware {:min-cores 1}))

I updated to this and now it works: 

(def default-node-spec
 
(node-spec
   
:image {:image-id :ubuntu-14.04
           
:os-family :ubuntu}
   
:hardware {:min-cores 1}))

Makes sense now!
Reply all
Reply to author
Forward
0 new messages