-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build: provide pre-built nodejs/node images or cache #39672
Comments
Also, FWIW, I am happy to help make this happen however I can. I assume if we go down the route of images, the auto-generation will be the... harder part for me to meaningfully contribute to purely because I don't have access/am not familiar with the infrastructure we'd likely use to do that compute. |
The challenge I see with a Docker container is how to "connect" it to the user's GitHub credentials (so they can easily push to their fork after working on a change). |
@targos yeah, that's a place I think the enhancement with a small CLI or other kind of helper would be beneficial. |
I also think that's a much better problem to have than having to compile Node.js on your own computer 😅 |
I suppose I should ask, assuming we do images:
|
I think we should really explore two options and see what is feasible:
A few stats:
If we consider a 100MBit line, this bundle will download in around 20-30s. |
I'm experimenting with this in https://github.com/targos/node-dev-docker |
GitHub actions might be enough, but I don't know where we would push the image. I would try with the GitHub container registry, but I don't know if it's designed to hold short-lived images (we don't want to keep all nightly builds in storage forever). |
After 41 minutes on my mac, the image is built. Its size is 2.86 GB |
Compressed or uncompressed? Usually those are transferred in a compressed fashion. |
You could always remove |
I going to try again with |
This might be really interesting. |
Still building, but FWIW the image is already 1.86 GB before compilation, so there's probably a lot of room for improvement (like removing the apt cache) |
We do have a GCP account in build used for the download metrics so we could make use of the container registry there. (if its applicable) |
Somehow ccache isn't used when the image is built... I pushed what I have so far. |
Dont you need to explicitly set |
Not if using the ccache symlinks. |
The problem is that the |
Perhaps because the
But maybe we don't need to modify |
This seems pretty interesting. Once we build, we might be able to build a small CLI inside node-core-utils to download the bundle for the closest base commit. |
It seems interesting, but isn't the build output very dependent on the environment (OS, build tools, etc.) ? |
would that involve having the run a action for each of the main three? (windows, mac, linux)? cause then we run into issues with things like macos action being very slow and unable to use ccache |
I made a workflow that built node on This is the output: https://nodejs-build-snapshots.s3.eu-west-1.amazonaws.com/builds/node-linux-v17.0.0-build-files.tar.gz I see that the build directory I am not an expert of building big C++/like projects, let me know if you have any clue... |
Found the right person at GitHub to talk to today and they said they'd be able to get us an extra large runner for this if we decide to go down the Actions route 👍🏻 |
I'm sure we could get GitHub Container Registry set up if we want to, and I'd be happy to help with that. Docker Hub is also an option - I assumed we'd go with this purely based off of it being the default. re: short-lived images: I honestly don't know if this matters. I actually think it might be nice to have nightly developer builds permanently archived. Perhaps there's justification for not keeping them that I'm missing? |
I'm working on an image for this. I'm going to see if I can grab some time with a couple of my coworkers who are much more experienced with Docker than I am to make it Good™ but hoping to publish it to a repo this week. I'll share it here for feedback - I've incorporated everything that's been suggested that is reasonable without enhancing existing tooling (see: nodejs/node-core-utils#554 for context on that!)... I figure we can do that work incrementally. |
@bnb in case you missed it, I spent some time working on an image in https://github.com/targos/node-dev-docker. Feel free to take anything from it :) |
oooh I did miss it, my apologies. I'll comb through it and see what's similar and what's different - I'm sure there's some things you thought of that I didn't 👍🏻 |
I've been working on this over the past few weeks. Today I made the final bit of progress needed (thanks @mhdawson and @bmeck for the advice) to get it in a workable state. ProgressSo far, I've got a Docker image that:
This is all done in Additionally, I've got an example devcontainer config (available at My proposal with this would be to include the configuration files (those in Further WorkI've set this up with building and publishing nightly in mind. Theoretically this should be doable (and ~relatively trivial) with GitHub Actions, but I've been focusing on the Docker side of things until the breakthrough progress I had today. If we do decide to proceed with this, I'd presumably move the Ideally, to proceed, we'd need a few things:
And to land:
If this is something you'd like to see, I'd appreciate hearing that. |
I'm +1 on trying this out and make it part of the Node.js infrastructure. I have a few questions. Could the docker image be part of our docker team help maintaining? Could the image be used to develop Node.js outside of CodeSpaces? In that case, how would the flow work? Would it be possible we get some level of sponsorship from GitHub to let developers use CodeSpaces for free in that environment/as part of contributing to Node.js? |
+1 from me as well. |
It could be maintained by anyone, so yes if they want to. I'd definitely love to continue contributing, of course :)
Yep! The image is your typical Docker image, just perhaps a bit more chonky than you'd normally want a production service Docker image to be. Spin it up on your local machine or in a cloud, SSH in and you're good to go. We should definitely have instructions for this!
I'm not sure on this, since I don't think this is how Codespaces works in terms of the infrastructure/billing. Specifically, it's presently tied to org membership with the org being responsible for the bill. What I'd assume is more likely than public entitlements, given the billing structure, is getting an entitlement for the org and its members. I'll be happy to ask on both fronts, though. |
Is this relevant? |
@targos heh, yes. I'll have to see what's needed for that :) |
Is your feature request related to a problem? Please describe.
Presently, making a small contribution to node.js core is particularly challenging. There are a number of contributing factors, but a primary one is simply having to build Node.js from scratch. For someone unfamiliar/new to Node.js, this can be particularly challenging compared to basically anything else in the JavaScript ecosystem.
Describe the solution you'd like
It would be a nice contributor experience enhancement to provide a pre-built image (containerd or Docker?) or some kind of cache that would help alleviate the pain of needing to build completely from scratch every single time.
One theoretical manifestation of how this could work:
Containers provide some nice benefits:
Or, we could do something in the vein of a cloud cache (in the vein of goma). While these require immense work, they are extremely useful and don't require you to run Docker. If there's more interest in this, I'm happy to see what resources I can pull from Microsoft (including potentially open sourcing some things) to enable it.
Either way, this is a build feature that seems to go in a positive direction that helps both new and existing contributors. Would love thoughts, if there are any.
Describe alternatives you've considered
Doing nothing: I mean this works but also retains an unnecessary bad experience.
The text was updated successfully, but these errors were encountered: