question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Lambda and other thoughts

See original GitHub issue
  • Allow the user to declare assembly dependencies. (what UX?)

    • e.g. A function depends on a custom assembly, which will be loaded by using Assembly ... or Add-Type ..., or Assembly.Load(...). Do we want to support that scenario? One solution would be the AssemblyLoadContext.Default.Resolving.
  • ~Capture Write-Host to logging~ Write-Host also write the message to Information stream, so we are good here.

  • PowerShell based Lambda doesn’t bundle AWSPowerShell.NetCore (AWS version of AzureRM.NetCore) with the runtime, but instead, bundle it with user’s scripts in the deployment package. The user needs to use #Requires -Modules in script to specify the module dependency.

    • I don’t like having AzureRM.NetCore bundle with user’s Function App, that will likely cause duplications of such module, which is a waste of bandwidth. However, that would solve the module version issue, since user needs to be explicit about what version of AzRM to be deployed.
    • But we do need a way to let user specify what custom module they want to deploy along with their scripts. (what UX? use #Requires -Modules like Lambda does?)
    • Just realized that the func CLI doesn’t have a pack option. Is the deployment restricted to container image? dotnet-lambda package pack the function app into a zip file, ready for deployment.
      • Lambda provides a powershell module to facilitate creating a powershell lambda, including templates, create a package (zip), publish a package to AWS.
      • By having a powershell helper module, it’s able to parse the script to get the module dependencies from #Requires -Modules ..., and pack the dependencies into the package. We cannot find the dependency moduels without running in the PowerShell session that the user uses for creating the function.
  • ~Lambda tool is a .NET Global Tool “Amazon.Lambda.Tools”. Maybe func CLI should consider to be a Global Tool too, given it’s a .NET Core application.~ (not related to the PS worker)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
daxian-dbwcommented, Oct 15, 2018

Thanks @KirkMunro for sharing your experiences. For the last two points, it’s doable by loading a module to a separate AssemblyLoadContext. Both code and data (statics) from a module can be isolated in that way. The idea is to add a new flag -Isolated to Import-Module to explicitly make powershell load a module to a separate assembly context. The tricky part is how the type resolution in powershell should change accordingly. I will write up an RFC on this after PSConf Asia, probably in late November.

1reaction
SteveL-MSFTcommented, Oct 12, 2018

func CLI as a global tool makes sense but is orthogonal to this and I suspect many PowerShell scripters won’t have dotnetcli installed.

From a packaging standpoint, I think it would be interesting to have a generic way to package a script and dependencies so that ITPros can easily distribute them in their environment even outside of AzF. This can simply be a zip with a well known extension and layout (including assemblies).

I like the idea of requiring the user to package Az module rather than having it in our worker image to resolve the versioning problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Some Quick Thoughts on LaMBDA and Sentience
Folks seem to be talking past each other, working with different definitions of terms, and being overconfident in their proclamations. So I ...
Read more >
9 Killer Use Cases for AWS Lambda | Contino
In this post, I will cover how Lambda works, what makes it different and explore 9 killer AWS Lambda use cases.
Read more >
AWS Lambda - Serverless Computing
AWS Lambda is a serverless compute service for running code without having to provision or manage ... Run code without thinking about servers...
Read more >
Are Lambda-to-Lambda calls really so bad?
A more accurate description of my thinking should be “across ownership lines”. That is, calling Lambda functions that are owned by other ......
Read more >
Learning about Lambda function in Python
A Lambda Function in Python is an anonymous function or a function which doesn't have any name. It is a mostly one liner...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found