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

Open
wants to merge 70 commits into
base: feature/oop-host
Choose a base branch
from
Open

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
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.

Initial review iteration.

azure-pipelines.yml Outdated Show resolved Hide resolved
build/Settings.cs Outdated Show resolved Hide resolved
build/Settings.cs Outdated Show resolved Hide resolved
pipelineUtilities.psm1 Show resolved Hide resolved
test/Azure.Functions.Cli.Tests/E2E/StartTests.cs Outdated Show resolved Hide resolved
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

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