Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

[ThoughtWorks] Perforce for Release Engineers

426 views

Published on

Published in: Technology
  • Be the first to comment

[ThoughtWorks] Perforce for Release Engineers

  1. 1. 1  Perforce for Release EngineersLogan McGrathDeveloper ConsultantThoughtWorks
  2. 2. 2  Managing ConfigurationHow can configuration be managed as an application goes fromDEV through PROD environments?
  3. 3. 3  Movement of Configuration through a PipelineEmail server host configuration
  4. 4. 4  Common Configuration Strategies•  All configuration stored in single file•  Specific configuration deployed with application•  Configuration stored in relational database•  Etc...Each strategy has problems!
  5. 5. 5  Single Configuration FileApplication is built containing the configuration fileor is co-deployed with the file
  6. 6. 6  Configuration File Per EnvironmentThe application is built with an environment-specific configuration file orco-deployed with one.
  7. 7. 7  Configuration Database Per EnvironmentThe deployment uses a database to storeconfiguration for the respective environment.
  8. 8. 8  Using Perforce for ConfigurationWhy and how Perforce beats all other options
  9. 9. 9  Why is Perforce the better choice forapplication configuration?•  Change audit•  Permissions and access control•  Maintained divergence•  Live configuration•  Support for feature toggleshttp://martinfowler.com/bliki/FeatureToggle.html
  10. 10. 10  How would application configuration withPerforce work?•  Applications fetch their own configuration overHTTP/REST•  Or config pushed to them•  Configuration stored in plain-text, newline-delimited formats that are human-readable•  XML•  JSON
  11. 11. 11  App-Config-App in Action•  Making a change•  Committing the change•  Merging the changefrom DEV to QA•  User permissionsbetween environments
  12. 12. 12  App-Config-App in Action•  Making a change•  Committing the change•  Merging the changefrom DEV to QA•  User permissionsbetween environments
  13. 13. 13  App-Config-App in Action•  Making a change•  Committing the change•  Merging the changefrom DEV to QA•  User permissionsbetween environments
  14. 14. 14  App-Config-App in Action•  Making a change•  Committing the change•  Merging the changefrom DEV to QA•  User permissionsbetween environments
  15. 15. 15  App-Config-App in Action•  Making a change•  Committing the change•  Merging the changefrom DEV to QA•  User permissionsbetween environments
  16. 16. 16  Applications Using the App-Config-AppObtaining runtime configuration from the App-Config-App and ademonstration
  17. 17. 17  Application UsageRuntime configuration ofan application using theApp-Config-App
  18. 18. 18  Strategies for Propagating Changes•  Applications poll against config MD5 hash forchanges•  App-Config-App notifies applications of changes•  App-Config-App publishes ATOM feed,applications poll for updates then query thechanges
  19. 19. 19  Scaling the App-Config-AppHorizontalscaling offoo.com
  20. 20. 20  The Internals of the App-Config-AppOverview of architecture and technologies used
  21. 21. 21  Tech Choices in Our Proof of Concept•  HTML5 + AngularJS•  Sinatra (Ruby)•  REST interfaces•  Pretty-printed JSON•  Perforce backend - of course!
  22. 22. 22  Why JSON and not XML?•  JavaScript: JSON’s natural habitat•  Transparent serialization and deserialization•  Supported everywhere•  Natively in .NET, Ruby, Python, and PHP•  Supported in Java through libraries like Jackson
  23. 23. 23  Architecture•  Roughly 100 lines of JavaScript onthe front-end using AngularJS•  Roughly 400 lines of Ruby on theback-end using Sinatra•  Ruby drives all interaction withPerforce server and workingcopy using the p4 commandline clientAngularJS  Sinatra  Perforce  Working  Copy  
  24. 24. 24  Architecture•  A different branch is createdin Perforce for eachenvironment the applicationruns in.•  The application fetchesconfiguration stored inPerforce through theApp-Config-App
  25. 25. 25  Directory Structure•  dev/•  stack_configuration.json - the configuration•  stack_configuration.html - the form to manipulate it•  stack_configuration.js - additional javascript•  qa/•  uat/•  stage/•  prod/
  26. 26. 26  App-Config-App Source
  27. 27. 27  
  28. 28. 28  
  29. 29. 29  
  30. 30. 30  
  31. 31. 31  
  32. 32. 32  Alternative Technologies•  Client-side technology alternatives to AngularJS•  Backbone, Knockout (and 20 others)•  Server-side technology alternatives to Sinatra•  Java•  .NET•  Rails•  PHP•  Python•  Generally, any technology that supports the following capabilities will work:•  HTTP, HTTPS•  JSON over REST•  Driving interaction with Perforce using p4 on the command line
  33. 33. 33  Recap•  AngularJS•  Easy client-side•  Sinatra•  Easy server-side•  P4 command line client•  Easy integration with P4D
  34. 34. 34  Questions?Logan McGrathlmcgrath@thoughtworks.comwww.thoughtworks.comwww.loganmcgrath.com

×