gradle netflix pdf - revised-4

Upload: miko-matsumura

Post on 08-Jan-2016

12 views

Category:

Documents


0 download

DESCRIPTION

Gradle open source build automation system white paper.

TRANSCRIPT

  • 2015 Gradle Inc. PAGE 1 of 3

    www.gradle.org

    CULTURE OF FREEDOM AND RESPONSIBITY

    MIGRATING THE BUILD WITH GRADLE INC.

    Netflix is the pioneer of commercial consumer video streaming. Netflix

    requires one of the worlds most sophisticated media delivery systems to

    serve its 53 million members watching more than two billion hours of TV

    shows and movies per month.

    Netflix has a very independent company culture, where developers have a

    lot of autonomy. They have a Engineering tools team whose goal it is to

    help distributed teams to achieve optimal productivity. While there isnt a

    single Enterprise unified build or even a unified toolset across the compa-

    ny, the Engineering Tools group is responsible for identifying emerging

    technologies that can be evangelized and adopted by the teams for

    maximum benefit.

    This passion for cutting edge technology and a desire to improve the art of

    build management led the team to Gradle. Netflixs Build Team was using

    Ant, Ivy, and their own custom tools when they found out about Gradle.

    With the help of Gradle Inc., the Netflix team decided to migrate over 20

    different projects to take advantage of Gradles improved build speeds,

    cleaner builds, more powerful scripting options, and extensive plugin

    library.

    A lot of developers at Netflix wanted to use Apache Maven when Justin

    Ryan of the Netflix Engineering Tools Team discovered Gradle. Ryan

    discovered the flexibility and power inherent in Gradle and quickly tested

    it on a few projects. Once on a solid footing, Ryan began to evangelize it

    across the organization. Gradle fit the bill for us, says Justin.

    CHALLENGEImproving build times and CI

    exibility for one of the biggest builds in the world. Continuous Delivery Pipeline with Gradle.

    SOLUTIONA migration from Ant and Ivy to Gradle, with extensive custom Gradle plugins.

    Gradle consultants can help

    you with a number of criti-

    cal services to get up and

    running, including:

    RESULTSBuild time reduced as much as 1500% for some projects. Reduction in time to market

    enabling teams to ship 2-3 times a week.

    Plugin development:Identify opportunities to leverage Gradle plugins to put in place a manageable build infrastructure.

    Integration:Integrate Gradle with your existing tools and platforms.

    Build review:Review your current Gradle build infrastructure with a core developer, and get recommendations on improvements.

    Standardization:Get help to centralize your Gradle build infrastructure.

    Performance tuning:Improve build performance and developer productivity.

    CD optimization:Leverage Gradle to automate your continuous delivery pipeline and best practices.

    Build migration:Create a seamless build migration to Gradle and Replicate custom build functionality, including Ant or Maven scripts.

    We do truly feel that Gradle is the best build system for the JVM right now. - Justin Ryan, Netflix

    Push Button Continuous Delivery

  • With assistance from Gradle Inc., the Netflix Engineering Tools team set out to migrate from Ant and Ivy to Gradle.

    They went over initial strategy and best practices for migration, which included build reviews and an in-depth analysis

    of the development environment(s) and culture. As is typical for Enterprise adoption of Gradle, the Netflix team started

    with a few key projects, and then used the results to sell other teams on the Gradle way.

    REDUCING BUILD TIMES ACROSS THE ORGANIZATION

    UNTANGLING UNRULY XML & SCRIPTS

    Netflix has a culture of both freedom and responsibility. Developers are free to use the tools they feel are necessary to

    do their jobs, but this can make a build considerably more complex. We have an easier time standardizing people to

    Gradle as soon as we show them the improved build times, says Spieldenner.

    Improved build times have a profound effect on engineering culture, and are a key enabler for agile and Continuous

    Deployment methodologies. If your organization is unable to build rapidly, the frequency of builds decreases. A fast

    build minimizes developer down time but much more importantly decreases cycle time to improvement. It also enable

    the organization to release features more frequently, thus decreasing the shelf-time of new features and increasing the

    organizations competitiveness in the market.

    Gradle decreases build times by reducing redundant actions within a build. Our selling point to other teams is the

    speed up in build times that weve seen, says Sr. Software Engineer Rob Spieldenner. We migrated one deeply

    nested multi-modular project with overrides and forces to Gradle.

    Gradle gives Netflix an unprecedented amount of flexibility with their build. Unlike XML, Gradle offers a rich extensible

    Domain Specific Language (DSL), which pushes declarative builds to the next level by providing imperative language

    elements. Historically, other scripting languages have been used to write build-related tasks, but one problem that

    emerges from this is fragmentation. With thousands of scripts written in dozens of languages in one large project,

    things can become unruly, unmaintainable and slow, and full of bloat. Without the kind of concise definitions that arise

    from having a build-specific Domain Specific Language, expressing even simple things about the build take many lines

    of code. This results in maximal readability, maintainability, speed of development, speed of improvement, standardiza-

    tion, and the ability to enforce enterprise policies.

    Another organizational advantage can be had through the development of custom plugins to Gradle. The Netflix

    Engineer Tools Team started to create and maintain plugins for a variety of projects. Weve written a lot of new Gradle

    plugins since switching, and they are much easier to test and release, says Spieldenner.

    By refactoring the build and creating clean abstractions including correct plugin architecture and navigating the bound-

    ary between convention and configuration builds are able to achieve a steady state that gets smaller and faster over

    time instead of larger and slower. The Gradle system enables a logical separation of concerns that allows for the

    centralization of best practices but also for diversity, creativity and freedom.

    The result was pretty straightforward - we took a build that took over 80 minutes down to less than five. - Rob Spieldenner, Netflix

    Our former XML build scripts were long and unruly, says Spieldenner. Using Gradle Plugins, we were able to convert many of our XML scripts to Gradle. Our Gradle code keeps getting smaller and smaller and smaller.

    2015 Gradle Inc. PAGE 2 of 3 www.gradle.org

  • By refactoring the build and creating clean abstractions including correct plugin architecture and navigating the bound-

    ary between convention and configuration builds are able to achieve a steady state that gets smaller and faster over

    time instead of larger and slower. The Gradle system enables a logical separation of concerns that allows for the

    centralization of best practices but also for diversity, creativity and freedom.

    Builds that get smaller and smaller are the exact opposite of what is typically seen in Enterprise organizations. Build

    sprawl eventually can cause organizational productivity to grind to a halt and even impact developer team morale and

    increase frustration with the build.

    A BUILD THAT EVOLVES WITH THE NEEDS OF THE ORGANIZATION

    GRADLE CONSULTING

    Each Netflix team typically deploys two to three times a week. Since every team has different needs and tools, this sort

    of agility can be challenging. The key here was automation, automation, automation. I really wanted there to be a

    button there for people with the right authorization to click release and get these plugins out there, says Ryan.

    By dropping XML scripts in favor of Gradle, the Engineering Team could meet these needs. If teams want to go ahead

    and add a bunch of custom deployment logic, being in Gradle scripts is a great place to be. You can add some depen-

    dencies, you can push to external places, its very flexible, says Ryan. If someone has a specific project they want to

    build, we can just write them a quick plugin, which is great.

    Netflix is among the top engineering organizations in the world, and they turned to Gradle Inc. for their build consulting

    needs. Gradle Inc. develops, distributes and supports the worlds most powerful open source build automation system,

    Gradle. Gradle consultants come from the core team that builds Gradle itself every day, and these elite Gradle experts

    have seen everything from Fortune 100 Enterprise multi-language builds to the most advanced build environments in

    the world.

    The Gradle model works very well for us. - Justin Ryan, Netflix

    2015 Gradle Inc. PAGE 3 of 3 www.gradle.org