Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Under the Hood - C++ at Puppet Labs

Kylo Ginsberg
October 09, 2015
320

Under the Hood - C++ at Puppet Labs

Under the Hood - C++ at Puppet Labs, 2015-10-09

Kylo Ginsberg

October 09, 2015
Tweet

Transcript

  1. UNDER THE HOOD: C++ AT PUPPET LABS Kylo Ginsberg Principal

    Engineer | Puppet Labs @kylog / freenode: kylo
  2. • Brief history of languages at Puppet Labs • Why

    C++? • C++ at Puppet Labs Today • Contributing • C++ at Puppet Labs Tomorrow Talk Overview: 5 Easy Pieces
  3. Ruby: Puppet Takes Off • 2004: Luke starts developing in

    Ruby "I chose Ruby because it did the job the best for me during development” • And Puppet blossoms
  4. Language Selection Criteria • Portability • Performance, performance, performance •

    Footprint • Strong tooling and ecosystem • Developer Ease • Maintainable
  5. Statically typed language • Yes, you type ‘make’ • Yes,

    you fix compiler errors • Find failures at compile time not run time • Trades off development speed for stability • Intelligible code
  6. Facter: our first major C++ project • Complete reimplementation of

    ruby facter • Initially opt-in, now the only option • Huge emphasis on backwards compatibility • Dynamic loading of ruby • Tighten / Document APIs • Cross-platform challenges: toolchains and APIs
  7. Leatherman • Execution framework (for “shelling out”) • Dynamic library

    loading • Ruby loading • Wrapper for libcurl • Logging • Misc utilities: file, json, locale • CMake common code • Vendored: catch, rapidjson, nowide
  8. C++ Sharp Edges • Best Practices • No bare allocations

    • Resource Acquisition Is Initialization (RAII) • #include <algorithm> • STL, Boost • Partially enforced by automated tooling • cpplint • -Wall -Werror • Travis / AppVeyor CI
  9. Contributing to C++ Projects • Not so scary • Tooling

    support for popular platforms • e.g. docker pull kylo/centos7-pl-devel • cpp-project-template is good to start • IRC: #puppet-dev on freenode
  10. End Goal: Agent Stack is All Native • What does

    “agent stack” mean? • puppet resource • puppet agent • puppet apply 1. Command Line Interface 2. Resource Abstraction Layer 3. Transaction 4. Puppet Compiler
  11. End Goal: Agent Stack is All Native • Four big

    components: what to tackle first? • Seeking feedback! • Join conversations on: [email protected]
  12. THANKS Adrien Thebo Alessandro Parisi Bostjan Skufca Branan Riley Brian

    Cain Chris Spence Dan Lidral-Porter David Lutterkort Eric Thompson Ethan J. Brown Geoff Nichols Glenn Matthews Hailee Kenney Heath Seals Ian Kronquist James Stocks Jasper Lievisse Adriaanse John Duarte Josh Cooper Josh Partlow Joshua Hoblitt Justin Holguin Justin Stoller Kevin Imber Kurt Wall Maggie Dreyer Matt Dainty Matthaus Owens Matthias Schmitz Melissa Stone Michael Moll Michael Smith Michael Stahnke Nick Fagerlund Paul Morgan Peter Huene Pieter Loubser Rahul Gopinath Richard Clamp Rick Bradley Rob Reynolds Roger Ignazio Ryan McKern Scott McClellan Shaigy Nixon Will Hopper