Git Product home page Git Product logo

puppet-static-compiler's Introduction

Puppet Static Compiler

Note: This has been merged into Puppet core, so this repo is no longer maintained, although it should work fine with 2.6.x.

This is a prototype project to create a new kind of compiler for Puppet - one that produces catalogs that are entirely static and require no communication between client and server during the catalog runs. There are a few goals with this:

  • Support off-line file serving
  • Dramatically simplify and speed up fileserving

These will both be accomplished via post-compile processing, by finding all files with sources included and updating the files on the spot to include metadata, including owner, mode, and checksums.

This requires my Interfaces module:

https://github.com/lak/puppet-interfaces

You also have to running on 2.6.5 or one of its release candidates.

Usage

Use is pretty straightforward:

Make sure both this and the interfaces module are in your RUBYLIB search path

Create a test manifest that includes at least one file that does remote file serving

It should obviously point to a file for which serving works

$ echo 'file { "/tmp/bar": source => "puppet:///modules/mymod/myfile" }' > /tmp/test.pp

Start the master with the new compiler terminus:

$ ~/puppet/bin/puppet master --catalog_terminus=static_compiler --config=/Users/luke/.puppet/puppet.conf --manifest /tmp/test.pp

Download catalog

$ puppet catalog --bucketdir /tmp/buckets --verbose download localhost

And check the local filebucket

$ find /tmp/buckets

Now look in the catalog and notice that instead of it having a URL for the file in it, it has the file checksum, mode, owner, and group specified in it.

It also has downloaded all of the needed files into the local file bucket. It did this via the server filebucket - both the server and client now have a copy of all needed files in their filebuckets.

You can use this plugin to create completely static catalogs, which can then be pushed to clients to be run locally.

Problems

  • Files are all read into memory rather than streamed. This will definitely cause problems with large files, but the filebucket doesn't currently handle streaming.
  • We test the local filebucket before downlaoding new files into it, to make sure the file doesn't already exist, but our test actually reads the whole file in. This is again because of the limitations of the filebucket API.
  • I think the recursion behavior is equivalent, but I can't really guarantee it without a good bit of testing.
  • If you don't use the 'puppet catalog download' action to retrieve your catalog, then the local filebucket won't have the needed files. This means you need to point the client at the server filebucket, or download them via some other means.
  • Behavior on the server is currently undefined if your puppet masters are behind a load balancer and they're configured to do fileserving through that load balancer. It should work, but it probably won't be that fast.

puppet-static-compiler's People

Contributors

lak avatar slippycheeze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.