Skip to content

Commit 95c901b

Browse files
committed
L34 added New College
1 parent ef84b93 commit 95c901b

File tree

2 files changed

+30
-21
lines changed

2 files changed

+30
-21
lines changed

lectures/L34-slides.tex

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,19 +177,19 @@
177177
\end{center}
178178

179179
Its whole purpose is to manage your config as codes
180-
situation where you want to run your code using a cloud provider (e.g., AWS),
180+
situation where you want to run your code using a cloud provider (e.g., AWS).
181181

182182
\end{frame}
183183

184184

185185
\begin{frame}
186186
\frametitle{Planning is Essential}
187187

188-
Terraform has a ``plan'' operation: can verify the change it's about to make.
188+
Terraform has a \emph{plan} operation: can verify the change it's about to make.
189189

190190
Verify that we aren't about to give all our money to Jeff Bezos but also that a small change is actually small.
191191

192-
If you are happy with the change, apply it -- but things can change between plan and apply!
192+
If you are happy with the change, \emph{apply} it---but things can change between plan and apply!
193193

194194
\end{frame}
195195

@@ -229,9 +229,9 @@
229229

230230
Is this what we are best at?
231231

232-
Think extra carefully if you plan to do roll your own anything that is security or encryption related.
232+
Think extra carefully if you plan to do roll-your-own anything that is security or encryption related.
233233

234-
Remember that platforms like AWS are constantly launching new tools.
234+
Also, remember that platforms like AWS are constantly launching new tools.
235235

236236
\end{frame}
237237

@@ -274,7 +274,7 @@
274274
\begin{frame}
275275
\frametitle{Billing or Potato?}
276276

277-
Debates rage about names should be meaningful or fun.
277+
Debates rage about whether names should be meaningful or fun.
278278

279279
If the service is called \texttt{billing} it may be helpful in determining what it does, more so than if it were called \texttt{potato}.
280280

@@ -284,15 +284,24 @@
284284

285285
\end{frame}
286286

