diff --git a/.github/actions/docker-job/action.yaml b/.github/actions/docker-job/action.yaml index 7807a16..b6a5dd0 100644 --- a/.github/actions/docker-job/action.yaml +++ b/.github/actions/docker-job/action.yaml @@ -2,4 +2,6 @@ runs: using: docker image: docker/Dockerfile + args: + - scripts/run.sh diff --git a/.github/actions/docker-job/docker/Dockerfile b/.github/actions/docker-job/docker/Dockerfile index 3c9dbb3..017a98f 100644 --- a/.github/actions/docker-job/docker/Dockerfile +++ b/.github/actions/docker-job/docker/Dockerfile @@ -1,5 +1,20 @@ FROM debian:sid +ENV TZ "Europe/Berlin" +ENV DEBIAN_FRONTEND "noninteractive" +ENV LC_ALL C.UTF-8 +ENV LANG C.UTF-8 + +RUN apt update \ + && apt -y install \ + sudo \ + build-essential \ + debhelper \ + devscripts \ + dh-make \ + dh-cmake \ + && true + COPY entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] diff --git a/.github/actions/docker-job/docker/entrypoint.sh b/.github/actions/docker-job/docker/entrypoint.sh index 6294142..9ff521b 100755 --- a/.github/actions/docker-job/docker/entrypoint.sh +++ b/.github/actions/docker-job/docker/entrypoint.sh @@ -8,5 +8,5 @@ echo "Runner GID: ${runner_gid}" useradd --uid "${runner_uid}" --no-user-group --home-dir "$(pwd)" --no-create-home worker -su -c scripts/run.sh - worker +sudo -E -u worker -- "$@" diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 8577018..fc0868d 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -8,5 +8,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + with: + fetch-tags: true + repository: vectorgrp/sil-kit + path: sil-kit + ref: sil-kit/v4.0.42 - uses: ./.github/actions/docker-job/ diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..be72279 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,126 @@ +libsilkit (SIL_KIT_MAJOR.SIL_KIT_MINOR.SIL_KIT_PATCH-1) unstable; urgency=medium + + * Reworked debian packaging container + + -- Daniel Edwards Tue, 05 Dec 2023 16:15:00 +0200 + +libsilkit (4.0.37-1) UNRELEASED; urgency=medium + + * Reworked the documentation on Virtual Time Synchronization + * The documentation of the demo section now refers to the pre built Vector + SIL Kit packages and not to a source build. + + -- Jan Kraemer Wed, 18 Oct 2023 09:40:00 +0200 + +libsilkit (4.0.36-3) UNRELEASED; urgency=medium + + * Fixed dependencies + -- Jan Kraemer Tue, 17 Oct 2023 08:49:56 +0200 + +libsilkit (4.0.36-2) UNRELEASED; urgency=medium + + * Added dependencies + -- Jan Kraemer Tue, 17 Oct 2023 08:49:56 +0200 + +libsilkit (4.0.36-1) UNRELEASED; urgency=medium + + * Documentation on DashboardUri + * Fixed misbehavior of the sil-kit-system-controller in interactive mode on + user input: + * The sil-kit-system-controller now triggers a Stop() in + SystemState::Running or SystemState::Paused + * The sil-kit-system-controller only triggers AbortSimulation when not + SystemState::Running, SystemState::Paused, SystemState::Shutdown or + SystemState::Aborting + * Performance improvement of the internal serialization + * The final state handling of the sil-kit-system-controller in interactive + mode on user input has changed: + * Old: The sil-kit-system-controller triggered AbortSimulation if the + finalState was not received after 5s + * New: The sil-kit-system-controller retries receiving the finalState 3x5s. + If this fails, the sil-kit-system-controller triggers AbortSimulation (if + not already happened) and tries receiving the finalState 3x5s again. If + this fails, the sil-kit-system-controller just terminates + + -- Jan Kraemer Tue, 03 Oct 2023 08:49:56 +0200 + +libsilkit (4.0.35-1) UNRELEASED; urgency=medium + + * Memory management documentation introduced + * Integration tests for communication in the stop/shutdown/abort handlers. + * When building the SIL Kit documentation, the sphinx build command is no + longer called in a pipenv. + * Ensured that calling ``ISystemController::AbortSimulation()`` does not lead + to the system controller terminating prior to other participants receiving + its abort message. + * Ensure that userContext field for external CanFrameTransmitEvents is + always null. + * Fixed warning in VS2017 (x86) build + + -- Jan Kraemer Tue, 19 Sep 2023 08:49:56 +0200 + +libsilkit (4.0.34) UNRELEASED; urgency=medium + + * Behavior change of ParticipantState::Error + + * Old: Several situations could lead to an ParticipantState::Error before + the user called StartLifecycle() + + * Reception of an invalid WorkflowConfiguration + * Remote participant disconnected + * Reception of AbortSimulation + + * New: ParticipantState::Error should only be reached after + StartLifecycle() was called + * Reception of a WorkflowConfiguration is not validated before + StartLifecycle() + * A disconnected remote participant is only transitioned to + ParticipantState::Error if he had a started Lifecycle + * Reaction on SystemCommang::AbortSimulation is deferred before + StartLifecycle() + * Behavior change of SystemCommand::AbortSimulation + * Old: Reception of AbortSimulation before StartLifecycle() led to + ParticipantState::Error + * New: Reception of AbortSimulation before StartLifecycle() is firstly + ignored. A later call to StartLifecycle() then directly leads to an abort + (transition to ParticipantState::Aborting, calling the AbortHandler) + * clang presets in CMakePresets.json now have the clang version in their + names + * Added an internal barrier between ParticipantState::Shutdown and setting + the final state promise. This ensures that the participant state updates + are all transmitted while shutting down. + * Revised log messages when shutting down / disconnecting participants + * Graceful, participant has lifecycle: "Participant has + disconnected after gracefully shutting down", + * Not graceful, participant has lifecycle: "Participant + has disconnected without gracefully shutting down." + * Registry shutdown: Connection to SIL Kit Registry was lost - no new + participant connections can be established. + * Participant without lifecycle: Participant has + disconnected. + * Made simulation time stop for all coordinated participants when one + coordinated participant disconnects ungracefully + + -- Jan Kraemer Tue, 05 Sep 2023 08:49:56 +0200 + +libsilkit (4.0.33) UNRELEASED; urgency=medium + * New experimental extension of the LIN API that allows a user to send frame + headers and respond to them without setting up a static configuration + beforehand. + * Added link to FMU importer in Readme.md + * Restructured the documentation to have separate sections for overview. It + is now divided into an overall introduction, a developer guide, and a user + guide. + * Removed internal use of exceptions for failing connections to the registry + if another connection mechanism succeeded. + * Fixed missing entry of RegistryAsFallbackProxy in YAML schema + + -- Jan Kraemer Wed, 16 Aug 2023 08:49:56 +0200 + +libsilkit (4.0.32) UNRELEASED; urgency=medium + + * Ensure that the registry rejects a connecting participant if a participant + with the same name is already connected. + * This is a Quality Assured Release. + + -- Jan Kraemer Wed, 02 Aug 2023 08:49:56 +0200 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..4ac2329 --- /dev/null +++ b/debian/control @@ -0,0 +1,38 @@ +Source: libsilkit +Priority: optional +Maintainer: Jan Kraemer +Build-Depends: debhelper-compat (= 13), cmake (>= 3.20), ninja-build, dh-cmake, dh-cmake-compat (= 1), dh-sequence-cpack, libfmt-dev libspdlog-dev libasio-dev +Standards-Version: 4.6.0 +Section: libs +Homepage: https://github.com/vectorgrp/sil-kit +Vcs-Git: https://github.com/vectorgrp/sil-kit +Rules-Requires-Root: no + +Package: libsilkit-dev +Section: libdevel +Architecture: any +Multi-Arch: no +Depends: libsilkit4(= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends} +Description: Development packages for libsilkit + The Vector SIL Kit is an open-source library for connecting + Software-in-the-Loop Environments. This README is intended to provide you with + quick start on how to build the Vector SIL Kit. For documentation on using the + Vector SIL Kit, see the HTML documentation, which can be generated when + building the Vector SIL Kit (cf. Customizing the Build) and is provided in + pre-built form with the SIL Kit packages. The SIL Kit source and documentation + is licensed under a permissible open source license, see LICENSE file. For + licenses of third party dependencies, see ThirdParty/LICENSES.rst. + +Package: libsilkit4 +Architecture: any +Multi-Arch: no +Depends: ${shlibs:Depends}, ${misc:Depends}, libyaml-cpp-dev +Description: Simulation in the loop kit by Vector + The Vector SIL Kit is an open-source library for connecting + Software-in-the-Loop Environments. This README is intended to provide you with + quick start on how to build the Vector SIL Kit. For documentation on using the + Vector SIL Kit, see the HTML documentation, which can be generated when + building the Vector SIL Kit (cf. Customizing the Build) and is provided in + pre-built form with the SIL Kit packages. The SIL Kit source and documentation + is licensed under a permissible open source license, see LICENSE file. For + licenses of third party dependencies, see ThirdParty/LICENSES.rst. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..00c2a5f --- /dev/null +++ b/debian/copyright @@ -0,0 +1,36 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: silkit +Upstream-Contact: jan.kraemer@vector.com +Source: https://www.github.com/vectorgrp/sil-kit + +Files: * +Copyright: 2023 Vector Informatik GmbH +License: MIT + +Files: debian/* +Copyright: 2023 Vector Informatik GmbH +License: MIT + +License: MIT + MIT License + . + Copyright (c) 2022 Vector Informatik GmbH + . + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + . + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/debian/libsilkit-dev.cpack-components b/debian/libsilkit-dev.cpack-components new file mode 100644 index 0000000..38f8e88 --- /dev/null +++ b/debian/libsilkit-dev.cpack-components @@ -0,0 +1 @@ +dev diff --git a/debian/libsilkit4.cpack-components b/debian/libsilkit4.cpack-components new file mode 100644 index 0000000..ba077a4 --- /dev/null +++ b/debian/libsilkit4.cpack-components @@ -0,0 +1 @@ +bin diff --git a/debian/libsilkit4.manpages b/debian/libsilkit4.manpages new file mode 100644 index 0000000..ce38cc7 --- /dev/null +++ b/debian/libsilkit4.manpages @@ -0,0 +1,3 @@ +debian/sil-kit-registry.1 +debian/sil-kit-monitor.1 +debian/sil-kit-system-controller.1 diff --git a/debian/libsilkit4.silkit-registry.service b/debian/libsilkit4.silkit-registry.service new file mode 100644 index 0000000..4b1ba11 --- /dev/null +++ b/debian/libsilkit4.silkit-registry.service @@ -0,0 +1,10 @@ +[Unit] +Description="Starts the silkit-registry background service" + +[Install] +WantedBy=default.target + +[Service] +Type=simple +ExecStart=/usr/bin/sil-kit-registry -s + diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..b8efdab --- /dev/null +++ b/debian/rules @@ -0,0 +1,11 @@ +#!/usr/bin/make -f +export DH_VERBOSE = 1 + +%: + dh $@ --buildsystem=cmake+ninja + +override_dh_auto_configure: + dh_auto_configure -- -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_SOURCE=Off -DSILKIT_LINK_LLD=On -DSILKIT_BUILD_REPRODUCIBLE=Off -DSILKIT_USE_SYSTEM_LIBRARIES=On -DSILKIT_BUILD_DASHBOARD=Off + +override_dh_installsystemd: + dh_installsystemd -plibsilkit4 --name silkit-registry silkit-registry.service --no-start diff --git a/debian/sil-kit-monitor.1 b/debian/sil-kit-monitor.1 new file mode 100644 index 0000000..65b2d84 --- /dev/null +++ b/debian/sil-kit-monitor.1 @@ -0,0 +1,33 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1. +.TH sil-kit-monitor "1" "September 2023" "sil-kit-monitor" "User Commands" +.SH NAME +sil-kit-monitor \- Manual page for Vector SIL Kit - System Monitor +.SH SYNOPSIS +.B sil-kit-monitor +[\fI\,--version\/\fR] [\fI\,--help\/\fR] [\fI\,--connect-uri \/\fR] [\fI\,--name \/\fR] [\fI\,--configuration \/\fR] [\fI\,--autonomous\/\fR] [\fI\,--coordinated\/\fR] [\fI\,--sync\/\fR] +.SH DESCRIPTION +Vector SIL Kit \fB\-\-\fR System Monitor, SIL Kit version: 4.0.34. +.PP +.SH SYNOPSIS +.IP "-v --version" +Get version info. +.IP "-h --help" +Get this help. +.IP "-u --connect-uri " +The registry URI to connect to. Defaults to 'silkit://localhost:8500'. +.IP "-n --name " +The participant name used to take part in the simulation. Defaults to 'SystemMonitor'. +.IP "-c --configuration " +Path and filename of the Participant configuration YAML or JSON file. +.IP "-a --autonomous" +Run with an autonomous lifecycle. +.IP "-r --coordinated" +Run with a coordinated lifecycle. +.IP "-s --sync" +Run with virtual time synchronization. +.SH "SEE ALSO" +The full documentation for +.I sil-kit-monitor +.B Vector +is maintained at +.B https://vectorgrp.github.io/sil-kit-docs/ diff --git a/debian/sil-kit-registry.1 b/debian/sil-kit-registry.1 new file mode 100644 index 0000000..5abad9e --- /dev/null +++ b/debian/sil-kit-registry.1 @@ -0,0 +1,30 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1. +.TH sil-kit-registry 1 Sep 2023 Linux sil-kit-registry +.SH NAME +sil-kit-registry \- Manual page for Vector SIL Kit - Registry +.SH SYNOPSIS +.B sil-kit-registry +[\fI\,--version\/\fR] [\fI\,--help\/\fR] [\fI\,--use-signal-handler\/\fR] [\fI\,--listen-uri \/\fR] [\fI\,--generate-configuration \/\fR] [\fI\,--log \/\fR] [\fI\,--registry-configuration \/\fR] +.SH DESCRIPTION +Vector SIL Kit \fB\-\-\fR Registry, SIL Kit version: 4.0.34 +.PP +.SH OPTIONS +.IP "-v --version" +Get version info. +.IP "-h --help" +Get this help. +.IP "-s --use-signal-handler" +Exit this process when a signal is received. If not set, the process runs infinitely. +.IP "-u --listen-uri " +The silkit:// URI the registry should listen on. Defaults to 'silkit://localhost:8500'. +.IP "-g --generate-configuration " +Generate a configuration file which includes the URI the registry listens on. +.IP "-l --log " +Log to stdout with level 'trace', 'debug', 'warn', 'info', 'error', 'critical' or 'off'. Defaults to 'info'. +.IP "-c --registry-configuration" +The configuration read from this file overrides the values specified on the command line. +.SH "SEE ALSO" +The full documentation for +.I sil-kit-registry +is maintained at +.B https://vectorgrp.github.io/sil-kit-docs/ diff --git a/debian/sil-kit-system-controller.1 b/debian/sil-kit-system-controller.1 new file mode 100644 index 0000000..3638379 --- /dev/null +++ b/debian/sil-kit-system-controller.1 @@ -0,0 +1,31 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.1. +.TH sil-kit-system-controller "1" "September 2023" sil-kit-system-controller "User Commands" +.SH NAME +sil-kit-system-controller \- Manual page for Vector SIL Kit - System Controller +.SH SYNOPSIS +.B sil-kit-system-controller +[\fI\,--version\/\fR] [\fI\,--help\/\fR] [\fI\,--non-interactive\/\fR] [\fI\,--connect-uri \/\fR] [\fI\,--name \/\fR] [\fI\,--configuration \/\fR] \fI\, \/\fR[\fI\, \/\fR...] +.SH DESCRIPTION +Vector SIL Kit \fB\-\-\fR System Controller, SIL Kit version: 4.0.34 +.PP +Arguments: +.IP "-v --version" +Get version info. +.IP "-h --help" +Get this help. +.IP "--non-interactive" +Run without awaiting any user interactions at any time. +.IP "-u --connect-uri " +The registry URI to connect to. Defaults to 'silkit://localhost:8500'. +.IP "-n --name " +The participant name used to take part in the simulation. Defaults to 'SystemController'. +.IP "-c --configuration " +Path and filename of the Participant configuration YAML or JSON file. Note that the format was changed in v3.6.11. +.IP ", " +Names of participants to wait for before starting simulation. +.SH "SEE ALSO" +The full documentation for +.I sil-kit-system-controller +is maintained as a Texinfo manual. If the +is maintained at +.B https://vectorgrp.github.io/sil-kit-docs/ diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/scripts/run.sh b/scripts/run.sh index ea11995..b7dbe22 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -1,5 +1,43 @@ #!/bin/bash -echo "Environment Variables:" -env +set -e + +SIL_KIT_SOURCE_DIR="sil-kit" + +get_sil_kit_version_component() { + sed -n -E "s/^[[:space:]]*set[[:space:]]*[(][[:space:]]*SILKIT_VERSION_${1}[[:space:]]+([[:digit:]]+)[[:space:]]*[)].*$/\1/p" "${SIL_KIT_SOURCE_DIR}/SilKit/cmake/SilKitVersion.cmake" +} + +SIL_KIT_MAJOR="$(get_sil_kit_version_component MAJOR)" +SIL_KIT_MINOR="$(get_sil_kit_version_component MINOR)" +SIL_KIT_PATCH="$(get_sil_kit_version_component PATCH)" + +SIL_KIT_PACKAGE_NAME="libsilkit_${SIL_KIT_MAJOR}.${SIL_KIT_MINOR}.${SIL_KIT_PATCH}" + +rm -rf "${SIL_KIT_SOURCE_DIR}/debian" +cp -r debian "${SIL_KIT_SOURCE_DIR}/debian" + +sed -i \ + -e "s/SIL_KIT_MAJOR/${SIL_KIT_MAJOR}/g" \ + -e "s/SIL_KIT_MINOR/${SIL_KIT_MINOR}/g" \ + -e "s/SIL_KIT_PATCH/${SIL_KIT_PATCH}/g" \ + "${SIL_KIT_SOURCE_DIR}/debian/changelog" + + +# echo "-- creating source tarball" +tar -cva -C "${SIL_KIT_SOURCE_DIR}" -f "libsilkit_${SIL_KIT_MAJOR}.${SIL_KIT_MINOR}.${SIL_KIT_PATCH}.orig.tar.gz" . + +# echo "-- dh_make" +# dh_make --packagename "${SIL_KIT_PACKAGE_NAME}" --library --createorig --yes + +cd "${SIL_KIT_SOURCE_DIR}" + +ls -l . +ls -l .. + +echo "-- debuild" +debuild -us -uc + +ls -l . +ls -l ..