Files
Copilot d525bc3f28 Bound reconnect cleanup and organize samples by domain (#4276)
# 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
2026-08-21 04:35:47 +00:00

160 lines
5.9 KiB
YAML

name: Docker Sample Images CI
on:
push:
branches: [ master, release/*, docker* ]
paths-ignore:
- 'docs/**'
- 'tests/**'
pull_request:
branches: [ master ]
paths-ignore:
- 'docs/**'
- 'tests/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
REGISTRY: ghcr.io
DOCKERSIGN: false
jobs:
build-and-push-image:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# Sample servers
- image: refserver
dockerfile: ./samples/Reference/ConsoleReferenceServer/Dockerfile
- image: ldsserver
dockerfile: ./samples/Lds/ConsoleLdsServer/Dockerfile
- image: boilerserver
dockerfile: ./samples/MinimalApi/MinimalBoilerServer/Dockerfile
- image: calcserver
dockerfile: ./samples/MinimalApi/MinimalCalcServer/Dockerfile
- image: mcpserver
dockerfile: ./tools/Opc.Ua.Mcp/Dockerfile
- image: redundantserver
dockerfile: ./samples/Redundancy/RedundantServer/Dockerfile
# Redundant client
- image: redundantclient
dockerfile: ./samples/Redundancy/RedundantClient/Dockerfile
# PubSub samples
- image: redundantpubsub
dockerfile: ./samples/Redundancy/RedundantPubSub/Dockerfile
- image: pubsubclient
dockerfile: ./samples/PubSub/ConsoleReferencePubSubClient/Dockerfile
env:
IMAGE_NAME: ${{ matrix.image }}
IS_NOT_PR: ${{ !github.head_ref && true }}
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up .NET 8
uses: actions/setup-dotnet@v6
with:
dotnet-version: '8.x'
- name: Set Version
shell: pwsh
run: ./.azurepipelines/set-version.ps1
# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install cosign
if: github.event_name != 'pull_request' && env.DOCKERSIGN == 'true'
uses: sigstore/cosign-installer@main
with:
cosign-release: 'v1.13.1'
# https://github.com/docker/build-push-action
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v4
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v4
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare Tag Repo Info
run: |
echo IMAGE_REPOSITORY=${{ env.REGISTRY }}/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]' | awk '{gsub(/-|\./, "")}1')/${{ env.IMAGE_NAME }} >> $GITHUB_ENV
echo IMAGE_VERSION=$(echo ${{ env.NBGV_Version }}${{ env.NBGV_PrereleaseVersion }}) >> $GITHUB_ENV
- name: Prepare Tag Branch info
if: env.NBGV_PublicRelease == 'False'
run: |
echo IMAGE_TAG=-$(echo ${{ github.ref }} | tr '[:upper:]' '[:lower:]' | awk '{sub(/([^\/]*\/){2}/,""); gsub(/\/|_/, "-")}1') >> $GITHUB_ENV
- name: Prepare version and latest tag
run: |
echo TAG_BRANCH=$(echo ${{ env.IMAGE_REPOSITORY }}:${{ env.IMAGE_VERSION }}${{ env.IMAGE_TAG }}) >> $GITHUB_ENV
echo TAG_LATEST=$(echo ${{ env.IMAGE_REPOSITORY }}:latest${{ env.IMAGE_TAG }}) >> $GITHUB_ENV
- name: Prepare Release tags
if: ${{ env.NBGV_PublicRelease == 'True' && env.NBGV_PrereleaseVersion == '' && env.IS_NOT_PR == 'true' }}
run: |
echo TAG_RELEASE=,${{ env.IMAGE_REPOSITORY }}:${{ env.NBGV_MajorMinorVersion }},${{ env.IMAGE_REPOSITORY }}:${{ env.NBGV_SimpleVersion }},${{ env.IMAGE_REPOSITORY }}:release >> $GITHUB_ENV
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v6
with:
images: ${{ env.IMAGE_REPOSITORY }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v7
with:
context: .
build-args: |
Version=${{ env.NBGV_Version }}
SimpleVersion=${{ env.NBGV_SimpleVersion }}
InformationalVersion=${{ env.NBGV_AssemblyInformationalVersion }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.TAG_BRANCH }},${{ env.TAG_LATEST }}${{ env.TAG_RELEASE }}
platforms: linux/amd64,linux/arm64/v8
file: ${{ matrix.dockerfile }}
labels: ${{ steps.meta.outputs.labels }}
provenance: false
cache-from: type=gha,scope=${{ matrix.image }}
# setup-buildx-action@v4 installs Buildx and BuildKit versions that support ignore-error.
cache-to: type=gha,mode=max,scope=${{ matrix.image }},ignore-error=true
# Sign the resulting Docker image digest except on PRs.
# https://github.com/sigstore/cosign
- name: Sign the published Docker image
if: github.event_name != 'pull_request' && env.DOCKERSIGN == 'true'
env:
COSIGN_EXPERIMENTAL: "true"
# This step uses the identity token to provision an ephemeral certificate
# against the sigstore community Fulcio instance.
run: |
echo Signing ${{ env.IMAGE_REPOSITORY }}@${{ steps.build-and-push.outputs.digest }}
echo "${{ env.IMAGE_REPOSITORY }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}