-
Notifications
You must be signed in to change notification settings - Fork 183
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
Prejit support on FunctionsNetHost #2711
base: main
Are you sure you want to change the base?
Conversation
@steveisok @ivdiazsa FYI. |
@khkh-ms FYI. I used a previously generated trace for this PR. Once your changes are done, we could replace this file with that. Let's merge both traces to single file (like what we do for host) |
…t package. Minor version bumped.
@steveisok @ivdiazsa Appreciate if you could do review the changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you added unit tests where possible?
I don't have further comments other than addressing the ones that have been pointed out so far. |
…ONS_NETHOST" for env variables.
We don't have any tests as of today as what we want to validate is the native output. There has been discussion about adding an E2E test which simulates the linux scenarios as part of build pipeline (potentially a nightly build). Never got a chance to create a work item until now. #2724 I think that should be the priority. We can certainly revisit as we have more cycles to work on this. |
Looks good to me! Glad you were able to work this in 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…er app so that the pubish output (portable) works for linux use cases.
@@ -25,5 +25,5 @@ jobs: | |||
publishWebProjects: false | |||
zipAfterPublish: false | |||
modifyOutputPath: false | |||
arguments: -c Release -o $(Build.ArtifactStagingDirectory)/_preLaunchAppPackages/${{ version }} -f ${{ version }} -p:UseAppHost=false | |||
arguments: -c Release -o $(Build.ArtifactStagingDirectory)/_preLaunchAppPackages/${{ replace(version, 'net', '') }} -f ${{ version }} -p:UseAppHost=false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing an existing error in output path value, which was introduced during the pipeline migration.
…k. Named eventwait handle does not work in unix,
…-functions-dotnet-worker into shkr/2637_fnh_prejit
@@ -0,0 +1,331 @@ | |||
[S.P.CoreLib]System.Array.Empty<Candidate>()~System.Array,System.Private.CoreLib~0~1:Microsoft.AspNetCore.Routing.Matching.Candidate,Microsoft.AspNetCore.Routing~Empty |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eliaslopezgt please replace coldstart.jittrace
and linux.coldstart.jittrace
files.
E2E test resultsWindowsValidated E2E in private stamp. Everything works as expected. LinuxSpecialization is working as expected, but the http trigger invocation fails with below error.
The azure-functions-dotnet-worker/src/DotNetWorker.Grpc/Definition/GrpcFunctionDefinition.cs Lines 31 to 43 in 24cd553
|
Log("Waiting for cold start request."); | ||
|
||
// When specialization request arrives, FNH will connect to this named server stream and send the assembly path. | ||
using (var pipeServer = new NamedPipeServerStream(Constants.NetHostWaitHandleName, PipeDirection.In)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we instead make an interop call from the native host following the pattern used against the worker?
@@ -57,12 +57,12 @@ static bool WaitOnDebugger(int cycle) | |||
|
|||
if (string.Equals(jsonOutputEnabled, bool.TrueString, StringComparison.OrdinalIgnoreCase)) | |||
{ | |||
Console.WriteLine($"azfuncjsonlog:{{ \"name\":\"dotnet-worker-startup\", \"workerProcessId\" : { processId } }}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert whitespace only changes unrelated to the PR.
<TargetFrameworks>net8.0;net9.0</TargetFrameworks> | ||
<DebugSymbols>False</DebugSymbols> | ||
<DebugType>None</DebugType> | ||
<TieredCompilation>false</TieredCompilation> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set all appropriate assembly properties here.
This assembly will be injected and visible in the default context. It should be signed, properly versioned and named
var taEx = new System.Threading.ThreadInterruptedException(); | ||
|
||
// Same with ASP.NET Core types. | ||
var provider = new Microsoft.Extensions.Configuration.EnvironmentVariables.EnvironmentVariablesConfigurationProvider(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are this part of our safe list of dependencies that won't ship out-of-band?
Assembly entryAssembly = Assembly.GetEntryAssembly(); | ||
string version = System.Diagnostics.FileVersionInfo.GetVersionInfo(entryAssembly.Location).FileVersion; | ||
|
||
var jsonPath = Path.Combine(Path.GetDirectoryName(entryAssembly.Location), Path.GetFileNameWithoutExtension(entryAssembly.Location) + ".deps.json"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's unclear whether this is simply trying to exercise these paths or if there's something missing here. Can you comment?
<TieredCompilation>false</TieredCompilation> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<FrameworkReference Include="Microsoft.AspNetCore.App" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are not part of our safe list of dependencies to bring in. At least in this iteration, we don't want to have this present.
Domo. |
outputs: | ||
- output: pipelineArtifact | ||
displayName: Publish Pre-jit placeholder app artifacts | ||
path: $(Build.ArtifactStagingDirectory)/_preJitAppPackages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider making this a variable
steps: | ||
- template: /eng/ci/templates/steps/install-dotnet.yml@self | ||
|
||
- ${{ each version in split(variables.dotnetVersions, ',') }}: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nit: use framework
terminology instead of version
.
path: $(Build.SourcesDirectory)/host/dist/portable | ||
path: $(Build.SourcesDirectory)/host/dist/portable/prelaunchapps | ||
|
||
- task: DownloadPipelineArtifact@2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we supposed to use DownloadPipelineArtifact
? 1ES has its own syntax for artifact inputs:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of a separate solution file, can we not use an existing one?
Fixes #2637
This PR adds support for pre-jitting framework methods during placeholder mode. Currently this is enabled only for net8 onwards. This behavior can be explicitly disabled by setting
AZURE_FUNCTIONS_FUNCTIONSNETHOST_DISABLE_PREJIT
environment variable value to0
.See internal wiki page for more context.
I will have a separate follow up PR for fixing the build pipeline & nuget packaging needed for this change.Also included the build pipeline changes to include the new artifacts in the final package.Did a minor version bump.
Pull request checklist
release_notes.md