287+
\begin{frame}[fragile]
288+
\frametitle{New College, founded 1379}
289+
290+
\begin{center}
291+
\includegraphics[width=.8\textwidth]{images/New_College_garden_front_Oxford_England.jpg}\\
292+
CC-BY-SA 2.0, SnapshotsofthePast.com\\
293+
\tiny \url{https://commons.wikimedia.org/wiki/File:New_College_garden_front_Oxford_England.jpg}
294+
\end{center}
295+
\end{frame}
287296

288297
\begin{frame}
289298
\frametitle{Descriptive Names aren't Magic}
290299

291-
I've seen examples where the teams are called (anonymized a bit) ``X infrastructure'' and ``X operations''.
300+
I've seen examples where the teams are called (anonymized a bit) ``X~infrastructure'' and ``X operations''.
292301

293302
I'd estimate that 35\% of queries to each team result in a reply that says that the question should go to the other team.
294303

295-
It gets worse when a team is responsible for a common or shared component (e.g., library).
304+
It gets worse when a team is responsible for a common or shared component (e.g., a library).
296305

297306
\end{frame}
298307

lectures/L34.tex

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ \section*{DevOps for P4P}
4444
\paragraph{Continuous Integration.}
4545
This is now a best practice -- each change (or related group of changes) is built and tested to evaluate it. Once upon a time, putting the code changes together didn't happen on every build, but nightly or otherwise. That was a weird time when builds were slow and expensive. I think we're past that now, especially given that we have use of version control, good tests, and scripted deployments.
4646
It works like this:
47-
\begin{itemize}
47+
\begin{itemize}[noitemsep]
4848
\item pull code from version control;
4949
\item build;
5050
\item run tests;
@@ -56,7 +56,7 @@ \section*{DevOps for P4P}
5656

5757
\subsection*{Configuration as Code}
5858
Systems have long come with complicated configuration options.
59-
Sendmail is particularly notorious, but apache and nginx aren't super
59+
Sendmail is particularly notorious (though who runs their own mail server anymore?), but apache and nginx aren't super
6060
easy to configure either. But the environment that you're running your code in is also a kind of configuration. Furthermore, it's an excellent idea to have tools for configuration. It's not enough to just have a wiki page or github document titled ``How to Install AwesomeApp'' (fill in name of program here). Complicated means mistakes and people will forget steps. Don't let them make mistakes: make it automatic. The first principle is to treat \emph{configuration as code}.
6161
Therefore:
6262
\begin{itemize}
@@ -70,7 +70,7 @@ \subsection*{Configuration as Code}
7070
go down after a while, for instance.
7171
\item aim for a suite of modular services that integrate together smoothly.
7272
\item refactor configuration files (Puppet manifests, Chef recipes, etc);
73-
\item use continuous builds
73+
\item use continuous builds.
7474
\end{itemize}
7575

7676
One particular example of applying all those principles to infrastructure
@@ -82,26 +82,26 @@ \subsection*{Configuration as Code}
8282
Even beyond that, you can ask Terraform to manage things like who has access
8383
to your GitHub repositories and who is in what groups (e.g., reviewers).
8484

85-
Terraform does support a ``plan'' operation so it can tell you what it will
86-
do, so you can verify that, before anything is actually changed. The plan can also tell you expected changes in terms of cost, which both helps verify that we aren't about to give all our money to Jeff Bezos but also that a small change is actually small. If you are happy with the change, apply it!
85+
Terraform does support a \emph{plan} operation so it can tell you what it will
86+
do, so you can verify that, before anything is actually changed. The plan can also tell you expected changes in terms of cost, which both helps verify that we aren't about to give all our money to Jeff Bezos but also that a small change is actually small. If you are happy with the change, \emph{apply} it!
8787

8888
The plan operation isn't perfect as things can change between the plan and apply steps, and some things like unique identifiers are really only known if they are created. Non-destructive changes are generally easy to deal with; just make another PR that corrects it. Destructive changes, however...
8989

9090
It's easy for very bad things to happen with Terraform as well: you could accidentally tell it you want to destroy all GitHub groups and it will gladly carry it out. This has the side effect of causing some people to message you on Slack in a panic, thinking that the removal of their GitHub access is actually a sign they are being fired. They were not. But I see why they were worried, honestly. Restoring some information in destructive changes might not be as easy as just reverting the change: if you told your tool to destroy a database, reverting the change will re-create the database, but not its contents. You took backups, right?
9191

9292
\subsection*{Common Infrastructure}
93-
Using tools to manage the infrastructure is a good start, but it also matters how services use it. You should view different parts of your infrastructure as having an interface and communication is done exclusively via the interface or API. This reduces the coupling between different components, and, as we've discussed, allows you to scale the parts that need scaling.
93+
Using tools to manage the infrastructure is a good start, but it also matters how services use it. You should view different parts of your infrastructure as having an interface. Communication is done exclusively via the interface or API. This reduces the coupling between different components, and allows you to scale the parts that need scaling.
9494

95-
Try to avoid not-invented-here syndrome: it is usually better to use an existing tool -- whether open-source, commercial, or provided by your cloud platform -- than to roll your own. Some examples might be:
96-
\begin{itemize}
95+
Try to avoid not-invented-here syndrome: it is usually better to use an existing tool---whether open-source, commercial, or provided by your cloud platform---than to roll your own. Some examples might be:
96+
\begin{itemize}[noitemsep]
9797
\item Storage: some sort of access layer (e.g., MongoDB or S3);
9898
\item Naming and discovery (e.g., Consul)
9999
\item Monitoring (e.g., Prometheus)
100100
\end{itemize}
101101

102102
However, be prepared to build your own tools if needed. Sometimes what you want, or need, doesn't exist (yet). Think carefully about whether this service that is needed is really part of your core competence and whether creating it adds sufficient value to the business. It's fun to make your own system and all, but are you doing what you're best at?
103103

104-
Think extra carefully if you plan to do roll your own anything that is security or encryption related. I'm just going to say that unless you have experts on staff who know the subject really well and you're willing to pay for external audits and the like, you're more likely to end up with a terrible security breach than a terrific secure system.
104+
Think extra carefully if you plan to do roll-your-own anything that is security or encryption related. I'm just going to say that unless you have experts on staff who know the subject really well and you're willing to pay for external audits and the like, you're more likely to end up with a terrible security breach than a terrific secure system.
105105

106106
As a second followup soapbox point to that: if what you are looking for doesn't exist, there might be a reason, Maybe the reason is that you are the first to think of it, but consider the possibility that it's not that good of an idea (either due to inefficiency or just not being great in principle).
107107

@@ -115,9 +115,9 @@ \subsection*{Naming}
115115

116116
Allegedly-descriptive names aren't always the easiest to figure out either. I've seen examples where the teams are called (anonymized a bit) ``X infrastructure'' and ``X operations'' and I'd estimate that 35\% of queries to each team result in a reply that says that the question should go to the other team. It gets worse when a team is responsible for a common or shared component (e.g., library).
117117

118-
The \textit{real} solution to this kind of problem at least in my opinion, is similar to the idea of service discovery: we need a tool that provides directory information: if I want to know about \texttt{potato} I need to be able to look it up and have it send me to the right place. Tools for this, like OpsLevel, exist (even if they do much more than this). Such tools can also give some information about service maturity -- are you using deprecated things, do you have unpatched security vulnerabilities, is there enough test coverage...?
118+
The \textit{real} solution to this kind of problem at least in my opinion, is similar to the idea of service discovery: we need a tool that provides directory information: if I want to know about \texttt{potato} I need to be able to look it up and have it send me to the right place. Tools for this, like OpsLevel, exist (even if they do much more than this). Such tools can also give some information about service maturity---are you using deprecated things, do you have unpatched security vulnerabilities, is there enough test coverage...?
119119

120-
There are potential morale implications for insisting on boring names for teams and services. A team that has named itself after some mythological name or fictional organization can have some feeling of identity in it -- Avengers, Assemble -- and that can be valuable.
120+
There are potential morale implications for insisting on boring names for teams and services. A team that has named itself after some mythological name or fictional organization can have some feeling of identity in it---Avengers, Assemble---and that can be valuable.
121121

122122
\subsection*{Servers as cattle, not pets}
123123
By servers, I mean servers, or virtual machines, or containers. It's much better to have a reproducible process for deployment of a server than doing it manually every single time. The amount of manual intervention should be minimized and ideally zero. If this is done you can save a lot of hours of time, reduce errors, and allow for automatic scaling (starting and stopping servers depending on demand).
@@ -130,7 +130,7 @@ \subsection*{Servers as cattle, not pets}
130130

131131
This is also called ``test in prod''. Sometimes you just don't know how code is really going to work until you try it. After, of course, you use your best
132132
efforts to make sure the code is good. But real life is rarely like the test system. I've seen many operations that work beautifully in the development environment where there are 100~000 records... and time out in production where there are 10~000~000. But for canarying deployments of the second kind, the basic steps:
133-
\begin{itemize}
133+
\begin{itemize}[noitemsep]
134134
\item stage for deployment;
135135
\item remove canary servers from service;
136136
\item upgrade canary servers;
@@ -150,7 +150,7 @@ \subsection*{Servers as cattle, not pets}
150150
Containerization gives many of the advantages of this separation, but without nearly so much overhead of the guest operating systems (both its maintenance and runtime costs). Containers are run by a container engine so there is some abstraction of the underlying hardware, and the container is assembled from a specification that says what libraries, tools, etc. are needed. And thus when the container is built and deployed it is sufficiently isolated but shares (in read only mode) where it can. So a container is a very lightweight VM, in some sense. See this diagram from~\cite{netappcontainer}:
151151

152152
\begin{center}
153-
\includegraphics[width=0.55\textwidth]{images/cvm.png}
153+
\includegraphics[width=0.5\textwidth]{images/cvm.png}
154154
\end{center}
155155

156156
So the goal of your build process should be to produce a container that is ready to be deployed and managed by the other parts of your infrastructure (e.g., Kubernetes).

0 commit comments

Comments
 (0)