KTH ‘17. SE and Distributed Systems
A deep dive into Linux namespaces, part 4
In this final post of the series we take a look at Network namespaces. As we hinted at during the intro post, a network namespace isolates network related resources - a process running in a distinct network namespace has its own networking devices, routing tables, firewall rules etc. We can see this in action immediately by inspecting our current network environment. The ip Command Since we will be interacting with network devices in this post, we will re-enforce the superuser requirements that we relaxed in the previous posts. From now on, we will assume that both ip and isolate are being run with sudo. ...
A deep dive into Linux namespaces, part 3
Mount namespaces isolate filesystem resources. This pretty much covers everything that has to do with files on the system. Among the encapsulated resources is a file containing the list of mount points that are visible to a process and as we hinted at in the intro post, isolation can enforce that changing the list (or any other file) within some mount namespace instance M does not affect that list in a different instance (so that only the processes in M observe the changes). ...
A deep dive into Linux namespaces, part 2
In the previous post we dipped our toes into namespace waters and in the process, saw how simple it was to to get a process up and running with an isolated UTS namespace. In this post, we shine a spotlight on the User namespace. User namespaces isolate, among other security related resources, user and group identities in the system. We will focus solely on the user and group ID (UID and GID respectively) resources in this post as they are fundamental role to carrying out permissions checks and other security related activities throughout the system. ...
A deep dive into Linux namespaces
In this series of posts we will look closely at one of the main ingredients in a container - Namespaces. In the process, we will create a simpler clone of the docker run command - our very own program that will take as input a command (along with it’s arguments if any) and spin up a container process to run it, isolated from the rest of the system similar to how you would docker run it from an image. ...
Understanding Consensus and Paxos in Distributed Systems
Computers can sometimes be unexpectedly tricky. Having them accomplish seemingly rudimentary tasks can be a lot more complicated than we would expect. One example is having a group of them decide and come to an agreement upon something: a process known as consensus. That something could be anything. It could be what time of the day they should begin their attack to take over the world. Or simply the amount in your bank account at some given moment: Without agreement that amount may be $10 according to your work pc while your laptop at home says $100. Let’s elaborate on the former scenario as it’s more likely to happen. Say we have three machines that we call X, Y and Z plotting to conquer the world on a Monday. They have an plan of attack that only works if all available computers show up to battle and no one stays behind. A number of things can go wrong while they’re trying to come to an agreement on what time to begin their attack. One fundamental problem arises because everyone has an opinion. Computer X maybe suggests 08:00 for the takeover since it’s monday morning and the humans are still hungover from the weekend while some other computer Z thinks 13:00 is better because, well, Z’s not really a morning computer. Having them agree on a time is crucial as the humans have a better chance if all computers don’t show up. Another issue is that these computers are located in different parts of the world, communicating via cables and whatnot. If X suggests 08:00, it has to be sure that the suggestion reaches Y and Z as long as they are alive so as not to end up alone on the battlefront. ...
Client-side haskell
Hi! before introducing this post let’s do some myth busting! 😎 Purely functional programming languages have no place in the browser and Haskell is a magical genius language that everyone talks about but no one really uses. Truth is, haskell is not a difficult language to program in and it’s past reputation of never being used in the industry has always been uncalled for. As for how we can use it to program applications for the web, there are some really cool projects that make this possible and this post will show you just that. This will be a hands on tutorial on how to use Haste, a Haskell to Javascript compiler that allows you to write Haskell code that can be executed on the web. We will be creating a simple pong game while exploring some of the features of the Haste environment. You can check the game out over here. ...