This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns pallet.action-plan | |
"An action plan contains actions for execution. | |
It might be possible to unify actions and crate functions, if we can solve | |
nested execution of actions (ie. real control flows within the action plan). | |
This might be possible by having a `do` action that creates a nested action | |
plan." | |
{:author "Hugo Duncan"} | |
(:require |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns pallet.action-plan | |
"An action plan contains actions for execution. | |
The action plan is built by executing a phase function. Each phase function | |
calls actions which insert themselves into the action plan. | |
The action plan is transformed to provide aggregated operations, and to | |
resolve precedence relations between actions. | |
A translated plan is executed by passing an executor, which is a map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns pallet.action | |
"Actions implement the conversion of phase functions to script and other | |
execution code. | |
An action has a :type. Known types include :script/bash and :fn/clojure. | |
An action has a :location, :origin for execution on the node running | |
pallet, and :target for the target node. | |
An action has an :execution, which is one of :aggregated, :in-sequence or |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns pallet.phase | |
"A phase is a function of a single `request` argument, that contains | |
calls to crate functions or actions. A phase has an implicitly | |
defined pre and post phase." | |
(:require | |
[clojure.contrib.condition :as condition])) | |
(defn- pre-phase-name | |
"Return the name for the pre-phase for the given `phase`." | |
[phase] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:environment | |
{:phases {:bootstrap | |
(fn [request] | |
(pallet.resource.package/package-manager | |
request | |
:configure :proxy "http://192.168.1.37:3128"))} | |
:proxy "http://192.168.1.37:3128"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns pallet.execute | |
"Exectute commands. At the moment the only available transport is ssh." | |
(:require | |
[pallet.action-plan :as action-plan] | |
[pallet.compute :as compute] | |
[pallet.environment :as environment] | |
[pallet.script :as script] | |
[pallet.stevedore :as stevedore] | |
[pallet.stevedore.script :as script-impl] | |
[pallet.utils :as utils] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns pallet.core | |
"Core functionality is provided in `lift` and `converge`. | |
- node :: A node in the compute service | |
- node-spec :: A specification for a node. The node-spec provides an image | |
hardware, location and network template for starting new | |
nodes. | |
- server-spec :: A specification for a server. This is a map of phases and | |
a default node-spec. A server-spec has the following keys | |
:phase, :packager and node-spec keys. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns pallet.stevedore.script | |
"Uses pallet.script to provide script functions in stevedore. | |
Script functions (defined with `pallet.script/defscript`) can be implemented | |
using `defimpl`." | |
(:require | |
[pallet.script :as script] | |
[pallet.stevedore :as stevedore]) | |
(:use | |
[clojure.contrib.core :only [-?>]])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'slime) | |
(defun slime-line-breakpoint () | |
"Set a breakpoint at the current line" | |
(interactive) | |
(slime-eval-with-transcript | |
`(swank:line-breakpoint | |
,(slime-current-package) ,(buffer-name) ,(line-number-at-pos)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns pallet.nodes | |
"Node templates. Provide node size and image selection for pallet." | |
(:require | |
[clojure.core.logic.match :as match] | |
[clojure.core.logic.minikanren :as mk] | |
[clojure.core.logic.prelude :as prelude]) | |
(:use | |
clojure.test)) | |
(def spec-data |