Skip to content

Commit

Permalink
Fix container build and improve diagnostics and reconnect handling
Browse files Browse the repository at this point in the history
* Filter heartbeat in ln
* Fix lifetime counter configuration
* Subscription status handling to recreate subscription that have expired
* Update build tooling to correctly build arm and arm64 images
* Improve diagnostics
  • Loading branch information
marcschier authored Dec 27, 2023
1 parent 246ff6e commit 19bd7c1
Show file tree
Hide file tree
Showing 61 changed files with 726 additions and 495 deletions.
10 changes: 5 additions & 5 deletions deploy/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ services:
############################
opcplc:
container_name: opcplc
image: mcr.microsoft.com/iotedge/opc-plc:${OPC_PLC_TAG:-latest}
image: mcr.microsoft.com/iotedge/opc-plc:${OPC_PLC_TAG:-2.9.10}
ports:
- "50000:50000"
command: [
Expand All @@ -16,8 +16,8 @@ services:
"--ses",
"--ei=${EVENT_NODES:-100}",
"--gn=${GUID_NODES:-100}",
"--fn=${FAST_NODES:-49900}",
"--sn=${SLOW_NODES:-49900}",
"--fn=${FAST_NODES:-99900}",
"--sn=${SLOW_NODES:-99900}",
"--aa"
]
volumes:
Expand All @@ -38,12 +38,12 @@ services:
"--bs=1",
"--bi=0",
"--di=60",
"--pd=Events",
"--cl=5",
"--rs",
"--dm=True",
"--pki=/shared/pki",
"--pf=/shared/pn.json",
"--npd=${NODES_PER_DATASET:-5000}"
"--npd=${NODES_PER_DATASET:-10000}"
]
environment:
EdgeHubConnectionString:
Expand Down
22 changes: 12 additions & 10 deletions docs/opc-publisher/commandline.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ When both environment variable and CLI argument are provided, the command line o
██║ ██║██╔═══╝ ██║ ██╔═══╝ ██║ ██║██╔══██╗██║ ██║╚════██║██╔══██║██╔══╝ ██╔══██╗
╚██████╔╝██║ ╚██████╗ ██║ ╚██████╔╝██████╔╝███████╗██║███████║██║ ██║███████╗██║ ██║
╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝╚══════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
2.9.3
2.9.4
General
-------
Expand Down Expand Up @@ -464,11 +464,17 @@ Subscription settings
Also can be set using `DefaultPublishingInterval`
environment variable in the form of a duration
string in the form `[d.]hh:mm:ss[.fffffff]`.
--kt, --keepalivethreshold, --MaxKeepAliveCount=VALUE
Specify the default number of keep alive packets a
server can miss, before the session is
disconneced.
Default: `50`.
--ska, --keepalivecount, --DefaultKeepAliveCount=VALUE
Specifies the default number of publishing
intervals before a keep alive is returned with
the next queued publishing response.
Default: `10`.
--slt, --lifetimecount, --DefaultLifetimeCount=VALUE
Default subscription lifetime count which is a
multiple of the keep alive counter and when
reached instructs the server to declare the
subscription invalid.
Default: `100`.
--fd, --fetchdisplayname, --FetchOpcNodeDisplayName[=VALUE]
Fetches the displayname for the monitored items
subscribed if a display name was not specified
Expand Down Expand Up @@ -528,10 +534,6 @@ Subscription settings
Also can be set using `DefaultHeartbeatInterval`
environment variable in the form of a duration
string in the form `[d.]hh:mm:ss[.fffffff]`.
--slt, --MinSubscriptionLifetime=VALUE
Minimum subscription lifetime in seconds as per
OPC UA definition.
Default: `not set`.
--da, --deferredacks, --UseDeferredAcknoledgements[=VALUE]
(Experimental) Acknoledge subscription
notifications only when the data has been
Expand Down
24 changes: 23 additions & 1 deletion docs/release-announcement.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Table Of Contents <!-- omit in toc -->

- [Azure Industrial IoT OPC Publisher 2.9.4](#azure-industrial-iot-opc-publisher-294)
- [Changes in 2.9.4](#changes-in-294)
- [Azure Industrial IoT OPC Publisher 2.9.3](#azure-industrial-iot-opc-publisher-293)
- [Breaking changes in 2.9.3](#breaking-changes-in-293)
- [New features in 2.9.3](#new-features-in-293)
Expand Down Expand Up @@ -38,6 +40,22 @@
- [Azure Industrial IoT Platform Release 2.8.1](#azure-industrial-iot-platform-release-281)
- [Azure Industrial IoT Platform Release 2.8](#azure-industrial-iot-platform-release-28)

## Azure Industrial IoT OPC Publisher 2.9.4

We are pleased to announce the release of version 2.9.4 of OPC Publisher and the companion web api. This release comes with several bug and security fixes and is the latest supported release.

### Changes in 2.9.4

- Fix release build issue which broke support for ARM64 images running on RPi4 (#2145).
- Update console diagnostics output to provide better naming and reflect other transports than IoT Edge Hub (#2141)
- Add keep alive notification counts to Diagnostics output and messages
- Add a full version that includes runtime, framework and full version string to runtime state message, twin, diagnostic object, and in console output.
- When only using cyclic reads, the underlying dummy subscription should stay disabled (#2139)
- Recreate session if it expires on server (#2138)
- Log subscription keep alive error only when session is connected (#2137)
- Update OPC UA .net stack to latest version (1.4.372.106) to enable fully async reconnect
- Fix issue where certain publish errors cause reconnect state machine to fail (#2104, #2136)

## Azure Industrial IoT OPC Publisher 2.9.3

We are pleased to announce the release of version 2.9.3 of OPC Publisher and the companion web api. This release moves OPC Publisher to .net 8 which is the latest LTS version of .net and comes with several new features, bug and security fixes. 2.9.3 is the latest supported release.
Expand All @@ -60,11 +78,13 @@ We are pleased to announce the release of version 2.9.3 of OPC Publisher and the
- X509 User Authentication support using secrets reference feature request (#2005)
- New API to manage the PKI infrastructure of the OPC Publisher (certificate stores). You can now list, add and remove certificates from the OPC UA certificate stores remotely. (#1996)
- You can now configure OPC Publisher to re-use a session across writer groups with the same endpoint url and security settings. (#2065)
- Subscription Watchdog monitors keep alive notifications and generates metric and logs when subscription keep alive is missing (#2060)
- Added samples to show how to call OPC Publisher API over MQTT, HTTP and IoT Hub.

### Bug fixes in 2.9.3

- 2.8 Start instrument was missing on 2.9 prometheus endpoint (#2110)
- Fix Publisher cannot get ssl cert from workload api, HTTPS API returning SSL_ERROR_SYSCALL error (#2101)
- Harden when OPC UA server sometimes reports monitored items samples changes unordered in subscription notification and thus samples messages are also unordered (#2108)
- Need to have timestamp information and other information in runtime state reporting message, need to have a special routing path for runtime state messages feature request. Restart announcement now includes additional information, including version, timestamp of (re-)start, module and device ids. (#2111)
- Optimize metadata collection, do not collect metadata from servers for built in types (#2105)
Expand All @@ -73,11 +93,13 @@ We are pleased to announce the release of version 2.9.3 of OPC Publisher and the
- Dapr now works without requiring state component. Dapr now runs over http instead of https by default. New option to select the url scheme (#2102, #2119, #2117, #2109
- It is now possible to disable retrying subscription re-creation by configuring a value of 0. (#2100)
- Fix that extension field values show up wrong in samples mode. (#2092)
- FIx Event subscription using the REST Api fails with: "The request field is required." (#2078)
- Fix Event subscription using the REST Api fails with: "The request field is required." (#2078)
- The configuration of the OpcPublisher 2.9.2 fails using the REST Api bug (#2066)
- For each configured in pn.json Dataset publisher must try to reuse an existing session for this EndpointUrl with the identical security settings (if exists). feature request
- Address issues deploying the web api, e.g., getting error when trying to use option 2 to deploy Azure IIoT Deployment and ./aad-register.ps1 errors with "A parameter cannot be found that matches the parameter name 'ReplyUrl'." (#2063, #2064)
- Update documentation, including breaking changes, Add Azure Storage, Azure Key Vault services, and Application Insights to arch diagram, how to setup the OPCPublisher edge module with X.509 certificates documentation, and how to emit ExtensionFields in Pub sub mode using key frame counter. (#1917, #2091, #2083)
- Fix incorrect API definitions in OpenAPI JSON for OPC publisher
- FileSystem target now appends data instead of updating the file content. FileSystem target now supports arbitrary chars in topics.

## Azure Industrial IoT OPC Publisher 2.9.2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Furly.Extensions.Abstractions" Version="1.0.13" />
<PackageReference Include="Furly.Extensions.Abstractions" Version="1.0.15" />
</ItemGroup>
</Project>
7 changes: 6 additions & 1 deletion src/Azure.IIoT.OpcUa.Publisher.Models/src/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@ public static class Constants
public const string TwinPropertySiteKey = "__siteid__";

/// <summary>
/// Version property name constant
/// Semver Version property name constant
/// </summary>
public const string TwinPropertyVersionKey = "__version__";

/// <summary>
/// Full Version property name constant
/// </summary>
public const string TwinPropertyFullVersionKey = "__fullversion__";

/// <summary>
/// Spi key property name constant
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class RuntimeStateEventModel
public DateTime TimestampUtc { get; set; }

/// <summary>
/// The Publisher Id if available
/// The Publisher semver version
/// </summary>
[DataMember(Name = "Version", Order = 3,
EmitDefaultValue = true)]
Expand Down Expand Up @@ -69,5 +69,12 @@ public class RuntimeStateEventModel
[DataMember(Name = "ModuleId", Order = 7,
EmitDefaultValue = true)]
public string? ModuleId { get; set; }

/// <summary>
/// The Publisher full version string
/// </summary>
[DataMember(Name = "FullVersion", Order = 8,
EmitDefaultValue = true)]
public string? FullVersion { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -230,5 +230,19 @@ public record class WriterGroupDiagnosticModel
[DataMember(Name = "NumberOfSubscriptions", Order = 30,
EmitDefaultValue = true)]
public long NumberOfSubscriptions { get; set; }

/// <summary>
/// Number of incoming keep alive notifications
/// </summary>
[DataMember(Name = "IngressKeepAliveNotifications", Order = 31,
EmitDefaultValue = true)]
public long IngressKeepAliveNotifications { get; set; }

/// <summary>
/// Publisher version
/// </summary>
[DataMember(Name = "PublisherVersion", Order = 99,
EmitDefaultValue = true)]
public string? PublisherVersion { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.6.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.5">
<PackageReference Include="xunit" Version="2.6.4" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Furly.Extensions.Json" Version="1.0.13" />
<PackageReference Include="Furly.Extensions.MessagePack" Version="1.0.13" />
<PackageReference Include="Furly.Extensions.Newtonsoft" Version="1.0.13" />
<PackageReference Include="Furly.Extensions.Json" Version="1.0.15" />
<PackageReference Include="Furly.Extensions.MessagePack" Version="1.0.15" />
<PackageReference Include="Furly.Extensions.Newtonsoft" Version="1.0.15" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\src\Azure.IIoT.OpcUa.Publisher.Models.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Furly.Azure.IoT" Version="1.0.13" />
<PackageReference Include="Furly.Azure.KeyVault" Version="1.0.13" />
<PackageReference Include="Furly.Azure.IoT" Version="1.0.15" />
<PackageReference Include="Furly.Azure.KeyVault" Version="1.0.15" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Azure.IIoT.OpcUa.Publisher.Testing\src\Azure.IIoT.OpcUa.Publisher.Testing.Servers.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,19 @@
<None Remove="pki\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Furly.Extensions.AspNetCore" Version="1.0.13" />
<PackageReference Include="Furly.Extensions.Mqtt" Version="1.0.13" />
<PackageReference Include="Furly.Extensions.Dapr" Version="1.0.13" />
<PackageReference Include="Furly.Extensions.MessagePack" Version="1.0.13" />
<PackageReference Include="Furly.Tunnel" Version="1.0.13" />
<PackageReference Include="Furly.Extensions.AspNetCore" Version="1.0.15" />
<PackageReference Include="Furly.Extensions.Mqtt" Version="1.0.15" />
<PackageReference Include="Furly.Extensions.Dapr" Version="1.0.15" />
<PackageReference Include="Furly.Extensions.MessagePack" Version="1.0.15" />
<PackageReference Include="Furly.Tunnel" Version="1.0.15" />
<PackageReference Include="Grpc.Net.Client" Version="2.59.0" />
<PackageReference Include="Mono.Options" Version="6.12.0.148" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Exporter.Prometheus.AspNetCore" Version="1.7.0-rc.1" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.6.0-rc.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.6.0-rc.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.7.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.5.1" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ namespace Azure.IIoT.OpcUa.Publisher.Module.Controllers
{
using Azure.IIoT.OpcUa.Publisher.Module.Filters;
using Furly.Tunnel.Router;
using Microsoft.Extensions.Logging;
using System;
using System.Threading.Tasks;

Expand Down
2 changes: 1 addition & 1 deletion src/Azure.IIoT.OpcUa.Publisher.Module/src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ private static void LogLogo()
██║ ██║██╔═══╝ ██║ ██╔═══╝ ██║ ██║██╔══██╗██║ ██║╚════██║██╔══██║██╔══╝ ██╔══██╗
╚██████╔╝██║ ╚██████╗ ██║ ╚██████╔╝██████╔╝███████╗██║███████║██║ ██║███████╗██║ ██║
╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝╚══════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
{ThisAssembly.AssemblyInformationalVersion}
{PublisherConfig.Version.PadLeft(96)})
");
}

Expand Down
Loading

0 comments on commit 19bd7c1

Please sign in to comment.