xp days ukraine 2016 building cd pipeline in azure

39
CONTINUOUS DELIVERY PIPELINE IN AZURE SERGII KRYSHTOP NOVEMBER 12, 2016 INFRASTRUCTURE, TOOLS AND PROCESSES

Upload: sergii-kryshtop

Post on 24-Jan-2018

205 views

Category:

Engineering


1 download

TRANSCRIPT

Page 1: XP Days Ukraine 2016 Building CD Pipeline in Azure

CONTINUOUS DELIVERY

PIPELINE IN AZURE

SERGII KRYSHTOP

NOVEMBER 12, 2016

INFRASTRUCTURE, TOOLS AND PROCESSES

Page 2: XP Days Ukraine 2016 Building CD Pipeline in Azure

SOFTWARE ENGINEERING

MANAGER

12+ YEARS IN IT

MICROSOFT STACK / AZURE

DEVOPS & ENGINEERING PRACTICES

Page 3: XP Days Ukraine 2016 Building CD Pipeline in Azure

3

AGENDA

Understanding Delivery Pipeline and Release Cycle1

Selecting tools for CD2

Building and optimizing Infrastructure3

Page 4: XP Days Ukraine 2016 Building CD Pipeline in Azure

4

QA

Production

Staging

AcceptVerifyDeployRun TestBuildCommit

DELIVERY CYCLE

AcceptVerify

Development

AcceptVerify

AcceptVerify

CI CD

Page 5: XP Days Ukraine 2016 Building CD Pipeline in Azure

5

DELIVERY PIPELINE

Commit to Branch

Build Unit TestsComponent

Tests

Publish

Artifacts BUILD

DEPLOYDeploy

Acceptance

Tests

Manual

TestingApprove

Propagate to

NextSmoke TestsDONE

?

Page 6: XP Days Ukraine 2016 Building CD Pipeline in Azure

6

CD BEST PRACTICES

Environment

-specific

configuration

Build

Binaries Only

Once

Post

Deployment

Tests

Deploy same

way

Page 7: XP Days Ukraine 2016 Building CD Pipeline in Azure

7

CD BEST PRACTICES

Environment-

specific

configuration

Build

Binaries

Only Once

Post

Deployment

Tests

Deploy

same way

CI CD

Page 8: XP Days Ukraine 2016 Building CD Pipeline in Azure

8

BUIDLING CI PIPELINE

IN AZURE

Page 9: XP Days Ukraine 2016 Building CD Pipeline in Azure

9

VISUAL STUDIO TEAM SERVICES

• Git

• Large Repository of Tasks

• .NET, Java, JS, Xamarin

• NuGet, NPM, Maven, Grunt

Page 10: XP Days Ukraine 2016 Building CD Pipeline in Azure

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

Page 11: XP Days Ukraine 2016 Building CD Pipeline in Azure

11

ARTIFACTS PACKAGE MANAGEMENT

Page 12: XP Days Ukraine 2016 Building CD Pipeline in Azure

12

CROSS PLATFORM BUILD AGENT

Windows OSX

Ubuntu RedHat

CentOS

Page 13: XP Days Ukraine 2016 Building CD Pipeline in Azure

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

Page 14: XP Days Ukraine 2016 Building CD Pipeline in Azure

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

Page 15: XP Days Ukraine 2016 Building CD Pipeline in Azure

15

TOOL

SELECTING

RELEASE MANAGEMENT

Page 16: XP Days Ukraine 2016 Building CD Pipeline in Azure

16

ENVIRONMENTS AND RELEASE PIPELINE

Page 17: XP Days Ukraine 2016 Building CD Pipeline in Azure

17

DEPLOYMENT STEPS

Page 18: XP Days Ukraine 2016 Building CD Pipeline in Azure

18

CONFIGURATION VARIABLES

Page 19: XP Days Ukraine 2016 Building CD Pipeline in Azure

19

DASHBOARD

Page 20: XP Days Ukraine 2016 Building CD Pipeline in Azure

20

APPROVALS

Page 21: XP Days Ukraine 2016 Building CD Pipeline in Azure

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

Page 22: XP Days Ukraine 2016 Building CD Pipeline in Azure

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

Page 23: XP Days Ukraine 2016 Building CD Pipeline in Azure

23

ENVIRONMENT

DEPLOYMENT

STEPS

VARIABLE

NAME and

VALUE

VSTS DEPLOYMENT MODEL

RELEASE DEFINITION

Page 24: XP Days Ukraine 2016 Building CD Pipeline in Azure

24

ENVIRONMENT

CONFIGURATION

VARIABLE VALUEROLE

RELEASE +

DEPLOYMENT

STEPS

VARIABLE

NAME

OCTOPUS DEPLOYMENT MODEL

Page 25: XP Days Ukraine 2016 Building CD Pipeline in Azure

25

OCTOPUS ENVIRONMENT MODEL

Page 26: XP Days Ukraine 2016 Building CD Pipeline in Azure

26

OCTOPUS – RELEASE PROCESS

ENVIRONMENT

PROJECT + DEPLOY

STEPS

ROLE

RELEASE PACKAGE VERSION

OCTOPUS DEPLOY

Page 27: XP Days Ukraine 2016 Building CD Pipeline in Azure

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

Page 28: XP Days Ukraine 2016 Building CD Pipeline in Azure

28

OCTOPUS – DEPLOY RELEASE

Page 29: XP Days Ukraine 2016 Building CD Pipeline in Azure

29

OCTOPUS – DEPLOY RELEASE

Page 30: XP Days Ukraine 2016 Building CD Pipeline in Azure

30

TIP – USE ARTIFACTS

Cmdlet: New-OctopusArtifact

Page 31: XP Days Ukraine 2016 Building CD Pipeline in Azure

31

FOR CONTINUOUS DELIVERY

ENVIRONMENTS

AZURE INFRASTRUCTURE

Page 32: XP Days Ukraine 2016 Building CD Pipeline in Azure

32

[TOPIC]

DEV

AUTOMATION

QA STAGE PROD

RESOURCE GROUPS AS CONTAINERS

Page 33: XP Days Ukraine 2016 Building CD Pipeline in Azure

33

TIP - SCALE SQL DATABASES

STANDARD

PREMIUM

Page 34: XP Days Ukraine 2016 Building CD Pipeline in Azure

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+

Page 35: XP Days Ukraine 2016 Building CD Pipeline in Azure

36

ROLE BASES ACCESS CONTROL (RBAC)

USERS

GROUPS

MANAGEMENT

PERMISSION

SUBSCRIPTION

RESOURCE GROUP

RESOURCE

Page 36: XP Days Ukraine 2016 Building CD Pipeline in Azure

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

Page 37: XP Days Ukraine 2016 Building CD Pipeline in Azure

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

Page 38: XP Days Ukraine 2016 Building CD Pipeline in Azure

THANK

YOU

Page 39: XP Days Ukraine 2016 Building CD Pipeline in Azure

CONTACT ME

[email protected]

skryshtop