Virtualenv Shell Tools? (Development environment isolation)

Soldato
Joined
18 Oct 2002
Posts
6,817
Location
Cambridge
I'm taking on a bit of contract development work, and as part of it I'm going to need to install a toolchain including things like the AWS CLI tool, a particular version of Ruby, NodeJS, kubectl and probably other things I don't know about yet. I have a Mac desktop I'd like to use for this work, but in the past I've always been fastidious about isolating different project dev environments, mainly due to having had horrible experiences with conflicts between different versions of tools :eek:

The last time I was contracting I usually did a combination of the following:

1. Spin up a project-dedicated Linux VM locally or on EC2 / DigitalOcean / Linode
2. Run Docker containers / compose stacks locally
3. Use a dedicated computer just for the project and run everything natively (though this was only really practical for big, long-running projects)

As this work is part-time and I'm not sure how long it'll last, I'm unwilling to do item 3, but having worked with Python recently I was wondering whether there was a lighter-weight way of doing this that doesn't rely on VMs which I could just run on my Mac, similar to Virtualenv? My vision is that all my project tools are only available (and 'loaded') when I'm within a particular project folder on my Mac. I don't mind activating this environment manually if needed.

I'm pretty sure I've come across tools like this in the past, with BSD jails and also running Docker natively on Linux, but I've always found Docker to be really slow and resource-heavy on MacOS, so I'd probably prefer to avoid that this time. I've played with Nix flakes recently, and I suspect these will do just what I want, but unfortunately I find Nix to be a really opaque system which seems to be fragmented by so many opinions that I suspect I'd spend more time tinkering with it than doing actual work! :)

I'd really welcome any thoughts on this from Linux / BSD-based developers. I'm sure in 2024 (nearly 2025!) there must be some good tooling around for this. Thanks :)

EDIT - I am currently investigating Devbox (https://www.jetify.com/devbox/), which seems quite promising.
 
Last edited:
Thanks, those are some good thoughts. Docker Desktop seems like a fairly unpleasant piece of software these days, so I'll have a look at Podman.

I tend to prefer developing in Linux environments over the weirdness that is Mac OS, personally, as pretty much all deployments I've encountered in the last 12 years or so have some variant of Linux.

One slight awkwardness with things right now is that there seems to be a bit of a shift away from x86 to ARM for a lot of smaller / clustered workloads I've worked with, but other than the Raspberry Pi and the Apple ecosystem I'm not entirely sure what non-laptop (e.g. workstation) options there are available for this architecture.

If anyone's interested, I'll post an update with what I end up doing, as I think the work will be starting next week :)
 
Yeah, I think that for lighter stuff a Pi would be fine, it's just I know from experience that some of the heavy build processes / running certain workloads in debug mode (full logging / tracing etc.) can really hammer even modern systems, particularly in regards to RAM. I was working on a medium-sized project a while ago and was regularly exceeding 24GB RAM use for the few services running locally (on ARM).

If I had a fairly good guarantee of steady work, I think my favourite solution of the past few projects was running a fairly beefy cloud VPS and just remoting into it with Mosh all the time. The main benefit I found was that the process of downloading and installing packages - something I was doing all the time as a NodeJS developer - was so much faster on a server in a datacentre, compared to over my FTTC connection at home or in the office.
 
Back
Top Bottom