Advanced Configuration Management with Config Split et al. Fabian Bircher

Similar documents
Con guration Management

Configuration Management in Drupal 8

Configuration Management

Revision Control. How can 4. Slides #4 CMPT 276 Dr. B. Fraser. Local Topology Simplified. Git Basics. Revision Control:

Visualizing Git Workflows. A visual guide to 539 workflows

CONFIGURATION AS DEPENDENCY. Managing Drupal 8 Configuration with Git and Composer

Build & Launch Tools (BLT) Automating best practices for enterprise sites

1. Which of these Git client commands creates a copy of the repository and a working directory in the client s workspace. (Choose one.

Version Control. Second level Third level Fourth level Fifth level. - Software Development Project. January 11, 2017

Lab 08. Command Line and Git

CS 390 Software Engineering Lecture 3 Configuration Management

Object Oriented Programming. Week 1 Part 2 Git and egit

CESSDA Expert Seminar 13 & 14 September 2016 Prague, Czech Republic

CPSC 491. Lecture 19 & 20: Source Code Version Control. VCS = Version Control Software SCM = Source Code Management

Common Git Commands. Git Crash Course. Teon Banek April 7, Teon Banek (TakeLab) Common Git Commands TakeLab 1 / 18

Review Version Control Concepts

Cheaper by the Dozens

CS314 Software Engineering Configuration Management

git commit --amend git rebase <base> git reflog git checkout -b Create and check out a new branch named <branch>. Drop the -b

Technical Architecture & Analysis

Getting the files for the first time...2. Making Changes, Commiting them and Pull Requests:...5. Update your repository from the upstream master...

What is version control? (discuss) Who has used version control? Favorite VCS? Uses of version control (read)

Using Git to Manage Source RTL

Belle II - Git migration

The Old World. Have you ever had to collaborate on a project by

Git Workflows. Sylvain Bouveret, Grégory Mounié, Matthieu Moy

AVOIDING THE GIT OF DESPAIR

... Fisheye Crucible Bamboo

b. Developing multiple versions of a software project in parallel

Git. Charles J. Geyer School of Statistics University of Minnesota. Stat 8054 Lecture Notes

The Rock branching strategy is based on the Git Branching Model documented by Vincent Driessen.

Revision control. INF5750/ Lecture 2 (Part I)

Git(Lab) Tutorial and Hands-On

Version Control. Second level Third level Fourth level Fifth level. - Software Development Project. January 17, 2018

TM DevOps Use Case. 2017TechMinfy All Rights Reserved

Linux System Management with Puppet, Gitlab, and R10k. Scott Nolin, SSEC Technical Computing 22 June 2017

django simple pagination Documentation

Branching and Merging

Software configuration management

KTH Royal Institute of Technology SEMINAR 2-29 March Simone Stefani -

Software Development I

Chimpegration for The Raiser s Edge

Version Control Systems

Agenda. - Final Project Info. - All things Git. - Make sure to come to lab for Python next week

How to set up SQL Source Control The short guide for evaluators

Aldryn Installer Documentation

Composer and Drupal. CIDUG Meeting December 13, 2018 John Rearick

G E T T I N G S TA R T E D W I T H G I T

Prof. Dr. Marko Boger. Prof. Dr. Christian Johner. Version Management

API RI. Application Programming Interface Reference Implementation. Policies and Procedures Discussion

Snapshot Best Practices: Continuous Integration

A BASIC UNDERSTANDING OF VERSION CONTROL

DEVNET Introduction to Git. Ashley Roach Principal Engineer Evangelist

Effective Programming Practices for Economists. 7. Version Control, Part II: Git with a Shared Repository

FAQ Q: Where/in which branch do I create new code/modify existing code? A: Q: How do I commit new changes? A:

Github/Git Primer. Tyler Hague

About SJTUG. SJTU *nix User Group SJTU Joyful Techie User Group

Documentation External Synchronization FirstSpirit

Tizen/Artik IoT Practice Part 4 Open Source Development

Continuous Integration Ensemble / HealthShare Health Connect

CSCI 2132: Software Development. Norbert Zeh. Faculty of Computer Science Dalhousie University. Subversion (and Git) Winter 2019

Microsoft Visual Source Safe (MVSS)

Bazaar VCS. Concepts and Workflows

TangeloHub Documentation

CS 520: VCS and Git. Intermediate Topics Ben Kushigian

Software Development. Using GIT. Pr. Olivier Gruber. Laboratoire d'informatique de Grenoble Université de Grenoble-Alpes

Revision control systems (RCS) and. Subversion

1. WORKSHARE PROJECT OVERVIEW

Windows. Everywhere else

From: Sudarshan N Raghavan (770)

JenkinsPipelineUnit. Test your Continuous Delivery Pipeline. Ozan Gunalp - Emmanuel Quincerot

Seven Habits of Highly Effective Jenkins Users

Welcome! Virtual tutorial will start at 15:00 GMT. Please leave feedback afterwards at:

CS 390 Software Engineering Lecture 5 More Git

BUILDING, DEPLOYING AND MAINTAINING DRUPAL SITES LIKE A PRO. Bob Kepford Mediacurrent.com TheWeeklyDrop.com

Collaboration. Problems in collaboration. The solution

CSC 2700: Scientific Computing

Versioning with git. Moritz August Git/Bash/Python-Course for MPE. Moritz August Versioning with Git

Building and Maintaining a Distribution in Drupal 7 with Features.

GIT TUTORIAL. Creative Software Architectures for Collaborative Projects CS 130 Donald J. Patterson

2 Initialize a git repository on your machine, add a README file, commit and push

Software Engineering 2 A practical course in software engineering. Ekkart Kindler

Working in Teams CS 520 Theory and Practice of Software Engineering Fall 2018

Crash Course in C++ R F L Evans. www-users.york.ac.uk/~rfle500/

Git AN INTRODUCTION. Introduction to Git as a version control system: concepts, main features and practical aspects.

TM DevOps Use Case. 2017TechMinfy All Rights Reserved

Git AN INTRODUCTION. Introduction to Git as a version control system: concepts, main features and practical aspects.

Untangling your code: a git workflow for Noobs

Technical Comparison Sheet: ez Platform Cloud vs Other Hosting Approaches

Overriding Configuration in Drupal 8

Table of Contents. Concepts

Outline The three W s Overview of gits structure Using git Final stuff. Git. A fast distributed revision control system

USER GUIDE MADCAP LINGO Source Control: Git

Git for Subversion users

Git. Christoph Matthies Software Engineering II WS 2018/19. Enterprise Platform and Integration Concepts group

projecto Documentation

Drupal Command Line Instructions Windows 7 List All Users >>>CLICK HERE<<<

Version Control Systems: Overview

Source Control: Perforce

Git Introduction CS 400. February 11, 2018

Transcription:

Advanced Configuration Management with Config Split et al. Fabian Bircher fabian@nuvole.org web: nuvole.org twitter: @nuvoleweb

Our Distributed Team Nuvole: a 100% Drupal company with a distributed team in: Italy Belgium Czech Republic

Our Clients International organisations Institutions Fast delivery: several developers working simultaneously on the same project Frequent configuration changes: need for safe updates

Chapter 1 CM in core Can I develop/test configuration on a development copy and keep the production site online all the time? Can I export configuration changes from development and import them into production?

Chapter 1: Configuration Management in Drupal core Active Con guration Storage *

Chapter 1: Configuration Management in Drupal core Synchronise Con guration config export config import

Chapter 1: Configuration Management in Drupal core Deploy Con guration

Chapter 1: Configuration Management in Drupal core Problem solved? Configuration Management works perfectly for its use case. But the reference use case scenario is very narrow. In real life we need to cover many more scenarios.

Chapter 2 Install a site from existing con guration

Chapter 2: Install a site from existing configuration Bootstrapping production Deployment is nice but how do get production up and running for the first time?

Chapter 2: Install a site from existing configuration Con guration Installer Usually running the installer creates a "new site". The Configuration Installer is an installation profile that takes over the Drupal installer and allows sites to be created from existing configuration. It is an installation profile and needs to be put in /profiles in order to work. Should be on every site (and in core)

Chapter 2: Install a site from existing configuration Con guration Installer UI

Chapter 2: Install a site from existing configuration Con guration Installer in core Allow a site to be installed from existing configuration: https://www.drupal.org/node/1613424 Allow a profile to be installed from existing config: https://www.drupal.org/node/2788777

Chapter 3 local con guration override Can I have verbose error logging enabled on the development copy only? Can I customize API keys in production without committing them?

Chapter 3: local configuration override Overriding In development, it is convenient to have a different configuration than on the production site. Examples: different error reporting, different API keys for services, different site name or site mail. These customizations are not to be exported. Not covered by the reference use case.

Chapter 3: local configuration override Using $config The $config array allows run-time overriding: configuration is still there, but it gets overridden. Example: add to settings.php (or settings.local.php) in the development enviroment: $config['system.logging']['error_level'] = 'verbose'; This enables verbose error logging on that instance.

Chapter 3: local configuration override Con g Override *

Chapter 3: local configuration override A satisfactory solution? $config covers our need for differentiating configuration between environments but... You can only alter existing configuration. You can't add new configuration using $config You can't completely "unset" existing configuration using $config You can't override which modules are installed. You can't override the color of Bartik and other details.

Chapter 4 Con g Filter How can we do more than configuration overrides?

Chapter 4: Config Filter CM in Core *

Chapter 4: Config Filter with Con g Filter *

Chapter 4: Config Filter Con guration Filters Filters can modify the data for every operation. Filters are plugins Plugins are sorted by weight and applied one after the other Plugins can be inactive and skipped 6k+ installs, top 100 modules, 0* bugs

Chapter 4: Config Filter Con g Filter

Chapter 4: Config Filter Con g Split

Chapter 4: Config Filter Con g Ignore

Chapter 5 Con g Split con guration What do the different configuration options do? What is the difference between a complete split and a conditional split?

Chapter 5: Config Split configuration Static settings Folder: Path to the secondary config storage Weight: Determines the order in daisy-chained filters Active: To use the split or not to use the split.

Chapter 5: Config Split configuration Complete Split (blacklist) Modules: will be removed from core.extensions when exporting Config items: automatically includes configuration which depends on modules Additional config: text area for use with * wildcards

Chapter 5: Config Split configuration Conditional Split (graylist) Config items: select the configuration will not be deleted on export Dependent config: add config that depends on the listed ones split when different: useful when using wildcards

Chapter 5: Config Split configuration CLI commands csim/csex without argument: replacement for drush < 8.1.10 and console with split machine name: import/export only that specific split

Chapter 5: Config Split configuration Example Not listed: A Complete Split: B Conditional Split: C

Chapter 5: Config Split configuration Example

Chapter 6 Environment speci c modules/con g Can I have development modules enabled on a development environment but not deploy them to the production site?

Chapter 6: Environment specific modules/config Con guration split List modules to split off Add environment specific configuration Override per environment to make split active $config['config_split.config_split.dev']['status'] = TRUE;

Chapter 6: Environment specific modules/config Environment speci c permissions Use Config Role Split Config Filter Plugin Add/remove permissions during import/export Role Split can be overwritten split or ignored per environment

Chapter 7 Con guration Management with git Can two or more developers work simultaneously on the same project? How do I ensure that my work is not lost? Can I assume that Git will always do the right thing when merging?

Chapter 7: Configuration Management with git Git to the rescue Configuration Management is designed to share configuration between different environments. Configuration is exported to text files. And for text files we have Git!

Chapter 7: Configuration Management with git Working as a Team of developers Share a Git repository for both code and configuration. Install site starting from initial configuration. Adopt A successful Git branching model (cit.)

Chapter 7: Configuration Management with git Project bootstrap First developer: Initialise repository. Installs site locally. Exports configuration to sync. Commits and pushes to shared Git repository. Other developers (and prod): Clone code. Have config_installer profile available. Install site starting from exported configuration.

Chapter 7: Configuration Management with git Parallel development First developer: Own branch: checkout -b feature-a (code, code, code...) Commits and pushes to shared Git repository. Other developer(s): Own branch: checkout -b feature-b (code, code, code...) Commit and push to shared Git repository....but careless merge is dangerous and problematic.

Chapter 7: Configuration Management with git Collaboration issues A careless workflow may result in: Losing all uncommitted work. Accidentally overwrite work by others. A configuration that looks OK at first sight but that is actually invalid for Drupal.

Chapter 7: Configuration Management with git The safe sequence for sharing 1. Export configuration: drush cex 2. Commit: git add && git commit 3. Merge: git pull 4. Update dependencies: composer install 5. Run updates: drush updb 6. Import configuration: drush cim 7. Push: git push

Chapter 7: Configuration Management with git If you do it wrong... Import before Export: Deletes your work, no backup. Merge before Export: Export deletes previous work, solved by git. No updb or after cim, will be disallowed, database might be broken. No composer install, may not have all the updated code. Merge before Commit: Manual labour on conflicts. Forgotten Import: Next export will not contain merged config, more difficult to solve in git.

Chapter 7: Configuration Management with git The safe sequence for updating 1. Update code: composer update 2. Run updates: drush updb 3. Export updated config: drush cex 4. Commit: git add && git commit 5. Push: git push

Chapter 7: Configuration Management with git Update DB before con g import update hooks are for fixing the database. See #2762235 New with proof of concept module Config Import N: function hook_pre_config_import_name(&$sandbox) { } function hook_post_config_import_name(&$sandbox) { } Or in core: #2901418

Chapter 7: Configuration Management with git Breaking con guration with Git Setup: Installed standard profile Developer A on branch feature-a deletes Tags from 'Article'. Resulting configuration change: 2 files are removed (field instance and field storage) Developer B on branch feature-b adds Tags to 'Basic page'. Resulting configuration change: 1 file is added (field instance) Git will happily merge feature-a and feature-b into develop The resulting configuration is invalid: Tags has a field instance but no storage.

Chapter 8 Con g changes on production How to deal with changes to configuration on the production site?

Chapter 8: Config changes on production Changes on production Imagine the ideal situation: Configuration is correctly exported, versioned and deployed Development team adopts a solid GIT branching model BUT... Configuration on production is changed by your Geeky Client overnight, without notice.

Chapter 8: Config changes on production Option 1 Lock con guration on production Don t allow config changes on the production site if ever possible by installing the config_readonly module. Note: add this to settings.php in production: $settings['config_readonly'] = TRUE;

Option 2 Con guration Split Review changes done by the client on production and agree what to keep conditional split. Export production changes via drush config-split-export client to../config/client Pull new configuration: business as usual Deploy configuration changes via drush cim: business as usual Configuration is imported from both../config/sync and../config/client

Chapter 8: Config changes on production Option 3 Con g Ignore Add config names/keys allowed to change to ignore config. Pull new configuration: business as usual Deploy configuration changes via drush cim: business as usual Configuration is imported from both../config/sync and the active config.

Chapter 9 Shared con guration Re-using configuration? Multisite configuration?

Chapter 9: Shared configuration Features Bundle configuration for re-use on other sites Site then owns configuration, feature update unsolved. Great for starter-kit to optionally add more features

Chapter 9: Shared configuration Con g Split for multisite Shared splits or shared sync with site specific splits Join BOF on Thursday