Cutting through the laptop installation jungle: How our MacBook setup repository helps our Data Scientists to organise their tools in only half a day
For me, one of the most frustrating parts of learning to program in earnest was that I always had some tooling problem before I could start. When I found a cool Python package and was eager to wrap my head around how it could help me to solve a problem, for instance, I often lacked the right version of Python to just install the package version I wanted and dive right in. After doing a workaround-install of another Python version, and copy-pasting enough seemingly arcane commands to my path variable from Stack Overflow, I got it to work, but at the cost of my system (and my Python) looking like this:
The setup on my machine as a novice Python programmer…
Virtual environments and package management
Now, several years later and some painful lessons wiser, I use pyenv and pipenv to manage Python and its packages and provide me with a virtual environment with the exact versions I want without breaking anything.
To understand how those two work, picture your programming environment as a workbench (Python) and some tools (your non-standard packages). If you have a workbench with tools set up for a certain project and you want to work on another project at the same time you will find yourself in trouble if the new project needs a different combination of workbench and tools than the current one. Ideally you would want to freely set up a new, independent workbench including the specific tools every time you start a project. This is exactly what pyenv and pipenv do: Pyenv allows you to download several different versions of Python without them getting in each others way, whereas pipenv can use those versions and combine them with the exact package versions you want, giving you an independent workbench for your new project. Tools like this exist for many languages and solve one of the greatest pain points of developing. In case you never heard of the concept of a virtual environment in regards to development, you could take a look at this blogpost, describing how pipenv works in greater detail.
Use Ansible to set up your development workflow without a headache
These tools, though, only fix one part of development hell. Because you have to install them and do some configuration first, along with all the other apps/tools you need to effectively work in a team.
And if you get a new machine or something ever goes wrong with your laptop, a failed update, an install into the wrong directory, or the replacement of a system-critical binary with a wrong version, you need to set them up again. In a company that collaborates across many tools, this can quickly take a day or two, not to mention the apprehensiveness toward reinstalling a laptop that “kind of” works, just to avoid the pain of manually reinstalling everything. This is not a good situation for a company to be in.
The quicker you can reliably set up your laptops, the quicker you can start producing value for your clients
This is why, at idalab, deciding on a functional workflow for our development process in Python (via pyenv and pipenv) was only half the journey. To set up our MacBooks from start to finish, we use a special configuration repository that uses Ansible (https://www.ansible.com/) to give us a stable reproducible Macbook setup we have 100% confidence in.
This repository puts us in the position to be able to set up a new machine or reinstall an existing one within half a day, during which we can already work with it because the setup is running discreetly in the background.
Where to go from here
We made our MacBook repository available for everyone on GitHub. So if you want to try it out yourself, follow this link and take a look: https://github.com/idalab-de/macbook-configuration
In the Readme you will find details on how to use and/or customize the install for your own needs.
We hope it helps you as much as it helps us!
The MacBook setup repository was originally written by our former colleagues Daniel Kirsch and Noa Shinitski and is now maintained by David Hinrichs.
Feature Photo by Cesar Carlevarino Aragon on Unsplash