mirror of
https://github.com/OPCFoundation/UA-.NETStandard.git
synced 2026-10-18 22:55:08 +08:00
d525bc3f28
# Description This PR fixes bounded ManagedSession reconnect cleanup and reorganizes the sample applications into domain-focused folders. ## Reconnect cleanup - Bounds reconnect integration cleanup with independent 30-second close and dispose limits. - Sends `CloseSession` through the awaited transport request path during `Session.DisposeAsync`. - Preserves explicit `Session.CloseAsync` behavior that waits for or cancels outstanding publish requests. - Covers the disposal request path with a regression test. ## Sample organization - `samples/OpenUsd`: `GeneratorServer`, `SiteCompositionServer` - `samples/Redundancy`: `RedundantClient`, `RedundantServer`, `RedundantPubSub` - `samples/Isa95`: `MinimalIsa95Server` - `samples/MinimalApi`: `MinimalBoilerServer`, `MinimalCalcServer`, `MinimalClient` - `samples/DI`: `PumpDeviceIntegrationServer` - `samples/Lds`: `ConsoleLdsServer` - `samples/Reference`: `ConsoleReferenceClient`, `ConsoleReferenceServer` - `samples/PubSub`: `ConsoleReferencePubSubClient` `UA.slnx` now exposes the same requested domain groups. Project references, tests, runtime sample probes, CI workflows, Dockerfiles, Compose files, helper scripts, and documentation were updated to the new paths. `samples/Robotics/MinimalRobotServer` remains under `Robotics`. ## Validation - `dotnet build UA.slnx` - 3 Redundancy short-haul sample tests - 70 DI sample tests - 914 OpenUSD tests - 1 WotCon model-materialization test - 137 AOT tests - `docker compose config` for all 6 moved Redundancy Compose files ## Related Issues - Fixes #4273 ## Checklist - [ ] I have signed the [CLA](https://opcfoundation.org/license/cla/ContributorLicenseAgreementv1.0.pdf) and read the [CONTRIBUTING](https://github.com/OPCFoundation/UA-.NETStandard/blob/master/CONTRIBUTING.md) doc. - [x] I have added tests that prove my fix is effective or that my feature works and increased code coverage. - [x] I have added all necessary documentation. - [x] I have verified that my changes do not introduce new build or analyzer warnings. - [x] I built the complete `UA.slnx` solution locally. - [ ] I ran all tests locally against at least .NET Framework and .NET 10. - [ ] I fixed all failing and flaky tests in the CI pipelines and all CodeQL warnings. - [x] I have addressed all PR feedback received. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: marcschier <11168470+marcschier@users.noreply.github.com> Co-authored-by: Marc Schier <mschier@microsoft.com> Co-authored-by: Marc Schier <marcschier@users.noreply.github.com> Copilot-Session: a2c2838f-74ae-4997-a1d4-50574d9e0636
79 lines
4.4 KiB
Markdown
79 lines
4.4 KiB
Markdown
# Container support and remote debugging for Reference Server
|
|
|
|
## Overview
|
|
|
|
There are multiple options to run the reference server in a Docker container:
|
|
|
|
- Latest and release builds from the GitHub container registry [here](https://github.com/OPCFoundation/UA-.NETStandard/pkgs/container/uanetstandard%2Frefserver). These builds support only Linux targets.
|
|
- Since [this](https://github.com/OPCFoundation/UA-.NETStandard/commit/61a61081f6060804b12b8f351e32a8075703263d) commit the container image has amd64 and arm64 support. The build of the sample has been moved to containers, no more need to install the .NET SDK.
|
|
- Local build without .NET 6.0 SDK on Linux or Windows with Docker Desktop. The target OS is chosen based on the settings in Docker Desktop for Linux or Windows containers.
|
|
- Although with VS 2019 and greater there is built in Container support, so far issues in the UA Reference solution prevent build/startup/connection (under investigation).
|
|
- VS2022 supports native debugging on a Linux distribution with WSL.
|
|
|
|
## Other published sample images
|
|
|
|
In addition to the reference server (`refserver`), the `Docker Sample Images CI` workflow builds and publishes the other sample servers, the redundant client, and both PubSub samples to the GitHub container registry (`ghcr.io/opcfoundation/uanetstandard/<image>`). All are `linux/amd64` + `linux/arm64` and share the same version/`latest` tagging scheme as `refserver`:
|
|
|
|
| Image | Sample application |
|
|
| --- | --- |
|
|
| `refserver` | `samples/Reference/ConsoleReferenceServer` |
|
|
| `ldsserver` | `samples/Lds/ConsoleLdsServer` |
|
|
| `boilerserver` | `samples/MinimalApi/MinimalBoilerServer` |
|
|
| `calcserver` | `samples/MinimalApi/MinimalCalcServer` |
|
|
| `pumpserver` | `samples/DI/PumpDeviceIntegrationServer` |
|
|
| `mcpserver` | `tools/Opc.Ua.Mcp` |
|
|
| `redundantserver` | `samples/Redundancy/RedundantServer` |
|
|
| `redundantclient` | `samples/Redundancy/RedundantClient` |
|
|
| `redundantpubsub` | `samples/Redundancy/RedundantPubSub` |
|
|
| `pubsubclient` | `samples/PubSub/ConsoleReferencePubSubClient` |
|
|
|
|
For example: `docker pull ghcr.io/opcfoundation/uanetstandard/ldsserver:latest`. Each image has a Dockerfile under its application folder that is built from the repository root as context (for example `docker build -f samples/Lds/ConsoleLdsServer/Dockerfile -t opcua-lds-server .`).
|
|
|
|
## Building the local containers
|
|
|
|
1. Open a command prompt which can execute docker commands.
|
|
2. Navigate to the folder `samples/Reference/ConsoleReferenceServer`.
|
|
3. Build the docker container by executing the command `dockerbuild.cmd`.
|
|
|
|
On Linux,
|
|
|
|
1. Open a shell which can execute docker commands.
|
|
2. Navigate to the folder `samples/Reference/ConsoleReferenceServer`.
|
|
3. Build the docker container by executing the command `./dockerbuild.sh`.
|
|
|
|
## Run the reference server container
|
|
|
|
The following samples run the server in interactive mode, hostname is the same as the host, the certificate store, the log output and the configuration file (see option `-s`) are mapped to a folder called `./OPC Foundation`.
|
|
|
|
the following defaults are used:
|
|
|
|
- the certificate store is mapped to './OPC Foundation/pki'
|
|
- A log file is created in './OPC Foundation/Logs'
|
|
- The shadow configuration file is created in './OPC Foundation/Quickstarts.ReferenceServer.Config.xml'
|
|
|
|
With the option `-s` the configuration file is first copied to the root of the mapped folders. In subsequent restarts the shadowed configuration file is used when the server is started and all settings can be changed from the mapped configuration file.
|
|
|
|
### Run the local build of the Docker container
|
|
|
|
To run the local containers, batch files are provided called `dockerrun.bat` for Windows and `dockerrun.sh` for Linux.
|
|
|
|
### Run the prebuilt Docker container hosted on Github
|
|
|
|
On Windows, open a command prompt and execute the following commands:
|
|
|
|
```cmd
|
|
docker pull ghcr.io/opcfoundation/uanetstandard/refserver:latest
|
|
docker run -it -p 62541:62541 -h %COMPUTERNAME% -v "%CD%/OPC Foundation:/root/.local/share/OPC Foundation" ghcr.io/opcfoundation/uanetstandard/refserver:latest -c -s
|
|
```
|
|
|
|
On Linux, execute the following commands in a shell:
|
|
|
|
```bash
|
|
sudo docker pull ghcr.io/opcfoundation/uanetstandard/refserver:latest
|
|
sudo docker run -it -p 62541:62541 -h $HOSTNAME -v "$(pwd)/OPC Foundation:/root/.local/share/OPC Foundation" ghcr.io/opcfoundation/uanetstandard/refserver:latest -c -s
|
|
```
|
|
|
|
## Known limitations and issues
|
|
|
|
- VS integrated docker build/debug support is not working with the Solution.
|