xp days ukraine 2016 building cd pipeline in azure
TRANSCRIPT
CONTINUOUS DELIVERY
PIPELINE IN AZURE
SERGII KRYSHTOP
NOVEMBER 12, 2016
INFRASTRUCTURE, TOOLS AND PROCESSES
SOFTWARE ENGINEERING
MANAGER
12+ YEARS IN IT
MICROSOFT STACK / AZURE
DEVOPS & ENGINEERING PRACTICES
3
AGENDA
Understanding Delivery Pipeline and Release Cycle1
Selecting tools for CD2
Building and optimizing Infrastructure3
4
QA
Production
Staging
AcceptVerifyDeployRun TestBuildCommit
DELIVERY CYCLE
AcceptVerify
Development
AcceptVerify
AcceptVerify
CI CD
5
DELIVERY PIPELINE
Commit to Branch
Build Unit TestsComponent
Tests
Publish
Artifacts BUILD
DEPLOYDeploy
Acceptance
Tests
Manual
TestingApprove
Propagate to
NextSmoke TestsDONE
?
6
CD BEST PRACTICES
Environment
-specific
configuration
Build
Binaries Only
Once
Post
Deployment
Tests
Deploy same
way
7
CD BEST PRACTICES
Environment-
specific
configuration
Build
Binaries
Only Once
Post
Deployment
Tests
Deploy
same way
CI CD
8
BUIDLING CI PIPELINE
IN AZURE
9
VISUAL STUDIO TEAM SERVICES
• Git
• Large Repository of Tasks
• .NET, Java, JS, Xamarin
• NuGet, NPM, Maven, Grunt
10
USE WILDCARD IN CI BUILD TRIGGERS
release-16.1.1 release-16.1.2 release-16.2.1 release-16.2.2 release-16.3.1
develop
11
ARTIFACTS PACKAGE MANAGEMENT
12
CROSS PLATFORM BUILD AGENT
Windows OSX
Ubuntu RedHat
CentOS
13
DEPLOYING PRIVATE BUILD AGENT
• Free: 4 build hours/month. Each next agent $40 / month.
• 30 minute maximum single job duration.
• Average performance.
HOSTED
• Free: 1 agent; Each next agent $15 / month
• Pay for VM
• $$ vs. Build Time
PRIVATE
14
SETUP PRIVATE BUILD SERVER IN AZURE
VM 2 x Standard_DS3_v2
CORE 4, RAM 14GB, Max DISK I/O (MBps): 12800 (192)
STORAGE 3 x Standard LRS Storage.
Storage Pool60 MB/s
STORAGE
SSD
1 x SSD Premium Storage Disk
P10 (128 GiB, 500 IOPS (100 MB/s): $75
P20 (512 GiB, 2300 IOPS (150 MB/s): $150
P30 (1TB, 5000 IOPS (200 MB/s): $300
Free disk space matters.
180 MB/s
AGENTS 2 x Agents
1 Agent : 1 Disk
15
TOOL
SELECTING
RELEASE MANAGEMENT
16
ENVIRONMENTS AND RELEASE PIPELINE
17
DEPLOYMENT STEPS
18
CONFIGURATION VARIABLES
19
DASHBOARD
20
APPROVALS
21
• Build by .NET Developers for .NET Developers
• Integration with all popular CI servers:
– Jenkins,
– TeamCity,
– Visual Studio Team Services
• Installs in minutes
• Affordable prices, one-time payment
WHY OCTOPUS DEPLOY
Does one thing, does it well: Automated deployment
22
• Environment management
• Life-cycle management
• Internal and external nugget package feed
• Deployment pipeline management w/ automatic
parallelization
• Built-in configuration parameters substitutions
• Approvals and manual intervention
• Comprehensive API
OCTOPUS DEPLOY MAIN FEATURES
23
ENVIRONMENT
DEPLOYMENT
STEPS
VARIABLE
NAME and
VALUE
VSTS DEPLOYMENT MODEL
RELEASE DEFINITION
24
ENVIRONMENT
CONFIGURATION
VARIABLE VALUEROLE
RELEASE +
DEPLOYMENT
STEPS
VARIABLE
NAME
OCTOPUS DEPLOYMENT MODEL
25
OCTOPUS ENVIRONMENT MODEL
26
OCTOPUS – RELEASE PROCESS
ENVIRONMENT
PROJECT + DEPLOY
STEPS
ROLE
RELEASE PACKAGE VERSION
OCTOPUS DEPLOY
27
OCTOPUS DEPLOY ARCHITECTURE
DEV/QA/Staging/Production
Web Server Web Server App Server App Server
VSTS
Octopus Deploy Server
PaaS Apps
Managed Build Server
28
OCTOPUS – DEPLOY RELEASE
29
OCTOPUS – DEPLOY RELEASE
30
TIP – USE ARTIFACTS
Cmdlet: New-OctopusArtifact
31
FOR CONTINUOUS DELIVERY
ENVIRONMENTS
AZURE INFRASTRUCTURE
32
[TOPIC]
DEV
AUTOMATION
QA STAGE PROD
RESOURCE GROUPS AS CONTAINERS
33
TIP - SCALE SQL DATABASES
STANDARD
PREMIUM
34
SQL
SERVER
DEV
TIP – USE ELASTIC DATABASE POOL
S2
50 DTU
DB1
S3
100 DTU
DB2
DB1
S3
100 DTU
DB2
S2
50 DTU
$75
$150
$75
$150
$450
SQL
SERVER
QA
SQL
SERVER
ELASTIC
POOL
S3
100 eDTU
S3
100 eDTU
DB1_QA DB2_QA
S3
100 eDTUS3
100 DTU
DB1_QA DB2_QA
$220+
36
ROLE BASES ACCESS CONTROL (RBAC)
USERS
GROUPS
MANAGEMENT
PERMISSION
SUBSCRIPTION
RESOURCE GROUP
RESOURCE
37
RBAC BUILT-IN ROLES
Role name Permissions
Owner Full management rights
Contributor Full management rights except for user management
Reader View resources and their settings
None Does not see resources
CORE ROLES
Role name Permissions
*** Contributor Full management rights except for user management on
specific types of resources.
Examples: Virtual Machine Contributor, SQL DB
Contributor
RESOURCE TYPE SPECIFIC ROLES
38
• Check that you use the right tool for CI and CD
• VSTS in Azure provides main features for CI process and basic
CD functionality
• Use your favorite tool with Octopus Deploy to get full control
and flexibility of both processes
• Use ARM resource groups and templated for environments
provisioning
• Leverage RBAC for control permissions on service
administration
• Leverage Elastic SQL Pool to drop cost of SQL databases
WRAP UP
THANK
YOU