This document discusses how Netflix leverages Gradle for building and managing their large codebase. Some key points:
- Netflix migrated from Ivy and Ant to Gradle, publishing around 9k artifacts daily across 3.3k+ repositories.
- Challenges included slow/broken builds, metadata issues, and ensuring reproducible builds.
- The Nebula plugin suite was created to standardize build logic and provide conventions for tasks like dependency management, publishing, and linting.
- Nebula is distributed via custom Gradle distributions and its compatibility is validated through acceptance testing on Gradle nightly/candidate releases.
- Other initiatives like shared caches, Astrid for artifact
2. Who am I?
Leveraging Gradle
@ Net
fl
ix
Roberto Pérez Alcole
a
Senior Software Enginee
r
Java Platform @ Netfli
x
rperezalcolea@netflix.com
@rpalcolea
4. •Many repositories (~3.3k
)
•Binary integration (JARs
)
•Microservices with fat
client
s
•Hundreds of engineer
s
•Ivy + Ant in the past. Now
we use Gradle
!
•Java, Groovy, Scala, Kotlin,
Clojure
Leveraging Gradle @ Net
fl
ix
11. Slow Build
s
•Dependency resolutio
n
•Plugins and custom tasks
impacting con
fi
guration tim
e
•Using excludes on dependencies
declaration
s
•Lack of parallelization
Leveraging Gradl
e
@ Net
fl
ix
12. Metadat
a
•Bad Ivy or Maven metadata can
lead to a poisoned dependency
graph
.
•Dynamic dependencie
s
•Bad scope
s
•Dependency declaration for
shaded librarie
s
Leveraging Gradl
e
@ Net
fl
ix
14. Packagin
g
•Make sure that a java application
can be deployed with easiness in
our infrastructure
•VMs on EC
2
•Docker containers in Titu
s
Leveraging Gradl
e
@ Net
fl
ix
15. Plugin Ecosyste
m
•Third party plugin compatibility with
new versions of Gradl
e
•Strong opinions from external and
internal plugins (forcing
dependencies
)
•Upgrade well known plugins for
existing build
s
Leveraging Gradl
e
@ Net
fl
ix
16. Fast evolution of
Gradl
e
•Deprecated APIs and the need to
migrate folks to use the new one
s
•It isn’t only about the DSL but also
for plugin authors at Net
fl
i
x
•Introduce new features and keep
up with Gradle release
s
Leveraging Gradl
e
@ Net
fl
ix
20. Leveraging Gradl
e
@ Net
fl
ix
What is Nebula
?
•Gradle plugins and internal custom
distribution built to eliminate
boilerplate build logic and provide
sane convention
s
•Dependency managemen
t
•Publishin
g
•OS Packagin
g
•Lintin
g
•Dependency lockin
g
•And many others
!
21. This plugin provides general
purpose rule types on top of
Gradle resolution strategies and
module metadata, allowing
rules to be published,
versioned, shared between
projects, and optionally
dependency locked.
•Duplicate classes caused by
changes to group or artifact ids,
without renaming package
s
•Duplicate classes caused by
bundle dependencies, which do not
con
fl
ict resolve against the 'regular'
dependencies for that library
•Lack of version alignment between
libraries, where version alignment
is needed for compatibility
•Ensuring a minimum version of a
library
Resolution Rules
Plugin
Leveraging Gradl
e
@ Net
fl
ix
27. Gradle custo
m
Distributions
Leveraging Gradle
@ Net
fl
ix
• Apply internal and OSS plugin
s
• Custom init script
s
• Configure repositorie
s
• Configure status schemes
(snapshot, candidate, release
)
• Enable metrics collectio
n
• Enable/disable feature
s
• Default gradle.properties
29. How do we
validate new
versions of
Nebula?
Leveraging Gradl
e
@ Net
fl
ix
30. •Leverage Niagara to clone
every Nebula based project at
Gradle on its own container and
build it using the new version of
Nebula
.
•Gradle nightly release
s
•Gradle candidate releases
•Leverage Niagara to clone our
OSS plugins and test them
against nightly releases of
Gradle.
Acceptance Testin
g
Leveraging Gradl
e
@ Net
fl
ix
33. •Automatic Pull requests
:
•Dependency lock
s
•Nebula wrappe
r
•Lint rule
s
Managed Sourc
e
Evolving Continuous Integration at Netflix
(Elise McCallum) | 2019
Leveraging Gradl
e
@ Net
fl
ix
35. •Build Cach
e
•Shared Read-only Dependency
Cach
e
•Build Scan
s
•Gradle Enterpris
e
•Parallel execution
Gradle Feature
s
Leveraging Gradl
e
@ Net
fl
ix
40. •Collection of services and UIs
that enable artifact observability
and the ability to effect change
in the Net
fl
ix ecosystem
.
•High level goal is to decrease
time and effort needed to
propagate change through the
Net
fl
ix ecosyste
m
•Useful for Library deprecation
and Security Vulnerabilitie
s
Astri
d
Leveraging Gradl
e
@ Net
fl
ix
45. •Distributed Testin
g
•Java Toolchain
s
•Gradle Metadata Adoptio
n
•Con
fi
guration Cach
e
•Publishing veri
fi
cation
mechanisms
Gradle Features in
Our Horizo
n
Leveraging Gradl
e
@ Net
fl
ix