SlideShare a Scribd company logo
1 of 51
Configuration Management
Drupal Camp Alpe-Adria 2014
Fabian Bircher
Agenda
Introduction
Configuration Management for site builders
From Drupal 7 to Drupal 8
A Closer Look at CMI
CMI for Developers
Fabian Bircher
Developer at Nuvole
Drupal company
Brussels, Parma, Prague
Pioneers of Code Driven Development:
configuration management for Drupal 6 and Drupal 7.
@fabianbircher
@nuvoleweb
Configuration Management
An overview and practical introduction for site builders
Configuration Management Initiative
“Site configuration information in D8 is stored in
files in your library’s directory, making it much
simpler to transport configuration changes such as
new content types, fields, or views from
development to production.”
The initial goal, with some implementation
differences, was reached. CMI already works in the
Drupal 8 branch.
Reference Use Case
Modify the configuration of a production site:
Keeping the site online all the time.
Developing/testing the new configuration on a
development copy.
Exporting the configuration changes from development
and importing them in production.
Step 1 of 6: Clone Site to Dev
PRODUCTION
Copy:
Database
Full Drupal tree
Files
DEVELOPMENT
Restore the copy
Step 2 of 6: Modify Configuration
PRODUCTION
Site operates normally:
new users
new content
DEVELOPMENT
Step 3 of 6: Export Configuration
PRODUCTION
Site operates normally:
new users
new content
DEVELOPMENT
Step 4 of 6: Import in Staging
PRODUCTION DEVELOPMENT
Step 5 of 6: Review Changes
PRODUCTION DEVELOPMENT
Step 6 of 6: Apply Changes
PRODUCTION DEVELOPMENT
There's Much More...
This is only the site builder's user experience.
CMI is still under active development.
Significant changes can still occur before Drupal 8 is
released.
From Drupal 7 to Drupal 8
What changed. What improved. What's still missing.
D7 to D8: Configuration is defined
Are vocabularies
configuration?
Are taxonomy terms
configuration?
If it's in the config, it's
configuration!
D7 to D8: Configuration Storage
Database
Text files
(well... text files stored
in DB by default)
D7 to D8: Uniform Approach
Variables
DB Tables
CTools
Features
Black magic...
Text files in YAML
format
D7 to D8: Staging Configuration
Through Features,
revert to apply
Native
D7 to D8: Interface to Developers
“Exportables”
from CTools and bag of
(incompatible) tricks
“Configurables”
as PHP classes (entities)
D7 to D8: Comparison
D7 core D7 core +
features
D8 core
Export full site config (no content) NO NO YES
Export selected config items NO YES YES
Track config changes (full site) NO NO YES
Track config changes (selected items) NO YES YES
Stage configuration NO YES YES
Package configuration NO YES NO
Reuse configuration in other projects NO YES NO
Collaborate on the same project NO YES NO*
Is CMI “Features Done Right”?
No.
It is a nice way to replace and improve one use case
for Features: making configuration exportable into
text files.
Is CMI “Features Done Wrong”?
No.
It is a huge step forward to developers and it paves
the way for additional modules that could offer the
same functionality of Drupal 7 + Features in a much
cleaner and more reliable way.
A Closer Look at CMI
Under the hood. Caveats and pending developments.
Key-Value store
Concept
Unique key
Potentially complex data
Declarative (no logic)
Implementation
Files
Two columns in a database
…
Two Levels of Configuration
Active store
The real site configuration. If you only configure
“D7-style”, you'll use this one and never see CMI.
Staging store
Temporary area for configuration files that are to be
reviewed and imported.
Configuration in settings.php
$config_directories['active'] =
'sites/default/files/config_al6ppw6/active';
$config_directories['staging'] =
'sites/default/files/config_al6ppw6/staging';
The random string is for extra security.
The two directories can be out of the Drupal root.
A Look at the Active Store
$ ls sites/default/files/config_al6ppw6/active
$
Empty?
Files are in Database
+---------------------------------+
| name |
+---------------------------------+
| bartik.settings |
| ... |
| views.view.who_s_new |
| views.view.who_s_online |
+---------------------------------+
166 rows in set
Why the Database?
Performance
It's faster than reading/parsing files.
Safety
No temptation to edit files “because you can”.
Changes ALWAYS need to be imported!
Security
Less likely to leave read access accidentally open.
YAML Example: in Drupal
YAML Example: in Exported Config
$ cat image.style.large.yml
name: large
label: 'Large (480x480)'
status: true
uuid: 15dda024-4160-40e2-b305
langcode: en
dependencies: { }
effects:
ddd73aa7-4bd6-4c85-b600:
uuid: ddd73aa7-4bd6-4c85-b600
id: image_scale ...
YAML Example: in Default Config
$ pwd
.../core/modules/system/config/install
$ cat system.site.yml
uuid: ''
name: Drupal
mail: ''
slogan: ''
page:
403: ''
404: ''
front: user
admin_compact_mode: false
YAML Example: After Install
UUIDs Everywhere
Good
Prevent any possible conflicts.
Bad
“Universally Unique” clashes with “Reusable”
(especially with relations).
Caveat: CMI is for the Same Site
No portability, by design
The export/import cycle is assumed to be between
multiple version (dev, production) of the same Drupal
project.
Caveat: CMI is not Atomic
$ cat user.role.authenticated.yml
id: authenticated
label: 'Authenticated user'
weight: 1
permissions:
- 'use text format plain_text'
- 'access content'
- 'use text format basic_html'
- 'access comments'
Can't package a “feature” reusing whole files.
Need for an intermediate layer.
Caveat: Import Can Break Things
$ [export config]
$ rm node.type.page.yml
$ [import config]
Existing pages are orphaned and unusable; always
make a backup dump or review changes carefully!
Caveat: No Consistency Check
$ [export config]
$ vim system.theme.yml
$ cat system.theme.yml # Typo in name!
admin: seven
default: barTtik
$ [import config]
An invalid configuration is imported and applied; style
is broken.
Pending: Install from Existing Config
Issue 1613424
Idea: create a clean copy (all config, no content) of
a production site.
Theoretically, possible by providing an “install fom
existing config” choice as if it were an installation
profile (see issue for discussion).
Pending: Robust Synchronization
Issue 2121751
Idea: Synchronize sites in a stable way, handling
possible conflicts.
Use case: handle gracefully the case where the
same View was created independently on
production and development (see issue for
discussion).
CMI for Developers
Configurables. How to work with configuration.
Configurables
As everything in Drupal 8, object-oriented
interface:
abstract class ConfigEntityBase
Namespace
DrupalCoreConfigEntity
Configurables are Entities
class ConfigEntityBase extends Entity { ...
}
DrupalCoreEntityEntity
|- DrupalCoreConfigEntityConfigEntityBase
- DrupalCoreEntityContentEntityBase
Two namespaces: one for config, one for content.
Retrieving Configuration Objects
Drupal::config($name)
Where $name is the configuration object (filename of
the YAML file, without the .yml extension).
Example:
$site_name = Drupal::config('system.site')
->get('name');
Modifying Configuration Objects
Drupal::config('system.site')
->set('name', 'Drupal 8 test')
->save();
The active store is immediately modified. The
staging store is not used.
Drush 7.x Integration
config-list (cli)
List config names by prefix.
config-export (cex)
Export config from the active store.
config-import (cim)
Import config from a config dir.
config-get (cget)
Display a config value, or a whole
configuration object.
config-set (cset)
Set a config value directly in
the active configuration.
Configuration EVERYTHING?
variable_xxx() is dead!
How is the time of the last cron run saved?
State API to the rescue!
Environment specific settings
Separation of configuration, state and content
Content staging not implemented yet
Settings overrides
Configuration can be locally overridden
CSS & JS aggregation
TWIG debugging
settings.local.php
$config['system.performance']['css']
['preprocess'] = FALSE;
CSV workflow
PRODUCTION
Clone site
don’t touch config
Pull from git
Import configuration
DEVELOPMENT
Insall clone
Configure
Export configuration
into staging
Commit&push to git
More…
Jam’s virtual drupal camp featuring Rob Bayliss
https://www.youtube.com/watch?v=St9s7DqFR7o
Thank you for your attention

More Related Content

What's hot

Introduction to Module Development (Drupal 7)
Introduction to Module Development (Drupal 7)Introduction to Module Development (Drupal 7)
Introduction to Module Development (Drupal 7)April Sides
 
Building and Maintaining a Distribution in Drupal 7 with Features
Building and Maintaining a  Distribution in Drupal 7 with FeaturesBuilding and Maintaining a  Distribution in Drupal 7 with Features
Building and Maintaining a Distribution in Drupal 7 with FeaturesNuvole
 
Drupal 8 - Corso frontend development
Drupal 8 - Corso frontend developmentDrupal 8 - Corso frontend development
Drupal 8 - Corso frontend developmentsparkfabrik
 
Hive Quick Start Tutorial
Hive Quick Start TutorialHive Quick Start Tutorial
Hive Quick Start TutorialCarl Steinbach
 
Becoming A Drupal Master Builder
Becoming A Drupal Master BuilderBecoming A Drupal Master Builder
Becoming A Drupal Master BuilderPhilip Norton
 
ExtBase workshop
ExtBase workshop ExtBase workshop
ExtBase workshop schmutt
 
Improving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLAImproving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLAJesus Manuel Olivas
 
Drupal 8 Theme System: The Backend of Frontend
Drupal 8 Theme System: The Backend of FrontendDrupal 8 Theme System: The Backend of Frontend
Drupal 8 Theme System: The Backend of FrontendAcquia
 
Introduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, TerminologiesIntroduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, TerminologiesGerald Villorente
 
CertiFUNcation 2017 Best Practices Extension Development for TYPO3 8 LTS
CertiFUNcation 2017 Best Practices Extension Development for TYPO3 8 LTSCertiFUNcation 2017 Best Practices Extension Development for TYPO3 8 LTS
CertiFUNcation 2017 Best Practices Extension Development for TYPO3 8 LTScpsitgmbh
 
Working with Hive Analytics
Working with Hive AnalyticsWorking with Hive Analytics
Working with Hive AnalyticsManish Chopra
 
Hadoop, Hbase and Hive- Bay area Hadoop User Group
Hadoop, Hbase and Hive- Bay area Hadoop User GroupHadoop, Hbase and Hive- Bay area Hadoop User Group
Hadoop, Hbase and Hive- Bay area Hadoop User GroupHadoop User Group
 
PiBase Updates
PiBase UpdatesPiBase Updates
PiBase Updatesschmutt
 
What's new in the Drupal 7 API?
What's new in the Drupal 7 API?What's new in the Drupal 7 API?
What's new in the Drupal 7 API?Alexandru Badiu
 

What's hot (20)

Introduction to Module Development (Drupal 7)
Introduction to Module Development (Drupal 7)Introduction to Module Development (Drupal 7)
Introduction to Module Development (Drupal 7)
 
Building and Maintaining a Distribution in Drupal 7 with Features
Building and Maintaining a  Distribution in Drupal 7 with FeaturesBuilding and Maintaining a  Distribution in Drupal 7 with Features
Building and Maintaining a Distribution in Drupal 7 with Features
 
Drupal 8 - Corso frontend development
Drupal 8 - Corso frontend developmentDrupal 8 - Corso frontend development
Drupal 8 - Corso frontend development
 
Hive Quick Start Tutorial
Hive Quick Start TutorialHive Quick Start Tutorial
Hive Quick Start Tutorial
 
Becoming A Drupal Master Builder
Becoming A Drupal Master BuilderBecoming A Drupal Master Builder
Becoming A Drupal Master Builder
 
ExtBase workshop
ExtBase workshop ExtBase workshop
ExtBase workshop
 
Beginning hive and_apache_pig
Beginning hive and_apache_pigBeginning hive and_apache_pig
Beginning hive and_apache_pig
 
Improving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLAImproving your Drupal 8 development workflow DrupalCampLA
Improving your Drupal 8 development workflow DrupalCampLA
 
Drupal 8 Theme System: The Backend of Frontend
Drupal 8 Theme System: The Backend of FrontendDrupal 8 Theme System: The Backend of Frontend
Drupal 8 Theme System: The Backend of Frontend
 
Introduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, TerminologiesIntroduction to Drupal - Installation, Anatomy, Terminologies
Introduction to Drupal - Installation, Anatomy, Terminologies
 
CertiFUNcation 2017 Best Practices Extension Development for TYPO3 8 LTS
CertiFUNcation 2017 Best Practices Extension Development for TYPO3 8 LTSCertiFUNcation 2017 Best Practices Extension Development for TYPO3 8 LTS
CertiFUNcation 2017 Best Practices Extension Development for TYPO3 8 LTS
 
Working with Hive Analytics
Working with Hive AnalyticsWorking with Hive Analytics
Working with Hive Analytics
 
Hadoop, Hbase and Hive- Bay area Hadoop User Group
Hadoop, Hbase and Hive- Bay area Hadoop User GroupHadoop, Hbase and Hive- Bay area Hadoop User Group
Hadoop, Hbase and Hive- Bay area Hadoop User Group
 
PiBase Updates
PiBase UpdatesPiBase Updates
PiBase Updates
 
CHANGELOG.txt
CHANGELOG.txtCHANGELOG.txt
CHANGELOG.txt
 
Local Drupal MultiSite Set-up
Local Drupal MultiSite Set-upLocal Drupal MultiSite Set-up
Local Drupal MultiSite Set-up
 
Changelog
ChangelogChangelog
Changelog
 
Drupal 8 Configuration Management
Drupal 8 Configuration ManagementDrupal 8 Configuration Management
Drupal 8 Configuration Management
 
What's new in the Drupal 7 API?
What's new in the Drupal 7 API?What's new in the Drupal 7 API?
What's new in the Drupal 7 API?
 
Migrate in Drupal 8
Migrate in Drupal 8Migrate in Drupal 8
Migrate in Drupal 8
 

Similar to Configuration Management in Drupal 8: A preview (DrupalCamp Alpe Adria 2014)

DDAY2014 - Features per Drupal 8
DDAY2014 - Features per Drupal 8DDAY2014 - Features per Drupal 8
DDAY2014 - Features per Drupal 8DrupalDay
 
Migraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesMigraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesdrupalindia
 
Drupal Workflow Concepts
Drupal Workflow ConceptsDrupal Workflow Concepts
Drupal Workflow Conceptscgmonroe
 
Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8Anne Tomasevich
 
Drupal 8 Configuration Management for you and your team
Drupal 8 Configuration Management for you and your teamDrupal 8 Configuration Management for you and your team
Drupal 8 Configuration Management for you and your teamLuc Bézier
 
Liquibase - Open Source version control for your database
Liquibase - Open Source version control for your databaseLiquibase - Open Source version control for your database
Liquibase - Open Source version control for your databaseBlaine Carter
 
Drupal 8: frontend development
Drupal 8: frontend developmentDrupal 8: frontend development
Drupal 8: frontend developmentsparkfabrik
 
Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8Angela Byron
 
Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7Phase2
 
Building a Drupal Distribution using Features, Drush Make, Installation Profi...
Building a Drupal Distribution using Features, Drush Make, Installation Profi...Building a Drupal Distribution using Features, Drush Make, Installation Profi...
Building a Drupal Distribution using Features, Drush Make, Installation Profi...Ben Shell
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Mack Hardy
 
Drupal
DrupalDrupal
Drupalbtopro
 
Config management
Config managementConfig management
Config managementAlexei Goja
 
Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...
Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...
Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...buildacloud
 
Open writing-cloud-collab
Open writing-cloud-collabOpen writing-cloud-collab
Open writing-cloud-collabKaren Vuong
 
Converting (X)HTML/CSS template to Drupal 7 Theme
Converting (X)HTML/CSS template to Drupal 7 ThemeConverting (X)HTML/CSS template to Drupal 7 Theme
Converting (X)HTML/CSS template to Drupal 7 ThemeAdolfo Nasol
 

Similar to Configuration Management in Drupal 8: A preview (DrupalCamp Alpe Adria 2014) (20)

DDAY2014 - Features per Drupal 8
DDAY2014 - Features per Drupal 8DDAY2014 - Features per Drupal 8
DDAY2014 - Features per Drupal 8
 
Drupal
DrupalDrupal
Drupal
 
Migraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesMigraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sites
 
Drupal Workflow Concepts
Drupal Workflow ConceptsDrupal Workflow Concepts
Drupal Workflow Concepts
 
Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8
 
Vc++
Vc++Vc++
Vc++
 
Drupal 8 Configuration Management for you and your team
Drupal 8 Configuration Management for you and your teamDrupal 8 Configuration Management for you and your team
Drupal 8 Configuration Management for you and your team
 
Liquibase - Open Source version control for your database
Liquibase - Open Source version control for your databaseLiquibase - Open Source version control for your database
Liquibase - Open Source version control for your database
 
Drupal 8: frontend development
Drupal 8: frontend developmentDrupal 8: frontend development
Drupal 8: frontend development
 
Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8
 
Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7Taking your site from Drupal 6 to Drupal 7
Taking your site from Drupal 6 to Drupal 7
 
Building a Drupal Distribution using Features, Drush Make, Installation Profi...
Building a Drupal Distribution using Features, Drush Make, Installation Profi...Building a Drupal Distribution using Features, Drush Make, Installation Profi...
Building a Drupal Distribution using Features, Drush Make, Installation Profi...
 
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
Strategies and Tips for Building Enterprise Drupal Applications - PNWDS 2013
 
Drupal
DrupalDrupal
Drupal
 
Config management
Config managementConfig management
Config management
 
Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...
Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...
Open Writing! Collaborative Authoring for CloudStack Documentation by Jessica...
 
Open writing-cloud-collab
Open writing-cloud-collabOpen writing-cloud-collab
Open writing-cloud-collab
 
Drupal7
Drupal7Drupal7
Drupal7
 
Converting (X)HTML/CSS template to Drupal 7 Theme
Converting (X)HTML/CSS template to Drupal 7 ThemeConverting (X)HTML/CSS template to Drupal 7 Theme
Converting (X)HTML/CSS template to Drupal 7 Theme
 
Into to drupal8
Into to drupal8Into to drupal8
Into to drupal8
 

More from Nuvole

The OpenEuropa Initiative
The OpenEuropa InitiativeThe OpenEuropa Initiative
The OpenEuropa InitiativeNuvole
 
CMI 2.0 session at Drupal DevDays in Cluj-Napoca
CMI 2.0 session at Drupal DevDays in Cluj-NapocaCMI 2.0 session at Drupal DevDays in Cluj-Napoca
CMI 2.0 session at Drupal DevDays in Cluj-NapocaNuvole
 
Introducing the UI Patterns module: use atomic UI components everywhere in Dr...
Introducing the UI Patterns module: use atomic UI components everywhere in Dr...Introducing the UI Patterns module: use atomic UI components everywhere in Dr...
Introducing the UI Patterns module: use atomic UI components everywhere in Dr...Nuvole
 
Remote Collaboration and Institutional Intranets with Drupal and Open Atrium
Remote Collaboration and Institutional Intranets with Drupal and Open AtriumRemote Collaboration and Institutional Intranets with Drupal and Open Atrium
Remote Collaboration and Institutional Intranets with Drupal and Open AtriumNuvole
 
Public Works Monitoring
Public Works MonitoringPublic Works Monitoring
Public Works MonitoringNuvole
 
Extending and Customizing Open Atrium
Extending and Customizing Open AtriumExtending and Customizing Open Atrium
Extending and Customizing Open AtriumNuvole
 
Code driven development: using Features effectively in Drupal 6 and 7
Code driven development: using Features effectively in Drupal 6 and 7Code driven development: using Features effectively in Drupal 6 and 7
Code driven development: using Features effectively in Drupal 6 and 7Nuvole
 
Features based development workflow
Features based development workflowFeatures based development workflow
Features based development workflowNuvole
 
First Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven DevelopmentFirst Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven DevelopmentNuvole
 

More from Nuvole (9)

The OpenEuropa Initiative
The OpenEuropa InitiativeThe OpenEuropa Initiative
The OpenEuropa Initiative
 
CMI 2.0 session at Drupal DevDays in Cluj-Napoca
CMI 2.0 session at Drupal DevDays in Cluj-NapocaCMI 2.0 session at Drupal DevDays in Cluj-Napoca
CMI 2.0 session at Drupal DevDays in Cluj-Napoca
 
Introducing the UI Patterns module: use atomic UI components everywhere in Dr...
Introducing the UI Patterns module: use atomic UI components everywhere in Dr...Introducing the UI Patterns module: use atomic UI components everywhere in Dr...
Introducing the UI Patterns module: use atomic UI components everywhere in Dr...
 
Remote Collaboration and Institutional Intranets with Drupal and Open Atrium
Remote Collaboration and Institutional Intranets with Drupal and Open AtriumRemote Collaboration and Institutional Intranets with Drupal and Open Atrium
Remote Collaboration and Institutional Intranets with Drupal and Open Atrium
 
Public Works Monitoring
Public Works MonitoringPublic Works Monitoring
Public Works Monitoring
 
Extending and Customizing Open Atrium
Extending and Customizing Open AtriumExtending and Customizing Open Atrium
Extending and Customizing Open Atrium
 
Code driven development: using Features effectively in Drupal 6 and 7
Code driven development: using Features effectively in Drupal 6 and 7Code driven development: using Features effectively in Drupal 6 and 7
Code driven development: using Features effectively in Drupal 6 and 7
 
Features based development workflow
Features based development workflowFeatures based development workflow
Features based development workflow
 
First Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven DevelopmentFirst Steps in Drupal Code Driven Development
First Steps in Drupal Code Driven Development
 

Recently uploaded

Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 

Recently uploaded (20)

Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 

Configuration Management in Drupal 8: A preview (DrupalCamp Alpe Adria 2014)

  • 1. Configuration Management Drupal Camp Alpe-Adria 2014 Fabian Bircher
  • 2. Agenda Introduction Configuration Management for site builders From Drupal 7 to Drupal 8 A Closer Look at CMI CMI for Developers
  • 3. Fabian Bircher Developer at Nuvole Drupal company Brussels, Parma, Prague Pioneers of Code Driven Development: configuration management for Drupal 6 and Drupal 7. @fabianbircher @nuvoleweb
  • 4. Configuration Management An overview and practical introduction for site builders
  • 5. Configuration Management Initiative “Site configuration information in D8 is stored in files in your library’s directory, making it much simpler to transport configuration changes such as new content types, fields, or views from development to production.” The initial goal, with some implementation differences, was reached. CMI already works in the Drupal 8 branch.
  • 6. Reference Use Case Modify the configuration of a production site: Keeping the site online all the time. Developing/testing the new configuration on a development copy. Exporting the configuration changes from development and importing them in production.
  • 7. Step 1 of 6: Clone Site to Dev PRODUCTION Copy: Database Full Drupal tree Files DEVELOPMENT Restore the copy
  • 8. Step 2 of 6: Modify Configuration PRODUCTION Site operates normally: new users new content DEVELOPMENT
  • 9. Step 3 of 6: Export Configuration PRODUCTION Site operates normally: new users new content DEVELOPMENT
  • 10. Step 4 of 6: Import in Staging PRODUCTION DEVELOPMENT
  • 11. Step 5 of 6: Review Changes PRODUCTION DEVELOPMENT
  • 12. Step 6 of 6: Apply Changes PRODUCTION DEVELOPMENT
  • 13. There's Much More... This is only the site builder's user experience. CMI is still under active development. Significant changes can still occur before Drupal 8 is released.
  • 14. From Drupal 7 to Drupal 8 What changed. What improved. What's still missing.
  • 15. D7 to D8: Configuration is defined Are vocabularies configuration? Are taxonomy terms configuration? If it's in the config, it's configuration!
  • 16. D7 to D8: Configuration Storage Database Text files (well... text files stored in DB by default)
  • 17. D7 to D8: Uniform Approach Variables DB Tables CTools Features Black magic... Text files in YAML format
  • 18. D7 to D8: Staging Configuration Through Features, revert to apply Native
  • 19. D7 to D8: Interface to Developers “Exportables” from CTools and bag of (incompatible) tricks “Configurables” as PHP classes (entities)
  • 20. D7 to D8: Comparison D7 core D7 core + features D8 core Export full site config (no content) NO NO YES Export selected config items NO YES YES Track config changes (full site) NO NO YES Track config changes (selected items) NO YES YES Stage configuration NO YES YES Package configuration NO YES NO Reuse configuration in other projects NO YES NO Collaborate on the same project NO YES NO*
  • 21. Is CMI “Features Done Right”? No. It is a nice way to replace and improve one use case for Features: making configuration exportable into text files.
  • 22. Is CMI “Features Done Wrong”? No. It is a huge step forward to developers and it paves the way for additional modules that could offer the same functionality of Drupal 7 + Features in a much cleaner and more reliable way.
  • 23. A Closer Look at CMI Under the hood. Caveats and pending developments.
  • 24. Key-Value store Concept Unique key Potentially complex data Declarative (no logic) Implementation Files Two columns in a database …
  • 25. Two Levels of Configuration Active store The real site configuration. If you only configure “D7-style”, you'll use this one and never see CMI. Staging store Temporary area for configuration files that are to be reviewed and imported.
  • 26. Configuration in settings.php $config_directories['active'] = 'sites/default/files/config_al6ppw6/active'; $config_directories['staging'] = 'sites/default/files/config_al6ppw6/staging'; The random string is for extra security. The two directories can be out of the Drupal root.
  • 27. A Look at the Active Store $ ls sites/default/files/config_al6ppw6/active $ Empty?
  • 28. Files are in Database +---------------------------------+ | name | +---------------------------------+ | bartik.settings | | ... | | views.view.who_s_new | | views.view.who_s_online | +---------------------------------+ 166 rows in set
  • 29. Why the Database? Performance It's faster than reading/parsing files. Safety No temptation to edit files “because you can”. Changes ALWAYS need to be imported! Security Less likely to leave read access accidentally open.
  • 31. YAML Example: in Exported Config $ cat image.style.large.yml name: large label: 'Large (480x480)' status: true uuid: 15dda024-4160-40e2-b305 langcode: en dependencies: { } effects: ddd73aa7-4bd6-4c85-b600: uuid: ddd73aa7-4bd6-4c85-b600 id: image_scale ...
  • 32. YAML Example: in Default Config $ pwd .../core/modules/system/config/install $ cat system.site.yml uuid: '' name: Drupal mail: '' slogan: '' page: 403: '' 404: '' front: user admin_compact_mode: false
  • 34. UUIDs Everywhere Good Prevent any possible conflicts. Bad “Universally Unique” clashes with “Reusable” (especially with relations).
  • 35. Caveat: CMI is for the Same Site No portability, by design The export/import cycle is assumed to be between multiple version (dev, production) of the same Drupal project.
  • 36. Caveat: CMI is not Atomic $ cat user.role.authenticated.yml id: authenticated label: 'Authenticated user' weight: 1 permissions: - 'use text format plain_text' - 'access content' - 'use text format basic_html' - 'access comments' Can't package a “feature” reusing whole files. Need for an intermediate layer.
  • 37. Caveat: Import Can Break Things $ [export config] $ rm node.type.page.yml $ [import config] Existing pages are orphaned and unusable; always make a backup dump or review changes carefully!
  • 38. Caveat: No Consistency Check $ [export config] $ vim system.theme.yml $ cat system.theme.yml # Typo in name! admin: seven default: barTtik $ [import config] An invalid configuration is imported and applied; style is broken.
  • 39. Pending: Install from Existing Config Issue 1613424 Idea: create a clean copy (all config, no content) of a production site. Theoretically, possible by providing an “install fom existing config” choice as if it were an installation profile (see issue for discussion).
  • 40. Pending: Robust Synchronization Issue 2121751 Idea: Synchronize sites in a stable way, handling possible conflicts. Use case: handle gracefully the case where the same View was created independently on production and development (see issue for discussion).
  • 41. CMI for Developers Configurables. How to work with configuration.
  • 42. Configurables As everything in Drupal 8, object-oriented interface: abstract class ConfigEntityBase Namespace DrupalCoreConfigEntity
  • 43. Configurables are Entities class ConfigEntityBase extends Entity { ... } DrupalCoreEntityEntity |- DrupalCoreConfigEntityConfigEntityBase - DrupalCoreEntityContentEntityBase Two namespaces: one for config, one for content.
  • 44. Retrieving Configuration Objects Drupal::config($name) Where $name is the configuration object (filename of the YAML file, without the .yml extension). Example: $site_name = Drupal::config('system.site') ->get('name');
  • 45. Modifying Configuration Objects Drupal::config('system.site') ->set('name', 'Drupal 8 test') ->save(); The active store is immediately modified. The staging store is not used.
  • 46. Drush 7.x Integration config-list (cli) List config names by prefix. config-export (cex) Export config from the active store. config-import (cim) Import config from a config dir. config-get (cget) Display a config value, or a whole configuration object. config-set (cset) Set a config value directly in the active configuration.
  • 47. Configuration EVERYTHING? variable_xxx() is dead! How is the time of the last cron run saved? State API to the rescue! Environment specific settings Separation of configuration, state and content Content staging not implemented yet
  • 48. Settings overrides Configuration can be locally overridden CSS & JS aggregation TWIG debugging settings.local.php $config['system.performance']['css'] ['preprocess'] = FALSE;
  • 49. CSV workflow PRODUCTION Clone site don’t touch config Pull from git Import configuration DEVELOPMENT Insall clone Configure Export configuration into staging Commit&push to git
  • 50. More… Jam’s virtual drupal camp featuring Rob Bayliss https://www.youtube.com/watch?v=St9s7DqFR7o
  • 51. Thank you for your attention