TSC icon indicating copy to clipboard operation
TSC copied to clipboard

Is it make sense for Node.js team to enable codespaces

Open gengjiawen opened this issue 4 years ago • 10 comments

Context: https://docs.github.com/en/codespaces/managing-codespaces-for-your-organization/enabling-codespaces-for-your-organization#configuring-which-users-in-your-organization-can-use-codespaces

gengjiawen avatar Aug 13 '21 11:08 gengjiawen

I think this would be a good idea if Github gently donated the cloud resources.

I'm also not sure codespaces can actually build node.. @bnb definitely knows more.

mcollina avatar Aug 13 '21 12:08 mcollina

Codespaces aren't available to the Node.js organization yet, but we can definitely have the conversation before.

@mcollina You can do anything in them, they are ubuntu vms with root access.

targos avatar Aug 13 '21 12:08 targos

I mean I'm unsure how long it would take to build Node.js in there without some kind of compilation cache.

mcollina avatar Aug 13 '21 13:08 mcollina

it took 46 minutes the last time i tested it.

devsnek avatar Aug 13 '21 13:08 devsnek

That being said i would be 110% for a project sponsored compilation cache. Perhaps we could use electron's.

devsnek avatar Aug 13 '21 13:08 devsnek

@mcollina:

I'm also not sure codespaces can actually build node..

They can. I've done it many times before. With a codespace, it's possible to set it up with a default configuration and custom .dotfiles so that ccache can be made available. That's not going to speed up a fresh build, of course, but a codespace (once created) can be persisted for a while so that subsequent builds are faster.

jasnell avatar Aug 13 '21 13:08 jasnell

hi sorry going through my notifications now and just catching this.

I've built Node.js on every single machine size (I assume this likely surprises nobody). Codespaces can indeed build Node.js, but machine size really matters - you basically want to go as high as you can.

I did a side-by-side comparison back when it was still VS Codespaces (the infra is largely the same from what I understand) on Basic vs. Premium. Basic crashed before the compile completed, after about 2 hours. Premium (8 cores) took about 20-25 minutes. The Normal (4 core) machines that Codespaces defaulted to until they added the ability to switch between sizes took about 40-45 minutes IIRC, which matches the time that @devsnek pointed out.

Pre-building a Docker image would likely help quite a bit, which aligns with https://github.com/nodejs/node/issues/39672 pretty nicely. Dropping in a devcontainer.json file with some additional configuration on top of that would likely make this a pretty good experience.

bnb avatar Aug 20 '21 18:08 bnb

That being said i would be 110% for a project sponsored compilation cache. Perhaps we could use electron's.

AFAIK this is pretty tied to Azure-based infrastructure. Happy to internally advocate for donating that infrastructure to the project if we do go down this path.

bnb avatar Aug 20 '21 18:08 bnb

That would be indeed a really good stack/progress.

mcollina avatar Aug 20 '21 20:08 mcollina

I posted the same in https://github.com/nodejs/node/issues/39672.

https://github.blog/changelog/2022-06-15-prebuilding-codespaces-is-generally-available/

/cc @shogunpanda

simoneb avatar Jun 16 '22 10:06 simoneb