Git Workflow Building Blocks for Improved VERA Development, Integration, and Deployments Roscoe A. Bartlett Physics Integration Infrastructure Team Lead.

Slides:



Advertisements
Similar presentations
Extreme Programming Alexander Kanavin Lappeenranta University of Technology.
Advertisements

Software Development Management A simplistic howto Mathieu Lacage service DREAM.
SEP1 - 1 Introduction to Software Engineering Processes SWENET SEP1 Module Developed with support from the National Science Foundation.
Simple Git Steve Pieper. Topics Git considerations and Slicer Git as if it were svn Git the way it is meant to be.
Xtreme Programming. Software Life Cycle The activities that take place between the time software program is first conceived and the time it is finally.
G51FSE Version Control Naisan Benatar. Lecture 5 - Version Control 2 On today’s menu... The problems with lots of code and lots of people Version control.
Patterns & practices Symposium 2013 Introducing Git version control into your team Mark
Version Control with git. Version Control Version control is a system that records changes to a file or set of files over time so that you can recall.
CONTINUOUS INTEGRATION, DELIVERY & DEPLOYMENT ONE CLICK DELIVERY.
Git for Version Control These slides are heavily based on slides created by Ruth Anderson for CSE 390a. Thanks, Ruth! images taken from
Trilinos Coding and Documentation Guidelines Roscoe A. Bartlett Trilinos Software Engineering Technologies and Integration Lead Computer Science and Mathematics.
Overview of Git Workflows for CSE Software Trilinos Spring Developers Meeting May 13, 2015 Roscoe A. Bartlett Oak Ridge National Lab Computational Eng.
Chapter 3 – Agile Software Development 1Chapter 3 Agile software development.
Page 1 Trilinos Software Engineering Technologies and Integration Capability Area Overview Roscoe A. Bartlett Trilinos Software Engineering Technologies.
Software Engineering CS3003 Lecture 3 Software maintenance and evolution.
Git – versioning and managing your software L. Grewe.
GIT An introduction to GIT Source Control. What is GIT (1 of 2) ▪ “Git is a free and open source distributed version control system designed to handle.
Branching. Version Control - Branching A way to write code without affecting the rest of your team Merge branches to integrate your changes.
Page 1 Software Life-cycle and Integration Issues for CS&E R&D Software and Experiences from Trilinos (Part II, Integration Issues) Roscoe A. Bartlett.
Page 1 Trilinos Release Improvement Issues Roscoe A. Bartlett Department of Optimization & Uncertainty Estimation Trilinos.
Version control Using Git Version control, using Git1.
Puppet with vSphere Workshop Install, configure and use Puppet on your laptop for vSphere DevOps Billy Lieberman August 1, 2015.
Rapid software development 1. Topics covered Agile methods Extreme programming Rapid application development Software prototyping 2.
Copyright © 2015 – Curt Hill Version Control Systems Why use? What systems? What functions?
Continuous Integration and Code Review: how IT can help Alex Lossent – IT/PES – Version Control Systems 29-Sep st Forum1.
Generalization and externalization of the Trilinos package- based system Roscoe A. Bartlett Trilinos Software Engineering Technologies and Integration.
CS425 / CSE424 / ECE428 — Distributed Systems — Fall 2011 Some material derived from slides by Prashant Shenoy (Umass) & courses.washington.edu/css434/students/Coda.ppt.
Confidential Continuous Integration Framework (CIF) 5/18/2004.
CS5103 Software Engineering Lecture 02 More on Software Process Models.
Page 1 Almost Continuous Integration for the Co-Development of Highly Integrated Applications and Third Party Libraries Roscoe A. Bartlett
1Managed by UT-Battelle for the U.S. Department of Energy TriBITS Software Engineering Processes for the CASL Innovation Hub Roscoe A. Bartlett, Ph.D.
WATERFALL DEVELOPMENT MODEL. Waterfall model is LINEAR development lifecycle. This means each phase must be completed before moving onto the next!!! WHAT.
Optimal Pipeline Using Perforce, Jenkins & Puppet Nitin Pathak Works on
GitHub and the MPI Forum: The Short Version December 9, 2015 San Jose, CA.
Page 1 Integration Strategies for Computational Science & Engineering Software Roscoe A. Bartlett Department of Optimization.
Version Control and SVN ECE 297. Why Do We Need Version Control?
A Git Workflow Model Slides produced from blog by Vincent Driessen and secondary posting at The.
Introduction to Git Yonglei Tao GVSU. Version Control Systems  Also known as Source Code Management systems  Increase your productivity by allowing.
CSC444F'07Lecture 41 CSC444 Software Engineering Top 10 Practices.
1Managed by UT-Battelle for the U.S. Department of Energy Roadmap for Sustainable CSE Ecosystems A Roadmap for Sustainable Ecosystems of CSE Software Roscoe.
TEAM FOUNDATION VERSION CONTROL AN OVERVIEW AND WALKTHROUGH By: Michael Mallar.
CERN AI Config Management 16/07/15 AI for INFN visit2 Overview for INFN visit.
Process changes: Internal processes of CASA, external contributions, release schedule Mark G. Rawlings, CASA Build & Test Lead NRAO, Charlottesville Acknowledgements:
Information Systems and Network Engineering Laboratory I DR. KEN COSH WEEK 1.
Thanks to our Sponsors! Community Sponsor Yearly Sponsor Marquee Sponsor.
1 Ivan Marsic Rutgers University LECTURE 2: Software Configuration Management.
Software Development. The Software Life Cycle Encompasses all activities from initial analysis until obsolescence Analysis of problem or request Analysis.
Software Development - Methodologies
Software Development.
Open source development model and methodologies.
CS5220 Advanced Topics in Web Programming Version Control with Git
Git and GitHub primer.
Version Control with Subversion
11 Version control (part 2)
Mastering Version Control with Git
LECTURE 2: Software Configuration Management
CS4961 Software Design Laboratory I Collaboration using Git and GitHub
Version control, using Git
CS5220 Advanced Topics in Web Programming Version Control with Git
API Documentation Guidelines
Version Control with git
LECTURE 3: Software Configuration Management
Branching and Merging Practices
P Almost Continuous Integration for the Co-Development of Highly Integrated Applications and Third Party Libraries Roscoe A. Bartlett
Git CS Fall 2018.
Version Control System - Git
Git started with git: 2018 edition
CI/CD Workflow and Event Pages
1. GitHub.
Software Engineering and Architecture
Presentation transcript:

Git Workflow Building Blocks for Improved VERA Development, Integration, and Deployments Roscoe A. Bartlett Physics Integration Infrastructure Team Lead IDEAS Methodologies Team Oak Ridge National Lab Computational Eng. & Energy Sciences Computer Science and Mathematics Div

2Managed by UT-Battelle for the U.S. Department of Energy Git Workflows Building Blocks for VERA Dependencies Between Selected VERA Repositories Trilinos TeuchosWrappersExt VERAInExt COBRA-TF MPACT SCALE VUQDemos MOOSEExt MOOSE DatraTransferKit hydrath Exnihilo LIMEExt DakotaExt Dakota PSSDriversExt

3Managed by UT-Battelle for the U.S. Department of Energy Git Workflows Building Blocks for VERA Single-Repository and Multi-Repository Development and Integration External Repo1 (e.g. MPACT) External Repo2 (e.g. SCALE) Project Native Repo3 PkgA PkgB PkgC PkgD PkgE PkgF Project Copy Repo1 Project Copy Repo2 PkgA PkgB PkgC PkgD Project Internal Repos Repo2 Devs Repo1 Integrator Repo2 Integrator Repo1 Devs Project Devs Project Releaser Workflows: Workflows for developing external repos (e.g. MPACT and SCALE/Exnihilo) Workflows for developing directly against set of project repos (e.g. VERA repos) Workflows for integrating external repos into project repos (i.e. sync processes) pull push pull push pull and/or push pull and/or push pull and/or push pull and/or push pull and/or push pull VERA

4Managed by UT-Battelle for the U.S. Department of Energy Git Workflows Building Blocks for VERA Background on Git Workflows 2005: Git development begins (Linus Torvalds, for Linux Kernel) 2010: “Gitflow” is presented (Vincent Driessen) – Uses ‘develop’ and ‘master’ branches with short-lived “feature”, “release” and “hotfix” branches – Most well known and popular git workflow (by far) – Every workflow since compares itself to gitlfow (and criticizes gitflow in the process) After Gitflow: – “Github Flow” : Advocated by Github Simple feature branches with pull requests – “Simple Git Workflow is Simple” : Advocated by Atlassian Simple feature branches with rebasing on top of ‘master’ and --no-ff merges to ‘master’ – “Gitlab Flow” : Advocated by Gitlab team – “Git.git Worklow” (i.e. “gitworkflows(7))”: Official git man page “gitworkflows(7)” All feature branches with ‘next’ and ‘pu’ temp testing branches, graduate to ‘master’. Used by the developers for git itself (i.e. git.git) Used by Linux Kernel developers

5Managed by UT-Battelle for the U.S. Department of Energy Git Workflows Building Blocks for VERA Overview of Existing Defined Workflows

6Managed by UT-Battelle for the U.S. Department of Energy Git Workflows Building Blocks for VERA Github Flow Permanent branches : ‘master’ Primary focus of testing : Each individual feature branch Notes: – No release branches! (can’t support multiple releases)

7Managed by UT-Battelle for the U.S. Department of Energy Git Workflows Building Blocks for VERA Gitflow Permanent branches : ‘develop’ and ‘master’ Short-lived branches : “feature”, “release”, and “hotfix” Primary focus of testing : ‘develop’ branch (but still need testing on ‘master’ if ‘hotfixes’ exist) Special git command systems has been created to drive workflow! (Criticized as too complex)

8Managed by UT-Battelle for the U.S. Department of Energy Git Workflows Building Blocks for VERA MOOSE Workflow (Gitflow + Github Flow)

9Managed by UT-Battelle for the U.S. Department of Energy Git Workflows Building Blocks for VERA Git.git Workflow “gitworkflows(7)” (PETSc) See: Gitworfkows(7) man page Gitworkflows(7) presentation

10Managed by UT-Battelle for the U.S. Department of Energy Git Workflows Building Blocks for VERA An Incrementally Expanding Git Workflow for CSE Projects

11Managed by UT-Battelle for the U.S. Department of Energy Git Workflows Building Blocks for VERA Incrementally Expanding Git Workflow (Intro) Instead of defining complete workflows to choose from => Define git workflow “building blocks” (i.e. design patterns) and construct the workflow that is need! Workflow Construction Steps: – Consider the properties and challenges for a given project – Construct simplest git workflow using building blocks to meet current needs – Add new features to workflow as situation changes and more challenges emerge Workflow building blocks – Begin: The simple centralized CI workflow – Addition of a ‘develop’ branch – Addition of topic branches – Addition of release branches – Addition of feature branches – Addition of throwaway integration test branch(es) – End: The Git.git Workflow (e.g “gitworkflows(7)”) Consistent with “gitworkflows(7)” Git Tutorial and reference information : These can be added to a git workflow in almost any order!

12Managed by UT-Battelle for the U.S. Department of Energy Git Workflows Building Blocks for VERA Issues to Consider to Select Git Workflow Number of developers Distribution of general software knowledge and skills of the developers Distribution of git-specific knowledge and skills of the developers Amount of (or lack of) communication and coordination between the developers Nature of the customers and need for releases of the software Sensitivity of the software (e.g. security vulnerabilities?) Rate of development and change in the software Importance (and urgency) of performing code reviews Portability requirements and portability challenges of the software Heterogeneity of the development and testing environments Budget of computing resources available for testing Quality and expense of the test suites

13Managed by UT-Battelle for the U.S. Department of Energy Git Workflows Building Blocks for VERA Testing Issues/Support for Git Workflows Test Suites: CI Build : This is a Continuous Integration (CI) [2, 3] build of the code on a single platform and single configuration and the running of a (relatively) fast test suite. The CI Build should be constructed so that it protects the major features of the code that are needed by the other developers to continue their development work. The CI Build would be performed before any branch is updated that impacts other developers. This is the pre-push regression test suite described in [1]. Nightly Builds : This is a collection of builds on different platforms with different compilers and running a more comprehensive (i.e. expensive) test suite. This is the nightly regression test suite described in [1]. Testing assumptions: Additive test assumption of branches: If ‘m + a’ PASSES and ‘m + b’ PASSES, then ‘m + a + b’ also PASSES Subtractive test assumption of branches: If ‘m + a + b’ PASSES then ‘m + a’ or ‘m + b’ also PASSES. [1] “How to Add and Improve Testing in Your CSE Software Project”, IDEAS Project, 2015.“How to Add and Improve Testing in Your CSE Software Project” [2] “Continuous Integration”, Wikipedia, Integration” [3] Fowler, Martin. “Continuous Integration”, Integration”

14Managed by UT-Battelle for the U.S. Department of Energy Git Workflows Building Blocks for VERA Begin: Simple Centralized CI Workflow A1B1A2A3B2C Features implemented in commits intermingled on ‘master’ branch – Feature “A”: Commits “A1”, “A2”, “A3” – Feature “B”: Commits “B1”, “B2” – Feature “C”: Commit “C” Pros and Cons (w.r.t. other more sophisticated workflows): – Pro : Simplest workflow with fewest git commands, no distributed VC concepts (i.e. SVN-like) – Pro : Requires least knowledge of git – Pro : Minimizes merge conflicts (frequent pushes to and pulls from ‘master’) – Con : Difficult to perform pre-merge code reviews – Con : Difficult to collaborate with other developers with partial changes (can’t push broken code to ‘master’ to share with others) – Con : Difficult to back out bad feature sets – Con : Difficult to maintain 100% passing tests for all Nightly Builds Example project : New research project – Small number of closely collaborating developers – No real users (e.g. no need to support releases) master Dev 1 Dev 2 D

15Managed by UT-Battelle for the U.S. Department of Energy Git Workflows Building Blocks for VERA TriBITS Standard Testing Layers Coverage Testing Nightly Testing Secondary Tested (ST) CATEGORIES [BASIC CONTINUOUS NIGHTLY] (more platforms, more TPLs) Post-Push CI Testing Secondary Tested (ST) CATEGORIES [BASIC CONTINUOUS] (post-push CTest/CDash, Linux/GCC) Pre-Push CI Testing Primary Tested (PT) CATEGORIES [BASIC] (pre-push checkin-test.py) Memory (Valgrind) Testing Correctness Testing

16Managed by UT-Battelle for the U.S. Department of Energy Git Workflows Building Blocks for VERA (Rare) Bug fix on ‘master’ Passes nightlies Fails nightlies Addition of a ‘develop’ branch A2B1C develop D Users M1M4 Passes nightlies M5 master Introduce a ‘develop’ branch : – Developers directly push to ‘develop’ branch using CI Build (i.e. simple centralized CI workflow) – Only merge from ‘develop’ into ‘master’ when all Nightly Builds pass (perhaps with minor bug fixes) – Close users pull from more stable ‘master’ branch (‘master’ is default branch when cloning a git repo!) – Most testing focused on ‘develop’ branch. (Little to no testing needed on ‘master’) Pros and Cons (w.r.t. single branch workflow) : – Pro : Developers still only perform simple centralized CI workflow (only on ‘develop’ not ‘master’) – Pro : More stable ‘master’ branch seen by users – Con : Allows little to no time for review of commits on ‘develop’ before merge to ‘master’ – Con : Requires knowing how to use multiple branches and merges – Con : Extra effort to perform merges from ‘develop’ to ‘master’ (or could use cron job to do merges) Example project: Established research project with close users – Small number of closely collaborating developers – Few close customers that can’t handled the instability of the main dev branch Devs M2 Minor bug fix to allow merge to ‘master’ Fails nightlies B2 ‘develop’ always contains ‘master’ M3 A1

17Managed by UT-Battelle for the U.S. Department of Energy Git Workflows Building Blocks for VERA Addition of topic branches A1 B1 A2 A3 B2 C develop D 1 st topic branch for feature A direct commit Branch for small compete feature B 2 nd topic branch for feature A Introduce usage of temporary short-lived topic branches : – Developers (optionally) implement features in one or more topic branches and merge to ‘develop’. E.g.: Feature “A”: 1 st topic branch (commits “A1”, “A2”), 2 nd topic branch (commit “A3”) Feature “B”: Single topic branch (commits “B1”, “B2”) – Topic branches pass CI Build merged into ‘develop’ about once/day or 4-6 hours of work (rule of thumb) – Direct pushes to ‘develop’ are okay for single commit changes that are not shared/reviewed. – NOTE: Usage of short topic branches does not degrade CI at all! Does not lead to more merge conflicts! – NOTE: NOT long-lived “feature branches”! Pros and Cons (w.r.t. single branch workflow) : – Pro : Allow changes to be easily backed out if something goes wrong – Pro : Allow switching between different topic branches quickly – Pro : Allow easy sharing for quick collaboration with other devs before merging to ‘develop’ – Pro : Allow quick code reviews (pull-requests) on the topic branch before merging to ‘develop’. – Con : Requires knowing how to use multiple branches and merges with git Example project: Established research project with multiple developers – Medium number of number of developers who closely collaborate and review code Or ‘master’ branch if not using a ‘develop’ branch

18Managed by UT-Battelle for the U.S. Department of Energy Git Workflows Building Blocks for VERA Addition of release branches release-2.3 ‘master’ contains all release branches v rc.0 v rc.1 master v2.3.0 v2.3.1 Bug fix that affects v2.2 and forward branches v2.2.4 v2.2.5 release-2.2 Merge forward Introduce long-lived release branches : – Follows “Semantic Versioning” standard recommended by Github ( Release tag : vX.Y.Z (X = major, Y = minor, Z = patch), Release candidate : vX.Y.0-rcZ – Apply bug fix to oldest release branch that needs the fix then merge forward (“gitworkflows(7)”) – Cherry-picks from upstream to downstream also allowed (but not preferred) – NOTE: Since ‘master’ contains all release branches, then just testing ‘master’ provides some release testing. Pros and Cons (w.r.t. single ‘master’ branch which provides a single stream of releases) : – Pro : Allow support for multiple releases – Pro : Allows customers to depend on well-defined named versions of the software – Con : More labor and more testing needed to maintain old releases Example project: Established project with many customers requiring stable named releases See: “gitworkflows(7)” v dev v dev Update for release release- 2.3-start

19Managed by UT-Battelle for the U.S. Department of Energy Git Workflows Building Blocks for VERA Addition of feature branches B1 A1 B2 A2 B55 A15 Merge of medium- lived “A” branch goes smoothly Merge of long- lived “B” branch has many conflicts and other problems Big Bang Integration! develop Or ‘master’ branch if not using a ‘develop’ branch Introduce long-lived feature branches : – Features completed in separate (long-lived) branches before single merge into ‘develop’. Pros and Cons (w.r.t. short-lived topic branches) : – Pro : Allow time for detailed code reviews before the changes are merged into ‘develop’. – Pro : Accommodate less experienced developers who can’t be trusted to directly push to ‘develop’. – Pro : Accommodate changes from external developers who can’t directly push to the ‘develop’. – Pro : Handle risky changes that may never make it into ‘master’ – Pro : Keep very clean git history for each feature, merge commits become “changelog”. – Con : Risk of major merge (or semantic) conflicts (i.e. BIG BANG INTEGRATION, e.g. merge of “B” ) – Con : Not consistent with Agile best practice of CI (see “Feature Branch” by Martin Fowler).“Feature Branch” – Con : Discourages Agile best practice of continuous refactoring (refactoring makes merges difficult) – Con : Requires more testing resources to test each feature branch individually Example project: Established project with many external contributors and/or junior developers feature-a feature-b

20Managed by UT-Battelle for the U.S. Department of Energy Git Workflows Building Blocks for VERA Addition of throwaway integration test branch(es) B1 A1 B2 A2 B55 A15 develop Or ‘master’ branch if not using a ‘develop’ branch B3 Merge refactoring from “A” into “B” to make compatible next ‘next’ always contains ‘develop’ All feature branches merged into ‘next’ Introduce throw-away integration test branch(es) : – Feature branches (FBs) passing CI Build merged into throwaway ‘next’ branch. – Nightly Builds run on ‘next’ branch every night. – When ready, FB “graduates” and merges into ‘develop’. (i.e. Subtractive test assumption of branches! ) – Use promiscuous integration between feature branches to resolve conflicts (e.g. merge “A2” into “B” branch) Pros and Cons (w.r.t. stand-alone feature branches) : – Pro : Incompatibles between feature branches are tested early and often – Pro : Multiple feature branches are tested together, instead of individually, saving test computing resources – Con: Bad code in a single FB breaks all Nightly Builds run on ‘next’ branch (and no other FB gets tested). – Con: Hard to determine which FB is breaking a ‘next’ Nightly Build – Con : Have to resolve same conflicts twice! (i.e. merge “B” to ‘next’ and ‘develop’) => use git rerere? – Con : More complex and labor intensive workflow! “Graduation” of medium-lived “A” branch goes smoothly Graduation of long- lived “B” branch has fewer conflicts Has merge conflicts! Rebuild ‘next’ from ‘develop’ after next release! Has same merge conflicts! Run Nightly Builds against ‘next’ feature-a feature-b

21Managed by UT-Battelle for the U.S. Department of Energy Git Workflows Building Blocks for VERA End: The Git.git Workflow “gitworkflows(7)” Going from “addition of throw-away integration test branches” to Git.git Flow Discard the ‘develop’ branch Feature branches created from and merged to ‘master’ Full Git.git workflow also uses throw-away ‘pu’ branch! Current release branch is called ‘maint’, not ‘release’ Old maintained release branches called ‘maint-X.Y.Z’. In summary, Git.git Flow would be a good starting choice for any project where all of the members of the development team were very good with git and the portability demands are challenging. However, it comes at the cost of a more complex and labor-intensive development workflow. The Git.git Workflow may be a good choice for projects when any of the following are true: Developers are git experts Code is of high consequence and responsible for basic security (e.g. git itself) Many changes being suggested in feature branches may never go into the final version Desire for a very clean git history Users expect to pull working versions of the code from ‘master’ at any point in time Testing on any single platform (or small number of platforms) does not give sufficient confidence that there will not be major problems on other platforms. Developers use a heterogeneous set of development environments (e.g. Linux, PC, Mac, and various vendors and versions of compilers) and the code has portability issues

22Managed by UT-Battelle for the U.S. Department of Energy Git Workflows Building Blocks for VERA Summary Instead of defining complete workflows to choose from => Define workflow “building blocks” and construct the workflow that you need! Workflow Construction Steps: – Consider the properties and challenges for a given project – Construct simplest git workflow using building blocks to meet current needs – Add new features to workflow as situation changes and more challenges emerge Workflow building blocks – Begin: The simple centralized CI workflow – Addition of a ‘develop’ branch – Addition of topic branches – Addition of release branches – Addition of feature branches – Addition of throw-away integration test branch(es) – End: Git.git Flow (e.g “gitworkflows(7)”) Next steps: – Git training (see Git Tutorial and Reference Info)Git Tutorial and Reference Info – Review, refine and publish supporting document “Design Patterns for Incrementally Expanding Git Workflows for Research-Based Projects”“Design Patterns for Incrementally Expanding Git Workflows for Research-Based Projects” – Apply and improve workflows These can be added to a git workflow in almost any order!

23Managed by UT-Battelle for the U.S. Department of Energy Git Workflows Building Blocks for VERA A Proposed Git Workflow for VERA Overview: – Introduce a ‘develop’ branch that developers directly pull from and push to and integration scripts sync to – The ‘master’ branch is only updated from ‘develop’ after Nightly and Weekly builds pass ! Introduce a ‘nightly’ branch that is updated from ‘develop’ so all Nighty builds test against consistent version Cron job automatically does merge from ‘nightly’/’develop’ to ‘master’ based on CDash query (Kitware) – Close customers pull from (a much more stable) ‘master’ branch For average VERA developer/integrator: – Directly pull from and push to ‘develop’ branch with same a single-repo, single-branch workflow – (Optional) Use topic branches for most development work Pros and Cons (w.r.t. current simple centralized CI workflow): – Pro: Users and close collaborators will see a much more stable ‘master’ branch – Pro: Less paranoid sync processes for integrating repos – Con : Requires learning a little more about git to deal with ‘develop’ branch