This commit is contained in:
Spyros Garyfallos 2018-06-15 13:00:00 -07:00
Родитель 9c5658c130
Коммит d474f92dec
81 изменённых файлов: 1329 добавлений и 46 удалений

Просмотреть файл

@ -13,7 +13,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge" Version="0.1.48" />
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge" Version="0.1.50" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -13,7 +13,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge" Version="0.1.48" />
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge" Version="0.1.50" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -18,7 +18,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge.Host" Version="0.1.48" />
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge.Host" Version="0.1.50" />
<PackageReference Include="rocksdb-native-arm" Version="5.4.6" />
<PackageReference Include="RocksDbNative" Version="5.4.6.10" />
</ItemGroup>

Просмотреть файл

@ -12,7 +12,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge.Proxy" Version="0.1.48" />
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge.Proxy" Version="0.1.50" />
</ItemGroup>

Просмотреть файл

@ -10,7 +10,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge" Version="0.1.48" />
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge" Version="0.1.50" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>Microsoft.Azure.IoT.TypeEdge.Host</id>
<version>0.1.48</version>
<version>0.1.50</version>
<authors>paloukari</authors>
<owners>paloukari</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>

Просмотреть файл

@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<PackageId>Microsoft.Azure.IoT.TypeEdge.Proxy</PackageId>
<Version>0.1.48</Version>
<Version>0.1.50</Version>
<Authors>paloukari</Authors>
<Company>Microsoft</Company>

Просмотреть файл

@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<PackageId>Microsoft.Azure.IoT.TypeEdge</PackageId>
<Version>0.1.48</Version>
<Version>0.1.50</Version>
<Authors>paloukari</Authors>
<Company>Microsoft</Company>
<PackageOutputPath>../../TypeEdgeNuGets</PackageOutputPath>

Просмотреть файл

