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

Runtime should be able to directly consume webjobs dlls #1508

Closed
4 of 8 tasks
MikeStall opened this issue May 12, 2017 · 7 comments · Fixed by #1717
Closed
4 of 8 tasks

Runtime should be able to directly consume webjobs dlls #1508

MikeStall opened this issue May 12, 2017 · 7 comments · Fixed by #1717

Comments

@MikeStall
Copy link
Contributor

MikeStall commented May 12, 2017

The Functions runtime should be able to directly consume webjobs dlls.
Today when using VS tooling,

  1. we start with WebJobs C# source files,
  2. run a tool to create a Function.json that points to the compiled C# via the precompiled hook,
  3. then load in Functions runtime, and
  4. ref.emit to generate a C# wrapper that matches the original source files.
    We should skip steps 2...4 and just consume the webjobs dll directly.

Notes by @lindydonna:

  • If isGenerated flag is missing or false, script runtime should fall back to the old behavior and use function.json.
  • Runtime should emit a warning if function.json trigger does not match attribute, as this means the scale controller and runtime would be out of sync.

Tasks:

Support changes: (other bugs we need to fix already)

Process

  • add new direct load support
  • private drops available
  • verify existing bugs fixed.
@paulbatum paulbatum added this to the Next - Triaged milestone May 19, 2017
@MikeStall MikeStall changed the title Runtime should be able to direclty consume webjobs dlls Runtime should be able to directly consume webjobs dlls Jun 1, 2017
@MikeStall
Copy link
Contributor Author

Initial investigation looks promising. Just adding the compiled types to the TypeLoader in ScriptHost is enough to execute them. It looks like all of the Ref.Emit round-tripping is really to support the instrumentation that we have in FunctionInvoker.InvokeCore. But the SDK can provide a function begin/end hook to enable this instrumentation (Very similar to what we already do in fast-logger).

@fabiocav
Copy link
Member

fabiocav commented Jun 2, 2017

I'd expect that bringing them in directly would work, but we need to address some of the scenarios we've discussed (e.g out of proc). I think we really need to consider going with a metadata only approach from an SDK's perspective, instead of using the attributes. We can't expect to be able to load and inspect those assemblies in all scenarios.

@MikeStall
Copy link
Contributor Author

MikeStall commented Jun 6, 2017

Solving #578 will make this much easier because it addresses the issues we have around FunctionInvoker.InvokeCore.

@fabiocav
Copy link
Member

fabiocav commented Jun 6, 2017

Yes. Ideally, we'd solve #578 in a way that removes the need for the metrics logic in InvokeCore

@paulbatum
Copy link
Member

Flagging this as potentially breaking. Here is how a customer gets broken:

  1. Create a precompiled function app and deploy it.
  2. Use the integrate tab to change a configuration setting such as a queue name
  3. This change goes out, the runtime stops honoring the queue name in their function.json and reverts to using the queue name hard coded into the attribute in their dll.

If we don't want this to be breaking, the behavior has to go behind some type of flag, or we have to use function.json first and fallback to the attributes. Need to think about the exact semantics to use for the fallback.

@lindydonna
Copy link
Contributor

lindydonna commented Jul 7, 2017

Resolution to break: VS tooling adds a property "isGenerated": true to function.json. If this property is missing or false, then function.json takes precedence. Removing "breaking" label.

@lindydonna
Copy link
Contributor

Removing the "engineering" label as it does have some customer impact, wrt to "isGenerated"

@MikeStall MikeStall modified the milestones: Sprint 2, Next Jul 12, 2017
MikeStall added a commit that referenced this issue Jul 27, 2017
MikeStall added a commit that referenced this issue Jul 28, 2017
This is similar to precompiled, but is enabled if Function.json includes a "configurationSource" : "attributes".
All functions within an assembly need the same  setting.

Resolves #1508

Add test, which runs locally but disabled since it fails in appveyor.
MikeStall added a commit that referenced this issue Jul 28, 2017
This is similar to precompiled, but is enabled if Function.json includes a "configurationSource" : "attributes".
All functions within an assembly need the same  setting.

Resolves #1508

Add test, which runs locally but disabled since it fails in appveyor.
@ghost ghost locked as resolved and limited conversation to collaborators Jan 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants