Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Add new host for running single-exe bundle prototype #26197

Merged
merged 2 commits into from Aug 16, 2019

Conversation

elinor-fung
Copy link
Member

@elinor-fung elinor-fung commented Aug 15, 2019

Initial addition of a basic host for running as a bundle. Only on Linux. Based on unixcoreconsole.

Everything under the bundle/ subdirectory is basically a copy of the files from core-setup (as of 4b82b1e). I also copied pal/utils from core-setup and removed the parts we weren't using. There's probably more that could be pared down, but I wanted to get a starting point in for the prototype.

This host can be copied over the real 'apphost' in an SDK install such that it will be used to create the bundle instead.

@elinor-fung elinor-fung changed the title Add new host for running single-exe bundle Add new host for running single-exe bundle prototype Aug 15, 2019
@elinor-fung
Copy link
Member Author

@swaroop-sridhar I just copied over the bundle code as it exists now - i.e. just extracting files, not including the memory mapping changes you have in flight.

Copy link

@swaroop-sridhar swaroop-sridhar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Beyond the prototype, I wonder if corebundle will need to support some more features. For example:

  • deps.json resolution because of ADDITIONAL_DEPS (which is popular for use with profilers, but infamous for not working very well)
  • Support for startup-hook

Even though we don't need the above features for the prototype app, supporting these features will have non-trivial impact on host-size.

src/coreclr/hosts/unixcorebundle/corebundle.cpp Outdated Show resolved Hide resolved
@swaroop-sridhar
Copy link

@swaroop-sridhar I just copied over the bundle code as it exists now - i.e. just extracting files, not including the memory mapping changes you have in flight.

This is fine, I think we can replace the \bundle directory en masse once the changes are checked in to core-setup.

@swaroop-sridhar
Copy link

@dotnet-bot test this please.

@AaronRobinsonMSFT
Copy link
Member

/azp run coreclr-ci

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@elinor-fung
Copy link
Member Author

@swaroop-sridhar yeah, beyond the prototype, we'd need some sort of json parsing (runtime configs, deps). I'm hoping we may be able to reasonably estimate what added overhead that would bring based on measurements of hostpolicy.

What is expected to be the big cost for startup hooks on the host? I thought that was just passing in another runtime property based on an environment variable?

@swaroop-sridhar
Copy link

I'm hoping we may be able to reasonably estimate what added overhead that would bring based on measurements of hostpolicy.

OK, please share the number when you get to the measurement. hostpolicy.dll is about 0.5 MB -- which is quite steep to pay in the scenario. I'm not sure how much of it (wrt code-size wise) will carry over.

What is expected to be the big cost for startup hooks on the host?

I agree about startup-hook; I mainly wrote it down as an example of things we've removed but will be present in the full set (to keep the size calculations as good as possible).

@elinor-fung
Copy link
Member Author

Tried just ripping out the json parsing and deps resolving from hostpolicy - looked like a difference of ~160KB (Linux x64). From Leandro's investigations into switching to RapidJSON that was ~79KB less than casablanca. So in terms of size, I think a very rough estimate would be +80KB (with the switch to RapidJSON).

@swaroop-sridhar
Copy link

Thanks for the explanation @elinor-fung

.

@elinor-fung elinor-fung merged commit ea5d9d4 into dotnet:single-exe Aug 16, 2019
@elinor-fung elinor-fung deleted the newBundleHost branch August 16, 2019 23:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants