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

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 DetailsSander van der Burg
 
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 BasicsSander van der Burg
 
prodops.io k8s presentation
prodops.io k8s presentationprodops.io k8s presentation
prodops.io k8s presentationProdops.io
 
Hadoop Summit 2012 | HDFS High Availability
Hadoop Summit 2012 | HDFS High AvailabilityHadoop Summit 2012 | HDFS High Availability
Hadoop Summit 2012 | HDFS High AvailabilityCloudera, Inc.
 
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 declarativelySander van der Burg
 
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 LISAPatrick Bellasi
 
Considerations when implementing_ha_in_dmf
Considerations when implementing_ha_in_dmfConsiderations when implementing_ha_in_dmf
Considerations when implementing_ha_in_dmfhik_lhz
 
Overview of Linux real-time challenges
Overview of Linux real-time challengesOverview of Linux real-time challenges
Overview of Linux real-time challengesDaniel Stenberg
 
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...The Linux Foundation
 
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...peknap
 
QTube Global Media Workflow
QTube Global Media WorkflowQTube Global Media Workflow
QTube Global Media WorkflowQuantel
 
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 opsDemis Rizzotto
 
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 R2aralves
 
Reliability and Resilience Patterns
Reliability and Resilience PatternsReliability and Resilience Patterns
Reliability and Resilience PatternsDmitry Chornyi
 

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

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 DeploymentSander van der Burg
 
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 deploymentSander van der Burg
 
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 SystemSander van der Burg
 
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 managerSander van der Burg
 
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 processesSander van der Burg
 
Deploying (micro)services with Disnix
Deploying (micro)services with DisnixDeploying (micro)services with Disnix
Deploying (micro)services with DisnixSander van der Burg
 
The world of Docker and Kubernetes
The world of Docker and Kubernetes The world of Docker and Kubernetes
The world of Docker and Kubernetes vty
 
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)Young Suk Ahn Park
 
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 ParityMichael Hofmann
 
Nagesh-Devops
Nagesh-DevopsNagesh-Devops
Nagesh-Devopsnagesh v
 
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 WorldC4Media
 
Class.mobilefirstfoundation.chapter.2.devops
Class.mobilefirstfoundation.chapter.2.devopsClass.mobilefirstfoundation.chapter.2.devops
Class.mobilefirstfoundation.chapter.2.devopsRoss Tang
 
DevOps: Cooking Drupal Deployment
DevOps: Cooking Drupal DeploymentDevOps: Cooking Drupal Deployment
DevOps: Cooking Drupal DeploymentGerald Villorente
 
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 Cloudvty
 
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 TalkJulian Dunn
 
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...Sensu Inc.
 
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çõesRamon Durães
 
CI/CD Pipeline with Docker
CI/CD Pipeline with DockerCI/CD Pipeline with Docker
CI/CD Pipeline with Dockerkushalsingh007
 
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 - Conjurconjur_inc
 
NodeJS guide for beginners
NodeJS guide for beginnersNodeJS guide for beginners
NodeJS guide for beginnersEnoch Joshua
 

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! 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
 
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...
 
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

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 frameworkSander van der Burg
 
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 solutionsSander van der Burg
 
Automating Mendix application deployments with Nix
Automating Mendix application deployments with NixAutomating Mendix application deployments with Nix
Automating Mendix application deployments with NixSander van der Burg
 
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 managerSander van der Burg
 
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 DeploymentSander van der Burg
 
Deploying .NET services with Disnix
Deploying .NET services with DisnixDeploying .NET services with Disnix
Deploying .NET services with DisnixSander van der Burg
 
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 SystemsSander van der Burg
 
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 testingSander van der Burg
 
Disnix: A toolset for distributed deployment
Disnix: A toolset for distributed deploymentDisnix: A toolset for distributed deployment
Disnix: A toolset for distributed deploymentSander van der Burg
 
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 ChallengesSander van der Burg
 
