'

Dependency Management at Netflix

Понравилась презентация – покажи это...





Слайд 0

Dependency Management at Netflix Dependency management in a vast microservice landscape


Слайд 1

Thin Services, Fat Clients


Слайд 2

Freedom and Responsibility Responsible people thrive on freedom and are worthy of freedom


Слайд 3

The Binary Dependency Choice In principle provides the most freedom of action per team Each team selects a build tool that matches their style


Слайд 4

Version Skew How many versions am I behind the latest available version? Skew leads to runtime execution paths that were not unit tested!


Слайд 5

Stability Build repeatability Don't make me change until I'm ready!


Слайд 6

Nebula Dependency Locking Captures results of dependency resolution now so the same results can be reused later ./gradlew generateLock ./gradlew -PdependencyLock.useGeneratedLock=true test ./gradlew saveLock commitLock


Слайд 7

Nebula Dependency Locking To force every project in a multimodule project to agree on dependency versions: ./gradlew generateGlobalLock ./gradlew -PdependencyLock.useGeneratedLock=true test ./gradlew saveGlobalLock


Слайд 8

Avoidance


Слайд 9

Astrid


Слайд 10

Adepthub Uses a version compatibility matrix to calculate a known valid solution


Слайд 11

Modularization Shading involves package relocating dependencies makes them globally unique Runtime modularization like OSGi and JBoss Modules are too constraining for us, work well in some contexts


Слайд 12

Gradle Shadow Plugin Requires action on the part of the dependency producer shadowJar { dependencies { include(dependency('com.google.guava:guava:18.0')) } relocate 'com.google', 'shaded.com.google' } (roughly equivalent to the Maven Shade Plugin)


Слайд 13

Gradle Shadow Plugin public class NameAgeClient { Multimap<String, Integer> agesByName = HashMultimap.create(); public void addAll(Multimap<String, Integer> agesByName) { this.agesByName.putAll(agesByName); } } public Integer maxAge(String name) { return agesByName.get(name).stream().max(Integer::max).orElse(0); }


Слайд 14

Gradle Shadow Plugin Shaded transitive dependencies are leaked to dependency consumer @Test public void demonstrateUnshadedSeam() { shaded.com.google.common.collect.Multimap<String, Integer> nameAges = HashMultimap.create(); nameAges.put("jon", 10); NameAgeClient client = new NameAgeClient(); client.addAll(nameAges); } assertThat(client.maxAge("jon"), equalTo(10));


Слайд 15

Project Nemo A seam exists at the points where your project interacts with the public API of its first order dependencies The goal is for this seam to always refer to only your firstorder dependencies


Слайд 16

Project Nemo Just-in-time shading on the dependency consumer side


Слайд 17

Project Nemo repositories { maven { url 'https://nemo.netflix.com' } } dependencies { // appending _module causes JIT shading compile 'commons-configuration:commons-configuration_module:1.10' }


Слайд 18

Project Nemo Shaded artifacts are generated on the fly and differentiated by SHA1


Слайд 19

Project Nemo Shaded transitive dependencies are no longer leaked @Test public void demonstrateUnshadedSeam() { Multimap<String, Integer> nameAges = HashMultimap.create(); nameAges.put("jon", 10); NameAgeClient client = new NameAgeClient(); client.addAll(nameAges); } assertThat(client.maxAge("jon"), equalTo(10));


Слайд 20

Thanks! — we are hiring


Слайд 21


×

HTML:





Ссылка: