-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix queue task scheduler Increase queue retry attempts from 10 to 20 Fix queue names Rename curl script Code docs
- Loading branch information
Showing
22 changed files
with
154 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Simple client for command line uploads to Semantic Memory. | ||
|
||
Instructions: | ||
|
||
```bash | ||
./upload-file.sh -h | ||
``` | ||
|
||
Example: | ||
|
||
```bash | ||
./upload-file.sh -f test.pdf -s http://127.0.0.1:9001/upload -u curlUser -c curlDataCollection -i curlExample01 | ||
``` |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
|
||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Microsoft.Extensions.Hosting; | ||
using Microsoft.Extensions.Logging; | ||
using Microsoft.Extensions.Logging.Abstractions; | ||
using Microsoft.SemanticKernel.SemanticMemory.Core.Pipeline; | ||
|
||
namespace Microsoft.SemanticKernel.SemanticMemory.Core.AppBuilders; | ||
|
||
/// <summary> | ||
/// Wrapper of handler classes, allowing to run handlers as services hosted by IHost | ||
/// </summary> | ||
/// <typeparam name="T">Handler class</typeparam> | ||
public class HandlerAsAHostedService<T> : IHostedService where T : IPipelineStepHandler | ||
{ | ||
private readonly T _handler; | ||
private readonly IPipelineOrchestrator _orchestrator; | ||
private readonly string _stepName; | ||
private readonly ILogger<HandlerAsAHostedService<T>> _log; | ||
|
||
public HandlerAsAHostedService( | ||
string stepName, | ||
IPipelineOrchestrator orchestrator, | ||
T handler, | ||
ILogger<HandlerAsAHostedService<T>>? log = null) | ||
{ | ||
this._stepName = stepName; | ||
this._orchestrator = orchestrator; | ||
this._handler = handler; | ||
|
||
this._log = log ?? NullLogger<HandlerAsAHostedService<T>>.Instance; | ||
this._log.LogInformation("Handler as service created: {0}", stepName); | ||
} | ||
|
||
public Task StartAsync(CancellationToken cancellationToken) | ||
{ | ||
this._log.LogInformation("Handler service started: {0}", this._stepName); | ||
return this._orchestrator.AddHandlerAsync(this._handler, cancellationToken); | ||
} | ||
|
||
public Task StopAsync(CancellationToken cancellationToken) | ||
{ | ||
this._log.LogInformation("Stopping handler service: {0}", this._stepName); | ||
return this._orchestrator.StopAllPipelinesAsync(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.