Code Monkey home page Code Monkey logo

re-conf's Introduction

Intro

Re-conf is a framework for implementing provisioning recipes in Clojurescript.

Re-conf aims to be:

  • Fast(er) then existing solutions (Puppet, Chef etc..)
  • Portable (should run on any hardware and Unix like OS)
  • Simple to operate and deploy provisioning code
  • REPL first workflow in development
  • Tracing and profiling built in

And not to be:

  • An agent for orchestrating remote operations (Re-mote, Re-gent handle that)
  • disguised language in a dataformat
  • an external DSL
  • magical

Build Status

Look and feel

Re-conf use simple functions to describe configuration resources (check docs complete listing):

(line "/tmp/foo" "bar")

(template {:keys ...} "/home/re-ops/.ssh/autorized-keys" "authorized-keys.mustache")

(package "ghc")

Functions thread resources using Clojure built in macro:

(defn packer
  "Setup up packer"
  []
  (let [dest "/tmp/packer_1.2.2_linux_amd64.zip"
        sha "6575f8357a03ecad7997151234b1b9f09c7a5cf91c194b23a461ee279d68c6a8"
        url "https://releases.hashicorp.com/packer/1.2.2/packer_1.2.2_linux_amd64.zip"]
    (->
     (download url dest)
     (checksum dest sha :sha256)
     (exec "/usr/bin/unzip" "-o" dest "-d" "/tmp/packer")
     (summary "installing packer done"))))

Within each function each resource is executed asynchronously, once done the next resource beings.

Functions are grouped into namespaces and invoked in parallel:

(defn server
  [env]
  (report-n-exit
   (invoke-all env
               re-base.rcp.vim
               re-base.rcp.zfs
               re-base.rcp.docker
               re-base.rcp.shell)))

Multiple resources are running concurrently speeding up execution time:

# packer and restic installed at the same time, but still consistent
$ node re-conf.js
2018-4-8 21:56:11 rosetta info [:re-conf.cljs.core/main] - Started re-conf
2018-4-8 21:56:11 rosetta debug [:re-conf.cljs.core/invoke] - invoking packer
2018-4-8 21:56:11 rosetta debug [:re-conf.cljs.core/invoke] - invoking restic

Development

$ lein npm install

VIM

$ lein repl

Using a second window:

$ node target/js/compiled/re-conf.js

In the VIM session:

:Piggieback (figwheel-sidecar.repl-api/repl-env)

Copyright and license

Copyright [2018] [Ronen Narkis]

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.