News for hackers. Stuff that matters.
Re:New MacBook Air by ehutch79 on Wednesday March 18, 2020 @09:19AM (#22616287)
A typical JS developer is not building/rebuilding docker containers constantly.
Re:New MacBook Air by technotarek on Wednesday March 18, 2020 @09:51AM (#22616614)
That's correct. Not building/re-building the containers constantly. However, the initial build takes forever and some containers tend to crash (e.g., Prisma). Plus, in our case where we're using Angular, the recompiling of the app on change sends the fan into overdrive and I get noticeable lag on application switching. Again, this is on a 2013 MBA, which is almost ridiculous, but I'm that type of person. Still proudly sporting my iPhone SE. My development partner is on the 2019 MBA and has noticed improvement, but albeit rather underwhelming.

As an aside, I haven't taken the time to pin point the exact problem, but as much I prefer to use Firefox, it doesn't seem to do a great job of managing resources for the SPAs we're building.

Re:New MacBook Air by ricketycricket on Wednesday March 18, 2020 @09:59AM (#22616703)
Make sure your node_modules directory is mapped to a local volume inside docker (not synced to your Mac). This dramatically improves build performance in Docker for Mac. If using docker compose, try this out https://stackoverflow.com/questions/29181032/add-a-volume-to...
Re:New MacBook Air by estebarb on Wednesday March 18, 2020 @10:08AM (#22616792)
JS build times? I guess that I haven't touched JS development in a while... My Early 2011 MBP (with SSD and RAM upgrade to 16GB) still rocks with intensive information retrieval and other big data tasks (Go, Java, Python).
Re:New MacBook Air by ehutch79 on Wednesday March 18, 2020 @10:00AM (#22616715)
This is a dumb question, but you're talking about using docker, right? Doesn't docker spin up an entire vm for containers? That does seem pretty heavy for a MBA of any generation?
Re:New MacBook Air by menssen on Wednesday March 18, 2020 @10:38AM (#22617100)
It's almost impressive that Docker-on-macOS works so seamlessly that people are downvoting this comment. Yes, Docker containers run in a Linux VM on macOS. It's just one though, and generally seems fine on low resource workstations, unlike Vagrant setups from a few years ago that tried to run a VM for every application.
Re:New MacBook Air by qayxc on Wednesday March 18, 2020 @10:17AM (#22616885)
It's not a VM, which is the point of docker in the first place.

I agree, though, that it's next to unusable on a low-power dual-core system like the MBA if only for limited RAM.

Re:New MacBook Air by mcpeepants on Wednesday March 18, 2020 @10:25AM (#22616977)
docker on mac does indeed leverage a VM as the docker host, since a Linux kernel is required
Re:New MacBook Air by qayxc on Wednesday March 18, 2020 @11:04AM (#22617402)
To my understanding Docker doesn't do hardware virtualisation and doesn't run indiviual VMs per container instance, though, or does it?
Re:New MacBook Air by mcpeepants on Wednesday March 18, 2020 @11:38AM (#22617789)
it does not, but there is still some overhead running a single linux VM for the docker host on macOS
Re:New MacBook Air by hobofan on Wednesday March 18, 2020 @10:13AM (#22616837)
> Doesn't docker spin up an entire vm for containers?

(It generally does not. Instead it uses more lightweight isolation primtives. That has always been one of its main selling points.)

EDIT: see reply

> That does seem pretty heavy for a MBA of any generation?

It very much depends on what you are running inside the containers. I regularly have a dev environment with ~8 relatively lightweight containers running on my Early 2014 MBA without any problems.

Re:New MacBook Air by mikewhy on Wednesday March 18, 2020 @10:33AM (#22617050)
Docker for Mac very much uses a VM. It's as lightweight as it can be (using the OS-supplied hypervisor, not something third party), but still a VM.
Re:New MacBook Air by ecnahc515 on Wednesday March 18, 2020 @01:01PM (#22618774)
The context is on MacOS. Docker is a Linux technology, it runs Linux containers, thus it requires a Linux VM to run Docker on a Mac.
Re:New MacBook Air by kasey_junk on Wednesday March 18, 2020 @09:24AM (#22616343)
It seems pretty typical for js backend systems to be heavily containerized such that I’d say it’s approaching the default deployment mechanism.
Re:New MacBook Air by ehutch79 on Wednesday March 18, 2020 @09:32AM (#22616434)
Why would you keep rebuilding the container constantly though?
Re:New MacBook Air by ehutch79 on Wednesday March 18, 2020 @09:47AM (#22616575)
kasey: For deployment that makes sense, but for development, that seems like a lot of work to be happening.

If you change a small bit of css, the whole container is rebuilt? That seems super inefficient to me?

My backends arn't JS, but I still couldn't imagine rebuilding a container everytime I changed a piece of code. Right now I change a file, django picks up the change and reloads. No noticeable delay.

Re:New MacBook Air by nikanj on Wednesday March 18, 2020 @11:08AM (#22617450)
Because JS. And somehow we the developers convinced each other that -any- attention to performance whatsoever is "premature optimization".
Re:New MacBook Air by inapis on Wednesday March 18, 2020 @11:29AM (#22617690)
This has got nothing to do with JS. Plenty of devs (me included) work on frontend and backend JS without containers and everything is instant for us. OP has a special use case or build pipeline necessitating such complexity.
Re:New MacBook Air by kasey_junk on Wednesday March 18, 2020 @09:40AM (#22616498)
Typically build flows don’t mount the js with volumes they embed it in the image. I’m not cognizant enough of the trade offs to know why.
Re:New MacBook Air by bpicolo on Wednesday March 18, 2020 @09:46AM (#22616564)
Optimizing your local workflows is worth the effort at every team size.

I think the attempts to make local workflows mirror production 1:1 (local k8s, for example) are misguided. They miss too hard on the productivity story. Especially once you start having to swap out local debugging for remote debugging (which only a handful of languages support effectively).

This is the biggest miss for many companies striving for microservice architecture. The local development story is terrible, and it stays terrible, without a lot of opinionated decisions around what your dev workflow needs to look like past the ~3-5 services mark. At a past gig I had to change 5 different repositories (5 separate PRs, all needing approval) to send an email. In a rails app that would have been a trivial task.

Re:New MacBook Air by inapis on Wednesday March 18, 2020 @12:45PM (#22618596)
> At a past gig I had to change 5 different repositories (5 separate PRs, all needing approval) to send an email. In a rails app that would have been a trivial task.

That sounds like no thought was put in the system before development. Well thought out scopes & contracts between services should not create a situation like that. Reminds me of a commenter on HN who were rolling back changes to all microservices if one service needed a rollback. These kinds of issues are dead giveaways that devs are paying lip-service to "microservices." Also, devs need to understand that they don't need to be on microservices or on the latest fad. Use what works for the team. A 10-team of devs cannot necessarily adopt workflows of a FAANG.

Re:New MacBook Air by bpicolo on Friday March 20, 2020 @08:38AM (#22637052)
Here's the complexity story, if you're curious.

1. Terraform repo for AWS deploy

2. Step functions application logic (server-side polling daemon)

3. Email service template

4. Feature flag configuration

5. (Something in the monolith to trigger the workflow, probably?)

This wasn't an entirely small engineering org - 300-400+ devs?

I agree, though, is the point. I think folk don't put enough thought into the development story when going this route. I think monorepos are the only sensible way to go about it once folk have cross-service work to accomplish, and monoliths are a _good_ way to build applications for longer than folk give them credit. That said, some monoliths are more productive than others. Slow startup/compilation can destroy productivity.

Re:New MacBook Air by solat on Wednesday March 18, 2020 @09:27AM (#22616371)
Not really but when you try new config/Dockerfiles/docker-compose setups it's nice to have power + bandwidth. Thus, I develop on a remote server.