Fork me on GitHub
#off-topic
<
2018-07-04
>
vemv10:07:13

both my mac mini and MBAir have just 8gb ram, which I foresee won't be enough individually for my new job (various Clojure projects running over k8s) I was thinking of developing over the MBA, and 'deploying' (with docker/k8s) to the mac mini, which hopefully should shave some ram (one computer is freed from dev tooling overhead like CIDER, the other from the virtualization one) just wondering if this setup would would be a PITA / not? how quickly can I rebuild docker images + get them up and running in a computer which is over the same LAN? cc/ @joelsanchez

jgh10:07:05

i find the longest step in building docker images is actually the clojure / uberjar compile step

dominicm10:07:58

We've managed to take our 5m uberjar build time down to ~20s with pack.alpha (Disclaimer: I'm the author). It requires deps.edn though, but it might be something you can use. You will get bigger image sizes with it though, but I think it will be disproportionate to the time savings. I haven't measured to see if it's actually significantly bigger, there's a good chance it would only be a very slight cost for some metadata overheads.

jgh11:07:52

interesting, ill take a look at this!

jgh10:07:55

if you setup a docker repo (either via docker hub or on your own) the upload step is pretty fast after the first once since any parent layers above your layer will be already uploaded

jgh10:07:35

if you export/import the image manually i guess it would be bigger since it'll be exporting all the layers.

jgh10:07:48

anyway on a lan it'll be fast so that step won't be much of an issue.

jgh10:07:44

the image i use for my services is 309 mb and i'm not using alpine right now, so it's not exactly a ton of data to put over a local network

jgh10:07:32

another thing you can do if you want to do kind of a fake setup is to replace the executable code in the image using volumes. So that way whatever you build exists outside the image and you dont have to rebuild it but k8s/swarm/whatever is running it as if it's in the container.

👍 4
jgh10:07:33

ultimately you're just gonna have to mess around with it until you figure out a workflow you like

vemv11:07:39

Thank you @jgh, I'll think about the compilation step as it seems the bottleneck

tbaldridge14:07:09

@vemv I run my dbs on a Linux box, then ssh port forward them into my OS X machine. Helps with the ram problem

tbaldridge14:07:48

Maybe someday Apple will make a Dev machine with an acceptable amount of ram 😒

danielstockton15:07:51

Is everyone constantly on the move? Anyone doing most of their development on a desktop?

dominicm15:07:28

@danielstockton I think most people are always connected to the Internet now. I'm not one of those people, I can't develop in the cloud.

borkdude15:07:53

I thought about running some Docker services in our project (like the DB, Redis, etc.) on a Hades Canyon (https://www.intel.com/content/www/us/en/products/boards-kits/nuc/kits/nuc8i7hvk.html), it can be configured to take 32GB and doesn’t take up much space, e.g. place it next to your router

borkdude15:07:12

but so far I get away with 16GB in my laptop

danielstockton15:07:08

I like to have a desktop and a stable work environment, multiple big monitors, etc... However, sometimes moving about and doing work from laptops is unavoidable.

danielstockton15:07:35

In those situations, i would probably try to run some things in the cloud, or ssh to my desktop machine.

borkdude15:07:43

you could do VPN to your desktop from your laptop?

borkdude15:07:13

I actually meant VNC

danielstockton15:07:26

Yeah, I've just noticed that desktops seem to have fallen dramatically out of fashion. Even in offices where people spend 99% of time at their desks, they have a laptop.

3Jane15:07:45

It’s not that new

3Jane15:07:49

12 years ago, I already started on a laptop

3Jane15:07:18

it was part of the desire of the (large) company to make it easier for you to take work home.

3Jane15:07:54

(and also, theoretically, for people to hotdesk; but that was only in theory since everyone liked to have their desk)

3Jane15:07:32

So the reason for companies is pretty much the same as providing games, meals, beer and other conveniences in company space.

_rj_r_15:07:46

could run the development in a docker container... pull your repo down to your laptop, mount it as a volume to the docker container... maybe a bit more complex... but it would keep the dev environment the same on each machine without needing to have a bunch of packages and dependencies on each machine... not for everyone ... just an idea

danielstockton15:07:01

I guess the problem is maintaining two setups. If you do need to be on the move, you need the laptop environment to be ready.

_rj_r_15:07:47

hence using docker... you wouldn't need to maintain two setups.. you'd have one setup running in a docker container.... even the OS (assuming docker is available for the OS you use) on each machine wouldn't matter since the app is in the container...

danielstockton15:07:16

Docker itself uses a lot of disk space, if you're not pruning it all the time, which is often limited on laptops.

_rj_r_15:07:10

that's fair. Like I said, not for everyone, but does simplify having multiple machines that a person is doing dev on.. since that is kind of the point of Docker

👍 4
mpenet16:07:21

I wonder what kind of dependencies makes you exhaust 8g of ram

dpsutton16:07:27

slack is a big one for me

jgh16:07:12

I see slack using ~1gb, but i have 10 workspaces connected right now.

mpenet16:07:48

Slack in Chrome?

mpenet16:07:57

Or the app

dpsutton16:07:16

i used to run tabs but now i'm on the app. I closed it yesterday to get some more ram

dpsutton16:07:50

work is clj backend clj/cljs frontend chrome and slack open. i run out of 16gb sometimes

jgh16:07:57

the app, it's electron though so it's all web views

mpenet16:07:03

I moved recently to a laptop with 16g ram but I didnt have any issue with 8 really (3 slacks on chrome + all work stuff)

mpenet16:07:43

It s a bit random it seems. I guess it might depend on the os too

_rj_r_16:07:08

Slack app, Firefox, and VS Code are currently pushing me to just under 8GB RAM at the moment (I have 32 so I never really pay attention to it). But I have 6 Slack workspaces, and 3 browser instances each with about 3-7 tabs open at the moment....I run Arch as my OS.

jonahbenton21:07:58

I have been running an unusual setup for many years- mbp (16gb) with vmware, nothing else mac-side. In vmware I run fedora instances, and vary the memory/cpu allocation to their respective duties. Currently have 7 vms, 5 non-suspended. 3 for work for clients, 1 for a kubernetes master, 1 for gmail/slack/twitter, 1 for banking, 1 disposable/sandbox. Switch between them with cntl-opt arrow. It's more bang for the buck from a mem perspective because each linux vm uses ram + swap on its own, and swapping in one vm doesn't impact the others. Hard to quantify but linux seems better at managing ram too. We have some other macs around the house for media consumption, and spend a lot of time inexplicably watching the beachball.

dpsutton21:07:46

that's super interesting

jonahbenton21:07:43

thanks, i should probably write it up, it took a little while to get some of the details of key bindings to my liking, but it now works pretty well. particularly nice to be able to deploy into a single kubernetes in one vm from the other vms, rather than struggling with minikube. my one concern is that vmware recently sold this particular part of their business, and though the new owners seem committed to the product, one never knows. vmware head and shoulders better than parallels for this kind of setup.

fedreg04:07:34

+1 vote for a write up. Would be very interesting read

andy.fingerhut21:07:46

I've been using VirtualBox on my mbp for over a year now for Linux VMs, and it has been getting the job done for me, but I have no idea if the switching can be set up as easily as you have done.