SlideShare a Scribd company logo
1 of 13
Download to read offline
CMI feedback
● D.org config API overview / summary
● Demo / Examples
– Custom Config + Translation
– Environement specific (overrides + splits)
● Configuration by multisite
(site specific names, core base field overrides)
– Override existing config by modules
– Install site from existing configuration
Configuration vs. other types of information
● Content - site editors
● Session - user's interactions with the site
● State - Change frequently, don't need to be
deployed
● Configuration - site builders, will be deployed
● Cache - Speed up data retrieval, Tags
invalidation, Contexts
Configuration Storage in Drupal 8
● YAML format
● Has a schema metadata
● The site syncronize directory
– Defined in settings.php (ex. sites/default/config/sync)
– Or outside of the webroot
$config_directories[CONFIG_SYNC_DIRECTORY] = '../config/default/sync';
– Active configuration: in the database
– File system based workflow
● For modules (Only when the module is installed)
– config/install – module's installation fails if at least one of their
dependencies are not met.
– config/optional – that configs are installed only if all their
dependencies are met.
Configuration override system
● About
– See d.org introduction
– Always overrides and is only for reading
– Merge Deep Array with preserve integer keys
● Global overrides
sites/default/settings.local.php or sites/default/settings.$env.php :
global $config;
$config['system.logging']['error_level'] = 'verbose';
● Language overrides (Configuration translation)
sites/default/config/sync/language/fr/user.role.anonymous.yml :
label: 'Utilisateur anonyme'
● Overrides from modules (For custom purpose)
sites/default/config/sync/system.site.yml :
page:
front: /user
Configuration schema/metadata
● Cheat sheet
●
Each module define the type of the configuration it
ships with – config/schema/modulename.schema.yml
● See also core shema files - system.schema.yml,
core.data_types.schema.yml
● Used for
– multilingual support, translation forms for configuration
– the default persistence implementation for configuration
entities requires a configuration schema
– typecast values to their expected types
● Properties
● For debug The configuration inspector module
Configuration
Entity vs. Simple
● Lists of things that users can
create and delete;
● Work fine whether there are 0 or
100+ (image styles, views, etc)
● Complete set of CRUD hooks
● Easier to implement
● Can only depend on the module
that provides it
● Configuration entity dependencies
– Dependency can be: module, theme or entity (content, config)
– Dynamic dependencies - If in a view has filter to show Article
nodes, then it will also gain a dependency on the Article
configuration (node.type.article)
– Dependencies must be installed before the configuration entity
can be installed
– Install my_prf profile
– Copy the source config/sync
directory
– Get database uuids
– Import Configuration
● Configuration management UI, drush
● Config Override
– Environment (and/or multisite) overrides + splits
– Override existing configs by modules
● Config example module
– Working with Configuration Forms
– Defining and using your own configuration
– Translating configuration
● Allow a site to be installed from existing configuration
Until done:
– Create my_prf profile with just my_prf.info.yml. Use
core/profiles/minimal/minimal.info.yml as example
– Add as dependencies all modules from the source site
core.extension.yml.
Configuration Split
● Split means in some way like a partial
● Sets of configuration (a split) that will get exported to separate
directories when exporting, and get merged together when
importing
● Blacklist
– Configs and/or module's configs will be removed from the sync
directory to the split directory. Example of devel module with all his
configs (including the entry in core.extension)
● Greylist
– Configs will be copied (the current database value) to the split
directory and will not be removed from the sync directory
– Option to include dependant configs
– Option to split only when different (Excluded environment)
● Advanced Configuration Management (CMI) Workflows
Environment export to sync
● Splits are used for adding "dev" new files (ex. devel related configs)
● Overrides are used for "dev" specific config changes
– "dev" external services uris, site mail address
– "prd" changes go to config/sync.
– Use empty config file to delete it from "dev"
● Compare from backuped sync to
– Exported in split, from database values
– Applied overrides on sync
● Compare each other: the database version and the override
version of the environment specific configs
● Create splits, overrides from remote (ex. integ, ppd)
– Import the remote database
– Export for diff config/diff/integ
– The same way that for "dev" specifics
Environment import
● Local : Import with only "dev" split enabled, after "dev" overrides and
db uuids have been applied on sync
– Clean sync from overrides and/or uuids
● Remote (ex. not dev)
– Import with "integ" and "excluded" splits enabled after "integ" overrides and
db uuids have been applied
– Will drop configs from other disabled splits (ex. devel ones)
● Intended for "prd"
– Import with only "excluded" split enabled after db uuids have been applied
– No sense of "prd" split, nor "override" : the sync is intended for "prd"
● Remote delivery with keeping BO changes
– Define menus (system.menu.*) as client side configs
– Export excluded split before config files delivery (only when different)
– Import will not replace the menus user changes
– Config not in excluded will be imported
Git Workflow / Three-Way Merge
Configurations by modules
● Using Features Module
– Use features for packaging reusable components
– Use CMI for deployment : local (dev) => remote (live)
● Using the config override system.
– For existing configs use my_module/config/override
– For new configs, use my_module/config/install
– Get configuration from updated modules and profiles
● for import write the module's install configs (and the module's
optional ones if exist in sync) to sync then apply all modules'
overrides
● Compare (instead to write to) config/sync version of module's
configs with applied all modules' overrides (written to --destination)
to module's config (my_module/condfig)
– Feature module to export the database version - with
disabled module's overrides
See also
● Configuration Synchronizer
– Safely importing site configuration from updated modules, themes,
or distributions.
– requires Configuration Update Manager (like features)
● Configuration development
– auto import (into the active storage ) / export (configuration
objects into files)
– import automatique des yml du config/install (between the active
storage and exported modules)
● Configuration Tools
– Stores your current active configuration as yml in a specified
directory
– Auto commits changes to your configuration
● ...

More Related Content

Similar to Drupal & Drink Montpellier "CMI feedback"

Yocto: Training in English
Yocto: Training in EnglishYocto: Training in English
Yocto: Training in English
Otavio Salvador
 
Using the Corporate Geographic Data Model with Subversion
Using the Corporate Geographic Data Model with SubversionUsing the Corporate Geographic Data Model with Subversion
Using the Corporate Geographic Data Model with Subversion
Debbie Wilson
 
ZopeSkel & Buildout packages
ZopeSkel & Buildout packagesZopeSkel & Buildout packages
ZopeSkel & Buildout packages
Quintagroup
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3
Drupalcon Paris
 
Puppet camp london nov 2014 slides (1)
Puppet camp london nov 2014   slides (1)Puppet camp london nov 2014   slides (1)
Puppet camp london nov 2014 slides (1)
Puppet
 

Similar to Drupal & Drink Montpellier "CMI feedback" (20)

Kash Kubernetified
Kash KubernetifiedKash Kubernetified
Kash Kubernetified
 
Drupal Best Practices
Drupal Best PracticesDrupal Best Practices
Drupal Best Practices
 
Drupal Architecture and functionality
Drupal Architecture and functionality Drupal Architecture and functionality
Drupal Architecture and functionality
 
Getting Into Drupal 8 Configuration
Getting Into Drupal 8 ConfigurationGetting Into Drupal 8 Configuration
Getting Into Drupal 8 Configuration
 
Drupal con Sydney configuration management in drupal 7
Drupal con Sydney configuration management in drupal 7Drupal con Sydney configuration management in drupal 7
Drupal con Sydney configuration management in drupal 7
 
Drupal 8 configuration development flow
Drupal 8 configuration development flowDrupal 8 configuration development flow
Drupal 8 configuration development flow
 
Features & Installation Profiles
Features & Installation ProfilesFeatures & Installation Profiles
Features & Installation Profiles
 
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
Configuration as Dependency: Managing Drupal 8 Configuration with git and Com...
 
OroCRM Partner Technical Training: September 2015
OroCRM Partner Technical Training: September 2015OroCRM Partner Technical Training: September 2015
OroCRM Partner Technical Training: September 2015
 
Yocto: Training in English
Yocto: Training in EnglishYocto: Training in English
Yocto: Training in English
 
Drupal 8 Configuration Management with Features
Drupal 8 Configuration Management with FeaturesDrupal 8 Configuration Management with Features
Drupal 8 Configuration Management with Features
 
Magento2 Basics for Frontend Development
Magento2 Basics for Frontend DevelopmentMagento2 Basics for Frontend Development
Magento2 Basics for Frontend Development
 
Puppet managed loadays
Puppet managed loadaysPuppet managed loadays
Puppet managed loadays
 
Using the Corporate Geographic Data Model with Subversion
Using the Corporate Geographic Data Model with SubversionUsing the Corporate Geographic Data Model with Subversion
Using the Corporate Geographic Data Model with Subversion
 
PuppetCamp - How Puppet helped us to standardize, communicate and work together
PuppetCamp - How Puppet helped us to standardize, communicate and work togetherPuppetCamp - How Puppet helped us to standardize, communicate and work together
PuppetCamp - How Puppet helped us to standardize, communicate and work together
 
ZopeSkel & Buildout packages
ZopeSkel & Buildout packagesZopeSkel & Buildout packages
ZopeSkel & Buildout packages
 
Drupal features knowledge sharing
Drupal features   knowledge sharingDrupal features   knowledge sharing
Drupal features knowledge sharing
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3
 
Scaling AngularJS: Enterprise SOA on the MEAN Stack (Responsive Web & Mobile)
Scaling AngularJS: Enterprise SOA on the MEAN Stack (Responsive Web & Mobile)Scaling AngularJS: Enterprise SOA on the MEAN Stack (Responsive Web & Mobile)
Scaling AngularJS: Enterprise SOA on the MEAN Stack (Responsive Web & Mobile)
 
Puppet camp london nov 2014 slides (1)
Puppet camp london nov 2014   slides (1)Puppet camp london nov 2014   slides (1)
Puppet camp london nov 2014 slides (1)
 

Recently uploaded

Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
David Celestin
 
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
ZurliaSoop
 
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven CuriosityUnlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Hung Le
 

Recently uploaded (19)

Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
 
LITTLE ABOUT LESOTHO FROM THE TIME MOSHOESHOE THE FIRST WAS BORN
LITTLE ABOUT LESOTHO FROM THE TIME MOSHOESHOE THE FIRST WAS BORNLITTLE ABOUT LESOTHO FROM THE TIME MOSHOESHOE THE FIRST WAS BORN
LITTLE ABOUT LESOTHO FROM THE TIME MOSHOESHOE THE FIRST WAS BORN
 
Abortion Pills Fahaheel ௹+918133066128💬@ Safe and Effective Mifepristion and ...
Abortion Pills Fahaheel ௹+918133066128💬@ Safe and Effective Mifepristion and ...Abortion Pills Fahaheel ௹+918133066128💬@ Safe and Effective Mifepristion and ...
Abortion Pills Fahaheel ௹+918133066128💬@ Safe and Effective Mifepristion and ...
 
Ready Set Go Children Sermon about Mark 16:15-20
Ready Set Go Children Sermon about Mark 16:15-20Ready Set Go Children Sermon about Mark 16:15-20
Ready Set Go Children Sermon about Mark 16:15-20
 
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdfSOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
 
Using AI to boost productivity for developers
Using AI to boost productivity for developersUsing AI to boost productivity for developers
Using AI to boost productivity for developers
 
Digital collaboration with Microsoft 365 as extension of Drupal
Digital collaboration with Microsoft 365 as extension of DrupalDigital collaboration with Microsoft 365 as extension of Drupal
Digital collaboration with Microsoft 365 as extension of Drupal
 
BEAUTIFUL PLACES TO VISIT IN LESOTHO.pptx
BEAUTIFUL PLACES TO VISIT IN LESOTHO.pptxBEAUTIFUL PLACES TO VISIT IN LESOTHO.pptx
BEAUTIFUL PLACES TO VISIT IN LESOTHO.pptx
 
History of Morena Moshoeshoe birth death
History of Morena Moshoeshoe birth deathHistory of Morena Moshoeshoe birth death
History of Morena Moshoeshoe birth death
 
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
 
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven CuriosityUnlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
 
in kuwait௹+918133066128....) @abortion pills for sale in Kuwait City
in kuwait௹+918133066128....) @abortion pills for sale in Kuwait Cityin kuwait௹+918133066128....) @abortion pills for sale in Kuwait City
in kuwait௹+918133066128....) @abortion pills for sale in Kuwait City
 
ECOLOGY OF FISHES.pptx full presentation
ECOLOGY OF FISHES.pptx full presentationECOLOGY OF FISHES.pptx full presentation
ECOLOGY OF FISHES.pptx full presentation
 
2024 mega trends for the digital workplace - FINAL.pdf
2024 mega trends for the digital workplace - FINAL.pdf2024 mega trends for the digital workplace - FINAL.pdf
2024 mega trends for the digital workplace - FINAL.pdf
 
The Concession of Asaba International Airport: Balancing Politics and Policy ...
The Concession of Asaba International Airport: Balancing Politics and Policy ...The Concession of Asaba International Airport: Balancing Politics and Policy ...
The Concession of Asaba International Airport: Balancing Politics and Policy ...
 
"I hear you": Moving beyond empathy in UXR
"I hear you": Moving beyond empathy in UXR"I hear you": Moving beyond empathy in UXR
"I hear you": Moving beyond empathy in UXR
 
Introduction to Artificial intelligence.
Introduction to Artificial intelligence.Introduction to Artificial intelligence.
Introduction to Artificial intelligence.
 
ICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdfICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdf
 
BIG DEVELOPMENTS IN LESOTHO(DAMS & MINES
BIG DEVELOPMENTS IN LESOTHO(DAMS & MINESBIG DEVELOPMENTS IN LESOTHO(DAMS & MINES
BIG DEVELOPMENTS IN LESOTHO(DAMS & MINES
 

Drupal & Drink Montpellier "CMI feedback"

  • 1. CMI feedback ● D.org config API overview / summary ● Demo / Examples – Custom Config + Translation – Environement specific (overrides + splits) ● Configuration by multisite (site specific names, core base field overrides) – Override existing config by modules – Install site from existing configuration
  • 2. Configuration vs. other types of information ● Content - site editors ● Session - user's interactions with the site ● State - Change frequently, don't need to be deployed ● Configuration - site builders, will be deployed ● Cache - Speed up data retrieval, Tags invalidation, Contexts
  • 3. Configuration Storage in Drupal 8 ● YAML format ● Has a schema metadata ● The site syncronize directory – Defined in settings.php (ex. sites/default/config/sync) – Or outside of the webroot $config_directories[CONFIG_SYNC_DIRECTORY] = '../config/default/sync'; – Active configuration: in the database – File system based workflow ● For modules (Only when the module is installed) – config/install – module's installation fails if at least one of their dependencies are not met. – config/optional – that configs are installed only if all their dependencies are met.
  • 4. Configuration override system ● About – See d.org introduction – Always overrides and is only for reading – Merge Deep Array with preserve integer keys ● Global overrides sites/default/settings.local.php or sites/default/settings.$env.php : global $config; $config['system.logging']['error_level'] = 'verbose'; ● Language overrides (Configuration translation) sites/default/config/sync/language/fr/user.role.anonymous.yml : label: 'Utilisateur anonyme' ● Overrides from modules (For custom purpose) sites/default/config/sync/system.site.yml : page: front: /user
  • 5. Configuration schema/metadata ● Cheat sheet ● Each module define the type of the configuration it ships with – config/schema/modulename.schema.yml ● See also core shema files - system.schema.yml, core.data_types.schema.yml ● Used for – multilingual support, translation forms for configuration – the default persistence implementation for configuration entities requires a configuration schema – typecast values to their expected types ● Properties ● For debug The configuration inspector module
  • 6. Configuration Entity vs. Simple ● Lists of things that users can create and delete; ● Work fine whether there are 0 or 100+ (image styles, views, etc) ● Complete set of CRUD hooks ● Easier to implement ● Can only depend on the module that provides it ● Configuration entity dependencies – Dependency can be: module, theme or entity (content, config) – Dynamic dependencies - If in a view has filter to show Article nodes, then it will also gain a dependency on the Article configuration (node.type.article) – Dependencies must be installed before the configuration entity can be installed
  • 7. – Install my_prf profile – Copy the source config/sync directory – Get database uuids – Import Configuration ● Configuration management UI, drush ● Config Override – Environment (and/or multisite) overrides + splits – Override existing configs by modules ● Config example module – Working with Configuration Forms – Defining and using your own configuration – Translating configuration ● Allow a site to be installed from existing configuration Until done: – Create my_prf profile with just my_prf.info.yml. Use core/profiles/minimal/minimal.info.yml as example – Add as dependencies all modules from the source site core.extension.yml.
  • 8. Configuration Split ● Split means in some way like a partial ● Sets of configuration (a split) that will get exported to separate directories when exporting, and get merged together when importing ● Blacklist – Configs and/or module's configs will be removed from the sync directory to the split directory. Example of devel module with all his configs (including the entry in core.extension) ● Greylist – Configs will be copied (the current database value) to the split directory and will not be removed from the sync directory – Option to include dependant configs – Option to split only when different (Excluded environment) ● Advanced Configuration Management (CMI) Workflows
  • 9. Environment export to sync ● Splits are used for adding "dev" new files (ex. devel related configs) ● Overrides are used for "dev" specific config changes – "dev" external services uris, site mail address – "prd" changes go to config/sync. – Use empty config file to delete it from "dev" ● Compare from backuped sync to – Exported in split, from database values – Applied overrides on sync ● Compare each other: the database version and the override version of the environment specific configs ● Create splits, overrides from remote (ex. integ, ppd) – Import the remote database – Export for diff config/diff/integ – The same way that for "dev" specifics
  • 10. Environment import ● Local : Import with only "dev" split enabled, after "dev" overrides and db uuids have been applied on sync – Clean sync from overrides and/or uuids ● Remote (ex. not dev) – Import with "integ" and "excluded" splits enabled after "integ" overrides and db uuids have been applied – Will drop configs from other disabled splits (ex. devel ones) ● Intended for "prd" – Import with only "excluded" split enabled after db uuids have been applied – No sense of "prd" split, nor "override" : the sync is intended for "prd" ● Remote delivery with keeping BO changes – Define menus (system.menu.*) as client side configs – Export excluded split before config files delivery (only when different) – Import will not replace the menus user changes – Config not in excluded will be imported
  • 11. Git Workflow / Three-Way Merge
  • 12. Configurations by modules ● Using Features Module – Use features for packaging reusable components – Use CMI for deployment : local (dev) => remote (live) ● Using the config override system. – For existing configs use my_module/config/override – For new configs, use my_module/config/install – Get configuration from updated modules and profiles ● for import write the module's install configs (and the module's optional ones if exist in sync) to sync then apply all modules' overrides ● Compare (instead to write to) config/sync version of module's configs with applied all modules' overrides (written to --destination) to module's config (my_module/condfig) – Feature module to export the database version - with disabled module's overrides
  • 13. See also ● Configuration Synchronizer – Safely importing site configuration from updated modules, themes, or distributions. – requires Configuration Update Manager (like features) ● Configuration development – auto import (into the active storage ) / export (configuration objects into files) – import automatique des yml du config/install (between the active storage and exported modules) ● Configuration Tools – Stores your current active configuration as yml in a specified directory – Auto commits changes to your configuration ● ...