-
Notifications
You must be signed in to change notification settings - Fork 2k
Produce composite crossgen2 image for entire aspnet docker contents #1775
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
Produce composite crossgen2 image for entire aspnet docker contents #1775
Conversation
@richlander @MichaelSimons This is my intial stab at docker file creation for the aspnet scenario. Its not pretty, but it appears to work. Unfortunately it seems to have uncovered a bug in crossgen2 in that compilation is very time consuming. (~5 minutes on my machine) This time is spent mostly after finishing the actual JIT compilation and the system is single threaded, so we clearly have a non O(N) algorithm in there somewhere that is causing some havok. |
Thanks @davidwrighton! I'll work on the following:
What is the planned acquisition experience for the crossgen2 tool?
|
I'm concerned about your task 4 that you called out here. For best performance we need to actually build 1 single composite image with crossgen that serves as the implementation for both the runtime and aspnet components of the image with the current tech. We could potentially split that up, but it will cause the collective composite image size to be larger. Can you explain what sort of work you expect to do here, and what the benefits would be? In general, the crossgen2 acquisition experience for customers is expected to be through nuget for this release (The developer specifies a special property which injects an extra nuget package reference which contains the tool). For the docker build... well, no planning has been done, as we didn't have an expectation on how we would be doing the building. I expect we could probably package up the contents of the nuget package in a tarball for easier acquisition. |
Of course, we may need to move this all to official build, as this build process doesn't sign the resulting binaries and will in fact destroy any signatures that may exist on every managed dll in the container. |
Yeah - that is going to be a blocker. |
Can you explain more of what you mean by best performance? Is this startup, CPU usage, disk size or all of the above? The .NET Core docker images build upon each other. runtime-deps -> runtime -> aspnet -> SDK. The SDK image is not currently based on the aspnet image but that is the desire. The reason for this is to optimize disk usage and reduce pull times for scenarios in which multiple image variants are used on a single machine. With the way the images are constructed today, if you have the runtime and aspnet image pulled, you only contain one copy of the runtime. This allows higher disk density when using out images. |
So, what composite R2R does is that it builds a collection of .NET dlls at once into a single binary blob that contains all of the code, and then rewrites all of the input managed .NET dlls so that they have a reference to that single shared composite image. There are two benefits to this system.
The benefits here primarily accrue to startup, and early process throughput, and thus are intimately intertwined with issues such as docker image size, which are also large drivers of startup cost and site density. There are a number of significant drawbacks to composite images though, and those really need to be called out and explored.
Overall, there are a lot of questions here, and at the moment I would actually expect these composite images to be provided in addition to the existing non-composite images as they will break some applications, and are not a completely drop in replacement in all situations. |
@MichaelSimons If you think this is a good start to the process, could you commit this change to the branch? I don't have write permission here. |
Initial stab at producing composite image for aspnet docker container