The Brave New World of Continuous Release - Baruch Sadogursky

76
The Brave New World of Continuous Release Baruch, JFrog

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

Page 1: The Brave New World of Continuous Release - Baruch Sadogursky

The Brave New World of Continuous Release

Baruch, JFrog

Page 2: The Brave New World of Continuous Release - Baruch Sadogursky

Baruch Developer Advocate @JFrog

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

@jbaruch

About me

JAX Conference San Francisco 2012

2

Page 3: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 4: The Brave New World of Continuous Release - Baruch Sadogursky

Everything *aasThe New Silver Bullet

Page 5: The Brave New World of Continuous Release - Baruch Sadogursky

What’s So Good About *aaS?

*aaS features Continuous Delivery

JAX Conference San Francisco 2012

5

Page 6: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 7: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 8: The Brave New World of Continuous Release - Baruch Sadogursky

Herding Cats

Developers> Increasing entropy

+IT (operations)

> Maintaining stability

=DevOps

> Stable change

8JAX Conference San Francisco 2012

Page 9: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 10: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 11: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 12: The Brave New World of Continuous Release - Baruch Sadogursky

Agile Tooling for DevOps Checklist

Versioning Access control Traceability Promotions Tags and

annotations Search

JAX Conference San Francisco 2012

12

Page 13: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 14: The Brave New World of Continuous Release - Baruch Sadogursky

Here Comes Binary RepositoryThe Right Tool for the Job

Page 15: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 16: The Brave New World of Continuous Release - Baruch Sadogursky

Tooling Chain

16JAX Conference San Francisco 2012

Page 17: The Brave New World of Continuous Release - Baruch Sadogursky

In the Beginning it was…

17JAX Conference San Francisco 2012

Page 18: The Brave New World of Continuous Release - Baruch Sadogursky

Binary Repo in DevOps Ecosystem

18JAX Conference San Francisco 2012

Page 19: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 20: The Brave New World of Continuous Release - Baruch Sadogursky

The Release Pipeline

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

20JAX Conference San Francisco 2012

Page 21: The Brave New World of Continuous Release - Baruch Sadogursky

Passing the software to QA

Different access rights Different physical location Ability to annotate

JAX Conference San Francisco 2012

21

Page 22: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 23: The Brave New World of Continuous Release - Baruch Sadogursky

Going to Production

Convert staging binaries to production Allow public access Change settings Tag

JAX Conference San Francisco 2012

23

Page 24: The Brave New World of Continuous Release - Baruch Sadogursky

TraceabilityWhy and How?

Page 25: The Brave New World of Continuous Release - Baruch Sadogursky

Sometimes you need to go back in time

The Time Machine

Page 26: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 27: The Brave New World of Continuous Release - Baruch Sadogursky

Checkout branch/tag/revision Build Done!

Time consuming Unstable

27

Rebuilding from Sources

JAX Conference San Francisco 2012

Page 28: The Brave New World of Continuous Release - Baruch Sadogursky

Dependency Descriptors aren’t stable

28

Dependencies Lie

JAX Conference San Francisco 2012

Page 29: The Brave New World of Continuous Release - Baruch Sadogursky

POMs deployed with variables> Ivy is OK

Resolution strategies change over time

29

Evil Dependencies Resolution

JAX Conference San Francisco 2012

Page 30: The Brave New World of Continuous Release - Baruch Sadogursky

Record information on spot> When binaries are created

Build Server

30

Single Source of Truth

JAX Conference San Francisco 2012

Page 31: The Brave New World of Continuous Release - Baruch Sadogursky

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

31

Single Target of Truth

JAX Conference San Francisco 2012

Page 32: The Brave New World of Continuous Release - Baruch Sadogursky

Bill of Materials JSON REST accessible API accessible APLv2 on GitHub

32

Open Standard Of Truth

JAX Conference San Francisco 2012

Page 33: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 34: The Brave New World of Continuous Release - Baruch Sadogursky

Demo Time!Tracing Artifacts

Page 35: The Brave New World of Continuous Release - Baruch Sadogursky

What my friends think I doDevOps

Page 36: The Brave New World of Continuous Release - Baruch Sadogursky

What Others Think I Do

36

JAX Conference San Francisco 2012

Page 37: The Brave New World of Continuous Release - Baruch Sadogursky

What I Think I Do

37

JAX Conference San Francisco 2012

Page 38: The Brave New World of Continuous Release - Baruch Sadogursky

What I Really Do

38

JAX Conference San Francisco 2012

Page 39: The Brave New World of Continuous Release - Baruch Sadogursky

What I Really Do

39

JAX Conference San Francisco 2012

Page 40: The Brave New World of Continuous Release - Baruch Sadogursky

What I should Do

40JAX Conference San Francisco 2012

Page 41: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 42: The Brave New World of Continuous Release - Baruch Sadogursky

The magic of ReleasePut your repository to work

Page 43: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 44: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 45: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 46: The Brave New World of Continuous Release - Baruch Sadogursky

Demo time!Release With Release Candidates

Page 47: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 48: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 49: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 50: The Brave New World of Continuous Release - Baruch Sadogursky

Releasing with Release Candidates?

50JAX Conference San Francisco 2012

Page 51: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 52: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 53: The Brave New World of Continuous Release - Baruch Sadogursky

Controlling Versioning Scheme

Classic versioning scheme:> Release version > 2.0.3

> Integration version> 2.0.4-SNAPSHOT

YMMV

JAX Conference San Francisco 2012

53

Page 54: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 55: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 56: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 57: The Brave New World of Continuous Release - Baruch Sadogursky

Code time!Plugin What?

Page 58: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 59: The Brave New World of Continuous Release - Baruch Sadogursky

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

59

Community Effort

JAX Conference San Francisco 2012

Page 60: The Brave New World of Continuous Release - Baruch Sadogursky

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

Scheduled On demand

Plugin Invocation Options

JAX Conference San Francisco 2012

60

Page 61: The Brave New World of Continuous Release - Baruch Sadogursky

Plugin Code

Manipulating Version Control Systems

61JAX Conference San Francisco 2012

Page 62: The Brave New World of Continuous Release - Baruch Sadogursky

Plugin Code

Manipulating BuildInfo object

62JAX Conference San Francisco 2012

Page 63: The Brave New World of Continuous Release - Baruch Sadogursky

Plugin Code

Creating and replacing artifacts

63JAX Conference San Francisco 2012

Page 64: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 65: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 66: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 67: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 68: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 69: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 70: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 71: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 72: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 73: The Brave New World of Continuous Release - Baruch Sadogursky

Demo time!Release by Snapshot Promotion

Page 74: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 75: The Brave New World of Continuous Release - Baruch Sadogursky

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

Page 76: The Brave New World of Continuous Release - Baruch Sadogursky