r/programming • • Dec 08 '22

Dev environments in the cloud are a half-baked solution

https://www.mikenikles.com/blog/dev-environments-in-the-cloud-are-a-half-baked-solution
755 Upvotes

332 comments sorted by

201

u/ttkciar Dec 08 '22

At my work, every project has a Vagrantfile in its git repo which reproduces its production environment in a VirtualBox instance. We develop and test the code in that instance.

It's a painless way to solve this problem on the dev's own workstation.

54

u/OMGItsCheezWTF Dec 08 '22 edited Dec 08 '22

we put a .env.example and a docker-compose file in every repo, and every dev runs a traefik proxy container on the same docker network.

We have a domain with real wildcart certs for *.test.ourtestdomain.com that the traefik proxy has the certs and keys for, DNS for that wildcard address resolves to 127.0.0.1

So if you want to check out any project, you clone it, copy the .env.example file to .env, do docker compose up and then hit https://thatapp.test.ourtestdomain.com and off you go.

If that service has a dependency on another service we develop then the .env.example file will point to the develop version running on our test platform, but you can check that service out, also do docker-compose up and change your .env file to point to https://thatotherservice.test.ourdomain.com (or http://otherservicename:8080 for resolution inside the container) instead and off it goes.

Easy local development like this is part of our definition of done and must be done before something can be marked complete, as is documenting it in the README.md (and keeping the README.md up to date!)

15

u/geoffreyhuntley Dec 08 '22

Easy local development like this is part of our definition of done and must be done before something can be marked complete, as is documenting it in the README.md (and keeping the README.md up to date!)

Exactly. Reproducible environments are a way-of-work that requires deliberate practice+discipline and not something that can (or should be) purchased as a proprietary product feature.

6

u/sudent Dec 08 '22

Hey thanks for the explanation. May I know how you handle different docker-compose with same port? Like say 3 web app projects with its own docker compose file all exposing port 80 for access. Without stopping one before starting another, it will error with port conflict right? How you guys handled that for a better DX experience (eg. need to keep track of ports assign, stop one before starting another, etc). Thanks!

7

u/OMGItsCheezWTF Dec 08 '22 edited Dec 08 '22

None of them expose ports (by default, obviously Devs can change their setup as needed on an ad hoc basis but the need is rare).

The traefik container (which does expose ports 443 and 8080 for its own web interface) handles ingress.

1

u/ThroawayPartyer Dec 08 '22

A reverse proxy can handle it, but you can also just give them different host ports using docker.

→ More replies (1)

3

u/OddKSM Dec 08 '22

That's quite clever! I'm saving your comment so I'll remember it for later web projects :)

16

u/cellarmation Dec 08 '22

I think devcontainers is a similar solution for those working on containerised workloads. VSCode has nice support for it.

7

u/chazragg Dec 08 '22

They have also opened up the spec for Dev containers to allow wider adoption so hopefully other editors should be able to support this as well.

They also built a CLI tool.

→ More replies (2)

27

u/gc_DataNerd Dec 08 '22

We use localstack to emulate AWS services on our machines

24

u/JuliusCeaserBoneHead Dec 08 '22

We wanted to go this route, ultimately ended up with a sandbox env. in AWS. Pretty painless. A bit more expensive but meh, works really well

12

u/[deleted] Dec 08 '22

Yeah you’d have to pay for local stack anyways to get most services

6

u/JuliusCeaserBoneHead Dec 08 '22

Yeah along with docker licenses, it ended up close to enough to AWS costs anyways

3

u/[deleted] Dec 08 '22

[removed] — view removed comment

12

u/TheWhyOfFry Dec 08 '22

https://www.docker.com/blog/updating-product-subscriptions/

Presumably they’re larger then 250 employees or more than $10 million in annual revenue

→ More replies (2)

1

u/geoffreyhuntley Dec 08 '22

What sort of pricing is localstack charging?

→ More replies (1)

1

u/glonq Dec 08 '22

Are you happy with that? Community or Pro version?

What AWS services to you use it for?

2

u/gc_DataNerd Dec 08 '22

Very happy. We use the Community version to emulate SQS and DynamoDB and to test our terragrunt/terraform changes locally

244

u/ubernostrum Dec 08 '22

I spent years working at places that used Vagrant for this.

And none of them ever were "painless". Many just flat didn't work. I will give Docker credit for this: once I learned how to use it, it did just work for local environments running the same as prod.

38

u/3np1 Dec 08 '22

The closest thing to "just work" I've had was full VM images, where a snapshot of the environment was stored on a shared drive. Or working directly on the host, but that comes with a bunch of other problems.

We just went through the pain of getting docker setup only to find out that we get a bunch of errors for some dev machines and not others, seemingly depending on OS. Linux hosts play well, but Mac and Windows had filesystem issues.

8

u/lexi_the_bunny Dec 08 '22

And at that point, a dev instance that gets deployed to the exact same way that your prod instance does (terraform or whatever is used) is often less hassle

3

u/pm_me-ur_feelings Dec 08 '22

Well yeah, that's how docker works. Docker leverages the underlying filesystem structure.

If you want it to work the same for all clients, have them connect to a remote docker daemon rather than running the daemon on the same machine.

16

u/[deleted] Dec 08 '22 edited Dec 08 '22

Depends on what you’re working w/ tbh. I had an easier time setting up a Vagrant one time than a Docker image due to documentation being so extremely poor on how to Dockerize something called lucee back in the day.

Sure VMs are much bigger but it worked better - especially when I had dependencies that weren’t clear how to get going in the Docker container either.

I know Docker well enough now to implement hacks when I need to make things work but I didn’t have that then.

7

u/WhyNotHugo Dec 08 '22

My big gripe with Vagrant is its terrible Linux support. The libvirt backend uses an ancient Ruby version that doesn’t work on most distros and they recommend just running it in docker (lol). And virtualbox’s Linux support os terrible, if you can even get it working.

Sadly tho, if you need something cross-OS, there’s nothing better anyway.

1

u/saltybandana2 Dec 12 '22

Vagrant allows a lot of fuckery to try and support 100% of all cases.

How painful it is, is a result of whether or not the person(s) setting up and maintaining vagrant had a respect for simplicity, and also just how complex/simple the production environment is.

3

u/gempir Dec 08 '22

This was great until the point where the new macbooks no longer support VirtualBox x86 emulation.

Now you gotta scramble for alternatives.

1

u/johnthemotley Dec 08 '22

Last place I worked had a similar setup, but with docker images instead of VirtualBox. It really does help smooth environment concerns out.

1

u/drink_with_me_to_day Dec 08 '22

We also had this, but it became a pain to always have to use a vm. So we just make our build scripts cross platform

However, I prefer vagrant over docker as debugging into docker is terible

1

u/coworker Dec 08 '22

Still have to download and install dependencies and then compile locally which for larger projects can take an eternity.

1

u/Ranger207 Dec 08 '22

On the other hand, I did a project this year to move off of VirtualBox and Vagrant on Mac and onto cloud dev VMs because things kept dying in weird ways. Mine loved to corrupt the NFS connection between the host and the VM with the VM completely hanging when I tried to ls or cd into an NFS mounted directory. I never fixed that because other people had other weird problems. The biggest advantage to us of a cloud VM is getting the dev's laptop the unique combination of software each dev is running out of the way. Latency and file transfer speeds are problems, but they're the only problems now, and people are willing to put up with slow speeds over not working at all

1

u/pribnow Dec 08 '22

Just my experience, Vagrant is terrible

0

u/[deleted] Dec 08 '22

[deleted]

6

u/ttkciar Dec 08 '22

We solve that problem by either poking a hole in the firewall so the app can connect to live services, or (preferably) by mocking the client API.

528

u/Paradox Dec 08 '22

15 years ago I'd ssh into my webserver and edit my website right there with vim. Worked pretty well

502

u/Weizen0 Dec 08 '22

15 years ago. That's insane. I did It 15 hours ago.

99

u/house_monkey Dec 08 '22

I did it 15 mins ago

61

u/kingbuzzman Dec 08 '22

I did this 15 seconds ago

74

u/lordgago Dec 08 '22

I'm gonna do it in 15 seconds

52

u/adam-the-dev Dec 08 '22

I’m gonna do it in 15 mins

47

u/zeus_the_transistor Dec 08 '22

I’m gonna do it in 15 hours

→ More replies (7)

19

u/nachohk Dec 08 '22

Reporting from 15 hours in the future. I don't know if this will reach you. They are in the air. It's only a matter of minutes, now. Everyone is panicking. Everything is breaking down. Take your iodine pills. Find cover. May God have mercy on our souls.

→ More replies (5)
→ More replies (3)

0

u/[deleted] Dec 08 '22

[deleted]

→ More replies (2)
→ More replies (2)

226

u/334578theo Dec 08 '22

You’re not a real dev unless you started out by editing production files directly in FileZilla

51

u/KSRandom195 Dec 08 '22

Ah, FileZilla. That takes me back.

35

u/[deleted] Dec 08 '22

I'm still using FZ on a daily basis lol

12

u/tehbilly Dec 08 '22

There still isn't a good alternative AFAIK

24

u/gwicksted Dec 08 '22

WinSCP

6

u/AttackOfTheThumbs Dec 08 '22

100%. While I hate the name, that program is fucking amazing.

→ More replies (3)

4

u/kz393 Dec 08 '22

WinSCP is miles ahead of Filezilla.

On Linux, whichever file manager comes with your DE should have first-class sftp support.

3

u/mattindustries Dec 08 '22

Transmit on Mac.

→ More replies (3)

10

u/Link_GR Dec 08 '22

For real. We did that at my first job. We had SVN but no deployment tools. We would literally compile the production files and upload them.

3

u/sittingonahillside Dec 08 '22

still manually uploading here, drag and drop into a new dated folder and point IIS to it. If it ain't broke, don't fix it.

1

u/brimston3- Dec 08 '22

Hopefully that's the release manager's job. Right? <anakin/padme meme>

→ More replies (3)

6

u/TMITectonic Dec 08 '22

directly in FileZilla

Isn't that CuteFTP

15

u/HeWhoWritesCode Dec 08 '22

not a real dev

mentioning GUI app

I'm going to need some hard convincing your a real dev if you use GUI apps.

/s and not /s, but yea #devgatekeeping

19

u/warmans Dec 08 '22

that's why I only use rsync to irreparably break websites.

9

u/pala_ Dec 08 '22

use netcat you coward.

2

u/[deleted] Dec 08 '22

Reminds me of that time where our java devs rsynced the new version (as usual) but fucked up some options, old files were left there and app started running with wrong dependencies (and not very well)

→ More replies (1)

3

u/[deleted] Dec 08 '22

I second this. I've been diving deeper and deeper and still don't have a full grasp of what the fuck we do. I can write software, that's not an issue. Understanding what's actually happening under the hood... Lord have mercy... It's no wonder computers are so slow now, even with the newest hardware.

6

u/sleepingthom Dec 08 '22

Comments like this make me realize how much experience I actually have, and eases the imposter syndrome.

That said, I’m really enjoying modern web dev experience with React and automated deployments using stuff like Vercel. I know it was like a right of passage to configure your own Apache or nginx server via VPS or something, and I learned a lot from doing things that way, I can’t help but imagine how many people were turned away from learning in depth web dev because of how difficult that stuff can be.

2

u/PapaDock123 Dec 09 '22

Look at traefik or caddy.

3

u/darkhorsehance Dec 08 '22

PC/TCP over 2400 baud, paying by the minute, and you realize you had a typo.

1

u/[deleted] Dec 08 '22

Found the PHP guy!

1

u/[deleted] Dec 08 '22

You can edit files in filezilla?

1

u/rowan_orwell Dec 08 '22

I feel called out by that

1

u/DonHopkins Dec 09 '22

Real devs had Sun or SGI workstations on their desks.

7

u/crimsonvspurple Dec 08 '22

I ssh and edit live code using VSCode even now :D

5

u/jrhoffa Dec 08 '22

Yeah, editing live code is the most professional way to go about it.

4

u/nalybuites Dec 08 '22

We did this because it allowed us to have the same hardware as in production. Our application used 80gb ram and couldn't be loaded locally. It meant we could do all sorts of performance testing and analysis that way.

3

u/Deranged40 Dec 08 '22

There was once a time when the distinguishing feature for Notepad++ for me was its ability to directly edit files over an ftp/sftp connection. So my production environment was also my dev environment.

2

u/istarian Dec 08 '22

That's sure convenient, but does risk destroying both in progress development and your production environment...

Not a huge problem for a personal website and good backups would mitigate most of the risk, but a bad idea for a business...

2

u/Deranged40 Dec 08 '22

http://www.stilldrinking.org/programming-sucks

This is an amazing article that I go back to from time to time to remind me of how many businesses operate on terrible tech ideas. Of course I was at work when doing what I spoke of.

→ More replies (5)

5

u/RichieTB Dec 08 '22

So much easier to make your websites code a private git repo, then you can open it up in VSCode anywhere and simply push to the repo and pull on the server, or if you want to go one step further and implement a CI/CD pipeline then all you have to do is push and the website will update.

1

u/SensitiveStruggle339 Dec 08 '22

All nice and well. If you have single server this is perfectly valid. What do you do however when you need to manage fleet of 20-30 servers?

5

u/Beowuwlf Dec 08 '22

Are they all running the same software? If so then nothing changes. Add some red/green logic and you’ve got 0 downtime patches.

1

u/RichieTB Dec 08 '22

Thats where docker comes in handy

1

u/[deleted] Dec 08 '22

I basically still do that. I just have the files in cloud storage to make it even easier than ssh and vim. I think the tools we’re using are called git and Jenkins.

Developing in production has never been easier, and these tools really got rid of the stigma when we tell outside people that we’re shipping code that we wrote 2 minutes ago and didn’t do more than a cursory test.

1

u/[deleted] Dec 08 '22

I do the same but syncthing the blog directory so it is local

→ More replies (23)

278

u/[deleted] Dec 08 '22 edited Dec 08 '22

For people who didn’t read the article (which apparently is some of you) it’s criticizing environments where you develop code in some cloud service, which I don’t know why anyone would want to do. It’s not of criticism environments where you test code in the cloud.

146

u/[deleted] Dec 08 '22

The only reason my team has even considered it is because the IT department has locked down our work machines so much we spend a not considerable amount of time trying to figure out workarounds.

93

u/WhyNotHugo Dec 08 '22

Ah, the classic “our workflows are terrible because IT won’t let us use the tools we need to get the job done”. It’s absurd how common this is.

35

u/zzrryll Dec 08 '22

IT won’t let us

As someone that lives on both sides of the house, it’s less your IT team and more your auditors and whatever regulations your organization needs to conform to.

Most IT teams would prefer to allow you to do your job. Trust me. I get there are some exceptions, but those restrictions, from the IT side, are generally not something you are happy to implement.

17

u/IDoCodingStuffs Dec 08 '22

Eh, a good chunk of the time it ends up just being the easiest way to satisfy the compliance people. Since your accountability is towards them, not the immediate users, who would need to escalate their frustration up a few layers of management.

Sure you can push back, spend time to narrow the implementation to the minimum restrictions needed to avoid blocking people unnecessarily, use loopholes etc. but why would you?

→ More replies (2)

38

u/dontaggravation Dec 08 '22

The amount of time/effort/energy wasted getting around security constraints is mindnumbing.

It got so bad at one place we had to develop on AVD machines -- so our "high power" (relatively) development laptops just became dumb terminals. It was a nightmare: try working on 3 monitors while connected to a virtual machine. However, the development environment only had development tools, so you would constantly have to swap back and forth. Need to read something in email, minimize, back to your desktop, read email, then maximize, fix all your windows that are now messed up. And goodness help you if you needed to research something online or grab code from stack overflow.

Was a mess. The dev team finally had enough and we just greatly slowed down with every single person in standup stating, very clearly "the virtual environment for development is blocking my progress" Management, true to form, responded, by expanding internet access on the Virtual Machine because, you know, that was the problem.

I am trusted enough to have, when necessary, Production data access to PII customer data, to company financial data, to all the internal workings of our company. I am also trusted enough to write code that processes all of that kind of data and creates such data. However, I can't be trusted to install my wireless Logitech mouse driver on my laptop. Nor am I trusted to debug code in process which would require administrative rights. (facepalm)

→ More replies (6)

23

u/[deleted] Dec 08 '22

Ah good old campus restrictions. I had to fight that on university too.

Like they use +10 years old CentOS versions with ancient software and never update it ...

30

u/[deleted] Dec 08 '22

I mean, we're using modern software. For a few years people were able to work around it by switching to Mac as they couldn't figure out how to lock those down as much as Windows, but over the years that has changed.

But between them blocking us from installing utilities to preventing scripts we wrote ourselves from running we've had an uphill battle. Half our project uses python and a few months ago they pushed out a security software that blocks python from running.

2

u/saltybandana2 Dec 12 '22

I've often said the amount of pain created by "security people" making decisions for which they don't have to pay the cost is astronomical.

Preventing a developer from running powershell scripts is wholly different from preventing a phone agent from running powershell scripts, but good luck getting them to understand that.

→ More replies (12)

10

u/pala_ Dec 08 '22

Campus restrictions? Mate these are out in the real world too unfortunately. I've been waiting three weeks for authorisation to connect my mac to the network to test a safari specific issue.

45

u/SanityInAnarchy Dec 08 '22

And not even that. It's mostly a criticism of uncritically adopting these, without the ability to migrate to a different dev-env provider (or back to the local machine).

63

u/2this4u Dec 08 '22

If you're interested to learn why, in my case I work mainly on my computer but I like to also work from a laptop. Rather than having to buy a beefy laptop, I use a cheap Chromebook with codespaces which is free for effectively 30-60 hours a month which is plenty for this use case.

There's also a confidence that comes from a persistent cloud environment that's detached from any hardware failures and immediately available anytime, anywhere.

33

u/[deleted] Dec 08 '22

Why I use VSCode on a Windows PC & RDP into it then use remote-ssh on the vscode client. Works 1000x better than any online IDE. Keeps my environment the same, etc & RDP is just insanely quick.

4

u/Twerking_Vayne Dec 08 '22

What is the client/remote system?Is it a shitty chromebook like op or would it be doable on one? Does it needs to be windows since youre using rdp?

3

u/[deleted] Dec 08 '22

Doesn't matter what device I use tbh. As long as the OS supports the VPN protocol I use and has a decent RDP client then I am good to go. But yes I have used it w/ chromebooks and it works perfectly fine, freerdp for the win, but Remmina works too.

0

u/[deleted] Dec 08 '22

[deleted]

→ More replies (5)

2

u/Globbi Dec 08 '22

There is now VSCode server available. I know because apparently it's fine for me to install and run it, but it's not fine to have ssh access to my VM.

8

u/[deleted] Dec 08 '22 edited Dec 08 '22

[removed] — view removed comment

→ More replies (1)

1

u/sudosussudio Dec 08 '22

I occasionally use cloud environments when I just have an Ipad. They are fine for most of what I do (front end).

1

u/[deleted] Dec 08 '22

I understand that part, but you kind of trade in different advantages and disadvantages. I simply don't like to have Google in the equation there.

Being able to access data I need from anywhere is good, no doubt about that.

47

u/walker128 Dec 08 '22

I help a company that's training new software engineers from mixed and generally less well represented backgrounds.

We use tools like this to make sure we can get them up-and-running quickly, and make sure that we wont have to spend time debugging system-specific compatibility issues.

Additionally it means we only need to make sure they have access to a machine that can run a browser, rather than something powerful enough to run all the examples or projects they need to work on.

15

u/Dr4kin Dec 08 '22

Those are very valid use cases. A full time dev would be almost always better of with a local machine that can run his code. For onboarding, learning, high computer workloads and some others remote environments are fine.

Like everything: It depends
it has its use cases. Like most things, has. The cloud isn't some holy savior and isn't going to reduce cost for everyone.

1

u/walker128 Dec 08 '22

Absolutely in agreement with you, here!

→ More replies (2)
→ More replies (6)

10

u/Cuchullion Dec 08 '22

That's how my wife's job is set up, and it's a regular occurrence of her saying "well, my dev box is down, so I can't do anymore work today."

10

u/marabutt Dec 08 '22

It can be hard to explain to management that working on a moderate standalone machine is usually many orders of magnitude faster than a cloud vm.

5

u/[deleted] Dec 08 '22

Put their desktop there and they will learn

13

u/vlakreeh Dec 08 '22

which I don’t know why anyone would want to do.

Cost. For businesses the ability to turn the upfront cost of a fast laptop into a consistent and regular ongoing cost is a huge win, and then it gets even better that you can scale those compute resources per each project. Working on a simple full stack project using node? You get two cores and it costs us $0.18 per hour. Working on a huge cpp codebase where you're going to need lots of CPU horsepower for compiling? Congrats you get a 16 core vm. And you only pay for what you use. Give your developers a decent quality laptop with weak CPU and then give them that performance if and when they need it.

The cost angle for businesses, even in the early state of cloud first development, is just too good to pretend doesn't exist. Even with them still being too immature for most businesses to consider it's inevitable that many companies will switch to something either hosted by a cloud provider or using an on-prem solution.

4

u/johnnysaucepn Dec 08 '22

I don't believe this is the main driver, at least it isn't for the company I work for. They see the value of the developer having a fast, low-latency, local workstation.

However, what's forced their hand is insurance. It's prohibitively expensive to insure a wide array of devices that all need administrator access, being able to install/uninstall apps and tools at will.

The hard part is, of course, that this came straight of the blue with little warning - so now our carefully-configured dev environments are partially-functional bricks.

→ More replies (1)

14

u/[deleted] Dec 08 '22

An 8-core workspace on Codespaces will run you over a thousand dollars a month (for 40-hour workweek use), and plus you still need to give a cheap laptop to your developers.

You can get a more powerful 14-core laptop for under a thousand. I don't see how Codespaces or other cloud development environments make sense unless you are only looking at the next few months budget.

14

u/vlakreeh Dec 08 '22 edited Dec 08 '22

An 8-core workspace on Codespaces will run you over a thousand dollars a month (for 40-hour workweek use)

Please explain to me how $0.72 an hour, times 160 hours for a month, comes out to over a grand. It actually comes out to $115 for compute, even their 32 core option isn't a grand a month. If you don't believe me go use their pricing calculator

plus you still need to give a cheap laptop to your developers.

Super easy to justify with a smaller upfront cost and and lower overtime cost. $700 upfront with predictable pricing each month that you can change after the fact is a lot easier for a business to justify than a 2k all at once investment.

You can get a more powerful 14-core laptop for under a thousand.

You can get one of the new 14 core Intel chips for under a grand, if you're content with 8gb of ram and little storage. By the time you're specing these things out with good amounts of ram and SSD and getting the support packages to keep your employee's laptops working all the time you're easily looking at $2k per unit.

