Bug 1465779

Summary: aspnetcore.all meta package restore slows down s2i build and consumes bandwidth
Product: dotNET Reporter: Tom Deseyn <tdeseyn>
Component: rh-dotnet20-containerAssignee: Andrew Slice <andrew.slice>
Status: CLOSED WONTFIX QA Contact: Radka Gustavsson <rjanekov>
Severity: unspecified Docs Contact: Les Williams <lwilliam>
Priority: unspecified    
Version: 2.0CC: andrew.slice, bgollahe, bodavis, dbhole, djebbibmw, kanderso, lzachar, omajid, rjanekov, sgehwolf
Target Milestone: ga   
Target Release: 2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-01-24 15:46:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tom Deseyn 2017-06-28 07:50:11 UTC
ASP.NET Core 2.0 introduces a meta package to reference the major packages that make up the web framework.

The Microsoft dotnet docker sdk image caches these packages from nuget.org in the image.
This has the advantage of both speeding up the build and not wasting the bandwidth of downloading for each build.

With my internet connection/machine this takes about 1-2min and downloads 130MB of packages.

```
$ rm -rf ~/.nuget ~/.local/share/NuGet/; time dotnet new mvc
real	1m47.271s
$ du -ch $(find ~/.nuget/packages -name '*.nupkg') | tail -1
129M	total
```

Since we are not caching these packages, this restore currently happens for every s2i build.

Comment 1 Severin Gehwolf 2017-06-28 10:52:10 UTC
Andrew, how about we do this nuget cache warmup in the 2.0 s2i builder image? This should solve the issue, right?

Comment 2 Tom Deseyn 2017-06-28 11:08:39 UTC
Severin, I had implemented that but this is being removed as part of https://github.com/redhat-developer/s2i-dotnetcore/pull/88/files#diff-6f2669af799dae0df04fa82a92c1d7f9L60. The motivation is we are not building these packages.

Comment 7 Andrew Slice 2020-01-24 15:46:17 UTC
I'm closing this as "Won't Fix", though maybe the correct answer is actually "Can't Fix". As described here, source build issues in 2.x prevent us from shipping with the packages necessary to get rid of this, and any future development is going into the 3.x versions.

In 3.x, the design has been changed to no longer need to grab these packages at runtime, including providing proper source built packages. So the suggestion might be to upgrade to 3.x

For 2.x, there is a workaround that can be done, but it does require using non-source built packages that we can't ship.

We have imagestreams for 2.x packages that pre-cache ASP.NET. This was implemented in this PR upstream: https://github.com/redhat-developer/s2i-dotnetcore/pull/280

In general, information on that can be found upstream: https://github.com/redhat-developer/s2i-dotnetcore