continuous delivery hos tradeshift - lund&bendsen · continuous delivery hos tradeshift jan...

17
Continuous Delivery hos Tradeshift Jan Ypma [email protected]

Upload: others

Post on 21-May-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Continuous Delivery hos Tradeshift - Lund&Bendsen · Continuous Delivery hos Tradeshift Jan Ypma jyp@tradeshift.com. R 54 G157 B 215 R 0 G114 B 176 R 123 G193 B 77 R 235 G18 B 89

R 54G157B 215

R 0G114B 176

R 123G193B 77

R 235G18B 89

R 43G 43B 43

R 161G 161B 161

ContinuousDeliveryhos TradeshiftJan Ypma [email protected]

Page 2: Continuous Delivery hos Tradeshift - Lund&Bendsen · Continuous Delivery hos Tradeshift Jan Ypma jyp@tradeshift.com. R 54 G157 B 215 R 0 G114 B 176 R 123 G193 B 77 R 235 G18 B 89

R 54G157B 215

R 0G114B 176

R 123G193B 77

R 235G18B 89

R 43G 43B 43

R 161G 161B 161

Agenda

■ Vækst i systemer, kode, medarbejdere og brugere

■ Deployment i Tradeshift i dag■ Amazon eller ej■ Resilience (robusthed)■ Github og reviews

Page 3: Continuous Delivery hos Tradeshift - Lund&Bendsen · Continuous Delivery hos Tradeshift Jan Ypma jyp@tradeshift.com. R 54 G157 B 215 R 0 G114 B 176 R 123 G193 B 77 R 235 G18 B 89

R 54G157B 215

R 0G114B 176

R 123G193B 77

R 235G18B 89

R 43G 43B 43

R 161G 161B 161

Lidt om Tradeshift

■ Stiftet i 2010■ Globalt forretningsnetværk

● Indkøb, fakturering, processer● Brugere er firmaer fra 1 til 100.000 ansatte

■ Kontorer i København, San Francisco, Suzhou■ 150 udviklere

■ Omkring 50 systemkomponenter

Page 4: Continuous Delivery hos Tradeshift - Lund&Bendsen · Continuous Delivery hos Tradeshift Jan Ypma jyp@tradeshift.com. R 54 G157 B 215 R 0 G114 B 176 R 123 G193 B 77 R 235 G18 B 89

R 54G157B 215

R 0G114B 176

R 123G193B 77

R 235G18B 89

R 43G 43B 43

R 161G 161B 161

Vækst i kontorer

■ Når vi er vågne, så sover de andre■ Kreative ideer■ Opdeling efter systemer

Page 5: Continuous Delivery hos Tradeshift - Lund&Bendsen · Continuous Delivery hos Tradeshift Jan Ypma jyp@tradeshift.com. R 54 G157 B 215 R 0 G114 B 176 R 123 G193 B 77 R 235 G18 B 89

R 54G157B 215

R 0G114B 176

R 123G193B 77

R 235G18B 89

R 43G 43B 43

R 161G 161B 161

Vækst i kode

■ Backend-service● 200.000 kodelinjer (uden tests)● 26min build-tid● 200MB WAR fil● 2 minuter start-up● 2GB heap

■ Nye områder i nye komponenter■ Større forandringer: flyt til nye komponenter

Page 6: Continuous Delivery hos Tradeshift - Lund&Bendsen · Continuous Delivery hos Tradeshift Jan Ypma jyp@tradeshift.com. R 54 G157 B 215 R 0 G114 B 176 R 123 G193 B 77 R 235 G18 B 89

R 54G157B 215

R 0G114B 176

R 123G193B 77

R 235G18B 89

R 43G 43B 43

R 161G 161B 161

Vækst i systemer

■ Tradeshift i 2010

■ Tradeshift nu

Frontenddrupal

Backendjava

Frontendgrails

Backendjava

Frontendnodejs

(S)FTP(S)java

APIscala

Collaborationnodejs

Conversionsjava

Appsjava

......

Page 7: Continuous Delivery hos Tradeshift - Lund&Bendsen · Continuous Delivery hos Tradeshift Jan Ypma jyp@tradeshift.com. R 54 G157 B 215 R 0 G114 B 176 R 123 G193 B 77 R 235 G18 B 89

R 54G157B 215

R 0G114B 176

R 123G193B 77

R 235G18B 89

R 43G 43B 43

R 161G 161B 161

Vækst i deployment

■ 2011● Kompilere en ny version af Backend-Service i bussen

på vej til firmafest. Upload det manuelt til produktionsserveren.

■ 2016

Page 8: Continuous Delivery hos Tradeshift - Lund&Bendsen · Continuous Delivery hos Tradeshift Jan Ypma jyp@tradeshift.com. R 54 G157 B 215 R 0 G114 B 176 R 123 G193 B 77 R 235 G18 B 89

R 54G157B 215

R 0G114B 176

R 123G193B 77

R 235G18B 89

R 43G 43B 43

R 161G 161B 161

Softwareudvikling i dag

■ Fleksibel teknologi, faste kravKomponent på

Github Jenkins Docker container

Orchestration påGithub Jenkins

Terraform Puppet Staging

Integrationstest

Produktion

Page 9: Continuous Delivery hos Tradeshift - Lund&Bendsen · Continuous Delivery hos Tradeshift Jan Ypma jyp@tradeshift.com. R 54 G157 B 215 R 0 G114 B 176 R 123 G193 B 77 R 235 G18 B 89

R 54G157B 215

R 0G114B 176

R 123G193B 77

R 235G18B 89

R 43G 43B 43

R 161G 161B 161

Docker

■ Alt der bliver deployet, er docker containere■ Særlige tips

● Genstart er ikke selvsagt● Kør ikke som root, men f.eks. som uid 1 (daemon)● Komponenten monitorer sig self (statsd)● Gør Docker cache klar i base image (AMI)

■ Ikke alt af en build sker i Docker

Page 10: Continuous Delivery hos Tradeshift - Lund&Bendsen · Continuous Delivery hos Tradeshift Jan Ypma jyp@tradeshift.com. R 54 G157 B 215 R 0 G114 B 176 R 123 G193 B 77 R 235 G18 B 89

R 54G157B 215

R 0G114B 176

R 123G193B 77

R 235G18B 89

R 43G 43B 43

R 161G 161B 161

Jenkins

■ Servere og slaves administreres af Puppet■ Swarm plugin■ Github pull request builder plugin■ Maven, SBT, npm installeret på slave

Page 11: Continuous Delivery hos Tradeshift - Lund&Bendsen · Continuous Delivery hos Tradeshift Jan Ypma jyp@tradeshift.com. R 54 G157 B 215 R 0 G114 B 176 R 123 G193 B 77 R 235 G18 B 89

R 54G157B 215

R 0G114B 176

R 123G193B 77

R 235G18B 89

R 43G 43B 43

R 161G 161B 161

Terraform

■ Deklarativt DSL for at beskrive infrastruktur

resource "aws_elb" "frontend" {name = "frontend-load-balancer"listener {

instance_port = 8000 instance_protocol = "http" lb_port = 80 lb_protocol = "http"

}

instances = ["${aws_instance.app.*.id}"]}

resource "aws_instance" "app" {count = 5

ami = "ami-408c7f28"instance_type = "t1.micro"

}

Page 12: Continuous Delivery hos Tradeshift - Lund&Bendsen · Continuous Delivery hos Tradeshift Jan Ypma jyp@tradeshift.com. R 54 G157 B 215 R 0 G114 B 176 R 123 G193 B 77 R 235 G18 B 89

R 54G157B 215

R 0G114B 176

R 123G193B 77

R 235G18B 89

R 43G 43B 43

R 161G 161B 161

Puppet

■ Deklarativt DSL for at beskrive en maskine■ Central server (puppet master)■ Central Github repository

● Branch bliver til puppet “environment”■ Hiera

Page 13: Continuous Delivery hos Tradeshift - Lund&Bendsen · Continuous Delivery hos Tradeshift Jan Ypma jyp@tradeshift.com. R 54 G157 B 215 R 0 G114 B 176 R 123 G193 B 77 R 235 G18 B 89

R 54G157B 215

R 0G114B 176

R 123G193B 77

R 235G18B 89

R 43G 43B 43

R 161G 161B 161

Selenium

■ Byg op et testmiljø● Start infrastruktur med Terraform● Konfigurer servere med Puppet● Start komponenterne med Docker

■ 100% det samme som produktions-release■ Kør en masse tests

● Flere firefox maskiner

Page 14: Continuous Delivery hos Tradeshift - Lund&Bendsen · Continuous Delivery hos Tradeshift Jan Ypma jyp@tradeshift.com. R 54 G157 B 215 R 0 G114 B 176 R 123 G193 B 77 R 235 G18 B 89

R 54G157B 215

R 0G114B 176

R 123G193B 77

R 235G18B 89

R 43G 43B 43

R 161G 161B 161

Amazon eller ej

■ Rigtig nemt at bruge og automatisere■ Men findes ikke alle steder

● Kina● Udviklerlaptops

■ “Exit” strategi■ Abstraktion

● Consul i sted for ELB● Cassandra i sted for DynamoDB● Puppet + Docker i sted for EC2 Container Service

Page 15: Continuous Delivery hos Tradeshift - Lund&Bendsen · Continuous Delivery hos Tradeshift Jan Ypma jyp@tradeshift.com. R 54 G157 B 215 R 0 G114 B 176 R 123 G193 B 77 R 235 G18 B 89

R 54G157B 215

R 0G114B 176

R 123G193B 77

R 235G18B 89

R 43G 43B 43

R 161G 161B 161

Resilience (robusthed)

■ Uventede problemer opstår● Kode har bugs● Hardware fejler

■ Ingen nye komponenter i Tradeshift uden● High availability● Clustering● Performance tests

■ Zero-downtime deploy?

Page 16: Continuous Delivery hos Tradeshift - Lund&Bendsen · Continuous Delivery hos Tradeshift Jan Ypma jyp@tradeshift.com. R 54 G157 B 215 R 0 G114 B 176 R 123 G193 B 77 R 235 G18 B 89

R 54G157B 215

R 0G114B 176

R 123G193B 77

R 235G18B 89

R 43G 43B 43

R 161G 161B 161

Github og reviews

■ Lav pull request til en eller flere kollegaer● Automatisk unit test● Review

■ Merge til komponent-repository■ Nyt Docker image er releaset■ Lav pull request på puppet repository

● Automatisk integrationstest● Kun devops-team kan merge

Page 17: Continuous Delivery hos Tradeshift - Lund&Bendsen · Continuous Delivery hos Tradeshift Jan Ypma jyp@tradeshift.com. R 54 G157 B 215 R 0 G114 B 176 R 123 G193 B 77 R 235 G18 B 89

R 54G157B 215

R 0G114B 176

R 123G193B 77

R 235G18B 89

R 43G 43B 43

R 161G 161B 161

Konklusion

■ 8 DevOps understøtter 100 udviklere■ Enorm læringsproces, især for udviklerne■ Vi er ikke der endnu

● Mange komponenter ikke endnu “resilient”● Zero-downtime deploy● Stadig gammel infrastruktur tilbage