Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify "using pallet with existing servers" HowTo #33

Open
michaelerickson opened this issue Mar 16, 2013 · 0 comments
Open

Clarify "using pallet with existing servers" HowTo #33

michaelerickson opened this issue Mar 16, 2013 · 0 comments

Comments

@michaelerickson
Copy link

When reading http://palletops.com/doc/how-tos/using-pallet-with-existing-servers/, it wasn't clear to me how the group name should be specified. Especially when using the lein plugin. I recommend adding something like the following:

Assume your lein project looks something like:

`-- pallet_project
    |-- project.clj
    `-- src
         `-- com
              `foo
               |-- nodes.clj  ; nodes, servers, and group definitions

Assume you have a group specification in nodes.clj such as:

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

Using the Leiningen plugin will require you to specify a fully qualified namespace to the group created by group-spec. For instance, to start a single backend running in your AWS cloud, you could use:

lein pallet -P aws converge com.foo.nodes/backend 1

When using a node-list computing service provider, you must still specify the full path to the Clojure object that defines the group you want to affect change on, but the name specified in the node-list must match the name given to the group-spec.

For example, assume I have an image running on my local machine in VirtualBox. I can add the following into ~/.pallet/config.clj

(defpallet
  ;; A list of Virtual Box images
  :services
  {:vbox {:provider "node-list"
         :node-list [["my-vm"  "backend"  "192.168.56.101" :debian]]}}
)

To lift the my-phase on that virtual machine using Leiningen requires the following command:

lein pallet -P vbox  lift  com.foo.nodes/backend  :my-phase

As usual, the -P vbox defines the compute service. In this case, it tells Leiningen to use the existing nodes given in the node-list. Specifying com.foo.nodes/backend tells Leiningen which group you want to lift to. When that is happening, Pallet runs through all of the nodes listed in the provider and matches the second parameter ("backend" in this case) to identify which nodes actually correspond to the target group.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant