SlideShare a Scribd company logo
1 of 28
Download to read offline
A Generic Approach for Deploying and Upgrading
Mutable Software Components
Sander van der Burg
Delft University of Technology, EEMCS,
Department of Software Technology
June 3, 2012
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
Software deployment
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
Software deployment
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
Challenges
Systems are becoming bigger, more distributed and
more complicated
Deployment takes a lot of effort and time
Difficult to reproduce a configuration elsewhere
Upgrading may break a system and may introduce
significant downtimes
Therefore, automation is needed
The Nix project
The Nix project is our solution to deployment complexity:
Goal is to provide fully automated, reliable, reproducible
deployment
All tools are built around the Nix package manager
Nix borrows concepts from purely functional languages, such
as Haskell
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
The Nix project
Nix offers various advantages compared to conventional
deployment tools:
Ensures dependency completeness
Ability to store multiple variants in isolation next to each other
Strong guarantees of reproducibility
Atomic upgrades and rollbacks
Garbage collector capable of safely removing components no
longer in use
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
The Nix project
Several tools extend Nix to a broader domain:
Disnix, a Nix-based deployment tool for service-oriented
systems
NixOS, a Nix-based Linux distribution, managing complete
system configurations
Hydra, a Nix-based continuous build and integration server
Charon, a NixOS-based cloud deployment tool
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
Storing Nix packages
/nix/store/324pq1...-firefox-9.0.1
First part: 324pq1... is a hash code derived from all build-time
dependencies:
Libraries, build-scripts, source files, system architecture etc.
A different build-time dependency yields a different hash code
Components can be stored safely next to other variants
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
Nix expressions
rec {
stdenv = ...
fetchurl = ...
gtk = stdenv.mkDerivation {
name = "gtk-2.24.1"; ...
};
firefox = stdenv.mkDerivation {
name = "firefox-9.0.1";
src = fetchurl {
url = http://../firefox-9.0.1-source.tar.bz2;
md5 = "195f6406b980dce9d60449b0074cdf92";
};
buildInputs = [ gtk ... ];
buildCommand = ’’
tar xfvj $src
cd firefox-*
./configure
make
make install
’’;
};
...
}
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
Building Nix packages
While building a package, many side-effects are removed:
Environment variables are cleared and explicitly set, e.g. PATH.
Various build tools are patched, e.g. gcc, ld to ignore global
directories, such as /usr/lib
Optionally, builds are executed in a chroot() environment.
Build results are made immutable by making the contents
read-only.
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
No side-effects
A hash-code always identifies the same component, regardless on
what machine it has been built:
We can download a component with the same hash elsewhere,
instead of building it ourselves
We can reproduce entire configurations on a different machine
in the network
We can perform efficient upgrades. The Nix store is the cache
for derivation function invocations
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
Disnix: Nix-based deployment for service-oriented systems
$ disnix-env -s services.nix -i infrastructure.nix -d
distribution.nix
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
Disnix deployment process
From the three Disnix models, a distributed deployment process is
derived:
Build phase. All services are built from source code using the
Nix package manager.
Transfer phase. All services and their dependencies are
transferred to the target machines.
Activation phase. Obsolete services are deactivated and new
services are activated (end-user access may be blocked).
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
Mutable components
Nix and Nix applications can automatically reliably deploy
static (immutable) parts of software systems
What to do with mutable components, such as databases?
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
Mutable components
Mutable components have different properties:
They have to change, so they must be writable
Hosted inside a container: DBMS server, application server
State is stored in an implementation/architecture specific
format, which is not portable
State files may contain locks and can be temporarily
inconsistent
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
Mutable components
Containers provide tools capable of consistently capturing state in
a portable format:
$ mysqldump --single-transaction mydatabase
Physical state. The actual state stored on disk.
Logical representation. Dump of state generation in a
consistent portable format.
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
Supporting deployment of mutable components
How can we deploy mutable software components with in
conjunction with Disnix and other Nix related tools?
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
Dysnomia
Dysnomia: A prototype tool supporting automated, reliable,
reproducible deployment for mutable components
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
Managing mutable components
Provide an interface to each mutable component:
activate. Activate mutable component in container
deactivate. Deactivate mutable component in container
snapshot. Snapshot current physical state into a portable
format
incremental-snapshot. Create an incremental snapshot in
a portable format
restore. Bring the mutable component in a specific state, by
restoring a snapshot
Semantics differ among component types.
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
Identifying mutable components
We have to uniquely identify mutable component state generations:
/dysnomia/svn/default/disnix/34124
Component type: svn (Subversion repository)
Container identifier: default
Component name: disnix
Sequence number: 34124 (derived from Subversion revision
number)
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
Extending Disnix: Basic method
Build phase. All services are built from source code using the
Nix package manager.
Transfer phase. All services and their dependencies are
transferred to the target machines.
Activation phase. Obsolete services are deactivated and new
services are activated (end-user access may be blocked).
Deactivate obsolete mutable components and activate
mutable components + state transfer (end-user access may be
blocked)
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
Extending Disnix: Optimised method
From the three Disnix models, a distributed deployment process is
derived:
Build phase. All services are built from source code using the
Nix package manager.
Transfer phase. All services and their dependencies are
transferred to the target machines.
State transfer (access NOT blocked)
Activation phase. Obsolete services are deactivated and new
services are activated (end-user access may be blocked).
Deactivate obsolete mutable components and activate
mutable components + incremental state transfer (end-user
access may be blocked)
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
Results
We have deployed and upgrades various types of systems in various
environments:
Industrial case study: SDS2
Staff-Tracker toy systems (http://nixos.org/disnix)
Open-source: ViewVC (http://viewvc.tigris.org)
All deployment actions yield the same result including the state of
mutable components.
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
Results
Various types of mutable components are supported:
MySQL databases
PostgreSQL databases
Subversion repositories
Ejabberd databases
Web applications
Processes
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
Conclusion
Is the world a better place now?
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
Limitations
Unfortunately... No. The costs may be high:
File system is used as a common denominator.
Snapshotting large data sets may take a lot of time
A DMBS has more efficient replication features.
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
Related work
Most conventional tools, deploy mutable components
imperatively and in an ad-hoc manner.
A different approach with Nix has been done, using Ext3COW
Is more efficient, but only captures physical state
Cannot address mutable components individually
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
References
Disnix (and other related Nix tooling) is available under Free and
Open Source licenses:
Disnix homepage: http://nixos.org/disnix
Other Nix related software: http://nixos.org
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
Discussion & Questions
Some discussion questions:
How to ”safely” upgrade components which are large in size?
How can we efficiently capture generations of component
states and how can we uniquely identify them?
Can we upgrade state safely in a generic manner, without
blocking external access?
How can we efficiently transfer state generations to other
machines in a generic manner?
Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa

More Related Content

What's hot

QTube Global Media Workflow
QTube Global Media WorkflowQTube Global Media Workflow
QTube Global Media Workflow
Quantel
 
Windows Server Virtualization - Hyper-V 2008 R2
Windows Server Virtualization - Hyper-V 2008 R2Windows Server Virtualization - Hyper-V 2008 R2
Windows Server Virtualization - Hyper-V 2008 R2
aralves
 

What's hot (20)

Hydra: Continuous Integration and Testing for Demanding People: The Details
Hydra: Continuous Integration and Testing for Demanding People: The DetailsHydra: Continuous Integration and Testing for Demanding People: The Details
Hydra: Continuous Integration and Testing for Demanding People: The Details
 
Hydra: Continuous Integration and Testing for Demanding People: The Basics
Hydra: Continuous Integration and Testing for Demanding People: The BasicsHydra: Continuous Integration and Testing for Demanding People: The Basics
Hydra: Continuous Integration and Testing for Demanding People: The Basics
 
prodops.io k8s presentation
prodops.io k8s presentationprodops.io k8s presentation
prodops.io k8s presentation
 
Hadoop Summit 2012 | HDFS High Availability
Hadoop Summit 2012 | HDFS High AvailabilityHadoop Summit 2012 | HDFS High Availability
Hadoop Summit 2012 | HDFS High Availability
 
The NixOS project and deploying systems declaratively
The NixOS project and deploying systems declarativelyThe NixOS project and deploying systems declaratively
The NixOS project and deploying systems declaratively
 
Linaro Connect 2016 (BKK16) - Introduction to LISA
Linaro Connect 2016 (BKK16) - Introduction to LISALinaro Connect 2016 (BKK16) - Introduction to LISA
Linaro Connect 2016 (BKK16) - Introduction to LISA
 
Considerations when implementing_ha_in_dmf
Considerations when implementing_ha_in_dmfConsiderations when implementing_ha_in_dmf
Considerations when implementing_ha_in_dmf
 
Overview of Linux real-time challenges
Overview of Linux real-time challengesOverview of Linux real-time challenges
Overview of Linux real-time challenges
 
Rt linux-lab1
Rt linux-lab1Rt linux-lab1
Rt linux-lab1
 
XPDS16: XSM-Flask, current limitations and Ongoing work. - Anshul Makkar, Ct...
XPDS16:  XSM-Flask, current limitations and Ongoing work. - Anshul Makkar, Ct...XPDS16:  XSM-Flask, current limitations and Ongoing work. - Anshul Makkar, Ct...
XPDS16: XSM-Flask, current limitations and Ongoing work. - Anshul Makkar, Ct...
 
Solving Real-Time Scheduling Problems With RT_PREEMPT and Deadline-Based Sche...
Solving Real-Time Scheduling Problems With RT_PREEMPT and Deadline-Based Sche...Solving Real-Time Scheduling Problems With RT_PREEMPT and Deadline-Based Sche...
Solving Real-Time Scheduling Problems With RT_PREEMPT and Deadline-Based Sche...
 
QTube Global Media Workflow
QTube Global Media WorkflowQTube Global Media Workflow
QTube Global Media Workflow
 
Real time Linux
Real time LinuxReal time Linux
Real time Linux
 
RT linux
RT linuxRT linux
RT linux
 
Purnima
PurnimaPurnima
Purnima
 
Rtos 2
Rtos 2Rtos 2
Rtos 2
 
Devops (start walking in the same direction) by ops
Devops (start walking in the same direction) by opsDevops (start walking in the same direction) by ops
Devops (start walking in the same direction) by ops
 
The Nix project
The Nix projectThe Nix project
The Nix project
 
Windows Server Virtualization - Hyper-V 2008 R2
Windows Server Virtualization - Hyper-V 2008 R2Windows Server Virtualization - Hyper-V 2008 R2
Windows Server Virtualization - Hyper-V 2008 R2
 
Reliability and Resilience Patterns
Reliability and Resilience PatternsReliability and Resilience Patterns
Reliability and Resilience Patterns
 

Similar to A Generic Approach for Deploying and Upgrading Mutable Software Components

Nagesh-Devops
Nagesh-DevopsNagesh-Devops
Nagesh-Devops
nagesh v
 

Similar to A Generic Approach for Deploying and Upgrading Mutable Software Components (20)

A Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software DeploymentA Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software Deployment
 
Dysnomia: complementing Nix deployments with state deployment
Dysnomia: complementing Nix deployments with state deploymentDysnomia: complementing Nix deployments with state deployment
Dysnomia: complementing Nix deployments with state deployment
 
Automated Deployment of Hetergeneous Service-Oriented System
Automated Deployment of Hetergeneous Service-Oriented SystemAutomated Deployment of Hetergeneous Service-Oriented System
Automated Deployment of Hetergeneous Service-Oriented System
 
Deploying .NET applications with the Nix package manager
Deploying .NET applications with the Nix package managerDeploying .NET applications with the Nix package manager
Deploying .NET applications with the Nix package manager
 
Techniques and lessons for improvement of deployment processes
Techniques and lessons for improvement of deployment processesTechniques and lessons for improvement of deployment processes
Techniques and lessons for improvement of deployment processes
 
Deploying (micro)services with Disnix
Deploying (micro)services with DisnixDeploying (micro)services with Disnix
Deploying (micro)services with Disnix
 
The world of Docker and Kubernetes
The world of Docker and Kubernetes The world of Docker and Kubernetes
The world of Docker and Kubernetes
 
Intro to Cloud Native _ v1.0en (2021/01)
Intro to Cloud Native _ v1.0en (2021/01)Intro to Cloud Native _ v1.0en (2021/01)
Intro to Cloud Native _ v1.0en (2021/01)
 
Developer Experience Cloud Native - Become Efficient and Achieve Parity
Developer Experience Cloud Native - Become Efficient and Achieve ParityDeveloper Experience Cloud Native - Become Efficient and Achieve Parity
Developer Experience Cloud Native - Become Efficient and Achieve Parity
 
Nagesh-Devops
Nagesh-DevopsNagesh-Devops
Nagesh-Devops
 
Here Be Dragons: Security Maps of the Container New World
Here Be Dragons: Security Maps of the Container New WorldHere Be Dragons: Security Maps of the Container New World
Here Be Dragons: Security Maps of the Container New World
 
Class.mobilefirstfoundation.chapter.2.devops
Class.mobilefirstfoundation.chapter.2.devopsClass.mobilefirstfoundation.chapter.2.devops
Class.mobilefirstfoundation.chapter.2.devops
 
DevOps: Cooking Drupal Deployment
DevOps: Cooking Drupal DeploymentDevOps: Cooking Drupal Deployment
DevOps: Cooking Drupal Deployment
 
Dataverse in the European Open Science Cloud
Dataverse in the European Open Science CloudDataverse in the European Open Science Cloud
Dataverse in the European Open Science Cloud
 
Pull, don’t push: Architectures for monitoring and configuration in a microse...
Pull, don’t push: Architectures for monitoring and configuration in a microse...Pull, don’t push: Architectures for monitoring and configuration in a microse...
Pull, don’t push: Architectures for monitoring and configuration in a microse...
 
Pull, Don't Push! Sensu Summit 2018 Talk
Pull, Don't Push! Sensu Summit 2018 TalkPull, Don't Push! Sensu Summit 2018 Talk
Pull, Don't Push! Sensu Summit 2018 Talk
 
DevOps e a transformação digital de aplicações
DevOps e a transformação digital de aplicaçõesDevOps e a transformação digital de aplicações
DevOps e a transformação digital de aplicações
 
CI/CD Pipeline with Docker
CI/CD Pipeline with DockerCI/CD Pipeline with Docker
CI/CD Pipeline with Docker
 
Q Con New York 2015 Presentation - Conjur
Q Con New York 2015 Presentation - ConjurQ Con New York 2015 Presentation - Conjur
Q Con New York 2015 Presentation - Conjur
 
NodeJS guide for beginners
NodeJS guide for beginnersNodeJS guide for beginners
NodeJS guide for beginners
 

More from Sander van der Burg

More from Sander van der Burg (17)

The Monitoring Playground
The Monitoring PlaygroundThe Monitoring Playground
The Monitoring Playground
 
nix-processmgmt: An experimental Nix-based process manager-agnostic framework
nix-processmgmt: An experimental Nix-based process manager-agnostic frameworknix-processmgmt: An experimental Nix-based process manager-agnostic framework
nix-processmgmt: An experimental Nix-based process manager-agnostic framework
 
Using Nix and Docker as automated deployment solutions
Using Nix and Docker as automated deployment solutionsUsing Nix and Docker as automated deployment solutions
Using Nix and Docker as automated deployment solutions
 
Automating Mendix application deployments with Nix
Automating Mendix application deployments with NixAutomating Mendix application deployments with Nix
Automating Mendix application deployments with Nix
 
Deploying NPM packages with the Nix package manager
Deploying NPM packages with the Nix package managerDeploying NPM packages with the Nix package manager
Deploying NPM packages with the Nix package manager
 
The Nix project
The Nix projectThe Nix project
The Nix project
 
A Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software DeploymentA Reference Architecture for Distributed Software Deployment
A Reference Architecture for Distributed Software Deployment
 
Deploying .NET services with Disnix
Deploying .NET services with DisnixDeploying .NET services with Disnix
Deploying .NET services with Disnix
 
A Self-Adaptive Deployment Framework for Service-Oriented Systems
A Self-Adaptive Deployment Framework for Service-Oriented SystemsA Self-Adaptive Deployment Framework for Service-Oriented Systems
A Self-Adaptive Deployment Framework for Service-Oriented Systems
 
Using NixOS for declarative deployment and testing
Using NixOS for declarative deployment and testingUsing NixOS for declarative deployment and testing
Using NixOS for declarative deployment and testing
 
Pull Deployment of Services
Pull Deployment of ServicesPull Deployment of Services
Pull Deployment of Services
 
Disnix: A toolset for distributed deployment
Disnix: A toolset for distributed deploymentDisnix: A toolset for distributed deployment
Disnix: A toolset for distributed deployment
 
Pull Deployment of Services: Introduction, Progress and Challenges
Pull Deployment of Services: Introduction, Progress and ChallengesPull Deployment of Services: Introduction, Progress and Challenges
Pull Deployment of Services: Introduction, Progress and Challenges
 
Software Deployment in a Dynamic Cloud
Software Deployment in a Dynamic CloudSoftware Deployment in a Dynamic Cloud
Software Deployment in a Dynamic Cloud
 
Atomic Upgrading of Distributed Systems
Atomic Upgrading of Distributed SystemsAtomic Upgrading of Distributed Systems
Atomic Upgrading of Distributed Systems
 
Model-driven Distributed Software Deployment
Model-driven Distributed Software DeploymentModel-driven Distributed Software Deployment
Model-driven Distributed Software Deployment
 
Model-driven Distributed Software Deployment laymen's talk
Model-driven Distributed Software Deployment laymen's talkModel-driven Distributed Software Deployment laymen's talk
Model-driven Distributed Software Deployment laymen's talk
 

Recently uploaded

Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdfPests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
PirithiRaju
 
DIFFERENCE IN BACK CROSS AND TEST CROSS
DIFFERENCE IN  BACK CROSS AND TEST CROSSDIFFERENCE IN  BACK CROSS AND TEST CROSS
DIFFERENCE IN BACK CROSS AND TEST CROSS
LeenakshiTyagi
 
Hubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroidsHubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroids
Sérgio Sacani
 
Formation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksFormation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disks
Sérgio Sacani
 
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service 🪡
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service  🪡CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service  🪡
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service 🪡
anilsa9823
 
Pests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdf
PirithiRaju
 
Presentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptxPresentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptx
gindu3009
 

Recently uploaded (20)

Unlocking the Potential: Deep dive into ocean of Ceramic Magnets.pptx
Unlocking  the Potential: Deep dive into ocean of Ceramic Magnets.pptxUnlocking  the Potential: Deep dive into ocean of Ceramic Magnets.pptx
Unlocking the Potential: Deep dive into ocean of Ceramic Magnets.pptx
 
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdfPests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
Pests of cotton_Borer_Pests_Binomics_Dr.UPR.pdf
 
Biological Classification BioHack (3).pdf
Biological Classification BioHack (3).pdfBiological Classification BioHack (3).pdf
Biological Classification BioHack (3).pdf
 
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 60009654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000
 
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
❤Jammu Kashmir Call Girls 8617697112 Personal Whatsapp Number 💦✅.
 
Pulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceuticsPulmonary drug delivery system M.pharm -2nd sem P'ceutics
Pulmonary drug delivery system M.pharm -2nd sem P'ceutics
 
DIFFERENCE IN BACK CROSS AND TEST CROSS
DIFFERENCE IN  BACK CROSS AND TEST CROSSDIFFERENCE IN  BACK CROSS AND TEST CROSS
DIFFERENCE IN BACK CROSS AND TEST CROSS
 
Hubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroidsHubble Asteroid Hunter III. Physical properties of newly found asteroids
Hubble Asteroid Hunter III. Physical properties of newly found asteroids
 
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls Agency
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls AgencyHire 💕 9907093804 Hooghly Call Girls Service Call Girls Agency
Hire 💕 9907093804 Hooghly Call Girls Service Call Girls Agency
 
GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)GBSN - Microbiology (Unit 1)
GBSN - Microbiology (Unit 1)
 
Formation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disksFormation of low mass protostars and their circumstellar disks
Formation of low mass protostars and their circumstellar disks
 
fundamental of entomology all in one topics of entomology
fundamental of entomology all in one topics of entomologyfundamental of entomology all in one topics of entomology
fundamental of entomology all in one topics of entomology
 
CELL -Structural and Functional unit of life.pdf
CELL -Structural and Functional unit of life.pdfCELL -Structural and Functional unit of life.pdf
CELL -Structural and Functional unit of life.pdf
 
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43bNightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
Nightside clouds and disequilibrium chemistry on the hot Jupiter WASP-43b
 
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service 🪡
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service  🪡CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service  🪡
CALL ON ➥8923113531 🔝Call Girls Kesar Bagh Lucknow best Night Fun service 🪡
 
Pests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdf
 
Green chemistry and Sustainable development.pptx
Green chemistry  and Sustainable development.pptxGreen chemistry  and Sustainable development.pptx
Green chemistry and Sustainable development.pptx
 
Presentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptxPresentation Vikram Lander by Vedansh Gupta.pptx
Presentation Vikram Lander by Vedansh Gupta.pptx
 
Recombinant DNA technology (Immunological screening)
Recombinant DNA technology (Immunological screening)Recombinant DNA technology (Immunological screening)
Recombinant DNA technology (Immunological screening)
 
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...
TEST BANK For Radiologic Science for Technologists, 12th Edition by Stewart C...
 

A Generic Approach for Deploying and Upgrading Mutable Software Components

  • 1. A Generic Approach for Deploying and Upgrading Mutable Software Components Sander van der Burg Delft University of Technology, EEMCS, Department of Software Technology June 3, 2012 Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
  • 2. Software deployment Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
  • 3. Software deployment Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa Challenges Systems are becoming bigger, more distributed and more complicated Deployment takes a lot of effort and time Difficult to reproduce a configuration elsewhere Upgrading may break a system and may introduce significant downtimes Therefore, automation is needed
  • 4. The Nix project The Nix project is our solution to deployment complexity: Goal is to provide fully automated, reliable, reproducible deployment All tools are built around the Nix package manager Nix borrows concepts from purely functional languages, such as Haskell Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
  • 5. The Nix project Nix offers various advantages compared to conventional deployment tools: Ensures dependency completeness Ability to store multiple variants in isolation next to each other Strong guarantees of reproducibility Atomic upgrades and rollbacks Garbage collector capable of safely removing components no longer in use Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
  • 6. The Nix project Several tools extend Nix to a broader domain: Disnix, a Nix-based deployment tool for service-oriented systems NixOS, a Nix-based Linux distribution, managing complete system configurations Hydra, a Nix-based continuous build and integration server Charon, a NixOS-based cloud deployment tool Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
  • 7. Storing Nix packages /nix/store/324pq1...-firefox-9.0.1 First part: 324pq1... is a hash code derived from all build-time dependencies: Libraries, build-scripts, source files, system architecture etc. A different build-time dependency yields a different hash code Components can be stored safely next to other variants Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
  • 8. Nix expressions rec { stdenv = ... fetchurl = ... gtk = stdenv.mkDerivation { name = "gtk-2.24.1"; ... }; firefox = stdenv.mkDerivation { name = "firefox-9.0.1"; src = fetchurl { url = http://../firefox-9.0.1-source.tar.bz2; md5 = "195f6406b980dce9d60449b0074cdf92"; }; buildInputs = [ gtk ... ]; buildCommand = ’’ tar xfvj $src cd firefox-* ./configure make make install ’’; }; ... } Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
  • 9. Building Nix packages While building a package, many side-effects are removed: Environment variables are cleared and explicitly set, e.g. PATH. Various build tools are patched, e.g. gcc, ld to ignore global directories, such as /usr/lib Optionally, builds are executed in a chroot() environment. Build results are made immutable by making the contents read-only. Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
  • 10. No side-effects A hash-code always identifies the same component, regardless on what machine it has been built: We can download a component with the same hash elsewhere, instead of building it ourselves We can reproduce entire configurations on a different machine in the network We can perform efficient upgrades. The Nix store is the cache for derivation function invocations Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
  • 11. Disnix: Nix-based deployment for service-oriented systems $ disnix-env -s services.nix -i infrastructure.nix -d distribution.nix Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
  • 12. Disnix deployment process From the three Disnix models, a distributed deployment process is derived: Build phase. All services are built from source code using the Nix package manager. Transfer phase. All services and their dependencies are transferred to the target machines. Activation phase. Obsolete services are deactivated and new services are activated (end-user access may be blocked). Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
  • 13. Mutable components Nix and Nix applications can automatically reliably deploy static (immutable) parts of software systems What to do with mutable components, such as databases? Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
  • 14. Mutable components Mutable components have different properties: They have to change, so they must be writable Hosted inside a container: DBMS server, application server State is stored in an implementation/architecture specific format, which is not portable State files may contain locks and can be temporarily inconsistent Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
  • 15. Mutable components Containers provide tools capable of consistently capturing state in a portable format: $ mysqldump --single-transaction mydatabase Physical state. The actual state stored on disk. Logical representation. Dump of state generation in a consistent portable format. Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
  • 16. Supporting deployment of mutable components How can we deploy mutable software components with in conjunction with Disnix and other Nix related tools? Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
  • 17. Dysnomia Dysnomia: A prototype tool supporting automated, reliable, reproducible deployment for mutable components Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
  • 18. Managing mutable components Provide an interface to each mutable component: activate. Activate mutable component in container deactivate. Deactivate mutable component in container snapshot. Snapshot current physical state into a portable format incremental-snapshot. Create an incremental snapshot in a portable format restore. Bring the mutable component in a specific state, by restoring a snapshot Semantics differ among component types. Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
  • 19. Identifying mutable components We have to uniquely identify mutable component state generations: /dysnomia/svn/default/disnix/34124 Component type: svn (Subversion repository) Container identifier: default Component name: disnix Sequence number: 34124 (derived from Subversion revision number) Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
  • 20. Extending Disnix: Basic method Build phase. All services are built from source code using the Nix package manager. Transfer phase. All services and their dependencies are transferred to the target machines. Activation phase. Obsolete services are deactivated and new services are activated (end-user access may be blocked). Deactivate obsolete mutable components and activate mutable components + state transfer (end-user access may be blocked) Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
  • 21. Extending Disnix: Optimised method From the three Disnix models, a distributed deployment process is derived: Build phase. All services are built from source code using the Nix package manager. Transfer phase. All services and their dependencies are transferred to the target machines. State transfer (access NOT blocked) Activation phase. Obsolete services are deactivated and new services are activated (end-user access may be blocked). Deactivate obsolete mutable components and activate mutable components + incremental state transfer (end-user access may be blocked) Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
  • 22. Results We have deployed and upgrades various types of systems in various environments: Industrial case study: SDS2 Staff-Tracker toy systems (http://nixos.org/disnix) Open-source: ViewVC (http://viewvc.tigris.org) All deployment actions yield the same result including the state of mutable components. Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
  • 23. Results Various types of mutable components are supported: MySQL databases PostgreSQL databases Subversion repositories Ejabberd databases Web applications Processes Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
  • 24. Conclusion Is the world a better place now? Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
  • 25. Limitations Unfortunately... No. The costs may be high: File system is used as a common denominator. Snapshotting large data sets may take a lot of time A DMBS has more efficient replication features. Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
  • 26. Related work Most conventional tools, deploy mutable components imperatively and in an ad-hoc manner. A different approach with Nix has been done, using Ext3COW Is more efficient, but only captures physical state Cannot address mutable components individually Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
  • 27. References Disnix (and other related Nix tooling) is available under Free and Open Source licenses: Disnix homepage: http://nixos.org/disnix Other Nix related software: http://nixos.org Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa
  • 28. Discussion & Questions Some discussion questions: How to ”safely” upgrade components which are large in size? How can we efficiently capture generations of component states and how can we uniquely identify them? Can we upgrade state safely in a generic manner, without blocking external access? How can we efficiently transfer state generations to other machines in a generic manner? Sander van der Burg A Generic Approach for Deploying and Upgrading Mutable Softwa