Hacker News new | ask | show | jobs
by MuffinFlavored 1214 days ago
Let me ask a silly question.

Use case, I'm on Mac OS X (aka not Linux, not Windows). I have an Apple M1 processor (aka not x86_64). I have 8GB of RAM (silly mistake on my end, I know). Therefore, Docker + virtual machine based solutions are too expensive memory wise.

However, I also like to think in terms of "let me separate this functionality into say... a Kubernetes workload like a pod"

There's no good containerization solution for Mac OS.

Can something like `mask` be used to achieve basically a "poor man's k8s" for a long running service?

Basically, run these 5 or 6 services in parallel, let me be able to see their logs individually.

If not, I completely understand. I just can't tell if there is an actual need for a solution like this, if it already exists and I just can't find it, etc.

2 comments

Mask can't directly solve this problem by itself, it just runs whatever script you give it. If you can write a python/js/bash/etc script to achieve what you want, you can stick it inside a maskfile with the rest of your commands.

Regarding docker, I haven't tried it on M1 yet. However, I've been using Ubuntu multipass [1] for over a year now and I'm very happy with it. It makes it easy to set up and manage VMs for different projects, and it seems to run very efficiently on macOS in my experience. When a project needs a docker container like postgres, I just run docker compose inside the VM rather than running it directly in macOS. You can also limit the amount of CPU/RAM the VM uses to keep things under control.

[1]: https://github.com/canonical/multipass

Have you tried using a process manager like supervisord[1] or pm2[2]? The former has a pretty clean declarative interface that you could view as a replacement for something like a docker-compose file or a k8s pod config.

You don't get any containerization/isolation benefits obviously, but it sounds like you've already accepted that.

[1] http://supervisord.org/ [2] https://github.com/Unitech/pm2

Foreman is a nice, easy to use local process manager. It's what heroku and such use with a simple Procfile for defining multiple processes, but it would work fine for running multiple developer tools, testing services/dependencies, etc.

There are multiple implementations of it, heres the canonical one: https://github.com/ddollar/foreman And heres a go version that's easier to install and use: https://github.com/ddollar/forego

And another possibly lighter alternative is something like concurrently: https://github.com/open-cli-tools/concurrently