-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpresentation.html
844 lines (454 loc) · 12.3 KB
/
presentation.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
<!DOCTYPE html>
<html>
<head>
<title>Getting to Continuous Deployment</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css">
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
@import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
@import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
body { font-family: 'Droid Serif'; }
pre { font-size: 80%; }
.remark-slide-content { font-size: 25px; }
h1, h2, h3 {
font-family: 'Yanone Kaffeesatz';
font-weight: normal;
}
.remark-code, .remark-inline-code { font-family: 'Ubuntu Mono'; }
#video {
width: 40%;
padding: 0;
overflow: hidden;
margin: auto;
}
#wrap {
height: 100%;
padding: 0;
overflow: hidden;
margin: auto;
}
#scaled-frame {
width: 1400px;
height: 900px;
border: 0px;
zoom: 0.5;
-moz-transform: scale(0.5);
-moz-transform-origin: 0 0;
-o-transform: scale(0.5);
-o-transform-origin: 0 0;
-webkit-transform: scale(0.5);
-webkit-transform-origin: 0 0;
}
@media screen and (-webkit-min-device-pixel-ratio:0) {
#scaled-frame {
zoom: 1;
}
}
</style>
</head>
<body>
<textarea id="source">
class: center, middle
### Getting to Continuous Deployment
![:scale 75%](img/qr.png)
---
class: center, middle
## Getting to Continuous Deployment
![:scale 75%](img/businessCard_pp_lee.png)
Lee Johnson (CPAN: LEEJO / github: leejo)
???
---
class: center, middle
![:scale 100%](img/01.png)
???
A bit about PayProp
ZA, UK, CA, US
Slowly opening in CA and US
---
class: center, middle
![:scale 100%](img/CA.png)
---
## Continuous Deployment?
"Continuous deployment (CD) is a strategy in software development where code changes to an application are released automatically into the production environment."
--
Simple!
???
This talk is more about all of the things you need in place before you even consider CD, it's not a talk about how to setup and configure all of the CD like things
I might show some of that at the end if we have time however
Small caveat - talk was written as an internal presentation that I've adapted for a wider audience.
---
## Questions?
--
* Jot them down and if we have time at the end we can cover them
--
* Jot down the point number in the bottom right corner of the slide as well
---
## A Brief Introduction [to me]
--
* Backend/API developer
???
Perl, Python, Ruby, Bash, C (but rusty), etc
--
* Largely in the "payments" space
???
often backend bank integration kind of stuff
--
* I've been doing this for twenty years 😳
???
but only worked for three companies in that time
so have seen tech stacks grow
--
* More in a site reliability engineering [SRE] role these days
--
* Often been involved on the deployment side of things
???
Including 3am starts - remember those?
wrote quite a few tools around this in current and previous jobs
--
* Pragmatist, not an idealist
---
## Quixotism?
*/kiːˈhoʊtɪzəm/*
???
On that last point
--
* "Impracticality in pursuit of ideals...
--
* "... especially those ideals manifested by rash, lofty and romantic ideas"
--
* "... It also serves to describe an idealism without regard to practicality"
--
* Need to consider the practicality of getting to Continuous Deployment
---
## Practicality (Technical)?
--
* What state is your current deployment process in?
--
* Can you deploy all/some/no changes without a maintenance windows?
???
how often and how long are those maintenance windows?
--
* Do you need to babysit the deployment process?
--
* Run commands/restart processes manually?
--
* Apply DB updates manually?
--
* How's your monitoring?
--
* How quickly do you know PROD is having issues?
--
* Who gets alerted to that?
---
## Practicality (Human Side)?
--
* I don't want to be woken up because someone merged something to `main` at X o'clock CET
???
with distributed teams/devs those merges can happen
--
* I like to have my weekends free of work stuff
--
* Friday evening is part of my weekend...
--
* FAANG's site reliability engineering [SRE] teams are probably bigger than your entire IT department
???
FAANG: Facebook (now Meta Platforms), Amazon, Apple, Netflix and Google
--
* By an order of magnitude
--
* They effectively have 24/7 SRE coverage
???
you probably do not
---
## Practicality (Human Side)?
* PROD will have issues even when you make no changes
--
* Especially in "cloud" environments
???
"failure modes in cloud computing" is a entire other talk
i've been collecting these so might give that talk one day
--
* So by association CD can never be risk free
--
* "This change can't possibly have any impact"
--
* I disagree
--
* You're going to lose an evening or weekend at some point even with no deployments
--
* So reduce the chance of that happening
???
when are the most PROD outages? when devs are in the office deploying changes
---
## Our Infrastructure (PROD)
--
Long before I joined (early years, mid 2000s)
--
* A single server sat in an office somewhere in Stellenbosch (South Africa, Western Cape)
???
pretty easy to deploy to that
root on everything as well
---
## Our Infrastructure (PROD)
When I joined (mid 2013):
![:scale 50%](infra_diagrams/aws_region.png)
???
There's a tonne of stuff i haven't put in here
the bits in orange are the ones of concern: what we deploy code to
---
## Our Infrastructure (PROD)
Current situation (mid 2023)
![:scale 50%](infra_diagrams/aws_regions.png)
???
also added daemon servers
---
## Our Infrastructure (PROD)
--
* Deploy to: web servers, batch server, daemon server(s)
--
* Autoscaling (Web and Daemon servers)
--
* We handle payments and reconciliation for the rental industry
--
* Quietest case: c. 20 servers to deploy code to
* Busiest case (start/end of month): *at least* 100 servers to deploy code to
* Spread across 4 different AWS regions
???
I consider this large enough to mean automated deployment is necessary, but small enough where automated deployment can cause problems
if you have thousands of severs you can do a rolling release and stop then rollback when you identify problems
if you only have dozens or hundreds then you may well have finished rolling out a problematic deployment before you realise it is problematic
--
* Minimum threshold for automated deployment is probably 1 server anyway
---
## Our Infrastructure (PROD)
--
* Deployment started as tarballs
???
When it was just one or two servers
--
* Then bash scripts
???
When we were in one region
--
* Now a Perl script that is configuration driven
???
When i started to get annoyed by the bash scripts and we added more regions
--
* Future aim is containerisation so images/containers/whatever
???
At which point the toolchain will need refactoring/replacing
---
## Getting To Continuous Deployment?
--
* What are the things you need in place before you even *think* about CD?
--
* How do they help?
--
* How do they hinder?
---
## You Need: Consistency Through Your Environments
--
* Same version of Perl (currently 5.32 for us)
--
* With the same versions of the libraries
--
* Same version of the Operating System
--
* With the same versions of critical dependencies
???
e.g. PDF generation
--
* This goes for DEV all the way through to PROD
--
* Write once run everywhere is nice in theory
--
* Until you need to run `strace` to figure out a regression
---
## You Need: Comprehensive Automated Testing
--
* Goes without saying?
???
Yet i still see significant changes that lack test coverage
ramble about this a bit...
legacy? might not have tests
third parties? difficult, need emulators, etc
--
* Adding tests has a large negative impact on velocity
--
* At least in the short to medium term
--
* It should become a large positive impact in the long term
--
* If you do it right
--
* There's no such thing as a one line or one character change
--
* Unless that change is only in the test
---
## You Need: Continuous Integration (CI)
--
* You need tests for this (see previous slide)
--
* CI needs its own infrastructure
--
* How easily can you build that up and tear it down?
--
* How close does it represent PROD architecture?
???
a single box and filesystem is not like PROD
firewalls?
etc?
--
* Failures in the CI pipeline are sometimes failures in the toolchain
--
* But false negatives (failures) are better than false positives (passes) in CI
???
A CI suite falsely passing is obviously bad
---
## You Need: A Review and Quality Assurance [QA] Process
--
* Anything that can be automated here should be in the test stage
--
* Linting, etc
--
* Formalise the review process and apply to all merge requests
--
* With good judgement to allow exceptions
---
## You Need: Staging
--
* For the bigger changes
--
* Part of the review process
--
* For UAT from clients
--
* This may inform the release process if it's not a trivial set of changes
---
## You Need: An Internal Toolchain
--
* Deployment scripts
--
* Schema migrations and updates
--
* Repo management (if big enough)
--
* Monitoring
--
* Alerting
---
## You Need: An "External" Toolchain
--
* You will rely on tools built outside your company
--
* Choose wisely, couple loosely
--
* Gitlab
--
* AWS
???
We even use AWS to autoscale our CI server, which is neat
--
* Monitoring
* Alerting
---
## You Need: A Rollback Feature
--
* Built into the deployment process
--
* We tag every release to each region
--
* We annotate monitoring dashboards with releases
--
* We can rollback to previous releases trivially
--
* If you do release frequently this is (in theory) easier
---
## You Need: To Think About The Database / Complex Deployments?
--
* Feature flags
--
* Still have to babysit significant schema changes
--
* Write them in a "no downtime" approach if possible
--
* Backwards and forwards compatible
???
and then remove the backwards compatible parts after rolling forwards
--
* Deploy them during quiet periods of the month?
---
## You Need: Checking Once Changes Hit Production
--
* How do the original developers *know* it has been deployed?
???
we send notifications to Slack and email
--
* How do you verify those changes?
???
internal accounts / test users clearly
---
## You Need: Continuously Deploy All The Internal Things First
--
* A good proof of concept
--
* Internal tools *probably* don't affect the bottom line.
--
* Internal tools breaking for a short time isn't critical
* At least not immediately, that is to say no customer impact
* And you *probably* don't have to fix them out of office hours
???
If it's internally facing only you can probably use CD and not worry about the short-term consequences... maybe?
--
* Encourages development of the toolchain
---
## How Far Have *We* Got?
--
We have full CD on internal tools:
--
* Translation manager
* DB extract/backup scripts
* The deployment scripts themselves (meta!)
???
describe each one
--
* We have Semi CD elsewhere
---
## Semi-Continuous Deployment?
* One click "deploy to everywhere" is a nice compromise?
--
![:scale 100%](img/08_pipelines.png)
---
## Semi-Continuous Deployment?
* One click "deploy to everywhere" is a nice compromise?
![:scale 100%](img/09_pipeline_deployed.png)
---
## Semi-Continuous Deployment?
* One click "deploy to everywhere" is a nice compromise?
![:scale 75%](img/10_deployment_output.png)
---
## Questions or Bonus "Slides" (i.e. Demo)?
???
bonus slides show:
* pipelines
* gitlab CI
* gitlab CD
* grafana dashboards with annotations
* slack channel with deployment info
---
## Questions?
</textarea>
<script src="https://remarkjs.com/downloads/remark-latest.min.js" type="text/javascript">
</script>
<script type="text/javascript">
remark.macros['scale'] = function (percentage) {
var url = this;
return '<center><img src="' + url + '" style="width: ' + percentage + '" /></center>';
};
var slideshow = remark.create({
highlightLines: true
// ,slideNumberFormat: ''
});
</script>
</body>
</html>