8 ms·
I would have agreed until I started working at Google. Also, you should completely avoid having Remote Desktop and instead use ssh + an editor that works with r
by aleksiy123 4y ago
I would have agreed until I started working at Google. Also, you should completely avoid having Remote Desktop and instead use ssh + an editor that works with remote files.
At Google we have a custom fork of VSCode running in browser and builds can either be distributed or run on my Linux VM to utilize build cache.
I liked it so much I started doing a similar setup for small side projects. Just boot up the Cloud Console on GCP and start coding.
Advantages are:
- Accessible from anywhere (I use my pc, my laptop, etc. The env is always the same)
- More compute (I can attach more CPU + more RAM flexibly)
- Less friction to start (minimum environment setup, most tools are preinstalled)
- Datacenter Network speeds + Artifacts cached (installing dependencies is fast)
Disadvantages:
- network dependence
There are some adjustments that need to be made to your workflow. And for some applications you are dependent on having the correct tooling. However, my personal prediction is most companies will move to this type of development workflow as the tooling improves.
- kfajdsl 4y agoThis is exactly the alternative that was presented at the end of the post. He was specifically against remote desktops.
- danans 4y agoRemote desktops can work great if you constrain and structure what you do in them. For me, this means not using traditional desktop environments like gnome/kde/windows/macos, but instead a full screen tiled window manager (i3 in my case) with different virtual desktops assigned to different work items. Each virtual desktop is split in half between the IDE (vim in my case) and a terminal session for the code under development in that IDE. That's it. No silly weather or chat widgets (all that lives in my local laptop's traditional desktop). The result is I never have to search for a dev task related tab or be unsure if the code I'm running is the code I'm editing (which can happen if you are working on many concurrent changes). I liken the setup to the keyboard-driven text terminals you still see in some shops, hotels, and airport check-in desks. In general, I think smartly crafting your workflow matters a great deal more than the particular tool you might use.
- yjftsjthsd-h 4y ago> Each virtual desktop is split in half between the IDE (vim in my case) and a terminal session for the code under development in that IDE. That's it. No silly weather or chat widgets (all that lives in my local laptop's traditional desktop). I don't disagree, but if your editor is vim and you run/test in a terminal, why not do the whole thing in tmux in SSH?
- danans 4y ago> you run/test in a terminal Some of the software has a GUI, and some of the tools (i.e. unit test runners) display their output in a locally (to the remote desktop) running web app viewed via a browser. If I were doing strictly text-based work, I might use tmux, but to be honest i3 scales down so well to the text-only use case that I probably wouldn't bother, since there is no upside to doing so.
- aleksiy123 4y agoFor tools with webapp output. You can use a proxy to access it in your local browser. Something like ngrok would work well. The advantage of having tools with APIs
- danans 4y agoSure, but it's a lot easier just to open a browser in the remote desktop session. It's not like the FPS of the browser matters much when looking at unit test results.
- aleksiy123 4y agoSomehow I missed it at the end. However, he mentions the code still being present on the local env and only doing builds in the cloud. I'm more in the camp of the code living in the cloud, building in the cloud, executing in the cloud. You're editor running locally providing a view of the code. Which requires some specific tooling. As always theres a sliding scale here and people need to decide what works best for their use case.
- hulitu 4y ago> I'm more in the camp of the code living in the cloud, building in the cloud, executing in the cloud. Until you see how slow it is and you regret it.
- asdff 4y agoOn the 'cloud' (really our own cluster) we use at work most of the nodes have 16 cores and 128gb of memory, its a much beefier system than what is available locally.
- systemvoltage 4y ago> Accessible from anywhere (I use my pc, my laptop, etc. The env is always the same) This is a feature in search of a problem for me. I never wake up in the morning and go “Gee only if I can code on random computers”. It sounds super nice but then I think about it a little more and it’s just fluff.
- arcbyte 4y agoI have a website with a worker process doing RSS parsing that occasionally fails. It would be quite nice to be able to spend 10 minutes fixing trivial bugs from my phone while I'm out and about. Or from my iPad. I'm not doing feature development but this would be nice to have for things that are so easy I could do them now but instead must wait hours or days until I'm back in front of my dev machine. And actually I have a desktop and a laptop that I do dev work on. More than once I've started a branch on the desktop one night but don't quite get far enough to push it up and the next day I take my laptop to the coffee shop and realize the code is still at home.
- aleksiy123 4y agoI think this is it. As soon as you go from working on one computer to 2 you do have this problem. I myself work on 2 laptops and a desktop all running different OS.
- systemvoltage 4y agoI mean there are always going to be niche uses for this. My point is about corporations adopting this sort of a thing because executives got sold on a fancy feature "Accessible from anywhere" but no one really materializes it for 99.99% of the time they are not coding from anywhere but have to suffer latency the entire time. It sounds so damn good on paper vs. reality.
- vineyardmike 4y ago> executives got sold on a fancy feature "Accessible from anywhere" but no one really materializes it for 99.99% of the time they are not coding from anywhere but have to suffer latency the entire time. This isn’t the pitch. Not at all. The pitch is “no code (or IP) on local machines that can be stolen” and “no downtime if laptop breaks… IT desk can keep a stack of chrome books ready for backup”. Combined with something like gmail and google docs, the laptop at some employees WFH house contains no business secrets ever. I’ve never experienced the slightest drag of latency with this approach. If you’re running a compiled language, the compiler is surely the bottleneck. If you’re doing it for work, they’ll probably set it up so it’s always regionalized close to you from a cloud. Maybe fly.io should pitch this.
- aleksiy123 4y agoThere is one more point I would like to add to the "less friction to start." This is the killer feature for education. No more do students have to set up their own envs. Figure out PYTHONPATH. No more do educators need to debug installation issues on 3 different OSes. Teachers distribute a pre setup env which they know works for what they are trying to teach. Students go straight into writing code and building things with minimum friction. Learning to set up your env can be punted to a problem for later.
- ctoth 4y agoLearning to set up my environment to compile my first MUD back in 1999 was my first introduction to Autotools, ./configure, make, etc. I was motivated to solve the problem because I wanted to tinker. I'm sure someone will say I'm gatekeeping, but seriously these low-level skills have served me my entire career, and I wonder what happens when every dev environment is just a docker pull away. Who learns how to build new environments? That said, I have recently been tinkering with the Flipperzero firmware, and compared to the old Rockbox days when you had to install an arm-elf-gcc toolchain yourself and pray, embedded development has gotten way easier and this doesn't seem like a bad thing. I don't have an answer, just something to think about!
- deleted 4y ago[deleted]
- vlan0 4y ago>Who learns how to build new environments? Feels like this is happening already. There is no incentive to learn the fundamental concepts. We need more people interested in the why, and not just a quick buck. Folks interested in the why is the only reason we are here to begin with! On the other hand....it's great job security! Less and less people understand networking everyday it seems!
- bckr 4y agoIn my experience, "tinkering" with an environment before getting any code working was a recipe for believing "this is too hard, maybe I'm not smart enough to do this". Getting a feedback loop early on is so important. Once you're convinced that you can write software, setting up an environment starts to look like a tractable problem.
- jdelman 4y agoOut of curiosity, how much are you paying a month using Cloud Console that way?
- paxys 4y agoWhy would they be paying for it out of pocket?
- petercooper 4y agoI don't know about Google, but as far as I heard, AWS folks pay for their own AWS resources for side projects, at least.
- rfoo 4y agoGoogle too. Microsoft does give cloud credits per month for employees tho.
- deleted 4y ago[deleted]
- jdelman 4y agoThey said they were using it for side projects. Even if Google is subsidizing the bill, I'm interested to know how much something like this would cost.
- aleksiy123 4y agoGoogle does not provide any discounts for employees personal projects. Cloud Shell is free up to 5GB additional storage is $0.02/GB a month. Alternatively someone linked https://www.gitpod.io/ https://www.gitpod.io/ which also has a free tier.
- aleksiy123 4y agoIt's free tier. But storage is limited to 5GB. I'm pretty sure you can pay for more storage but I just haven't hit the limit yet.
- gimme_treefiddy 4y agoDamn, when you said Google I thought you were gonna talk about Cloudtop, etc. +1 to your recommendation, but they do a pretty good job Cloudtop too(for non-power users it is pretty usable). Also check out https://www.mightyapp.com/ https://www.mightyapp.com/
- aleksiy123 4y agoYeah, to be clear for Google work I am talking about the combination of Cloudtop (VM), Cider (IDE), Blaze/Bazel (Builds). In addition you also need a version control / file sync system. It's also nice to have some kind of network proxy especially if you are doing web dev. Tools or web services run on the VM and you just access it directly through the proxy on your local browser. The integration/combination of these is what allows things to work. For personal code this is Google Cloud Console. You can actually just jump into it . It has a built in VS Code editor. But at home it would be GCP VM + VS Code + Git. GCP also has built in proxy. The only problem I have had so far is it doesn't rewrite URL's which can be an issue for web apps. I think it's solveable I just haven't really tried yet. Theres some other solutions in the other comments as well.
- cbHXBY1D 4y agoYou also should mention the use of CitC. With CitC, I can build/write code from my work machine at the office and then go home and gmosh into a cloudtop that uses the same network mounted filesystem.
- mattnewton 4y agoI thought network filesystems were a terrible idea until I used citc + piper, really two incredible pieces of engineering infra. So many problems are reduced to just writing files to disk if you have a magically disk that acts like it is infinitely sized and everywhere all at once with low latency and versioned by the second. Whatever promotions they offered those authors and maintainers, and whatever black magic they had to invoke, it really was worth it.
- 4y ago
- samirsd 4y agovery cool! do you have a good guide you could share for setting that up?
- mox1 4y agoIf you don't want to set it all up yourself, GitPod basically has this up and running, with a pretty generous free tier. Think VSCode in the browser, with a docker container (controlled by you!) bash prompt at the bottom. https://gitpod.io/ https://gitpod.io/
- aleksiy123 4y agoHere is the product https://cloud.google.com/shell https://cloud.google.com/shell It has a quick start guide and docs.
- pradn 4y agoThere's not really a way around network dependence when coding at Google. You're not allowed to have code copied to a laptop, unless you get special permissions. Only teams that work on client code like desktop apps are likely to be given access. So this means to even look at code, you have to be connected to the network (via Chrome or a Fuse-based VFS.) If you're using a desktop, there's not really a case for going offline, so being dependent on the network is ok. I get nearly all my work done off a laptop, but I do find its weak CPU/memory a mismatch for my heavy use of Chrome.
- flerchin 4y agoIt's not that it can't be done well, it's that it's not likely to be done well, especially at a large org.
- vbezhenar 4y agoWhat languages does that setup support in Google? JS/TS I guess obviously. How do I replicate it with self-host? What keywords should I google?
- aleksiy123 4y agoAll Google supported languages C++, Golang, TS and prob some other ones I'm missing. Someone else mentioned https://www.gitpod.io/ https://www.gitpod.io/ and they actually have a self host option.
- asdff 4y agoThere are many ways to approach this sort of thing. For example I work similarly, all code running on a powerful slurm-managed cluster that i can access using anything with ssh, but I just use stuff like tmux and cli editors that are already installed on the server rather than use a gui based editor. we have an lmod system with prebuilt packages of a lot of software we typically use with various versions represented, and we also use environmental managers such as conda/mamba and workflow control tools which are straightforward to use. Seems simple enough imo.
- ilaksh 4y agoThat's not a cloud desktop. It's a cool setup, but you framed your comment as a disagreement with the post. But you are actually agreeing.
- novok 4y agoIMO you don't really need it to be a full vnc style remote desktop although, or even have the editor run in the browser. You can get equivalent results with bazel[0] remote execution + cache servers and get a similar horizontally scaling build system, without vnc style jank or full network dependence for your actions as a developer. Another reason why google likes the remote dev experience is because it doesn't download code to the developers laptop, because they don't trust them. [0] yes i know bazel / blaze is made by google
- outworlder 4y ago> Also, you should completely avoid having Remote Desktop and instead use ssh + an editor that works with remote files. That's kinda stretching the definition of a 'desktop', isn't it? The sort of tasks someone uses Remote Desktop for seldom overlaps with what someone uses SSH for. Also it doesn't seem to be the point of the article: Article: > I'm also going to restrict this discussion to the case of "We run a full graphical environment on the VM, and stream that to the laptop"
- aleksiy123 4y agoYes, somehow I missed this. My mistake. Though I think it could still work if the applications are built with this in mind. Think Google Docs, Sheets etc as cloud replacements for local Word, Excel. SSH and Video aren't the only two protocols to interact with a remote machine.
- throwaway413 4y agoassuming ssh and not scp, replacing traditional ssh with mosh in this setup could prove for some interesting benefits wrt network dependency. If the connection was less brittle, and directories could be opened and cached and rewritten later on, after the connection was disrupted and re-established…that’d be awesome.
- ranger_danger 4y agoWhy not just use sshfs and edit locally with whatever you want?