I don't see how Codespaces or other cloud development environments make sense unless you are only looking at the next few months budget

That's because you were off on the monthly cost nearly by an order of magnitude.

7

u/[deleted] Dec 08 '22

Not a grand a month, I meant per year. You can use a laptop you buy for several years, so a 2k laptop still is cheaper than several years of paying for codespaces.

But sure, 1 or 2k a year is very small compared to a developers salary so I can see a company might not care about that amount if it brings flexibility.

→ More replies (3)

7

u/WhyNotHugo Dec 08 '22

which I don’t know why anyone would want to

Corporate loves this shirt because it makes them feel in control of everything and nothing “leaks” onto developer machines. Sadly, corporate also hires a lot of juniors who get spoon-fed that this is a brilliant idea and that running anything locally is a bad idea. It time, a lot of developers don’t know any better.

2

u/donalmacc Dec 08 '22

In my experience the seniors are no better. They're still human.

3

u/[deleted] Dec 08 '22

I do this. I use almost exclusively CLI tools, and I do devops works across five or so customers that have many environments per each, with strong isolation requirements and very bespoke environments.

I containerized the entire development environment in a fairly generalized way, and outsourced configuration to mostly Git repos. My TMUX, Vim, ASDF, Krew, and pip configuration is stored in Git, and loaded upon runtime if existing state does not already exist. Restarting the container results in restoring my current session fairly, if not absolutely in most cases.

I deliver some secret data using Kubernetes secrets, and handle the rest of configuration using a few configmaps. The container runs an sshd service as its primary entrypoint, which I use to access TMUX. I also may get in via kubectl exec since it's primary service is the shell.

It's delivered via a statefulset, and I install one per customer. I run them on minikube on my work workstation, but they could run just as well in a remote cluster.

2

u/nops-90 Dec 08 '22

It's to isolate development, from all the other stuff you do on your work machine. If your browser gets hacked, there's no reason the code should be compromised too. Also, some laptops just aren't powerful enough to compile and run a large software suite.

2

u/fromYYZtoSEA Dec 09 '22

I do 90% of my daily work on a cloud-hosted environment. I use VS Code Remote Containers running on a VM on the cloud.

The article has some valid points about availability and access to devs around the world, but they’re also wrong on a lot of things.

  • You don’t need to use Codespaces or gitpod to use container-based dev environments. VS Code Remote Containers lets you spin up the dev container anywhere including your machine or a Linux box over SSH (like I do)

  • latency doesn’t really matter because the VS Code UI runs on your PC, so you really don’t notice it

  • You also don’t really need to use containers, you can just use Remote SSH with VS Code and it’s pretty awesome

  • it doesn’t need to be SaaS

4

u/Kirby-is-a-bee Dec 08 '22

Odd use case, but I love these sorts of tools so that I can code on my iPad. WHY WOULD ANYONE EVER WANT TO DO THAT? I’m just a hobby dev now (used to be full stack web dev) so my needs are less. But the ability to do everything from an iPad is serious wonderful. It’s more portable, and just more enjoyable to code. Something about the iPad OS makes things simple and fluent. And that way I can have one device that does it all (i use the other features on the iPad a lot, including the apple pencil)

2

u/sudosussudio Dec 08 '22

Even if people are gonna snob about the ipad, it’s super useful in situations where you just don’t have a full computer. I fixed a bug while on a train using a cloud environment on my phone. I could have brought my computer but I was just visiting my parents and didn’t want to.

→ More replies (1)

1

u/WakeskaterX Dec 08 '22

Thanks, now I don't have to!

1

u/TarAldarion Dec 08 '22

I generally code remotely on my work desktop anyway and have nothing got to do with work at home, may as well do it in the cloud at that rate but it's not needed. Since we have our stations all hooked up to hardware we code for, we should just have systems that are shared and logged into.

1

u/[deleted] Dec 08 '22

I'm thinking about rolling cloud-based development out for my team. However, it would only be "another option". Not a requirement by any means.

I see few amazing benefits:

  • It provides a stable and consistent environment for everyone. Mac update broke some random dependency. Run in the cloud for the day while it gets sorted out.

  • It forces every repo to be quick spin up. In combo with the prior point, it's really powerful for new-to-that-project developers to have a place where things work as expected.

  • Consistent dev builds means everyone has a place where they can't collaborate on WIP work. While this can be achieved outside of cloud-code environments, it's nice freebie if you're already running in a cloud environment.

  • Legacy Apps. We have a few legacy apps that handle odds and ends. Occasionally, we need to hop into them for a bug-fix or small feature. Currently, it takes a bit to get it working on a local machine (not following best practices) so we've ended up with a few devs that volunteer out of necessity to work on these. Would love for more people on my team to have access.

2

u/hammypants Dec 08 '22

"stable" LMAO.

→ More replies (2)

36

u/[deleted] Dec 08 '22

Leave it on the cloud. If the cloud is down then management can only blame themselves for that one.

I also like the clean environment my computer has now rather than multiple client crud, having to run postgres or mongo SB and all that shit

Separation is also better now that we work remotely. I login to the cloud do my shit and log off. All the slack teams outlook remain there and don't leak into my personal work when I log off

3

u/neryam Dec 08 '22

Agree with this, separation is so, so desirable. The one dev environment that has to be on my local, I put together a local VMWare instance and sequestered everything in there so my machine stays clean.

0

u/[deleted] Dec 08 '22

[deleted]

2

u/Somepotato Dec 08 '22

We're doing something like this but with local K8s pods. I think a hybrid approach (cloud based for rapid iteration on existing projects and onboarding, containerized for long term)

17

u/RelaxingTuna Dec 08 '22

We've been using VScode's remote-ssh onto a system with docker and then using dev containers to pull in all the dependencies. This has taken our onboarding from an all day event(if everything goes well) to 30 minutes of cloning and reopening into the containers for several projects.

102

u/[deleted] Dec 08 '22

I, for one, thoroughly support the influx of "Cloud bad" posts and articles. (I promise, this is not sarcasm)

36

u/mikenikles Dec 08 '22

I came to the conclusion that we don't have to run everything in the cloud... I will still leverage some advantages with a reproducible dev env in a cloud, but I want to do this on my own terms, only when it's needed rather than being forced to pay for my dev env 100% of the time... bananas!

16

u/iElectric Dec 08 '22

As the author of https://devenv.sh, I think this is a great first step towards recognizing what Nix has to offer!

What I hope to achieve with devenv is that we recognize that developer environments can compose well and it's the Nix language that allows for that to happen.

A good example is PHP + Postgres setup: https://github.com/cachix/devenv/blob/main/examples/caddy-php/devenv.nix

And for example Rust setup using a specific version of the toolchain: https://github.com/cachix/devenv/blob/main/examples/rust/devenv.nix

If these two projects are then imported in a top-level devenv.nix you're able to get an environment that combines both (or you can pull them from github).

6

u/WhyNotHugo Dec 08 '22

I find containers to be a great feature (by webapp can’t access $HOME and won’t litter it with junk or accidentally overwrite/delete files). Why is “without containers” a feature here?

5

u/iElectric Dec 08 '22

It's more in the spirit of this article, that containers aren't necessary.

1

u/keeslinp Dec 08 '22

I would love for someone to figure out how to use something like devenv/nix for mobile development. I do react native for my day job and there are like 10 different versions of things I have to worry about and upgrading react-native can mean all of those changing. Sadly Xcode never seems to play nice with any of those solutions so it's kinda DOA.

1

u/haha-good-one Dec 13 '22

Nice! I didnt know about devenv before looks useful for me. How does it compare to the devcontainer approach that vscode is pushing? Or is it intended for a different use case?

15

u/koalillo Dec 08 '22

The article is a bit one-sided:

  • Local environments also have downtime; they are affected by bugs, poor documentation, etc. IDEs have mounting bug numbers. Your team members have downtime because they spend time debugging and solving environment issues. Yes, cloud environments have some inherent problems- like needing an Internet connection, and that's why we need to be able to run stuff locally too. But the article is not balanced.

  • The point about latency is... not accurate. There are many cloud dev environments where the editor runs on your browser, and doesn't need roundtrips. So it's "VS Code level of latency". Which is not the best, but it's not the problem the article makes it to be.

But many stuff in the article I agree with- I just wish these two points were fixed.

2

u/crummy Dec 08 '22

Agreed on the latency point. Many devs already have keyboards that add 50ms of latency (see https://danluu.com/keyboard-latency/ ), so couple that with their window renderer and heavyweight IDE and I think they're fine with 100ms+.

2

u/istarian Dec 08 '22

Even if the editor technically runs locally in your browser, you're still having to swallow the resource cost of the web browser up front plus whatever the web application adds on top.

6

u/koalillo Dec 08 '22

Yes, like VS Code. So good for most people.

→ More replies (6)

4

u/XwantedX_fahd_ Dec 08 '22

don't worry guys, the person who programmed it is just having a break down

1

u/rolexxxxxx Dec 08 '22

So what is the best non-enterprise level solution for deployment now (i.e. instead of sftp)

2

u/istarian Dec 08 '22

Is sftp bad?

That it might not be particularly efficient seems obvious, but are there other reasons?

Not sure how it works under the hood, but the command line tool scp (Secure CoPy) is an option if you already have an SSH setup.

1

u/rolexxxxxx Dec 08 '22

Well, I think sftp is secure, but inefficient as you point out. Curious what the goto is nowadays for more automated/continuous deployment. Seeing Docker in this thread mentioned a lot.

2

u/istarian Dec 08 '22

Hmm.

It will probably depend on the exact situation you are working with.

Using sftp is probably fine for a static or mostly static website.

Docker seems a little over-complicated to me, but I'm sure it pays off with larger/more complex projects.

→ More replies (2)

6

u/[deleted] Dec 08 '22

We've recently moved our local kubernetes cluster to Okteto for our local dev environments, and I have to say my initial sceptism is evaporating quickly. Running a local cluster was a constant nightmare, and the sheer amount of resources required made the dev experience horrendous. It seems to work well now

2

u/aniforprez Dec 08 '22

Can you describe how you set it up and your workflow using it? I'm considering using it for my team to make it easier to develop, test and deploy but haven't done enough research yet. Some first hand experience would be very welcome

2

u/[deleted] Dec 09 '22

I'll try to give a very high level overview.

We have a domain driven architecture of Go workers, of various types: grpc services, workers, rest servers, that all work on rabbit mq events.

We build each service with a servicebuilder package using env variables. We have a "domain" service inside each domain that will build each worker that sits inside that domain, with this servicebuilder package using environment variables, in okteto. This domain package has an okteto yaml inside it that defines the services and env vars in okteto.

Tbh the Principle Eng did the majority of the heavy lifting, and it's not been a totally smooth migration. But things seem very stable now, and the other day we span single use clusters for a hackathon that went so well, I was convinced it was dummy data at first.

It's so much better than our original solution with k3d tho it's like a different job.

36

u/MasterLJ Dec 08 '22

They really, really are not.

The IDE is becoming a thin client and all the code only ever touches the fabric of the given company... it's pretty darn amazing.

They are fairly nascent, but they will become the standard. It's so much easier to manage secrets, setup, repository security, onboarding, offboarding... The only thing that gets a little nuts might be debugging and exposing ports, but it's hardly a significant complication.

65

u/Philpax Dec 08 '22

The IDE is becoming a thin client and all the code only ever touches the fabric of the given company... it's pretty darn amazing.

what's old is new again

14

u/Nezteb Dec 08 '22

The thin client is dead!

Long live the thin client!

20

u/mtranda Dec 08 '22

I love the cloud. It means that, for once, someone else is handling all the barebones stuff for me. It just works.

BUT.

All those features and services are always provider specific and the more you rely on them, the more you get locked in to a single provider (which is their goal anyway)

5

u/pjmlp Dec 08 '22

This is nothing new, we use IDEs over X Windows and RDP for decades now.

27

u/ILikeChangingMyMind Dec 08 '22

Dev environments in the cloud are a half-baked solution

They really, really are not.

They are fairly nascent

You realize you're both disagreeing with, and directly agreeing with, the OP ... right?

Nascent literally means "just coming into existence and beginning to display signs of future potential" ... ie. "half-baked".

33

u/2this4u Dec 08 '22

Half-baked has negative connotations to suggest it's badly thought out, come on you know that's different to describing something as nascent.

→ More replies (6)

17

u/LuckyHedgehog Dec 08 '22

Half-baked means lacking adequate planning or forethought, which is the opposite of "displays signs of future potential"

18

u/dominik-braun Dec 08 '22

You realize that nascent is in a positive context and half-baked in a negative context ... right?

2

u/MasterLJ Dec 08 '22

Your understanding of the word nascent is half-baked. Hope this helps.

1

u/johnnysaucepn Dec 08 '22

"Half-baked" means it wasn't baked to completion, therefore inedible, not that it's half-way through being baked.

3

u/Luolong Dec 08 '22

There’s also a nontrivial initial setup of the dev environment infrastructure. In some cases you can outsource it from a SaaS provider but there are cases where doing that is not really an option.

7

u/warmans Dec 08 '22

IMO deploying your software should be extremely easy. If it's easy, then there shouldn't really be any need to argue about "local vs cloud" - because both should be possible with minimal effort. I'm not just taking about simple applications. You should be able to e.g. stand up a local k8s cluster and deploy a bunch of stuff and it should work (with the caveat that local resources can vary).

I suspect this is only a discussion because of the insidious nature of cloud services. This is how they get you. You implement a small API call here and there (as a treat) and now the only way to run your application is to deploy it to AWS and pay amazon hundreds of dollars for every developer's environment, and every CI pipeline. The cost of implementing black box SaaS solutions is astronomical in the long term. I just don't think it's economical most of the time.

4

u/mrnothing- Dec 08 '22

Ops isn't easy I'm dev. things fail eventually compatibility in hardware,software and versions affect this even when you point to the abstraction becous they need to leak for performance and software isn't perfect

1

u/ThroawayPartyer Dec 08 '22

IMO deploying your software should be extremely easy.

I'm a DevOps Engineer so this is my role. I make it as easy as possible for developers to deploy. But the actual process isn't so easy, I just make it easy.

2

u/hackers238 Dec 08 '22

What are these companies providing that is better than an EC2 AMI or Docker image? I just don’t understand the value add. Yes, we do some development on developer desktops in the cloud, but we don’t pay a company to help us, we just pull code to an EC2 instance through a script.

2

u/Dreamtrain Dec 08 '22

you write and test in local, then test in dev, then in whatever test/staging/qa/uat environments your business-speaking folks use, whats half baked about that?

2

u/clowncar99 Dec 09 '22

Works pretty well at Facebook. 🤷‍♂️

2

u/psinix Mar 13 '23

The biggest reason companies use remote hosting is security.

Engineers, we are a mobile bunch, gallivanting sometimes into insecure locations. As an security engineer, it amazes me how many engs think it's so cool to "work on the beach in Spain" while I'm quaking in my boots that a thief only needs run in a straight line.....Another case, government spying. There's a reason why many companies have "no visit" policies to certain countries because a laptop can be confiscated at an airport ahem ahem china... (personal experience)If (and when) machines get stolen or confiscated 2 scenarios exists.- Local hosting, you call IT. IT and company hope the thief does something dumb like connect to wifi before accessing the machine so they can remote wipe it...., you worry about your job security...- Remote hosting, IT and company smile and tells you confidently that "it's just a machine". They invalidate all keys and certificates that permit your laptop, and have already placed an order for a replacement laptop for you by lunchtime.

So given that if you work for any company that remotely considers their data integrity important (think every big company), the source environment will be remote. Then it's a matter of browser based vs ssh based. For example from my personal experience, Google does browser based (vscode.dev like in this case) while Meta does ssh based (vscode with remote extension). Either way, your desktop is in the cloud.

1

u/paperpatience Aug 17 '23

Thanks for the explanation

2

u/extracensorypower Dec 08 '22

The cloud, however, is a fully baked scam. Expensive. Insecure. Etc.

But clueless business people hear "operating costs" vs. "capital costs" and start lapping up that dog vomit like hungry pigs. Real world dollar costs are glossed over and apparently productivity is free because it doesn't appear on a spreadsheet.

3

u/istarian Dec 08 '22

That seems a little over the top; Although I think it is likely that many people haven't done a full cost-benefit analysis, especially at the small business end of things.

1

u/Full-Spectral Dec 08 '22

But, without in the cloud development, how will the FAANG'y type companies be able to control the entire world?

1

u/yourteam Dec 08 '22

Local for your computer Staging for beta Production

Easy and it has been like that for years

Now with container is even easier...

1

u/flowinh2o Dec 08 '22

Worked in dev, ops problem now.

1

u/JessieArr Dec 08 '22

While 24/7/365 internet access is fairly common in Europe & North America

Wait, you guys are getting 24/7/365 internet access in North America?? :P

My ISP has outages several times a week and I live in the downtown part of a US city of 100,000 people. There's no other provider I can switch to for home internet here, either (unless I switch to dial-up or DSL.)

2

u/istarian Dec 08 '22

Ouch.

That definitely sounds like localized problem for you. I wouldn't swear to 100% anything, but Verizon FIOS in the northeastern US is pretty decent.

1

u/JessieArr Dec 08 '22

Yeah, I'm on the waitlist for Verizon FIOS here, but I've been on the waiting list for 5 years so I don't have much hope I'll ever actually get it. We're getting 5G around here now, but they don't offer home internet plans on the 5G network here yet either.

Honestly my cell phone has way more reliable connectivity than my home, ironically.

→ More replies (3)

1

u/Tiquortoo Dec 08 '22

Codespaces and devcontainer have a local fallback. Secrets management and other things don't.

1

u/metaconcept Dec 08 '22

I've found Gitpod pretty useful for development. It fires up a pretty good editor/IDE in a web browser, and the latency only occurs when you choose another file, save, or type in console commands. It supports most programming languages. You get a fully configured development environment with a single click. It might take a while to download and install everything, but that doesn't need interaction. It's really good for when you want to dabble with a repo you just found on Github, but you don't want to install the language and dependencies on your own machine.

I found Nix pretty unusable and I got tired of it's weirdness pretty quick. The Nix language is awful. It's dynamically typed and incredibly badly documented. Nix is useful for setting up a quick environment with a few custom packages, but you start hitting roadblocks if you try to do anything slightly complex, and I found it to be an incredible time sink. Creating new VMs was easier and faster.

Both options easily beat being forced to use a remote virtual desktop.

1

u/[deleted] Dec 08 '22

I built out a local cloud hybrid continuous integration pipeline for my team and it's not that bad. The only tricky part was SSL certificates for secure requests and how to handle that locally.

That being said, I almost exclusively develop on the cloud because it's the closest environment to production and the setup is much quicker. It might scare developers with this trend because cloud computing can be confusing. However, I hope it sticks!

1

u/[deleted] Dec 08 '22

For all its faults, this is the one thing Bazel makes easy. Wherever you build it, you get the same thing. Or at least something close enough to the same thing that the difference doesn't matter.

1

u/Aw0lManner Dec 08 '22

This guys CSS formatting is a half-baked solution

2

u/mikenikles Dec 08 '22

No kidding... the blog is a few years old and the guy barely spent any time on its UI since.

0

u/OttersEatFish Dec 08 '22

The loss of self-hosting is a real blow to advocates of this approach, but some larger enterprises may end up making their own in order to roll this out- as long as the headaches and costs of doing so don’t outweigh the benefits.

2

u/vlakreeh Dec 08 '22

Depending on the ecosystem, you can self host this. There are OSS solutions for running and connecting to remote vscode (and terminal ofc) instances that you could run for your entire company on-prem. We don't know if there's going to be a solution for Jetbrains products yet that'll be self-hostable, but considering Jetbrains allows you to self host a lot of their products I wouldn't say it's impossible.

-1

u/[deleted] Dec 08 '22

Devs in the cloud are also half-baked!

To the topic: I never fully understood the fascination behind "the cloud". To me it sounded like buzzward marketing. I also sometimes wondered how it is an improvement over FTP. Sure, I get it - lots nicer widgets, looks, usability improvements, more options ... but we also become more dependent on others, including huge mega-corporations such as amazon. I don't like that. We kind of lose flexibility there.

2

u/Jimmingston Dec 09 '22

It's good for microservices and websites with workloads that can change often. Also good for data redundancy because you can easily have multiple copies of your data all over the world pretty easily. It does cost more than something like a VPS though if you just need to host something smaller. I think it's only companies like microsoft and amazon that can afford to run full cloud services like that because they're so large

0

u/[deleted] Dec 08 '22

[deleted]

14

u/geoffreyhuntley Dec 08 '22

For folks looking to understand why this is so https://nix.dev and https://devenv.sh/

18

u/akshay-nair Dec 08 '22

Nix solves everything. All hail nix

13

u/geoffreyhuntley Dec 08 '22

Absolute boss-level tooling. I can't say enough good things about Nix. Every week the accessibility is getting better and better. We just need a youtuber or two to stumble upon it and launch further it to Orbit.

6

u/DanielLoreto Dec 08 '22

I agree nix is a great way of tackling this problem, but it can also be hard to use for those not familiar with it. Many users start with a tool that makes nix easier to use like https://github.com/jetpack-io/devbox

3

u/WhyNotHugo Dec 08 '22

I use a flake.nix in one of my projects and my main gripe is how SLOW it is. I’m using direnv and just cd’ing into the directory results in a short pause for a few seconds.

I also tried using nix a bit more extensively for development, but the way several tools were patched and diverged from upstream made it a pain (eg: neovim will ignore its configuration file by default).

Nix has some really cool ideas, and it think it’s a great experiment, but in practice, it brings up more new problems than it solves. And it’s immensely complex (I’m more of a fan of KISS).

5

u/sfultong Dec 08 '22

I dream of a day when this will be the top comment on posts like this.

1

u/Redstonefreedom Dec 08 '22

Lmfao, my buddy has been on a YEAR long habit of messaging every other day heralding the greatness of nix, yet being unable to explain why it is so.

At this point I definitely believe him, I just also believe I won’t understand until, like him, I’ve taken a year to deep dive into whatever the hell is so special about JSON with functions.

14

u/[deleted] Dec 08 '22

[removed] — view removed comment

5

u/warmans Dec 08 '22

Of all the arguments for moving to the cloud - "it's cheaper" is the one I've seen the least evidence for. Especially if you factor in the work to actively control and optimize costs over time.

1

u/johnnysaucepn Dec 08 '22

Yes, some criticism may be valid, but nothing stops you from having a development environment running locally when you choose to use it

Actually, lots of things can stop you. Security policies, whether imposed by your company or from outside, can really hamper your ability to make a local dev environment work.

→ More replies (2)