-
Notifications
You must be signed in to change notification settings - Fork 2k
Approach for using Crossgen2 #1791
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
Comments
I see a fourth option which is the runtime uses composite images and aspnet does as well, but they do not use a unified composite image, but rather one built locally to the particular image. I believe there is a bit of size cost there, but I would like to measure it before I dismiss it out of hand. All of this presumes that we can use the composite image for all of the scenarios, especially the SDK scenarios. |
K. I had an assumption that we could only have one composite image. If we can have multiple, then it's really a variation on the second option. Cool. Is the issue with the SDK that Roslyn uses a different version of System.Collections.Immutable or System.Reflection.Metdata, or both? |
Obviously, let's perf test all the options, and then choosing among them will be easier. |
Yeah, the issue is around the assemblies in the standard runtime that are overridden. The same problem exists in asp.net, as more of their assemblies are overrideable, which might push us back to your initial strategy with option 2. I believe since we only document a small number of assemblies as overrideable in the runtime we might be able to finesse the issue with just a runtime image that doesn't include the problematic assemblies, but I'm not sure. |
I'd like to say "don't do that if you want to use these images" or at least start out with that model. The nice things about Docker is that we have a lot more freedom to change these images in servicing than we do the mainline build. |
I also forgot a major point I was wanting to make earlier around size. We want these images to be as small as possible. So, the thing we ABSOLUTELY DO NOT WANT is a build of the runtime that has IL+R2R images and then a composite R2R file beside it. We want IL binaries + a composite R2R file. We were talking earlier about if and how we should change the build to accommodate this scenario. I think the main thing we want is a build that isn't crossgen'd (for Linux x64 and Linux ARM64). That will give us the most flexibility, will presumably be easier/quicker to process, and have the least size footprint. I am sure there are ways to get to the same result, but this particular ask seems like it might be the sweet spot. I'd also like an SDK (and I think they already have this) that is just the CLI (msbuild, nuget, the CLI verbs and friends) but no ASP.NET or runtime. That will make it much easier to layer it on top of these other layers we have been discussing. With both the ASP.NET and SDK layers, I'm wondering if we could have just one build that works on x64 and ARM64, and naturally, no R2R. |
There is no particular benefit to producing a non-R2R'd official build. The binaries produced by such a build when fed into composite image creation, are recreated without the R2R data, but with a marker that indicates that R2R data should be found in an associated composite image. |
I hear you saying that there is no benefit to the final artifacts (they will be the same). Is there a benefit to processing time? We re-build the container images multiple times a month (and there are many of them) so processing time is a metric we care about. |
@richlander, no there is no meaningful benefit to processing time. I wouldn't say it isn't measurable, but its certainly less than 1 second of processing time, and probably not that much more in download time to get the files to the container for processing. On the scale of the container image build process, the time involved is immaterial. |
@richlander - Do you think this issue can be closed now that #4343 has been completed? |
I was reading through #1775. It seems that there are a bunch of choices and trade-offs to make.
To date, we valued the following:
Going forward, we are going to have to make more tradeoffs, and likely give up on some desirable scenarios.
I see the following rough-hewn options:
I'm attracted to the second option as the default story. My guess is that it would be a sweet spot, assuming crossgen supports it. This option enables the new crossgen2 features, while keeping us on our current path (described at the start of this issue).
/cc @davidwrighton, @MichaelSimons
The text was updated successfully, but these errors were encountered: