The Brave New World of Continuous Release - Baruch Sadogursky

Post on 13-May-2015

604 views 5 download

Tags:

description

While rapid release cycles provide numerous benefits for end-users and developers, it puts additional pressure on DevOps to make sure that a good application is provisioned with no mistakes. In this session, we will look at the release process from the binaries point of view. We will explain what are the processes and the methodologies for moving your build binaries between different phases until declared production-ready. In the second part of the session, we will show how business requirements can affect release procedures. We will discuss what it takes to customize the logic of the process in the context of CI servers and binary artifacts. We will demonstrate several common release methodologies and compare the pros and cons of each one.

Transcript of The Brave New World of Continuous Release - Baruch Sadogursky

The Brave New World of Continuous Release

Baruch, JFrog

Baruch Developer Advocate @JFrog

> Job definition (part of): Hang out with the DevOps guys

@jbaruch

About me

JAX Conference San Francisco 2012

2

The cloud silver bullet The right tool for the job Binaries all the way The magic of release

Agenda

JAX Conference San Francisco 2012

3

Everything *aasThe New Silver Bullet

What’s So Good About *aaS?

*aaS features Continuous Delivery

JAX Conference San Francisco 2012

5

User advantages> Latest version/features> No upgrades/maintenance

Developer advantages> Agile> Rapid feedback> Users are the best beta-testers> No long-term support

Everybody wins?

Continuous Delivery FTW

JAX Conference San Francisco 2012

6

Used to quarterly release cycles “Secure” pace Minimizing the entropy caused by

developers with ADD

Almost, except the IT

JAX Conference San Francisco 2012

7

Herding Cats

Developers> Increasing entropy

+IT (operations)

> Maintaining stability

=DevOps

> Stable change

8JAX Conference San Francisco 2012

Continuous Delivery Challenge

Very frequent releases More than one version in production Complicated access levels Root cause analysis

> Tracing from binaries to source

Version tracking Not everyone is ready for CD

JAX Conference San Francisco 2012

9

Continuous Delivery Challenge

Very frequent releases More than one version in production Complicated access levels Root cause analysis

> Tracing from binaries to source

Version tracking Not everyone is ready for CD

JAX Conference San Francisco 2012

10

It’s… Agile!

Agile principles applied for DevOps We have good tooling for Agile

development> Version control> Unit testing and code coverage> CI servers> Hot swap tools

What’s up with tooling for agile DevOps?

JAX Conference San Francisco 2012

11

Agile Tooling for DevOps Checklist

Versioning Access control Traceability Promotions Tags and

annotations Search

JAX Conference San Francisco 2012

12

How Do I Know?

Artifactory is released with Artifactory

JFrog SaaS offering> Artifactory Online> Gradle, Grails, SpringSource,

Typesafe, Jenkins, etc.

We build, release and eat our own dog food> Continuously

13

JAX Conference San Francisco 2012

Here Comes Binary RepositoryThe Right Tool for the Job

Here Comes Binary Repository

E.g. Artifactory Proxy Smart storage

> Much more than a passive space

Critical for CI/CD and ALM

JAX Conference San Francisco 2012

15

Tooling Chain

16JAX Conference San Francisco 2012

In the Beginning it was…

17JAX Conference San Francisco 2012

Binary Repo in DevOps Ecosystem

18JAX Conference San Francisco 2012

From some point product in your lifecycle, all you care about is binaries

Lots of things to do after the software is built

Binaries All the Way

JAX Conference San Francisco 2012

19

The Release Pipeline

Source: Agile ALM, Michael Hüttermann, Manning Publications Co.

20JAX Conference San Francisco 2012

Passing the software to QA

Different access rights Different physical location Ability to annotate

JAX Conference San Francisco 2012

21

Staging and Preproduction

Replication of Production environment> Lock versions of dependencies and artifacts

Allow access to set of users

JAX Conference San Francisco 2012

22

Going to Production

Convert staging binaries to production Allow public access Change settings Tag

JAX Conference San Francisco 2012

23

TraceabilityWhy and How?

Sometimes you need to go back in time

The Time Machine

Quest for Traceability

What should be restored?> Sources > Dependencies> Environment details> Tags

Where’s the information?> Version control system> Build Tool> Build server

JAX Conference San Francisco 2012

26

Checkout branch/tag/revision Build Done!

Time consuming Unstable

27

Rebuilding from Sources

JAX Conference San Francisco 2012

Dependency Descriptors aren’t stable

28

Dependencies Lie

JAX Conference San Francisco 2012

POMs deployed with variables> Ivy is OK

Resolution strategies change over time

29

Evil Dependencies Resolution

JAX Conference San Francisco 2012

Record information on spot> When binaries are created

Build Server

30

Single Source of Truth

JAX Conference San Francisco 2012

Truth should be saved… … with the binaries… … in binaries storage!

31

Single Target of Truth

JAX Conference San Francisco 2012

Bill of Materials JSON REST accessible API accessible APLv2 on GitHub

32

Open Standard Of Truth

JAX Conference San Francisco 2012

Build Server Plugin

Build information> Resolved and realized during the build> Attached to the artifacts> Uploaded with the

artifacts

Artifacts + Build Info = 4eva!!11

JAX Conference San Francisco 2012

33

Demo Time!Tracing Artifacts

What my friends think I doDevOps

What Others Think I Do

36

JAX Conference San Francisco 2012

What I Think I Do

37

JAX Conference San Francisco 2012

What I Really Do

38

JAX Conference San Francisco 2012

What I Really Do

39

JAX Conference San Francisco 2012

What I should Do

40JAX Conference San Francisco 2012

Target: Automation

It’s impossible to release frequently with manual procedures> While maintaining quality

Use your binaries storage to release

41JAX Conference San Francisco 2012

The magic of ReleasePut your repository to work

Release Candidates

Your next build is a release-candidate Once successfully built and tested, click

the button> Automatic versions switch> From integration to release

> Right place to put your binaries> Move from Staging to Public

> Automatic VCS tagging

JAX Conference San Francisco 2012

43

Releasing with Release Candidates

Process:1. Produce and build snapshots until satisfied2. Once satisfied, build a release candidate3. Stage RC, check and verify4. Once verified, release

JAX Conference San Francisco 2012

44

Releasing With Artifactory Plugin

Changes versions in build script Allows choosing a target deploy

repository Creates a VCS tag/branch

JAX Conference San Francisco 2012

45

Demo time!Release With Release Candidates

OOTB Release Management

Pros> Out of the box> Supports the “by

the book” release cycle

> Supports majority of the tools

Cons> Limited

extensibility> May not fit your

requirements

JAX Conference San Francisco 2012 47

Releasing with Release Candidates

Process:1. Produce and build snapshots until satisfied2. Once satisfied, build a release candidate3. Stage RC, check and verify4. Once checked, release

JAX Conference San Francisco 2012

48

Releasing with Release Candidates

Process:1. Produce and build snapshots until satisfied2. Once satisfied, build release candidate3. Stage RC, check and verify4. Once checked, release

Redundant build

JAX Conference San Francisco 2012

49

Releasing with Release Candidates?

50JAX Conference San Francisco 2012

Releasing with Release Candidates?

Lots of things can go wrong during one more build

If we won’t build it, we won’t screw it Revised Process:

1. Produce and build snapshots until satisfied2. When satisfied, check and verify3. Once checked, release

JAX Conference San Francisco 2012

51

Automation Flexibility

YMMV (great deal) Write your own release logic

Pre and post build deploy hooks

52

We Know: We Don’t Know Better

JAX Conference San Francisco 2012

Controlling Versioning Scheme

Classic versioning scheme:> Release version > 2.0.3

> Integration version> 2.0.4-SNAPSHOT

YMMV

JAX Conference San Francisco 2012

53

Flexible Release

Code your release strategy> Versioning scheme> VCS (tagging, branching, commit comments)> Promotion hook (copy/move, comments,

status)

Available by REST

JAX Conference San Francisco 2012

54

REST == Scriptability == Automation

It’s impossible to release frequently with manual procedures> While maintaining quality

Use your scriptable binaries storage to release

55JAX Conference San Francisco 2012

Example: Promotion of Snapshots

Choose existing build to become a release

Using REST API without build server Invoke promotion plugin

> Convert to next version> Tag, branch, etc.> Promote (copy/move)

JAX Conference San Francisco 2012

56

Code time!Plugin What?

Artifactory is open for user plugins Groovy groovy DSL Your code runs inside the server Uses Public API (PAPI)

> Search for artifacts> Search for builds> Copy/move artifacts> Manipulate files> E.g. change versions in descriptors

Pluggable Architecture with DSLs

JAX Conference San Francisco 2012

58

https://github.com/JFrogDev/artifactory-user-plugins

59

Community Effort

JAX Conference San Francisco 2012

As a response for various events> Download/Create/Delete> Login> Release

Scheduled On demand

Plugin Invocation Options

JAX Conference San Francisco 2012

60

Plugin Code

Manipulating Version Control Systems

61JAX Conference San Francisco 2012

Plugin Code

Manipulating BuildInfo object

62JAX Conference San Francisco 2012

Plugin Code

Creating and replacing artifacts

63JAX Conference San Francisco 2012

http://repo-demo:8080/artifactory/api/plugins/build/promote/snapshotToRelease/gradle-

multi-example/1?params=snapExp=d14|targetRepository=gradle-release-local

Calling REST API With CURL

JAX Conference San Francisco 2012

64

http://repo-demo:8080/artifactory/api/plugins/build/promote/snapshotToRelease/gradle-multi-example/1?params=snapExp=d14|targetRepository=gradle-release-local

Calling REST API With CURL

JAX Conference San Francisco 2012

65

http://repo-demo:8080/artifactory/api/plugins/build/promote/snapshotToRelease/gradle-multi-example/1?params=snapExp=d14|targetRepository=gradle-release-local

Calling REST API With CURL

Artifactory server

JAX Conference San Francisco 2012

66

http://repo-demo:8080/artifactory/api/plugins/build/promote/snapshotToRelease/gradle-multi-example/1?params=snapExp=d14|targetRepository=gradle-release-local

Calling REST API With CURL

Artifactory server

Plugins API

JAX Conference San Francisco 2012

67

http://repo-demo:8080/artifactory/api/plugins/build/promote/snapshotToRelease/gradle-multi-example/1?params=snapExp=d14|targetRepository=gradle-release-local

Calling REST API With CURL

Artifactory server

Plugins API

Plugin name

JAX Conference San Francisco 2012

68

http://repo-demo:8080/artifactory/api/plugins/build/promote/snapshotToRelease/gradle-multi-example/1?params=snapExp=d14|targetRepository=gradle-release-local

Calling REST API With CURL

Artifactory server

Plugins API

Plugin name

Build name and number

JAX Conference San Francisco 2012

69

http://repo-demo:8080/artifactory/api/plugins/build/promote/snapshotToRelease/gradle-multi-example/1?params=snapExp=d14|targetRepository=gradle-release-local

Calling REST API With CURL

Artifactory server

Plugins API

Plugin name

Build name and number

versioning scheme

JAX Conference San Francisco 2012

70

http://repo-demo:8080/artifactory/api/plugins/build/promote/snapshotToRelease/gradle-multi-example/1?params=snapExp=d14|targetRepository=gradle-release-local

Calling REST API With CURL

Artifactory server

Plugins API

Plugin name

Build name and number

versioning scheme

Target repository for release

JAX Conference San Francisco 2012

71

Recap: Promotion of Snapshots

Choose existing build to become a release

Using the REST API without building Invoking the promotion plugin

> Convert to next version> Tag, branch, etc.> Promote (copy/move)

JAX Conference San Francisco 2012

72

Demo time!Release by Snapshot Promotion

4 Commandments of DevOps

Automate everything

Version everything

Trace everything Report/Log/Feed

back everything Designed by Jessica Allen on Dribbble.com

JAX Conference San Francisco 2012

74

4 Commandments of DevOps

Automate everything

Version everything

Trace everything Report/Log/Feed

back everything Designed by Jessica Allen on Dribbble.com

JAX Conference San Francisco 2012

75