Devops by Examples: Giulio Vian
Devops by Examples: Giulio Vian
Devops by Examples: Giulio Vian
Giulio Vian
http://blog.casavian.eu/
giulio.dev@casavian.eu
@giulio_vian
http://www.getlatestversion.it/
1992
freelance
1995 1999 2014
?
1990
TFS Aggregator
3
This Session
100/200-level
Grasp the essentials of the DevOps approach.
(well …, some essentials)
Leave open questions to the end
4
What we will talk about?
DevOps intro
Demos
Environment hosting the app
The Application itself
Deployment
Dynamic configuration
Wrap-up
5
Your turn
Azure
Visual Studio Team Services (VSTS)
ASP.NET
Linux (Ubuntu)
6
«Appetizer»
7
DevOps is a job?
O !
N
8
DevOps is a product?
O !
N
9
DevOps is a culture, movement or practice
Wikipedia (2017)
11
…rooted in Agile Principles
Individuals and interactions
over processes and tools
Working software
over comprehensive documentation
Customer collaboration
over contract negotiation
Responding to change
over following a plan
http://agilemanifesto.org/
«Main course»
Where? Infrastructure-as-Code
What? Build & Package
How? Deploy
13
Execution environment
Application Data
O.S. Modules
Network & External Services
Local Services, Libraries
Operating System
14
Execution environment (alt)
Application
o p e
c
Data
s
(in container)
O t
Custom Container
u
(e.g. Kubernetes)
Base container
15
Execution environment – Comments
Setup times vs. launch times
Capacity planning
Running costs (Buy vs. Make)
16
Infrastructure-as-
Code
Azure Resource Manager
• Code
• Automation
17
Infrastructure-as-Code – Comments
Azure Resource Manager
Declarative vs. Imperative Declarative Json-based
Extensible (script, DSC)
Version Control Entire infrastructure
AWS CloudFormation
Continuous Integration Declarative Json-based
Dynamic vs. Static Terraform
Docker
Not much declarative
Single container
Swarm, Kubernetes, Mesos, …
Ansible, Puppet, Chef, CFEngine, …
18
Application
Web page showing DB data
• Environment
• Configuration
19
Build & Packaging
Collect everything
20
Build & Packaging – Comments
Version Control
Continuous Integration
Semantic Versioning
Artifacts
Images (Docker, AMI, Azure VM images)
21
Deploy
VSTS Release Management
• Controlled Automation
22
Secrets
Build time .gitignore
Signing
Deploy time Centralized Version Control
Credentials Distinct repositories
Run time
Tokens
Azure Key Vault,
Avoid exposures AWS Key Management Service,
git push hook etc.
Static analysis
23
Deploy – Comments
Category
Dev / QA / Prod
Integrated (dynamic)
Release cadence
Feature toggles
24
Dynamic
Configuration
Feature Toggle
25
Additional DevOps topics (out-of-scope)
Application Monitoring
Troubleshooting
Feedback loop
…and more
Dev Ops
26
«Dessert»
27
People
(Photo: DoD)
28
Automation
29
Resources
(Photo: Elya)
30
Call to action
31
Bibliografy & References
https://github.com/giuliov/DevOps-by-examples
http://www.slideshare.net/giuliov/presentations
http://martinfowler.com/articles/feature-toggles.html
https://leanpub.com/build
https://launchdarkly.com/
http://agilemanifesto.org/
https://azure.microsoft.com/en-us/services/application-insights/
https://github.com/tfsaggregator/tfsaggregator
https://github.com/aspnet
https://azure.microsoft.com/en-us/services/key-vault/
https://aws.amazon.com/kms/
https://blogs.msdn.microsoft.com/buckh/2016/09/30/controlling-exposure-through-feature-
flags-in-vs-team-services/
32
To know more
Continuous Delivery: Reliable Software
Releases through Build, Test, and
Deployment Automation — J.Humble,
D.Farley (Addison-Wesley)
https://www.amazon.com/Continuous-Deliv
ery/dp/0321601912/
The Phoenix Project — G.Kim, K.Behr,
G.Spafford (IT Revolution Press)
https://www.amazon.com/Phoenix-Project-
DevOps-Helping-Business/dp/0988262509/ 33
To know more (cont’d)
The DevOps Handbook — G.Kim,
P.Debois, J.Willis, J.Humble (IT
Revolution Press)
https://www.amazon.com/DevOps-Handbo
ok-World-Class-Reliability-Organizations/dp/
1942788002/
Continuous Delivery with Visual Studio
ALM 2015 — M.Olausson, J.Ehn
(Apress)
http://www.amazon.com/Continuous-Deliv 34
Partial checklist
Where is configuration stored?
How is configuration updated?
Is production configuration isolated and secured?
Where are the secrets and who can access them?
How versions are tracked?
Who authorizes changes and how?
How data is preserved on updates?
How data schema and module interfaces updates?
Using environment images or scripts?
How big is the deploy window?
How are the tracked activities and errors?
How are operational data is collected from production?
35
Fine delle trasmissioni
36
Demo Screenshots
37
Infrastructure-as-Code
Azure Portal
Resource Groups
Resulting Resource Group
Visual Studio Team Services – Project home
42
Visual Studio Team Services Release Management
Create/Update Resource Group
Install packages
Environment creation in progress
Resulting Environment
47
Application
48
Version Control
Home page
50
Query “C”
51
Build & Packaging
52
Continuous Integration
Semantic Versioning
App build script
Deploy
56
App deploy script – Database
App deploy script – Copy files to Target
App deploy script – Run final setup script
App deploy – configuration data
App deploy – source packages
Deploying the app
Deploying the app – pick a version
App deploy log
App deployed
65
Dynamic Configuration
66
Toggle feature script – generate new config files
Toggle feature deploy script – deploy config changes
New configuration data