Software Deployment in a Dynamic Cloud
Software Deployment in a Dynamic CloudSoftware Deployment in a Dynamic Cloud
Software Deployment in a Dynamic CloudSander van der Burg
 
Atomic Upgrading of Distributed Systems
Atomic Upgrading of Distributed SystemsAtomic Upgrading of Distributed Systems
Atomic Upgrading of Distributed SystemsSander van der Burg
 
Model-driven Distributed Software Deployment
Model-driven Distributed Software DeploymentModel-driven Distributed Software Deployment
Model-driven Distributed Software DeploymentSander van der Burg
 
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 talkSander 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

GenAI talk for Young at Wageningen University & Research (WUR) March 2024
GenAI talk for Young at Wageningen University & Research (WUR) March 2024GenAI talk for Young at Wageningen University & Research (WUR) March 2024
GenAI talk for Young at Wageningen University & Research (WUR) March 2024Jene van der Heide
 
Observational constraints on mergers creating magnetism in massive stars
Observational constraints on mergers creating magnetism in massive starsObservational constraints on mergers creating magnetism in massive stars
Observational constraints on mergers creating magnetism in massive starsSérgio Sacani
 
The Sensory Organs, Anatomy and Function
The Sensory Organs, Anatomy and FunctionThe Sensory Organs, Anatomy and Function
The Sensory Organs, Anatomy and FunctionJadeNovelo1
 
GENERAL PHYSICS 2 REFRACTION OF LIGHT SENIOR HIGH SCHOOL GENPHYS2.pptx
GENERAL PHYSICS 2 REFRACTION OF LIGHT SENIOR HIGH SCHOOL GENPHYS2.pptxGENERAL PHYSICS 2 REFRACTION OF LIGHT SENIOR HIGH SCHOOL GENPHYS2.pptx
GENERAL PHYSICS 2 REFRACTION OF LIGHT SENIOR HIGH SCHOOL GENPHYS2.pptxRitchAndruAgustin
 
CHROMATOGRAPHY PALLAVI RAWAT.pptx
CHROMATOGRAPHY  PALLAVI RAWAT.pptxCHROMATOGRAPHY  PALLAVI RAWAT.pptx
CHROMATOGRAPHY PALLAVI RAWAT.pptxpallavirawat456
 
Measures of Central Tendency.pptx for UG
Measures of Central Tendency.pptx for UGMeasures of Central Tendency.pptx for UG
Measures of Central Tendency.pptx for UGSoniaBajaj10
 
Total Legal: A “Joint” Journey into the Chemistry of Cannabinoids
Total Legal: A “Joint” Journey into the Chemistry of CannabinoidsTotal Legal: A “Joint” Journey into the Chemistry of Cannabinoids
Total Legal: A “Joint” Journey into the Chemistry of CannabinoidsMarkus Roggen
 
Science (Communication) and Wikipedia - Potentials and Pitfalls
Science (Communication) and Wikipedia - Potentials and PitfallsScience (Communication) and Wikipedia - Potentials and Pitfalls
Science (Communication) and Wikipedia - Potentials and PitfallsDobusch Leonhard
 
cybrids.pptx production_advanges_limitation
cybrids.pptx production_advanges_limitationcybrids.pptx production_advanges_limitation
cybrids.pptx production_advanges_limitationSanghamitraMohapatra5
 
Observation of Gravitational Waves from the Coalescence of a 2.5–4.5 M⊙ Compa...
Observation of Gravitational Waves from the Coalescence of a 2.5–4.5 M⊙ Compa...Observation of Gravitational Waves from the Coalescence of a 2.5–4.5 M⊙ Compa...
Observation of Gravitational Waves from the Coalescence of a 2.5–4.5 M⊙ Compa...Sérgio Sacani
 
KDIGO-2023-CKD-Guideline-Public-Review-Draft_5-July-2023.pdf
KDIGO-2023-CKD-Guideline-Public-Review-Draft_5-July-2023.pdfKDIGO-2023-CKD-Guideline-Public-Review-Draft_5-July-2023.pdf
KDIGO-2023-CKD-Guideline-Public-Review-Draft_5-July-2023.pdfGABYFIORELAMALPARTID1
 
linear Regression, multiple Regression and Annova
linear Regression, multiple Regression and Annovalinear Regression, multiple Regression and Annova
linear Regression, multiple Regression and AnnovaMansi Rastogi
 
Loudspeaker- direct radiating type and horn type.pptx
Loudspeaker- direct radiating type and horn type.pptxLoudspeaker- direct radiating type and horn type.pptx
Loudspeaker- direct radiating type and horn type.pptxpriyankatabhane
 
Environmental Acoustics- Speech interference level, acoustics calibrator.pptx
Environmental Acoustics- Speech interference level, acoustics calibrator.pptxEnvironmental Acoustics- Speech interference level, acoustics calibrator.pptx
Environmental Acoustics- Speech interference level, acoustics calibrator.pptxpriyankatabhane
 
Timeless Cosmology: Towards a Geometric Origin of Cosmological Correlations
Timeless Cosmology: Towards a Geometric Origin of Cosmological CorrelationsTimeless Cosmology: Towards a Geometric Origin of Cosmological Correlations
Timeless Cosmology: Towards a Geometric Origin of Cosmological CorrelationsDanielBaumann11
 
ESSENTIAL FEATURES REQUIRED FOR ESTABLISHING FOUR TYPES OF BIOSAFETY LABORATO...
ESSENTIAL FEATURES REQUIRED FOR ESTABLISHING FOUR TYPES OF BIOSAFETY LABORATO...ESSENTIAL FEATURES REQUIRED FOR ESTABLISHING FOUR TYPES OF BIOSAFETY LABORATO...
ESSENTIAL FEATURES REQUIRED FOR ESTABLISHING FOUR TYPES OF BIOSAFETY LABORATO...Chayanika Das
 

Recently uploaded (20)

GenAI talk for Young at Wageningen University & Research (WUR) March 2024
GenAI talk for Young at Wageningen University & Research (WUR) March 2024GenAI talk for Young at Wageningen University & Research (WUR) March 2024
GenAI talk for Young at Wageningen University & Research (WUR) March 2024
 
Observational constraints on mergers creating magnetism in massive stars
Observational constraints on mergers creating magnetism in massive starsObservational constraints on mergers creating magnetism in massive stars
Observational constraints on mergers creating magnetism in massive stars
 
Let’s Say Someone Did Drop the Bomb. Then What?
Let’s Say Someone Did Drop the Bomb. Then What?Let’s Say Someone Did Drop the Bomb. Then What?
Let’s Say Someone Did Drop the Bomb. Then What?
 
The Sensory Organs, Anatomy and Function
The Sensory Organs, Anatomy and FunctionThe Sensory Organs, Anatomy and Function
The Sensory Organs, Anatomy and Function
 
GENERAL PHYSICS 2 REFRACTION OF LIGHT SENIOR HIGH SCHOOL GENPHYS2.pptx
GENERAL PHYSICS 2 REFRACTION OF LIGHT SENIOR HIGH SCHOOL GENPHYS2.pptxGENERAL PHYSICS 2 REFRACTION OF LIGHT SENIOR HIGH SCHOOL GENPHYS2.pptx
GENERAL PHYSICS 2 REFRACTION OF LIGHT SENIOR HIGH SCHOOL GENPHYS2.pptx
 
CHROMATOGRAPHY PALLAVI RAWAT.pptx
CHROMATOGRAPHY  PALLAVI RAWAT.pptxCHROMATOGRAPHY  PALLAVI RAWAT.pptx
CHROMATOGRAPHY PALLAVI RAWAT.pptx
 
Measures of Central Tendency.pptx for UG
Measures of Central Tendency.pptx for UGMeasures of Central Tendency.pptx for UG
Measures of Central Tendency.pptx for UG
 
Total Legal: A “Joint” Journey into the Chemistry of Cannabinoids
Total Legal: A “Joint” Journey into the Chemistry of CannabinoidsTotal Legal: A “Joint” Journey into the Chemistry of Cannabinoids
Total Legal: A “Joint” Journey into the Chemistry of Cannabinoids
 
Science (Communication) and Wikipedia - Potentials and Pitfalls
Science (Communication) and Wikipedia - Potentials and PitfallsScience (Communication) and Wikipedia - Potentials and Pitfalls
Science (Communication) and Wikipedia - Potentials and Pitfalls
 
cybrids.pptx production_advanges_limitation
cybrids.pptx production_advanges_limitationcybrids.pptx production_advanges_limitation
cybrids.pptx production_advanges_limitation
 
Observation of Gravitational Waves from the Coalescence of a 2.5–4.5 M⊙ Compa...
Observation of Gravitational Waves from the Coalescence of a 2.5–4.5 M⊙ Compa...Observation of Gravitational Waves from the Coalescence of a 2.5–4.5 M⊙ Compa...
Observation of Gravitational Waves from the Coalescence of a 2.5–4.5 M⊙ Compa...
 
AZOTOBACTER AS BIOFERILIZER.PPTX
AZOTOBACTER AS BIOFERILIZER.PPTXAZOTOBACTER AS BIOFERILIZER.PPTX
AZOTOBACTER AS BIOFERILIZER.PPTX
 
KDIGO-2023-CKD-Guideline-Public-Review-Draft_5-July-2023.pdf
KDIGO-2023-CKD-Guideline-Public-Review-Draft_5-July-2023.pdfKDIGO-2023-CKD-Guideline-Public-Review-Draft_5-July-2023.pdf
KDIGO-2023-CKD-Guideline-Public-Review-Draft_5-July-2023.pdf
 
Introduction Classification Of Alkaloids
Introduction Classification Of AlkaloidsIntroduction Classification Of Alkaloids
Introduction Classification Of Alkaloids
 
linear Regression, multiple Regression and Annova
linear Regression, multiple Regression and Annovalinear Regression, multiple Regression and Annova
linear Regression, multiple Regression and Annova
 
Loudspeaker- direct radiating type and horn type.pptx
Loudspeaker- direct radiating type and horn type.pptxLoudspeaker- direct radiating type and horn type.pptx
Loudspeaker- direct radiating type and horn type.pptx
 
Environmental Acoustics- Speech interference level, acoustics calibrator.pptx
Environmental Acoustics- Speech interference level, acoustics calibrator.pptxEnvironmental Acoustics- Speech interference level, acoustics calibrator.pptx
Environmental Acoustics- Speech interference level, acoustics calibrator.pptx
 
Timeless Cosmology: Towards a Geometric Origin of Cosmological Correlations
Timeless Cosmology: Towards a Geometric Origin of Cosmological CorrelationsTimeless Cosmology: Towards a Geometric Origin of Cosmological Correlations
Timeless Cosmology: Towards a Geometric Origin of Cosmological Correlations
 
ESSENTIAL FEATURES REQUIRED FOR ESTABLISHING FOUR TYPES OF BIOSAFETY LABORATO...
ESSENTIAL FEATURES REQUIRED FOR ESTABLISHING FOUR TYPES OF BIOSAFETY LABORATO...ESSENTIAL FEATURES REQUIRED FOR ESTABLISHING FOUR TYPES OF BIOSAFETY LABORATO...
ESSENTIAL FEATURES REQUIRED FOR ESTABLISHING FOUR TYPES OF BIOSAFETY LABORATO...
 
Ultrastructure and functions of Chloroplast.pptx
Ultrastructure and functions of Chloroplast.pptxUltrastructure and functions of Chloroplast.pptx
Ultrastructure and functions of Chloroplast.pptx
 

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