@ -165,7 +165,7 @@ namespace Microsoft.Azure.IoT.TypeEdge
var moduleType = assembly.GetTypes().SingleOrDefault(t =>
t.GetInterfaces().SingleOrDefault(i =>
i.GetCustomAttribute(typeof(TypeModuleAttribute), true) != null &&
String.Equals(i.Name.Substring(1), moduleName, StringComparison.CurrentCultureIgnoreCase)) != null);
String.Equals(i.Name.Substring(1), moduleName, StringComparison.InvariantCultureIgnoreCase)) != null);
if (moduleType == null)
{

Просмотреть файл

@ -14,7 +14,7 @@
<packageSources>
<add key="RocksDB ARM" value="https://www.myget.org/F/rocksdb-native-arm/api/v3/index.json" />
<add key="https://www.nuget.org/api/v2/" value="https://www.nuget.org/api/v2/" />
<add key="localSource" value="../TypeEdgeNuGets" />
<add key="localSource" value="C:\work\oss\me\Microsoft.Azure.IoT.TypeEdge\../TypeEdgeNuGets" />
</packageSources>
<disabledPackageSources>
<add key="https://www.nuget.org/api/v2/" value="true" />

Просмотреть файл

@ -3,4 +3,13 @@
<config>
<add key="defaultPushSource" value="https://msblox-03.pkgs.visualstudio.com/_packaging/private-nuget-feed/nuget/v3/index.json" />
</config>
<packageSources>
<add key="private-typeedge-feed" value="https://msblox-03.pkgs.visualstudio.com/_packaging/private-nuget-feed/nuget/v3/index.json" />
</packageSources>
<packageSourceCredentials>
<private-typeedge-feed>
<add key="Username" value="spyrosg" />
<add key="ClearTextPassword" value="123asd!@#" />
</private-typeedge-feed>
</packageSourceCredentials>
</configuration>

Просмотреть файл

@ -13,30 +13,30 @@
"sourceName": "TypeEdgeApplication",
"preferNameDirectory": true,
"symbols": {
"appNameLower":{
"appNameLower": {
"type": "generated",
"generator": "casing",
"parameters": {
"source":"name",
"source": "name",
"toLower": true
},
"replaces":"TypeEdgeApplicationEmulatorImageName"
"replaces": "emulatorimage"
},
"module1Name": {
"type": "parameter",
"defaultValue": "Module1",
"replaces": "TypeEdgeModule1",
"fileRename": "TypeEdgeModule1",
"fileRename": "TypeEdgeModule1",
"description": "The name of the first TypeEdge Module"
},
"module1NameLower":{
"module1NameLower": {
"type": "generated",
"generator": "casing",
"parameters": {
"source":"module1Name",
"source": "module1Name",
"toLower": true
},
"replaces":"TypeEdgeModule1ImageName"
"replaces": "module1image"
},
"module2Name": {
"type": "parameter",
@ -45,14 +45,14 @@
"fileRename": "TypeEdgeModule2",
"description": "The name of the second TypeEdge Module"
},
"module2NameLower":{
"module2NameLower": {
"type": "generated",
"generator": "casing",
"parameters": {
"source":"module2Name",
"source": "module2Name",
"toLower": true
},
"replaces":"TypeEdgeModule2ImageName"
"replaces": "module2image"
},
"connectionString": {
"type": "parameter",

Просмотреть файл

@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge" Version="0.1.48" />
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge" Version="0.1.50" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge" Version="0.1.48" />
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge" Version="0.1.50" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -31,6 +31,7 @@ COPY TypeEdgeApplication.Emulator/TypeEdgeApplication.Emulator.csproj TypeEdgeAp
COPY TypeEdgeApplication.Shared/TypeEdgeApplication.Shared.csproj TypeEdgeApplication.Shared/
COPY Modules/TypeEdgeModule2/TypeEdgeModule2.csproj Modules/TypeEdgeModule2/
COPY Modules/TypeEdgeModule1/TypeEdgeModule1.csproj Modules/TypeEdgeModule1/
COPY NuGet.Config ./
RUN dotnet restore TypeEdgeApplication.Emulator/TypeEdgeApplication.Emulator.csproj
COPY . .

Просмотреть файл

@ -1,2 +1 @@
ARG base_tag=2.1-runtime-stretch-slim
FROM microsoft/dotnet:${base_tag} AS base
FROM scratch

Просмотреть файл

@ -15,7 +15,7 @@
<ItemGroup>
<PackageReference Include="rocksdb-native-arm" Version="5.4.6" />
<PackageReference Include="RocksDbNative" Version="5.4.6.10" />
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge.Host" Version="0.1.48" />
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge.Host" Version="0.1.50" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge.Proxy" Version="0.1.48" />
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge.Proxy" Version="0.1.50" />
</ItemGroup>
<ItemGroup>

Просмотреть файл

@ -5,7 +5,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge" Version="0.1.48" />
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge" Version="0.1.50" />
</ItemGroup>
</Project>

Просмотреть файл

@ -13,6 +13,9 @@
<None Include="docker-compose.vs.debug.yml">
<DependentUpon>docker-compose.yml</DependentUpon>
</None>
<None Include="docker-compose.vs.release.yml">
<DependentUpon>docker-compose.yml</DependentUpon>
</None>
<None Include="docker-compose.yml" />
<None Include=".dockerignore" />
</ItemGroup>

Просмотреть файл

@ -1 +1,10 @@
version: '3.4'
version: '3.4'
services:
TypeEdgeApplication.Emulator:
image: ${DOCKER_REGISTRY}emulatorimage
build:
context: .
dockerfile: TypeEdgeApplication.Emulator/Dockerfile
volumes:
- env:/env

Просмотреть файл

@ -1,10 +1,2 @@
version: '3.4'
services:
TypeEdgeApplication.Emulator:
image: ${DOCKER_REGISTRY}TypeEdgeApplicationEmulatorImageName
build:
context: .
dockerfile: TypeEdgeApplication.Emulator/Dockerfile
volumes:
- env:/env

Просмотреть файл

@ -0,0 +1,2 @@
version: '3.4'

Просмотреть файл

@ -4,7 +4,7 @@ volumes:
services:
TypeEdgeApplication.Emulator:
image: ${DOCKER_REGISTRY}TypeEdgeApplicationEmulatorImageName
image: ${DOCKER_REGISTRY}emulatorimage
build:
context: .
dockerfile: TypeEdgeApplication.Emulator/DockerfileEmpty
@ -12,7 +12,7 @@ services:
- env:/env
TypeEdgeModule1:
image: ${DOCKER_REGISTRY}TypeEdgeModule1ImageName
image: ${DOCKER_REGISTRY}module1image
build:
context: .
dockerfile: Modules/TypeEdgeModule1/Dockerfile
@ -20,7 +20,7 @@ services:
- env:/env
TypeEdgeModule2:
image: ${DOCKER_REGISTRY}TypeEdgeModule2ImageName
image: ${DOCKER_REGISTRY}module2image
build:
context: .
dockerfile: Modules/TypeEdgeModule2/Dockerfile

Просмотреть файл

@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge.Host" Version="0.1.48" />
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge.Host" Version="0.1.50" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>TypeEdge.ML</id>
<version>0.1.2</version>
<description>Creates a new Azure IoT Edge ML solution for TypeEdge, a strongly typed Azure IoT Edge framework</description>
<authors>paloukari</authors>
<owners>paloukari</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<language>en-US</language>
<projectUrl>https://github.com/paloukari/TypeEdge</projectUrl>
<licenseUrl>https://github.com/paloukari/TypeEdge/blob/master/LICENSE</licenseUrl>
<packageTypes>
<packageType name="Template" />
</packageTypes>
</metadata>
</package>

Просмотреть файл

@ -0,0 +1,10 @@
.dockerignore
.git
.gitignore
.vs
.vscode
docker-compose.yml
docker-compose.*.yml
*/bin
*/obj
nuget.exe

Просмотреть файл

@ -0,0 +1 @@
DOCKER_REGISTRY=CONTAINER_REGISTRY/

Просмотреть файл

@ -0,0 +1,24 @@
{
"symbolInfo": {
"module1Name": {
"longName": "module1-name",
"shortName": "m1"
},
"module2Name": {
"longName": "module2-name",
"shortName": "m2"
},
"module3Name": {
"longName": "module3-name",
"shortName": "m3"
},
"connectionString": {
"longName": "connection-string",
"shortName": "cs"
},
"containerRegistry": {
"longName": "container-registry",
"shortName": "cr"
}
}
}

Просмотреть файл

@ -0,0 +1,84 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "Spyros Garyfallos",
"classifications": [ "TypeEdge", "Azure", "IoT", "Edge", "ML" ],
"name": "Type Edge ML",
"identity": "TypeEdge.ML.CSharp",
"groupIdentity": "TypeEdgeML",
"shortName": "typeedgeml",
"tags": {
"language": "C#",
"type": "project"
},
"sourceName": "TypeEdgeML",
"preferNameDirectory": true,
"symbols": {
"appNameLower": {
"type": "generated",
"generator": "casing",
"parameters": {
"source": "name",
"toLower": true
},
"replaces": "emulatorimage"
},
"module1Name": {
"type": "parameter",
"defaultValue": "Module1",
"replaces": "TypeEdgeModule1",
"fileRename": "TypeEdgeModule1",
"description": "The name of the first TypeEdge Module"
},
"module1NameLower": {
"type": "generated",
"generator": "casing",
"parameters": {
"source": "module1Name",
"toLower": true
},
"replaces": "module1image"
},
"module2Name": {
"type": "parameter",
"defaultValue": "Module2",
"replaces": "TypeEdgeModule2",
"fileRename": "TypeEdgeModule2",
"description": "The name of the second TypeEdge Module"
},
"module2NameLower": {
"type": "generated",
"generator": "casing",
"parameters": {
"source": "module2Name",
"toLower": true
},
"replaces": "module2image"
},
"module3Name": {
"type": "parameter",
"defaultValue": "Module3",
"replaces": "TypeEdgeModule3",
"fileRename": "TypeEdgeModule3",
"description": "The name of the third TypeEdge Module"
},
"module3NameLower": {
"type": "generated",
"generator": "casing",
"parameters": {
"source": "module3Name",
"toLower": true
},
"replaces": "module3image"
},
"connectionString": {
"type": "parameter",
"replaces": "CONNECTION_STRING",
"description": "The IoT Hub owner connection string"
},
"containerRegistry": {
"type": "parameter",
"replaces": "CONTAINER_REGISTRY",
"description": "The container registry login FQN"
}
}
}

28
Templates/TypeEdgeML/.vscode/launch.json поставляемый Normal file
Просмотреть файл

@ -0,0 +1,28 @@
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/TypeEdgeML.Emulator/bin/Debug/netcoreapp2.1/TypeEdgeML.Emulator.dll",
"args": [],
"cwd": "${workspaceFolder}/TypeEdgeML.Emulator",
// For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
"console": "internalConsole",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
,]
}

15
Templates/TypeEdgeML/.vscode/tasks.json поставляемый Normal file
Просмотреть файл

@ -0,0 +1,15 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/TypeEdgeML.sln"
],
"problemMatcher": "$msCompile"
}
]
}

Просмотреть файл

@ -0,0 +1,20 @@
ARG base_tag=2.1-runtime-stretch-slim
FROM microsoft/dotnet:${base_tag} AS base
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY Modules/TypeEdgeModule1/TypeEdgeModule1.csproj Modules/TypeEdgeModule1/
COPY TypeEdgeML.Shared/TypeEdgeML.Shared.csproj TypeEdgeML.Shared/
COPY NuGet.Config ./
RUN dotnet restore Modules/TypeEdgeModule1/TypeEdgeModule1.csproj
COPY . .
WORKDIR /src/Modules/TypeEdgeModule1
RUN dotnet build TypeEdgeModule1.csproj -c Release -o /app
FROM build AS publish
RUN dotnet publish TypeEdgeModule1.csproj -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "TypeEdgeModule1.dll"]

Просмотреть файл

@ -0,0 +1,13 @@
using System.Threading.Tasks;
using Microsoft.Azure.IoT.TypeEdge;
namespace TypeEdgeModule1
{
internal class Program
{
public static async Task Main(string[] args)
{
await Startup.DockerEntryPoint(args);
}
}
}

Просмотреть файл

@ -0,0 +1,35 @@
using System;
using System.Globalization;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Azure.IoT.TypeEdge.Enums;
using Microsoft.Azure.IoT.TypeEdge.Modules;
using Microsoft.Azure.IoT.TypeEdge.Modules.Endpoints;
using Microsoft.Azure.IoT.TypeEdge.Twins;
using TypeEdgeML.Shared;
using TypeEdgeML.Shared.Messages;
using TypeEdgeML.Shared.Twins;
namespace Modules
{
public class TypeEdgeModule1 : EdgeModule, ITypeEdgeModule1
{
public Output<TypeEdgeModule1Output> Output { get; set; }
public ModuleTwin<TypeEdgeModule1Twin> Twin { get; set; }
public bool ResetModule(int sensorThreshold)
{
Console.WriteLine($"New sensor threshold:{sensorThreshold}");
return true;
}
public override async Task<ExecutionResult> RunAsync()
{
while (true)
{
await Output.PublishAsync(new TypeEdgeModule1Output {Data = new Random().NextDouble().ToString(CultureInfo.InvariantCulture)});
Thread.Sleep(1000);
}
}
}
}

Просмотреть файл

@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge" Version="0.1.50" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\TypeEdgeML.Shared\TypeEdgeML.Shared.csproj" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,20 @@
ARG base_tag=2.1-runtime-stretch-slim
FROM microsoft/dotnet:${base_tag} AS base
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY Modules/TypeEdgeModule2/TypeEdgeModule2.csproj Modules/TypeEdgeModule2/
COPY TypeEdgeML.Shared/TypeEdgeML.Shared.csproj TypeEdgeML.Shared/
COPY NuGet.Config ./
RUN dotnet restore Modules/TypeEdgeModule2/TypeEdgeModule2.csproj
COPY . .
WORKDIR /src/Modules/TypeEdgeModule2
RUN dotnet build TypeEdgeModule2.csproj -c Release -o /app
FROM build AS publish
RUN dotnet publish TypeEdgeModule2.csproj -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "TypeEdgeModule2.dll"]

Просмотреть файл

@ -0,0 +1,13 @@
using System.Threading.Tasks;
using Microsoft.Azure.IoT.TypeEdge;
namespace TypeEdgeModule2
{
internal class Program
{
public static async Task Main(string[] args)
{
await Startup.DockerEntryPoint(args);
}
}
}

Просмотреть файл

@ -0,0 +1,31 @@
using System;
using Microsoft.Azure.IoT.TypeEdge.Modules;
using Microsoft.Azure.IoT.TypeEdge.Modules.Endpoints;
using Microsoft.Azure.IoT.TypeEdge.Modules.Messages;
using Microsoft.Azure.IoT.TypeEdge.Twins;
using TypeEdgeML.Shared;
using TypeEdgeML.Shared.Messages;
using TypeEdgeML.Shared.Twins;
namespace Modules
{
public class TypeEdgeModule2 : EdgeModule, ITypeEdgeModule2
{
public TypeEdgeModule2(ITypeEdgeModule1 proxy)
{
Input.Subscribe(proxy.Output, async msg =>
{
await Output.PublishAsync(new TypeEdgeModule2Output
{
Data = msg.Data,
Metadata = DateTime.UtcNow.ToShortTimeString()
});
return MessageResult.Ok;
});
}
public Output<TypeEdgeModule2Output> Output { get; set; }
public Input<TypeEdgeModule1Output> Input { get; set; }
public ModuleTwin<TypeEdgeModule2Twin> Twin { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge" Version="0.1.50" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\TypeEdgeML.Shared\TypeEdgeML.Shared.csproj" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,31 @@
ARG base_tag=2.1-runtime-stretch-slim
FROM microsoft/dotnet:${base_tag} AS base
RUN apt-get update -y && apt-get install python3 -y && apt-get install python3-pip -y
RUN ldconfig
WORKDIR /app
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY Modules/TypeEdgeModule3/TypeEdgeModule3.csproj Modules/TypeEdgeModule3/
COPY TypeEdgeML.Shared/TypeEdgeML.Shared.csproj TypeEdgeML.Shared/
COPY NuGet.Config ./
RUN dotnet restore Modules/TypeEdgeModule3/TypeEdgeModule3.csproj
COPY . .
WORKDIR /src/Modules/TypeEdgeModule3
RUN dotnet build TypeEdgeModule3.csproj -c Release -o /app
FROM build AS publish
RUN dotnet publish TypeEdgeModule3.csproj -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
RUN pip3 install --no-cache-dir -r requirements.txt
ENV LD_LIBRARY_PATH /usr/lib/python3.5/config-3.5m-x86_64-linux-gnu
ENTRYPOINT ["dotnet", "TypeEdgeModule3.dll"]

Просмотреть файл

@ -0,0 +1,17 @@
using Microsoft.Azure.IoT.TypeEdge;
using Microsoft.Azure.IoT.TypeEdge.Attributes;
using System;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
namespace TypeEdgeModule3
{
class Program
{
public static async Task Main(string[] args)
{
await Startup.DockerEntryPoint(args);
}
}
}

Просмотреть файл

@ -0,0 +1,92 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace TypeEdgeModule3
{
public sealed class SingleThreadTaskScheduler : TaskScheduler
{
[ThreadStatic] private static bool _isExecuting;
private readonly CancellationToken _cancellationToken;
private readonly BlockingCollection<Task> _taskQueue;
public SingleThreadTaskScheduler(CancellationToken cancellationToken)
{
_cancellationToken = cancellationToken;
_taskQueue = new BlockingCollection<Task>();
}
public void Start()
{
new Thread(RunOnCurrentThread) {Name = "STTS Thread"}.Start();
}
// Just a helper for the sample code
public Task Schedule(Action action)
{
return
Task.Factory.StartNew
(
action,
CancellationToken.None,
TaskCreationOptions.None,
this
);
}
// You can have this public if you want - just make sure to hide it
private void RunOnCurrentThread()
{
_isExecuting = true;
try
{
foreach (var task in _taskQueue.GetConsumingEnumerable(_cancellationToken))
{
TryExecuteTask(task);
}
}
catch (OperationCanceledException)
{
}
finally
{
_isExecuting = false;
}
}
// Signaling this allows the task scheduler to finish after all tasks complete
public void Complete()
{
_taskQueue.CompleteAdding();
}
protected override IEnumerable<Task> GetScheduledTasks()
{
return null;
}
protected override void QueueTask(Task task)
{
try
{
_taskQueue.Add(task, _cancellationToken);
}
catch (OperationCanceledException)
{
}
}
protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued)
{
// We'd need to remove the task from queue if it was already queued.
// That would be too hard.
if (taskWasPreviouslyQueued) return false;
return _isExecuting && TryExecuteTask(task);
}
}
}

Просмотреть файл

@ -0,0 +1,102 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Threading;
using Microsoft.Azure.IoT.TypeEdge.Modules;
using Microsoft.Azure.IoT.TypeEdge.Modules.Endpoints;
using Microsoft.Azure.IoT.TypeEdge.Modules.Enums;
using Microsoft.Azure.IoT.TypeEdge.Modules.Messages;
using Microsoft.Azure.IoT.TypeEdge.Twins;
using Microsoft.Extensions.Configuration;
using Python.Runtime;
using TypeEdgeML.Shared;
using TypeEdgeML.Shared.Messages;
using TypeEdgeML.Shared.Twins;
using TypeEdgeModule3;
namespace Modules
{
public class TypeEdgeModule3 : EdgeModule, ITypeEdgeModule3
{
private Py.GILState _state;
private dynamic _sys;
private dynamic _np;
private string _code;
private SingleThreadTaskScheduler _pythonTaskScheduler;
public override CreationResult Configure(IConfigurationRoot configuration)
{
var cts = new CancellationTokenSource();
_pythonTaskScheduler = new SingleThreadTaskScheduler(cts.Token);
_pythonTaskScheduler.Schedule(() =>
{
try
{
_state = Py.GIL();
_sys = Py.Import("sys");
_np = Py.Import("numpy");
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
});
_pythonTaskScheduler.Start();
_code = File.ReadAllText(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "pythagorean.py"));
return string.IsNullOrEmpty(_code) ? CreationResult.Error : CreationResult.Ok;
}
public TypeEdgeModule3(ITypeEdgeModule2 proxy)
{
Input.Subscribe(proxy.Output, async msg =>
{
Console.WriteLine("Processing new message in TypeEdgeModule3");
await _pythonTaskScheduler.Schedule(() =>
{
try
{
//TODO: run your python code here.
var sin = _np.sin;
var fortyFiveDegrees = Math.PI / 4;
var a = sin(fortyFiveDegrees);
var b = sin(fortyFiveDegrees);
PythonEngine.RunSimpleString(_code);
dynamic t = _sys.triangle;
var c = (float)t.Hypotenuse(a, b);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
});
await Output.PublishAsync(new TypeEdgeModule3Output
{
Data = msg.Data,
Metadata = DateTime.UtcNow.ToShortTimeString()
});
return MessageResult.Ok;
});
}
public Output<TypeEdgeModule3Output> Output { get; set; }
public Input<TypeEdgeModule2Output> Input { get; set; }
public ModuleTwin<TypeEdgeModule3Twin> Twin { get; set; }
public void Dispose()
{
_pythonTaskScheduler?.Schedule(() => { _state?.Dispose(); });
}
}
}

Просмотреть файл

@ -0,0 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge" Version="0.1.50" />
<PackageReference Include="Python.Runtime" Version="2.4.64" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\TypeEdgeML.Shared\TypeEdgeML.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="pythagorean.py">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="requirements.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,8 @@
import sys
from math import sqrt
class Triangle:
def Hypotenuse(self, a, b):
return sqrt(a*a + b*b)
sys.triangle = Triangle()

Просмотреть файл

@ -0,0 +1 @@
numpy

Просмотреть файл

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageRestore>
<add key="enabled" value="True" />
<add key="automatic" value="True" />
</packageRestore>
<bindingRedirects>
<add key="skip" value="False" />
</bindingRedirects>
<packageManagement>
<add key="format" value="0" />
<add key="disabled" value="False" />
</packageManagement>
<packageSources>
<add key="RocksDB ARM" value="https://www.myget.org/F/rocksdb-native-arm/api/v3/index.json" />
</packageSources>
</configuration>

Просмотреть файл

@ -0,0 +1,50 @@
ARG base_tag=2.1-runtime-stretch-slim
FROM microsoft/dotnet:${base_tag} AS base
# Add an unprivileged user account for running Edge Hub
RUN useradd -ms /bin/bash edgehubuser
ENV EdgeHubUser=edgehubuser
ARG EXE_DIR=.
ENV SSL_CERTIFICATE_PATH=/app/certs
ENV SSL_CERTIFICATE_NAME=mqtt-server.pfx
# Install snappy and set up symlinks that are absent from the base image
# Required by RocksDb
RUN apt-get update && \
apt-get install -y libsnappy1v5 libcap2-bin && \
ln -s /lib/x86_64-linux-gnu/libdl.so.2 /usr/lib/x86_64-linux-gnu/libdl.so && \
ln -s /lib/x86_64-linux-gnu/libc.so.6 /usr/lib/x86_64-linux-gnu/libc.so && \
rm -rf /var/lib/apt/lists/*
# add the CAP_NET_BIND_SERVICE capability to the dotnet binary because
# we are starting edge hub as a non-root user
RUN setcap 'cap_net_bind_service=+ep' /usr/share/dotnet/dotnet
# Expose MQTT and HTTPS ports
EXPOSE 8883/tcp
EXPOSE 443/tcp
FROM microsoft/dotnet:2.1-sdk AS build
WORKDIR /src
COPY TypeEdgeML.Emulator/TypeEdgeML.Emulator.csproj TypeEdgeML.Emulator/
COPY TypeEdgeML.Shared/TypeEdgeML.Shared.csproj TypeEdgeML.Shared/
COPY Modules/TypeEdgeModule1/TypeEdgeModule1.csproj Modules/TypeEdgeModule1/
COPY Modules/TypeEdgeModule2/TypeEdgeModule2.csproj Modules/TypeEdgeModule2/
COPY Modules/TypeEdgeModule3/TypeEdgeModule3.csproj Modules/TypeEdgeModule3/
COPY NuGet.Config ./
RUN dotnet restore TypeEdgeML.Emulator/TypeEdgeML.Emulator.csproj
COPY . .
COPY ./.env Thermostat.Emulator/
WORKDIR /src/TypeEdgeML.Emulator
RUN dotnet build TypeEdgeML.Emulator.csproj -c Release -o /app
FROM build AS publish
RUN dotnet publish TypeEdgeML.Emulator.csproj -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "TypeEdgeML.Emulator.dll"]

Просмотреть файл

@ -0,0 +1 @@
FROM scratch

Просмотреть файл

@ -0,0 +1,42 @@
using System;
using System.Threading.Tasks;
using Microsoft.Azure.IoT.TypeEdge.DovEnv;
using Microsoft.Azure.IoT.TypeEdge.Host;
using Microsoft.Extensions.Configuration;
using TypeEdgeML.Shared;
namespace TypeEdgeML
{
internal class Program
{
public static async Task Main(string[] args)
{
Console.WriteLine("Starting Emulator..");
//TODO: Set your IoT Hub iothubowner connection string in appsettings.json
var configuration = new ConfigurationBuilder()
.AddJsonFile("appsettings.json")
.AddEnvironmentVariables()
.AddDotenvFile()
.AddCommandLine(args)
.Build();
var host = new TypeEdgeHost(configuration);
//TODO: Register your TypeEdge Modules here
host.RegisterModule<ITypeEdgeModule1, Modules.TypeEdgeModule1>();
host.RegisterModule<ITypeEdgeModule2, Modules.TypeEdgeModule2>();
host.RegisterModule<ITypeEdgeModule3, Modules.TypeEdgeModule3>();
//TODO: Define all cross-module subscriptions
host.Upstream.Subscribe(host.GetProxy<ITypeEdgeModule3>().Output);
host.Build();
await host.RunAsync();
Console.WriteLine("Press <ENTER> to exit..");
Console.ReadLine();
}
}
}

Просмотреть файл

@ -0,0 +1,10 @@
{
"profiles": {
"TypeEdgeML.Emulator": {
"commandName": "Project",
"environmentVariables": {
"__PY_VERSION": "3.6"
}
}
}
}

Просмотреть файл

@ -0,0 +1,38 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<None Include="..\.env" Link=".env" Visible="false">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="..\Modules\TypeEdgeModule3\pythagorean.py" Link="pythagorean.py">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="rocksdb-native-arm" Version="5.4.6" />
<PackageReference Include="RocksDbNative" Version="5.4.6.10" />
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge.Host" Version="0.1.50" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Modules\TypeEdgeModule1\TypeEdgeModule1.csproj" />
<ProjectReference Include="..\Modules\TypeEdgeModule2\TypeEdgeModule2.csproj" />
<ProjectReference Include="..\Modules\TypeEdgeModule3\TypeEdgeModule3.csproj" />
<ProjectReference Include="..\TypeEdgeML.Shared\TypeEdgeML.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,6 @@
{
"TypeEdgeHost": {
"IotHubConnectionString": "CONNECTION_STRING",
"DeviceId": "type-edge-dev"
}
}

Просмотреть файл

@ -0,0 +1,31 @@
using System;
using System.Threading.Tasks;
using Microsoft.Azure.IoT.TypeEdge.Proxy;
using Microsoft.Extensions.Configuration;
using TypeEdgeML.Shared;
namespace TypeEdgeML.Proxy
{
internal class Program
{
private static async Task Main(string[] args)
{
Console.WriteLine("Press <ENTER> to start..");
Console.ReadLine();
var configuration = new ConfigurationBuilder()
.AddJsonFile("appsettings.json")
.AddEnvironmentVariables()
.Build();
ProxyFactory.Configure(configuration["IotHubConnectionString"],
configuration["DeviceId"]);
//TODO: Get your module proxies by contract
var proxy = ProxyFactory.GetModuleProxy<ITypeEdgeModule1>();
Console.WriteLine("Press <ENTER> to exit..");
Console.ReadLine();
}
}
}

Просмотреть файл

@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge.Proxy" Version="0.1.50" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TypeEdgeML.Shared\TypeEdgeML.Shared.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,4 @@
{
"DeviceId": "type-edge-dev",
"IotHubConnectionString": "CONNECTION_STRING"
}

Просмотреть файл

@ -0,0 +1,17 @@
using Microsoft.Azure.IoT.TypeEdge.Attributes;
using Microsoft.Azure.IoT.TypeEdge.Modules.Endpoints;
using Microsoft.Azure.IoT.TypeEdge.Twins;
using TypeEdgeML.Shared.Messages;
using TypeEdgeML.Shared.Twins;
namespace TypeEdgeML.Shared
{
[TypeModule]
public interface ITypeEdgeModule1
{
Output<TypeEdgeModule1Output> Output { get; set; }
ModuleTwin<TypeEdgeModule1Twin> Twin { get; set; }
bool ResetModule(int sensorThreshold);
}
}

Просмотреть файл

@ -0,0 +1,16 @@
using Microsoft.Azure.IoT.TypeEdge.Attributes;
using Microsoft.Azure.IoT.TypeEdge.Modules.Endpoints;
using Microsoft.Azure.IoT.TypeEdge.Twins;
using TypeEdgeML.Shared.Messages;
using TypeEdgeML.Shared.Twins;
namespace TypeEdgeML.Shared
{
[TypeModule]
public interface ITypeEdgeModule2
{
Output<TypeEdgeModule2Output> Output { get; set; }
Input<TypeEdgeModule1Output> Input { get; set; }
ModuleTwin<TypeEdgeModule2Twin> Twin { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,16 @@
using Microsoft.Azure.IoT.TypeEdge.Attributes;
using Microsoft.Azure.IoT.TypeEdge.Modules.Endpoints;
using Microsoft.Azure.IoT.TypeEdge.Twins;
using TypeEdgeML.Shared.Messages;
using TypeEdgeML.Shared.Twins;
namespace TypeEdgeML.Shared
{
[TypeModule]
public interface ITypeEdgeModule3
{
Output<TypeEdgeModule3Output> Output { get; set; }
Input<TypeEdgeModule2Output> Input { get; set; }
ModuleTwin<TypeEdgeModule3Twin> Twin { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,26 @@
using System.Collections.Generic;
using System.Text;
using Microsoft.Azure.IoT.TypeEdge.Modules.Messages;
using Newtonsoft.Json;
namespace TypeEdgeML.Shared.Messages
{
public class TypeEdgeModule1Output : IEdgeMessage
{
public string Data { get; set; }
public IDictionary<string, string> Properties { get; set; }
public byte[] GetBytes()
{
return Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(this));
}
public void SetBytes(byte[] bytes)
{
var obj = JsonConvert.DeserializeObject<TypeEdgeModule1Output>(Encoding.UTF8.GetString(bytes));
Properties = obj.Properties;
Data = obj.Data;
}
}
}

Просмотреть файл

@ -0,0 +1,27 @@
using System.Collections.Generic;
using System.Text;
using Microsoft.Azure.IoT.TypeEdge.Modules.Messages;
using Newtonsoft.Json;
namespace TypeEdgeML.Shared.Messages
{
public class TypeEdgeModule2Output : IEdgeMessage
{
public string Data { get; set; }
public string Metadata { get; set; }
public IDictionary<string, string> Properties { get; set; }
public byte[] GetBytes()
{
return Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(this));
}
public void SetBytes(byte[] bytes)
{
var obj = JsonConvert.DeserializeObject<TypeEdgeModule1Output>(Encoding.UTF8.GetString(bytes));
Properties = obj.Properties;
Data = obj.Data;
}
}
}

Просмотреть файл

@ -0,0 +1,27 @@
using System.Collections.Generic;
using System.Text;
using Microsoft.Azure.IoT.TypeEdge.Modules.Messages;
using Newtonsoft.Json;
namespace TypeEdgeML.Shared.Messages
{
public class TypeEdgeModule3Output : IEdgeMessage
{
public string Data { get; set; }
public string Metadata { get; set; }
public IDictionary<string, string> Properties { get; set; }
public byte[] GetBytes()
{
return Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(this));
}
public void SetBytes(byte[] bytes)
{
var obj = JsonConvert.DeserializeObject<TypeEdgeModule1Output>(Encoding.UTF8.GetString(bytes));
Properties = obj.Properties;
Data = obj.Data;
}
}
}

Просмотреть файл

@ -0,0 +1,9 @@
using Microsoft.Azure.IoT.TypeEdge.Twins;
namespace TypeEdgeML.Shared.Twins
{
public class TypeEdgeModule1Twin : TypeModuleTwin
{
public int Threshold { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,9 @@
using Microsoft.Azure.IoT.TypeEdge.Twins;
namespace TypeEdgeML.Shared.Twins
{
public class TypeEdgeModule2Twin : TypeModuleTwin
{
public int Threshold { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,9 @@
using Microsoft.Azure.IoT.TypeEdge.Twins;
namespace TypeEdgeML.Shared.Twins
{
public class TypeEdgeModule3Twin : TypeModuleTwin
{
public int Threshold { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge" Version="0.1.50" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,68 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2018
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{23F98030-B6A3-4ADC-B0BE-A3F476C93E92}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TypeEdgeModule1", "Modules\TypeEdgeModule1\TypeEdgeModule1.csproj", "{232F3A40-BC53-463E-A5F8-0A6DBE0C350A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TypeEdgeModule2", "Modules\TypeEdgeModule2\TypeEdgeModule2.csproj", "{B50131E0-4249-45FF-9DB4-FFFF49BD7F7E}"
EndProject
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{6603BB40-94EB-4AFC-83DE-9EF235F45237}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TypeEdgeML.Shared", "TypeEdgeML.Shared\TypeEdgeML.Shared.csproj", "{AB453E13-5A04-43CF-9737-CACC2395A9F0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TypeEdgeML.Proxy", "TypeEdgeML.Proxy\TypeEdgeML.Proxy.csproj", "{37F663D9-B38F-4A8D-B0D0-C5A8FD61A0F3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TypeEdgeML.Emulator", "TypeEdgeML.Emulator\TypeEdgeML.Emulator.csproj", "{A9356854-EE06-4402-985E-289EDD7B0450}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TypeEdgeModule3", "Modules\TypeEdgeModule3\TypeEdgeModule3.csproj", "{845EDC79-D3FD-4C1C-A4D2-B7D897B8AD51}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{232F3A40-BC53-463E-A5F8-0A6DBE0C350A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{232F3A40-BC53-463E-A5F8-0A6DBE0C350A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{232F3A40-BC53-463E-A5F8-0A6DBE0C350A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{232F3A40-BC53-463E-A5F8-0A6DBE0C350A}.Release|Any CPU.Build.0 = Release|Any CPU
{B50131E0-4249-45FF-9DB4-FFFF49BD7F7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B50131E0-4249-45FF-9DB4-FFFF49BD7F7E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B50131E0-4249-45FF-9DB4-FFFF49BD7F7E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B50131E0-4249-45FF-9DB4-FFFF49BD7F7E}.Release|Any CPU.Build.0 = Release|Any CPU
{6603BB40-94EB-4AFC-83DE-9EF235F45237}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6603BB40-94EB-4AFC-83DE-9EF235F45237}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6603BB40-94EB-4AFC-83DE-9EF235F45237}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6603BB40-94EB-4AFC-83DE-9EF235F45237}.Release|Any CPU.Build.0 = Release|Any CPU
{AB453E13-5A04-43CF-9737-CACC2395A9F0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AB453E13-5A04-43CF-9737-CACC2395A9F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AB453E13-5A04-43CF-9737-CACC2395A9F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AB453E13-5A04-43CF-9737-CACC2395A9F0}.Release|Any CPU.Build.0 = Release|Any CPU
{37F663D9-B38F-4A8D-B0D0-C5A8FD61A0F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{37F663D9-B38F-4A8D-B0D0-C5A8FD61A0F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{37F663D9-B38F-4A8D-B0D0-C5A8FD61A0F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{37F663D9-B38F-4A8D-B0D0-C5A8FD61A0F3}.Release|Any CPU.Build.0 = Release|Any CPU
{A9356854-EE06-4402-985E-289EDD7B0450}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A9356854-EE06-4402-985E-289EDD7B0450}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A9356854-EE06-4402-985E-289EDD7B0450}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A9356854-EE06-4402-985E-289EDD7B0450}.Release|Any CPU.Build.0 = Release|Any CPU
{845EDC79-D3FD-4C1C-A4D2-B7D897B8AD51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{845EDC79-D3FD-4C1C-A4D2-B7D897B8AD51}.Debug|Any CPU.Build.0 = Debug|Any CPU
{845EDC79-D3FD-4C1C-A4D2-B7D897B8AD51}.Release|Any CPU.ActiveCfg = Release|Any CPU
{845EDC79-D3FD-4C1C-A4D2-B7D897B8AD51}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{232F3A40-BC53-463E-A5F8-0A6DBE0C350A} = {23F98030-B6A3-4ADC-B0BE-A3F476C93E92}
{B50131E0-4249-45FF-9DB4-FFFF49BD7F7E} = {23F98030-B6A3-4ADC-B0BE-A3F476C93E92}
{845EDC79-D3FD-4C1C-A4D2-B7D897B8AD51} = {23F98030-B6A3-4ADC-B0BE-A3F476C93E92}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EF09051F-8E93-4054-8F11-1BEA1EDEF1A2}
EndGlobalSection
EndGlobal

Просмотреть файл

@ -0,0 +1,49 @@
@echo off
IF "%1"=="" GOTO HAVE_USERNAME
IF "%2"=="" GOTO HAVE_PASSWORD
if exist nuget.exe (
echo nuget.exe found
) else (
echo downloading nuget.exe from https://www.nuget.org/nuget.exe
Powershell.exe wget -outf nuget.exe https://nuget.org/nuget.exe
if not exist .\nuget.exe (
echo Error: nuget does not exist.
exit /b 1
)
)
echo Adding the private nuget packages feed "private-typeedge-feed"
nuget.exe sources Add -Name "private-typeedge-feed" -Source "https://msblox-03.pkgs.visualstudio.com/_packaging/private-nuget-feed/nuget/v3/index.json" -StorePasswordInClearText -ConfigFile NuGet.Config -UserName "%1" -Password "%2"
if errorlevel 1 (
echo Failed, trying to remove an existing record first ..
echo Removing the private "private-typeedge-feed" ..
nuget.exe sources Remove -Name "private-typeedge-feed"
echo Adding the private nuget packages feed "private-typeedge-feed"
nuget.exe sources Add -Name "private-typeedge-feed" -Source "https://msblox-03.pkgs.visualstudio.com/_packaging/private-nuget-feed/nuget/v3/index.json" -StorePasswordInClearText -ConfigFile NuGet.Config -UserName "%1" -Password "%2"
if errorlevel 0 (
echo Success!
)
)
if exist nuget.exe (
del nuget.exe /q
)
exit /b 0
:HAVE_USERNAME
echo Your Git credentials username is required
exit /b 1
:HAVE_PASSWORD
echo Your Git credentials password is required
exit /b 1
:exit
echo exiting..

Просмотреть файл

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" Sdk="Microsoft.Docker.Sdk">
<PropertyGroup Label="Globals">
<ProjectVersion>2.1</ProjectVersion>
<DockerTargetOS>Linux</DockerTargetOS>
<ProjectGuid>6603bb40-94eb-4afc-83de-9ef235f45237</ProjectGuid>
</PropertyGroup>
<ItemGroup>
<None Include=".env" />
<None Include="docker-compose.override.yml">
<DependentUpon>docker-compose.yml</DependentUpon>
</None>
<None Include="docker-compose.vs.debug.yml">
<DependentUpon>docker-compose.yml</DependentUpon>
</None>
<None Include="docker-compose.vs.release.yml">
<DependentUpon>docker-compose.yml</DependentUpon>
</None>
<None Include="docker-compose.yml" />
<None Include=".dockerignore" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,10 @@
version: '3.4'
services:
TypeEdgeML.Emulator:
image: ${DOCKER_REGISTRY}emulatorimage
build:
context: .
dockerfile: TypeEdgeML.Emulator/Dockerfile
volumes:
- env:/env

Просмотреть файл

@ -0,0 +1,2 @@
version: '3.4'

Просмотреть файл

@ -0,0 +1,2 @@
version: '3.4'

Просмотреть файл

@ -0,0 +1,36 @@
version: '3.4'
volumes:
env:
services:
TypeEdgeML.Emulator:
image: ${DOCKER_REGISTRY}emulatorimage
build:
context: .
dockerfile: TypeEdgeML.Emulator/DockerfileEmpty
volumes:
- env:/env
TypeEdgeModule1:
image: ${DOCKER_REGISTRY}module1image
build:
context: .
dockerfile: Modules/TypeEdgeModule1/Dockerfile
volumes:
- env:/env
TypeEdgeModule2:
image: ${DOCKER_REGISTRY}module2image
build:
context: .
dockerfile: Modules/TypeEdgeModule2/Dockerfile
volumes:
- env:/env
TypeEdgeModule3:
image: ${DOCKER_REGISTRY}module3image
build:
context: .
dockerfile: Modules/TypeEdgeModule3/Dockerfile
volumes:
- env:/env

Просмотреть файл

@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge" Version="0.1.48" />
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge" Version="0.1.50" />
</ItemGroup>
</Project>

Просмотреть файл

@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge.Proxy" Version="0.1.48" />
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge.Proxy" Version="0.1.50" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,49 @@
@echo off
IF "%1"=="" GOTO HAVE_USERNAME
IF "%2"=="" GOTO HAVE_PASSWORD
if exist nuget.exe (
echo nuget.exe found
) else (
echo downloading nuget.exe from https://www.nuget.org/nuget.exe
Powershell.exe wget -outf nuget.exe https://nuget.org/nuget.exe
if not exist .\nuget.exe (
echo Error: nuget does not exist.
exit /b 1
)
)
echo Adding the private nuget packages feed "private-typeedge-feed"
nuget.exe sources Add -Name "private-typeedge-feed" -Source "https://msblox-03.pkgs.visualstudio.com/_packaging/private-nuget-feed/nuget/v3/index.json" -StorePasswordInClearText -ConfigFile NuGet.Config -UserName "%1" -Password "%2"
if errorlevel 1 (
echo Failed, trying to remove an existing record first ..
echo Removing the private "private-typeedge-feed" ..
nuget.exe sources Remove -Name "private-typeedge-feed"
echo Adding the private nuget packages feed "private-typeedge-feed"
nuget.exe sources Add -Name "private-typeedge-feed" -Source "https://msblox-03.pkgs.visualstudio.com/_packaging/private-nuget-feed/nuget/v3/index.json" -StorePasswordInClearText -ConfigFile NuGet.Config -UserName "%1" -Password "%2"
if errorlevel 0 (
echo Success!
)
)
if exist nuget.exe (
del nuget.exe /q
)
exit /b 0
:HAVE_USERNAME
echo Your Git credentials username is required
exit /b 1
:HAVE_PASSWORD
echo Your Git credentials password is required
exit /b 1
:exit
echo exiting..

Просмотреть файл

@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge.Host" Version="0.1.48" />
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge.Host" Version="0.1.50" />
</ItemGroup>
</Project>

Просмотреть файл

@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge" Version="0.1.48" />
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge" Version="0.1.50" />
</ItemGroup>
</Project>

Просмотреть файл

@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge.Proxy" Version="0.1.48" />
<PackageReference Include="Microsoft.Azure.IoT.TypeEdge.Proxy" Version="0.1.50" />
</ItemGroup>
</Project>

Просмотреть файл

@ -11,6 +11,10 @@ mkdir TypeEdgeApplication
cd TypeEdgeApplication
mkdir content
cd ..
mkdir TypeEdgeML
cd TypeEdgeML
mkdir content
cd ..
mkdir TypeEdgeModule
cd TypeEdgeModule
mkdir content
@ -22,11 +26,13 @@ cd ..
cd ..
copy TypeEdgeEmulator.nuspec build\TypeEdgeEmulator
copy TypeEdgeApplication.nuspec build\TypeEdgeApplication
copy TypeEdgeML.nuspec build\TypeEdgeML
copy TypeEdgeModule.nuspec build\TypeEdgeModule
copy TypeEdgeProxy.nuspec build\TypeEdgeProxy
dotnet build TypeEdgeEmulator
dotnet build TypeEdgeApplication
dotnet build TypeEdgeApplication\TypeEdgeApplication.sln
dotnet build TypeEdgeML\TypeEdgeML.sln
dotnet build TypeEdgeModule
dotnet build TypeEdgeProxy
@ -35,11 +41,13 @@ dotnet new --debug:reinit
dotnet new --install TypeEdgeModule
dotnet new --install TypeEdgeApplication
dotnet new --install TypeEdgeML
dotnet new --install TypeEdgeProxy
dotnet new --install TypeEdgeEmulator
dotnet clean TypeEdgeModule
dotnet clean TypeEdgeApplication
dotnet clean TypeEdgeML
dotnet clean TypeEdgeProxy
dotnet clean TypeEdgeEmulator
@ -47,11 +55,13 @@ xcopy TypeEdgeEmulator build\TypeEdgeEmulator\content /s /e /EXCLUDE:list-of-exc
xcopy TypeEdgeProxy build\TypeEdgeProxy\content /s /e /EXCLUDE:list-of-excluded-files.txt
xcopy TypeEdgeModule build\TypeEdgeModule\content /s /e /EXCLUDE:list-of-excluded-files.txt
xcopy TypeEdgeApplication build\TypeEdgeApplication\content /s /e /EXCLUDE:list-of-excluded-files.txt
xcopy TypeEdgeML build\TypeEdgeML\content /s /e /EXCLUDE:list-of-excluded-files.txt
nuget.exe pack build\TypeEdgeEmulator -Version %version%
nuget.exe pack build\TypeEdgeProxy -Version %version%
nuget.exe pack build\TypeEdgeModule -Version %version%
nuget.exe pack build\TypeEdgeApplication -Version %version%
nuget.exe pack build\TypeEdgeML -Version %version%
move /Y *.nupkg ..\..\TypeEdgeNuGets
@ -61,3 +71,4 @@ dotnet nuget locals http-cache --clear
dotnet new --debug:reinit
dotnet new -i TypeEdge.Application::*
dotnet new -i TypeEdge.ML::*