Skip to content
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

Core Tools OOP Host #3802

Merged
merged 70 commits into from
Sep 24, 2024
Merged

Core Tools OOP Host #3802

merged 70 commits into from
Sep 24, 2024

Conversation

aishwaryabh
Copy link
Contributor

@aishwaryabh aishwaryabh commented Aug 28, 2024

Issue describing the changes in this PR

resolves #3744

This PR creates the feature branch feature/oop-host, which has the OOP host build. This PR also includes checks for the user passing in the --runtime param specifying the host and infers the host if that is not specified. I've also added tests which checks that we try to execute the correct func.exe (even though those tests technically fail since there is no inproc-6 or inproc-8 folder). We also only run on .NET 8 TFM and remove multi-targeting in the feature branch.

For when the user specifies the --runtime parameter, these are the following scenarios we support today where the first row is the options the user may put in and the first column are the potential apps a user may have:

inproc6 inproc8 default
.NET Isolated app x
.NET 6 in-proc app x
.NET 8 in-proc app x
non .NET app x

Anything that does not have an X within it throws an error to the user with a helpful message on why the passed in host runtime is not valid.

For inference the path will be:

Sequence Tool version
.NET Isolated app default default
.NET 6 in-proc app default -> inproc6 inproc6
.NET 8 in-proc app default -> inproc8 inproc8
non .NET app default default

This is how the logic looks like today for the inference scenario:

  • If app is in-proc app
    • If FUNCTIONS_INPROC_NET8_ENABLED is set
      - Run inproc8 host
    • Else
      - Run inproc6 host
  • else
    • Run OOP host

Pull request checklist

  • My changes do not require documentation changes
    • Otherwise: Documentation issue linked to PR
  • My changes do not need to be backported to a previous version
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • I have added all required tests (Unit tests, E2E tests)

@aishwaryabh aishwaryabh marked this pull request as ready for review September 5, 2024 23:57
@aishwaryabh aishwaryabh requested review from a team as code owners September 5, 2024 23:57
@aishwaryabh aishwaryabh changed the base branch from v4.x to feature/oop-host September 9, 2024 20:16
@aishwaryabh aishwaryabh changed the base branch from feature/oop-host to v4.x September 9, 2024 20:16
azure-pipelines.yml Outdated Show resolved Hide resolved
build.ps1 Show resolved Hide resolved
eng/ci/public-build.yml Show resolved Hide resolved
pipelineUtilities.psm1 Outdated Show resolved Hide resolved
src/Azure.Functions.Cli/Azure.Functions.Cli.csproj Outdated Show resolved Hide resolved
src/Azure.Functions.Cli/Azure.Functions.Cli.csproj Outdated Show resolved Hide resolved
{
FileName = inProc8FuncExecutablePath,
FileName = funcExecutablePath,
Copy link
Member

Choose a reason for hiding this comment

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

Where do we use the --no-build argument?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We use it in line 626?

@fabiocav
Copy link
Member

fabiocav commented Sep 19, 2024

The table shared above doesn't seem to capture the expected supported scenarios.

Shouldn't this reflect what is supported when --runtime is explicitly set?

inproc6 inproc8 default
.NET Isolated app x
.NET 6 in-proc app x
.NET 8 in-proc app x
non .NET app x

For inference, the path would always be:

Sequence Tool version
.NET Isolated app default default
.NET 6 in-proc app default -> inproc6 inproc6
.NET 6 in-proc app default -> inproc8 inproc8
non .NET app default default

EDIT: This information was applied to the PR description

@@ -418,15 +421,47 @@ private async Task<JObject> GetLocalSettingsJsonAsJObjectAsync()
public override async Task RunAsync()
{
await PreRunConditions();
var isVerbose = VerboseLogging.HasValue && VerboseLogging.Value;
Copy link
Member

Choose a reason for hiding this comment

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

Can we move this logic that is specific to .NET to a different method and out of RunAsync? That will help declutter this method and make the code easier to navigate.

Copy link
Member

Choose a reason for hiding this comment

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

This will also enable you to reduce the variables as you'll be able to drive the logic without needing to have an additional flag for OOP.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved this logic into: ShouldExitAfterDeterminingHostRuntime to clean up RunAsync

Copy link
Member

@fabiocav fabiocav left a comment

Choose a reason for hiding this comment

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

There are a few changes/improvements I'm tracking, but let's get this merged into the feature branch and collaborate there.

@aishwaryabh aishwaryabh merged commit 2d35b1b into feature/oop-host Sep 24, 2024
4 checks passed
@aishwaryabh aishwaryabh deleted the aibhandari/core-tools-oop branch September 24, 2024 19:05
kshyju pushed a commit that referenced this pull request Nov 4, 2024
* this doesn't work

* this finally works now

* default should be oop host

* added edge cases

* fixing formatting

* using determineTargetFramework

* saving tests

* adding copy step for OOP

* fixing the webhost reference

* removing test

* setting host version in ps script

* update to validate worker versions script

* update versions for worker packages

* adding ToString

* validating worker version

* validate worker versions

* updating csproj to compile

* addressing pr feedback

* updating build steps

* adding build step

* fixing build step

* trying to get this working

* reverrting target runtimes

* updating tests

* adding dotnet info step

* adding changes

* removing extra test

* trying to specify architecture

* modifying tests to see if they work

* narrowing down to tests that are failing

* trying to see if it works with nobuild flag

* addressing pr feedback

* updating tests with latest logging

* addressing comments and marking flaky tests

* updating so that we are only using net8 framework

* pushing change for branch build

* adding single quotes

* reverting quotes

* adding code mirror fiile

* updating build step

* updatinng build steps

* updating build step

* adding step for dotnet publish

* set inprochost compilation system to diff value and skip flaky test

* updating public build pipeline to trigger

* adding extra changes for pipeline

* public build yml

* updating official build

* readd net8 build artifact step

* readding space back

* addressing initial comments

* adding explicit openTelemetry dlls

* simplifying logic of startHostAction

* addressing PR feedback

* start tests

* changing some of the tests back

* reverting test back to normal

* fixing spacing for csproj

* addressing PR feedback

* adding extra variable

* adding logic for edge case scenarios

* added edge cases tests

* removing extra line in node

* addressing comments

* moving validate host runtime to its own method

* forgot to add return statement
aishwaryabh added a commit that referenced this pull request Nov 6, 2024
* this doesn't work

* this finally works now

* default should be oop host

* added edge cases

* fixing formatting

* using determineTargetFramework

* saving tests

* adding copy step for OOP

* fixing the webhost reference

* removing test

* setting host version in ps script

* update to validate worker versions script

* update versions for worker packages

* adding ToString

* validating worker version

* validate worker versions

* updating csproj to compile

* addressing pr feedback

* updating build steps

* adding build step

* fixing build step

* trying to get this working

* reverrting target runtimes

* updating tests

* adding dotnet info step

* adding changes

* removing extra test

* trying to specify architecture

* modifying tests to see if they work

* narrowing down to tests that are failing

* trying to see if it works with nobuild flag

* addressing pr feedback

* updating tests with latest logging

* addressing comments and marking flaky tests

* updating so that we are only using net8 framework

* pushing change for branch build

* adding single quotes

* reverting quotes

* adding code mirror fiile

* updating build step

* updatinng build steps

* updating build step

* adding step for dotnet publish

* set inprochost compilation system to diff value and skip flaky test

* updating public build pipeline to trigger

* adding extra changes for pipeline

* public build yml

* updating official build

* readd net8 build artifact step

* readding space back

* addressing initial comments

* adding explicit openTelemetry dlls

* simplifying logic of startHostAction

* addressing PR feedback

* start tests

* changing some of the tests back

* reverting test back to normal

* fixing spacing for csproj

* addressing PR feedback

* adding extra variable

* adding logic for edge case scenarios

* added edge cases tests

* removing extra line in node

* addressing comments

* moving validate host runtime to its own method

* forgot to add return statement
fabiocav pushed a commit that referenced this pull request Nov 6, 2024
* this doesn't work

* this finally works now

* default should be oop host

* added edge cases

* fixing formatting

* using determineTargetFramework

* saving tests

* adding copy step for OOP

* fixing the webhost reference

* removing test

* setting host version in ps script

* update to validate worker versions script

* update versions for worker packages

* adding ToString

* validating worker version

* validate worker versions

* updating csproj to compile

* addressing pr feedback

* updating build steps

* adding build step

* fixing build step

* trying to get this working

* reverrting target runtimes

* updating tests

* adding dotnet info step

* adding changes

* removing extra test

* trying to specify architecture

* modifying tests to see if they work

* narrowing down to tests that are failing

* trying to see if it works with nobuild flag

* addressing pr feedback

* updating tests with latest logging

* addressing comments and marking flaky tests

* updating so that we are only using net8 framework

* pushing change for branch build

* adding single quotes

* reverting quotes

* adding code mirror fiile

* updating build step

* updatinng build steps

* updating build step

* adding step for dotnet publish

* set inprochost compilation system to diff value and skip flaky test

* updating public build pipeline to trigger

* adding extra changes for pipeline

* public build yml

* updating official build

* readd net8 build artifact step

* readding space back

* addressing initial comments

* adding explicit openTelemetry dlls

* simplifying logic of startHostAction

* addressing PR feedback

* start tests

* changing some of the tests back

* reverting test back to normal

* fixing spacing for csproj

* addressing PR feedback

* adding extra variable

* adding logic for edge case scenarios

* added edge cases tests

* removing extra line in node

* addressing comments

* moving validate host runtime to its own method

* forgot to add return statement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Core Tools updates to use out-of-process host by default
4 participants