All around me are familiar (inter)faces
Currently Reading: Understanding the Linux Kernel, 3rd Edition, by Daniel P. Bovet
This week’s challenge was overcoming the idea of dumb questions, and just asking things. In the end, someone has to ask them, right?
It started with figuring out PHP FPM, and wondering “What is FPM”. A quick google search showed that FPM stands for “FastCGI Process Manager”. This brought me down the hole of.. what is FastCGI, what makes it Fast, and heck, what is CGI?
So, CGI (Common Gateway Interface) is a set of rules that defines how a web server and the things around it talk to each other. This made what I thought a web server was a lot less magical when I realized I was only taking care of managing connections, taking care of data, etc.
Summarized in RFC 3875 (https://tools.ietf.org/html/rfc3875) :
“The server is responsible for managing connection, data transfer,
transport and network issues related to the client request, whereas
the CGI script handles the application issues, such as data access
and document processing.”
Okay, so now that I understood what CGI is, I wanted to figure out what makes FastCGI so sonic fast. FastCGI is CGI but better because it uses persistent processes to handle a series of requests, instead of each request needing it’s own process.
Simple enough… and PHP FPM, well, that’s just a way to manage all the PHP requests coming through FastCGI by allocating different workers, etc.
I kept seeing this word “interface” and being told repeatedly “think of it as a protocol”. When trying to figure out what the difference between an interface and a protocol was, I found this:(https://serverfault.com/questions/454092/difference-between-protocol-and-service-interface).
“Because of service interface being “in” the protocol, you can not differentiate them. the protocols consist of interfaces.”
Protocols consist of interfaces, but what does that really mean? In the OSI reference model the packet is sent through the layers, and this means every layer must communicate with the layer below and above it. It communicates through these different layers through service interfaces.
How I understand it, is an interface is where two “systems” (which can be loosely defined) talk to each other, and a protocol is a set of rules for two devices to talk to one another.
Sticking with the interface theme, I was digging through the Calico code when I stumbled across this:
I always thought that a CNI was a competitor of Calico, but that’s because my understanding of it was pretty poor. After digging around, and asking in the Kubernetes Users slack, someone sat me down and explained that CNI (Container Network Interface) is what Kubernetes uses to have pods talk to one another.
If you’re sitting here going “That’s what Calico, Weave, Flannel, etc do!”, well that’s true too. Those services are actually establishing the connection, assigning the IPs, so forth, and the CNI (Container Network Interface) is what is bridging (haha, bridging, networking) that gap between the container and the plugin (Calico, Weave, etc) itself.
Docker has it’s own network interface too (libnetwork), but it really doesn’t play nice with Kubernetes, which is why Kubernetes uses CNI (built by CoreOS, used by rkt).
Check out more on why they don’t use libnetwork here: http://blog.kubernetes.io/2016/01/why-Kubernetes-doesnt-use-libnetwork.html
For the kubernetes project, I’m working on learning about different CIs to see which would work best in the platform. Jenkins seemed most popular when I started making the graph, however looking at Gitlab, Circle-CI and Travis-CI. Also, as much as I love the interface of Docker, I want to take the elitist route and try rkt since I’m using Container Linux as my image.
Right now I’m less in the “building and creating a universe” stage and more in the “reading about everything and watching tons of videos” stage. It’s not as rewarding as building my own universe (platform), but it’s the dirty work that will make me more informed in the long run.
Ending on a fun note, I signed up for my employer’s Raspberry Pi competition, and gained a good amount of interests for the ideas. However, some of the ideas seem a little unrealistic, but it’s a friendly competition so what could it hurt! So far I’ve got:
- Rock ’Em Sock ’Em Robots — Fighting Robots.
- Coffee Machine / Cocktail Maker — Can be triggered with a flag — coffee for terraform deploys or through RedShell, perhaps through google home / Cortana / Mac, maybe you can send it commands directly? HipChat integration ?
- Fortune Bot — dispense random unix facts via printer or something with Stallman’s face on them
- Hydroponic Farm
The Rock ’Em Sock ’Em Robots idea is the unrealistic one, where one robot would be an AI that you would fight against, and hooking up both robots up to servos so they can fight. But, we’ll see what happens.
Next week will be more diving into networking, and hopefully I’ll get some of these questions answered!