Skip to content

Commit

Permalink
0.6 release (#89)
Browse files Browse the repository at this point in the history
* Feat/chain (#84)

* validating chain

* refactor after chain

* split dps and hub certs

* skip chain test

* import chain

* use gw in rido

Co-authored-by: rido-min <rido-min@users.noreply.github.com>

* upd memmon defaults

* Feat/formats (#86)

* moving serializers

* copy serializers to samples

* upd tests to new hub

* review proto bindings

* rev 0.6 (#87)

* upd memmon to don7

* upd memmon defaults

* rev 0.6

* ci -> 7

* upd tests to 7

* warnings for memmon

* mmpb -> 7

* Rel/prep06 (#88)

* upd memmon to don7

* upd memmon defaults

* rev 0.6

* ci -> 7

* upd tests to 7

* warnings for memmon

* mmpb -> 7

* actions -> 7

Co-authored-by: rido-min <rido-min@users.noreply.github.com>
  • Loading branch information
ridomin and rido-min authored Nov 11, 2022
1 parent aec8990 commit 03ba71f
Show file tree
Hide file tree
Showing 17 changed files with 34 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
dotnet-version: 7.0.x

- name: Restore dependencies
run: dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
dotnet-version: 7.0.x

- name: Restore dependencies
run: dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push2nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
dotnet-version: 7.0.x

- name: Restore dependencies
run: dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion samples/memmon-protobuff/memmon-protobuff.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Worker">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<Nullable>enable</Nullable>
Expand Down
4 changes: 2 additions & 2 deletions samples/memmon/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/runtime:6.0 AS base
FROM mcr.microsoft.com/dotnet/runtime:7.0 AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY samples/memmon/. memmon/
RUN cd memmon && chmod +x ./proj2nupkg.sh && ./proj2nupkg.sh && cd ..
Expand Down
12 changes: 6 additions & 6 deletions samples/memmon/MemMonFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,34 +62,34 @@ public async Task<Imemmon> CreateMemMonClientAsync(string connectinStringName, C
return client;
}

static async Task<dtmi_rido_memmon.mqtt.memmon> CreateBrokerClientAsync(string connectionString, CancellationToken cancellationToken = default)
static async Task<dtmi_rido_memmon.mqtt._memmon> CreateBrokerClientAsync(string connectionString, CancellationToken cancellationToken = default)
{
var cs = new ConnectionSettings(connectionString) { ModelId = Imemmon.ModelId };
var mqtt = await BrokerClientFactory.CreateFromConnectionSettingsAsync(cs, true, cancellationToken);
connectionSettings = BrokerClientFactory.ComputedSettings;
var client = new dtmi_rido_memmon.mqtt.memmon(mqtt)
var client = new dtmi_rido_memmon.mqtt._memmon(mqtt)
{
InitialState = String.Empty
};
nugetPackageVersion = BrokerClientFactory.NuGetPackageVersion;
return client;
}

static async Task<dtmi_rido_memmon.hub.memmon> CreateHubClientAsync(string connectionString, CancellationToken cancellationToken = default)
static async Task<dtmi_rido_memmon.hub._memmon> CreateHubClientAsync(string connectionString, CancellationToken cancellationToken = default)
{
var cs = new ConnectionSettings(connectionString) { ModelId = Imemmon.ModelId };
var hub = await HubDpsFactory.CreateFromConnectionSettingsAsync(cs, cancellationToken);
connectionSettings = HubDpsFactory.ComputedSettings;
var client = new dtmi_rido_memmon.hub.memmon(hub);
var client = new dtmi_rido_memmon.hub._memmon(hub);
nugetPackageVersion = HubDpsFactory.NuGetPackageVersion;
client.InitialState = await client.GetTwinAsync(cancellationToken);
return client;
}

static async Task<dtmi_rido_memmon.aws.memmon> CreateAwsClientAsync(string connectionString, CancellationToken cancellationToken = default)
static async Task<dtmi_rido_memmon.aws._memmon> CreateAwsClientAsync(string connectionString, CancellationToken cancellationToken = default)
{
var mqtt = await AwsClientFactory.CreateFromConnectionSettingsAsync(connectionString, true, cancellationToken);
var client = new dtmi_rido_memmon.aws.memmon(mqtt);
var client = new dtmi_rido_memmon.aws._memmon(mqtt);
connectionSettings = AwsClientFactory.ComputedSettings;
nugetPackageVersion = AwsClientFactory.NuGetPackageVersion;
client.InitialState = await client.GetShadowAsync(cancellationToken);
Expand Down
4 changes: 2 additions & 2 deletions samples/memmon/dtmi_rido_memmon-2.aws.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace dtmi_rido_memmon.aws;

public class memmon : AwsMqttClient, Imemmon
public class _memmon : AwsMqttClient, Imemmon
{
public IReadOnlyProperty<DateTime> Property_started { get; set; }
public IWritableProperty<bool> Property_enabled { get; set; }
Expand All @@ -21,7 +21,7 @@ public class memmon : AwsMqttClient, Imemmon
public ICommand<int> Command_malloc { get; set; }
public ICommand Command_free { get; set; }

internal memmon(IMqttClient c) : base(c)
internal _memmon(IMqttClient c) : base(c)
{
Property_started = new ReadOnlyProperty<DateTime>(c, "started");
Property_interval = new WritableProperty<int>(c, "interval");
Expand Down
4 changes: 2 additions & 2 deletions samples/memmon/dtmi_rido_memmon-2.hub.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace dtmi_rido_memmon.hub;

public class memmon : HubMqttClient, Imemmon
public class _memmon : HubMqttClient, Imemmon
{

public IReadOnlyProperty<DateTime> Property_started { get; set; }
Expand All @@ -20,7 +20,7 @@ public class memmon : HubMqttClient, Imemmon
public ICommand<int> Command_malloc { get; set; }
public ICommand Command_free { get; set; }

public memmon(IMqttClient c) : base(c)
public _memmon(IMqttClient c) : base(c)
{
Property_started = new ReadOnlyProperty<DateTime>(c, "started");
Property_interval = new WritableProperty<int>(c, "interval");
Expand Down
4 changes: 2 additions & 2 deletions samples/memmon/dtmi_rido_memmon-2.mqtt.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace dtmi_rido_memmon.mqtt;

public class memmon : Imemmon
public class _memmon : Imemmon
{
public IMqttClient Connection { get; set; }
public string InitialState { get; set; }
Expand All @@ -21,7 +21,7 @@ public class memmon : Imemmon
public ICommand<int> Command_malloc { get; set; }
public ICommand Command_free { get; set; }

internal memmon(IMqttClient c)
internal _memmon(IMqttClient c)
{
Connection = c;
Property_started = new ReadOnlyProperty<DateTime>(c, "started");
Expand Down
7 changes: 4 additions & 3 deletions samples/memmon/memmon.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.Worker">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<ContainerImageName>memmon_dn7</ContainerImageName>
</PropertyGroup>

<ItemGroup>
Expand All @@ -22,8 +23,8 @@
<ItemGroup>
<PackageReference Include="Humanizer.Core" Version="2.14.1" />
<PackageReference Include="Microsoft.ApplicationInsights.WorkerService" Version="2.21.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="6.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Build.Containers" Version="0.2.7" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public async Task DeviceSendsBirth()
};
await ta.SubscribeAsync("registry/e2e-device/status");
cs.ModelId = Imemmon.ModelId;
var td = new memmon(await BrokerClientFactory.CreateFromConnectionSettingsAsync(cs, true));
var td = new _memmon(await BrokerClientFactory.CreateFromConnectionSettingsAsync(cs, true));
await Task.Delay(100);
Assert.True(birthFound);
Assert.Equal(Imemmon.ModelId, bm!.ModelId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ internal async Task NewDeviceSendDefaults()
var deviceId = "memmon-test" + new Random().Next(100);
var device = await GetOrCreateDeviceAsync(deviceId);

var td = new memmon(await HubDpsFactory.CreateFromConnectionSettingsAsync($"HostName={hubName};DeviceId={deviceId};SharedAccessKey={device.Authentication.SymmetricKey.PrimaryKey}"));
var td = new _memmon(await HubDpsFactory.CreateFromConnectionSettingsAsync($"HostName={hubName};DeviceId={deviceId};SharedAccessKey={device.Authentication.SymmetricKey.PrimaryKey}"));
td.Property_interval.OnMessage = async p =>
{
td.Property_interval.Value = p;
Expand Down Expand Up @@ -91,7 +91,7 @@ internal async Task DeviceReadsSettingsAtStartup()

await Task.Delay(1000);

var td = new memmon(await HubDpsFactory.CreateFromConnectionSettingsAsync($"HostName={hubName};DeviceId={deviceId};SharedAccessKey={device.Authentication.SymmetricKey.PrimaryKey}"));
var td = new _memmon(await HubDpsFactory.CreateFromConnectionSettingsAsync($"HostName={hubName};DeviceId={deviceId};SharedAccessKey={device.Authentication.SymmetricKey.PrimaryKey}"));
// await td.InitState();

td.Property_interval.OnMessage = async m =>
Expand Down Expand Up @@ -131,7 +131,7 @@ private async Task UpdatesDesiredPropertyWhenOnline()
var deviceId = "memmon-test" + new Random().Next(100);
var device = await GetOrCreateDeviceAsync(deviceId);

var td = new memmon(await HubDpsFactory.CreateFromConnectionSettingsAsync($"HostName={hubName};DeviceId={deviceId};SharedAccessKey={device.Authentication.SymmetricKey.PrimaryKey}"));
var td = new _memmon(await HubDpsFactory.CreateFromConnectionSettingsAsync($"HostName={hubName};DeviceId={deviceId};SharedAccessKey={device.Authentication.SymmetricKey.PrimaryKey}"));
td.Property_interval.OnMessage = m =>
{
var ack = new Ack<int>()
Expand Down Expand Up @@ -183,7 +183,7 @@ internal async Task CommandsGetCalled()
var device = await GetOrCreateDeviceAsync(deviceId);

bool commandInvoked = false;
var td = new memmon(await HubDpsFactory.CreateFromConnectionSettingsAsync($"HostName={hubName};DeviceId={deviceId};SharedAccessKey={device.Authentication.SymmetricKey.PrimaryKey}"));
var td = new _memmon(await HubDpsFactory.CreateFromConnectionSettingsAsync($"HostName={hubName};DeviceId={deviceId};SharedAccessKey={device.Authentication.SymmetricKey.PrimaryKey}"));
td.Command_getRuntimeStats.OnMessage = async m =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

namespace dtmi_rido_pnp_memmon.hub;

public class memmon : HubMqttClient, Imemmon
public class _memmon : HubMqttClient, Imemmon
{
public IReadOnlyProperty<DateTime> Property_started { get; set; }
public IWritableProperty<bool> Property_enabled { get; set; }
public IWritableProperty<int> Property_interval { get; set; }
public ITelemetry<double> Telemetry_workingSet { get; set; }
public ICommand<DiagnosticsMode, Dictionary<string,string>> Command_getRuntimeStats { get; set; }

public memmon(IMqttClient c) : base(c)
public _memmon(IMqttClient c) : base(c)
{
Property_started = new ReadOnlyProperty<DateTime>(c, "started");
Property_interval = new WritableProperty<int>(c, "interval");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace dtmi_rido_pnp_memmon.mqtt;

public class memmon : Imemmon
public class _memmon : Imemmon
{
public IMqttClient Connection { get; set; }
public string InitialState { get; set; }
Expand All @@ -18,7 +18,7 @@ public class memmon : Imemmon
public ITelemetry<double> Telemetry_workingSet { get; set; }
public ICommand<DiagnosticsMode, Dictionary<string, string>> Command_getRuntimeStats { get; set; }

internal memmon(IMqttClient c)
internal _memmon(IMqttClient c)
{
Property_started = new ReadOnlyProperty<DateTime>(c, "started");
Property_interval = new WritableProperty<int>(c, "interval");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "0.5",
"version": "0.6",
"publicReleaseRefSpec": [
"^refs/heads/master$",
"^refs/heads/rel/v\\d+(?:\\.\\d+)?$"
Expand Down

0 comments on commit 03ba71f

Please sign in to comment.