Граф коммитов

430 Коммитов

Автор SHA1 Сообщение Дата
Anatoli Beliaev 1fdc031423
Logging fixes (#286)
* Fix dependency management background logs

* Use log level in RpcLogger.WriteSystemLog

* Format "System Log" messages as a single line

* Don't share StringBuilder in RpcLogger

* Rename isUserLog parameter to isUserOnlyLog

* Move isUserOnlyLog parameter to the first position and make it mandatory

* Add isUserOnlyLog parameter comment
2019-07-22 13:37:36 -07:00
Anatoli Beliaev f26d5ec4e2
Move GetModuleLatestPublishedVersion from DependencyManager to DependencySnapshotInstaller (#283) 2019-07-18 18:25:45 -07:00
Anatoli Beliaev 357a2276bb
Improve module version purge on managed dependencies auto-upgrade (#275)
* Improve module version purge on managed dependencies auto-upgrade

* Purge dependency snapshots regardless of whether a new snapshot will be installed or not
2019-07-17 14:01:26 -07:00
Anatoli Beliaev 82cedeec87
Ignore function load requests with duplicate FunctionId values (#278) (#279)
* Add FunctionLoader IsLoaded method

* Return from ProcessFunctionLoadRequest early if already loaded
2019-07-16 11:31:26 -07:00
Anatoli Beliaev 4e5368cdd5
Clear pushed output binding values on exceptions (#281)
Fixed issue:
If a PowerShell function invokes Push-OutputBinding and then throws an exception, the next invocation response contains data passed to Push-OutputBinding on the previous invocation.
2019-07-15 19:32:23 -07:00
Anatoli Beliaev 78f4734d81
Ignore function load requests with duplicate FunctionId values (#278)
* Add FunctionLoader IsLoaded method

* Return from ProcessFunctionLoadRequest early if already loaded
2019-07-15 14:25:05 -07:00
Anatoli Beliaev 0b9b6fe9b6
Reimplement managed dependencies auto-upgrade (#267)
Reimplement managed dependencies auto-upgrade
2019-07-11 13:59:49 -07:00
Anatoli Beliaev c403773ea7
Fix E2E test on Linux: allow both '/' and '\' in module path (#272)
* Allow both '/' and '\' in module path

* Using Path.Combine and Path.DirectorySeparatorChar instead of regex
2019-07-09 10:14:32 -07:00
Anatoli Beliaev e0977763ee
Fixing E2E tests (#271)
* Add requirements.psd1

* Apply `using` to HttpClient
2019-07-08 15:32:08 -07:00
Anatoli Beliaev 0ed9b043f0
Add an end-to-end test for managed dependencies (#268)
* Add UsingManagedDependencies function

* Extract GetHttpTriggerResponse method

* Enable manaded dependencies in TestFunctionApp\host.json

* Output Az path from UsingManagedDependencies

* Add InvokeHttpTrigger overload returning the response string

* Add ManagedDependenciesEndToEndTests

* Add new line to ManagedDependenciesEndToEndTests.cs
2019-07-08 10:11:21 -07:00
Tyler James Leonhardt a4db0928f0 Fix issue with proxies (#261)
* fix issue with proxies
2019-06-21 20:27:03 -07:00
Francisco Gamino 8c6fcbef58
Updated subtree from https://github.com/azure/azure-functions-language-worker-protobuf. Tag: v1.2.0-protofile. Commit: 77b0401b85b6bf89494f0fab2313a336fcacb41f (#262) 2019-06-21 10:38:32 -07:00
Francisco Gamino 80016066fa
Fixing test pass. (#263) 2019-06-21 09:51:24 -07:00
Francisco Gamino 9e38fe1db1
Fixing faulty logic in InstallFunctionAppDependencies and adding unit test (#250)
* Fixing faulty logic in InstallFunctionAppDependencies and refactoring DependencyManager.cs to accommodate for unit test.

* Adding unit test to validate the retry logic in InstallFunctionAppDependencies as well as a successful module download.

* Adding Save-Module number of attempts to error log. Updating unit test to reflect this change.

* Adding logic to dependency manager to fail in the first dependencies installation run if the PSGallery could not be reached, but continue if previous dependencies exist.

* Adding unit test to validate that a function app execution should continue if the PSGallery could not be reached but a previous installation of managed dependencies exists.
2019-06-19 12:56:18 -07:00
Anatoli Beliaev 28cb6b92a9
Set response Content-Type to 'application/json' when an object is provided to Body (#245)
* Add TestObjectToTypedData_WhenBodyIsJson_AddsApplicationJsonContentTypeHeader test

* Move ContentType default value from HttpContext to TypeExtensions

* Add application/json to Json content

* Add explicit tests on added content-type headers

* Extract DeriveContentType method

* Extract ContentTypeHeaderKey constant
2019-06-07 13:44:07 -07:00
Francisco Gamino d28566ea1d
Adding function app dependencies installation retry logic with exponential back off. (#230)
* Adding function app dependencies installation retry logic with exponential back off.

* Addressing PR comments.
2019-05-30 13:31:09 -07:00
Dongbo Wang 46bacf7b72
Avoid invoking `run.ps1` and port helper module to C# to improve throughput performance (#214) 2019-05-22 09:44:20 +08:00
Dongbo Wang 3ed9960326
Create only one `Runspace` instance at the `FunctionLoad` stage (#201)
This is to fix the regression in local debugging.
We create the first `PowerShellManager` instance when processing the first `FunctionLoad` request, so the debugger has the target Runspace to attach to.
However, we delay the initialization of the first `PowerShellManager` instance until the first invocation (when checking out the instance from pool).

It turns out we cannot have the dependency manager to create a separate Runspace for downloading.
The VS Code local debugging assumes the target `Runspace` has `Id = 1`, which was true before as only one Runspace will be created initially.
Now, the dependency manager creates a separate `Runspace` for downloading, and there will be a race condition -- sometimes the `Runspace` created for the downloading has `Id = 1`, and thus the debugger will attach to that Runspace, which will be reclaimed after the download and causing the `Wait-Debugger` in the user's function script to not be hit.

This refactoring makes sure only one `Runspace` is created initially -- the `PowerShell` instance used for the downloading is also used to serve the first invocation request.
So there is no race condition and local debugging can work reliably.
2019-05-06 15:26:13 -07:00
Dongbo Wang 45322e8ae2
Special case the 'RpcHttp.RawBody' field to always return the literal string (#210) 2019-05-06 09:38:38 -07:00
Dongbo Wang 60b4e1ea40
Rev the gRPC/protobuf nuget package version (#209) 2019-05-06 09:37:20 -07:00
Dongbo Wang 61aabba69a
Refactor and clean up based on the dependency management changes (#194) 2019-04-26 20:08:30 -07:00
SatishRanjan 52e5c4b6a1 Managed dependency download on background thread (#193) 2019-04-24 16:51:36 -07:00
Dongbo Wang abbc0b36be
Minor cleanup changes (#191) 2019-04-10 15:58:20 -07:00
Francisco Gamino a521829287 Updating Managed Dependencies folder installation path for local development. (#190) 2019-04-09 16:57:19 -07:00
Dongbo Wang cf483fcf75
Improve throughput a bit by avoiding spinning up new threads when it's not needed (#189) 2019-04-09 14:26:53 -07:00
Dongbo Wang 35f9c1e71d
Add 'InvocationId', 'FunctionDirectory' and 'FunctionName' to $TriggerMetadata (#188) 2019-04-05 15:26:42 -07:00
Dongbo Wang 9f3179923d
Treat the string TypeData as Json if possible (#186) 2019-04-04 14:42:56 -07:00
Tyler James Leonhardt 6e8fdeda0a
Rev PowerShell SDK version (#185) 2019-04-03 14:33:57 -07:00
Dongbo Wang be09670ec0
Make the binding-info dictionary case-insensitive on the key (binding name) (#182) 2019-04-03 13:14:22 -07:00
Tyler James Leonhardt fa3dd6ec37
Add SupportsWildcards to Get-OutputBinding and fix help test (#183)
* Add SupportsWildcards

* enforce build and update doc

* comments

* bug fix from platyPS
2019-04-02 19:53:34 -07:00
Dongbo Wang 7ac8a349b7
Update the help content for 'Push-OutputBinding' (#179) 2019-04-02 16:22:14 -07:00
Dongbo Wang 1844e1e94f
Add the design doc in markdown (#180) 2019-04-02 16:21:34 -07:00
Francisco Gamino 5e34a5cfd3 Remove supportedManagedDependencies.json as the func CLI will directly query the PSGallery. (#176) 2019-03-27 16:09:07 -07:00
Dongbo Wang 124b0437e8
Fix the pool size log to reflect the correct size when the env variable is not set (#172) 2019-03-20 09:49:01 -07:00
Dongbo Wang c8b596dcb7
Clean up jobs after the function execution (#171) 2019-03-19 18:58:59 -07:00
Dongbo Wang be85cc9030
Enhance Push-OutputBinding by using the output binding information (#168)
- Change how `Push-OutputBinding` supports pipeline input: `<# produce values #> | Push-OutputBinding -Name queue`
- Change `Push-OutputBinding` to take advantage of the output binding data shared by the worker, to have the `Singleton` and `Collection` behaviors correspondingly.
2019-03-19 13:08:49 -07:00
Dongbo Wang f1df4f00a8
Avoid creating RpcLogger instances unnecessarily by adding static method 'WriteSystemLog' to RpcLogger (#170) 2019-03-19 11:30:59 -07:00
Francisco Gamino 2f757debec Enable installing function app dependencies via requirements.psd1. (#166)
* Enable installing function app dependencies via requirements.psd1.

* Addressing code review comments.

* Addressing code review comments.
2019-03-18 16:23:04 -07:00
Dongbo Wang bda1f8e5f4
Enable tiered compilation for the worker to help the code start (#167) 2019-03-16 15:26:56 -07:00
Dongbo Wang 65230eaf8e
Bring back the code that shares output binding metadata with the helper module (#161)
When script from the helper module is running, it can use `[FuncMetadata]::GetOutputBindingInfo([Runspace]::DefaultRunspace.InstanceId)` to get the output binding info about the function that is currently running. Hence, `Push-OutputBinidng` can do smart things based on the `-Name` with this change.
2019-03-13 17:19:51 -07:00
Francisco Gamino ae05997b41 Updated subtree from https://github.com/azure/azure-functions-language-worker-protobuf. Branch: dev . Commit:2e9cf4b (#164) 2019-03-13 16:00:22 -07:00
Dongbo Wang 19fa6c9789
Update 'New-gRPCAutoGenCode' to recursively find all .proto files (#165) 2019-03-13 14:43:44 -07:00
Tyler James Leonhardt 51acc6c072
Move to rc.1 and support the CustomPipe (#158)
* Move to rc.1 and support the CustomPipe

* use a logger instance

* remove SetContext/ResetContext
2019-03-08 11:52:01 -08:00
Tyler James Leonhardt 2bb6ab4388
No ops for other messages (#156)
* no-ops for other messages

* NewStreamingMessageTemplate additions

* dongbo's comments
2019-03-08 11:26:44 -08:00
Dongbo Wang c0c9f47006 Update the status badges to point to the right URL (#157) 2019-03-06 10:22:37 -08:00
Dongbo Wang 4072ecde23
Update the protobuf subtree from 'Azure/azure-functions-language-worker-protobuf'. Branch: dev. Commit: f786ef (#147)
Also update `New-gRPCAutoGenCode` accordingly.
2019-02-19 17:50:09 -08:00
Tyler James Leonhardt 9ebf44f942
E2e test suite from Nodejs worker (#139)
* Add e2e test suite from java worker

* add to appveyor for CI

* remove Invoke-Test for e2e

* move test csproj

* fix path in module tests

* change to capital T

* uppercase another T

* delete extensions.csproj

* add silentlyContinue to Remove-Item

* props file is one directory up
2019-02-01 18:15:39 -08:00
Dongbo Wang a998cbca9d Use ConvertFromJson/ConvertToJson APIs directly (#141)
* Use ConvertFromJson/ConvertToJson APIs directly

* Update the test code that uses 'ToTypedData'

* Add back the processing of PSObject
2019-02-01 16:31:09 -08:00
Tyler James Leonhardt 1ff1010982
Set ProductVersion by having a common props file (#142)
* set ProductVersion by having a common props file

* new line...

* address feedback

* dongo feedback
2019-02-01 16:30:29 -08:00
Tyler James Leonhardt 884c22a2c9 Update to build with PowerShell SDK 6.2.0-preview.4 (#140) 2019-01-29 02:55:14 -08:00