diff --git a/CMakeLists.txt b/CMakeLists.txt index 062ef89d4..9a798303d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ cmake_minimum_required(VERSION 3.14) project(villas-node VERSION 1.0.1 - DESCRIPTION "VILLASnode" + DESCRIPTION "Open-Source Real-time Multi-protocol Gateway" HOMEPAGE_URL "https://www.fein-aachen.org/projects/villas-node/" LANGUAGES C CXX ) @@ -48,7 +48,6 @@ include(FindPkgConfig) include(CheckIncludeFile) include(FeatureSummary) include(GNUInstallDirs) -include(GetVersion) include(FindSymbol) include(CMakeDependentOption) @@ -77,6 +76,7 @@ find_package(LibDataChannel) find_package(re) find_package(OpenDSSC) find_package(FileSystem) +find_package(Criterion) # Check for tools find_program(PROTOBUFC_COMPILER NAMES protoc-c) @@ -237,9 +237,6 @@ if(WITH_GHC_FS) include_directories($) endif() -# Get version info and buildid from Git -GetVersion(${PROJECT_SOURCE_DIR} "CMAKE_PROJECT") - if(WITH_FPGA) add_subdirectory(fpga) endif() @@ -324,19 +321,11 @@ add_feature_info(NODE_ZEROMQ WITH_NODE_ZEROMQ "Build with if(TOPLEVEL_PROJECT) feature_summary(WHAT ALL VAR FEATURES) - message(STATUS "Building ${CMAKE_PROJECT_DESCRIPTION}:") + message(STATUS "Building ${PROJECT_NAME}:") message(STATUS "${FEATURES}") - if(FOUND_GIT_VERSION) - message(STATUS " VERSION: ${CMAKE_PROJECT_VERSION}") - message(STATUS " RELEASE: ${CMAKE_PROJECT_RELEASE}") - message(STATUS " GIT_REV: ${CMAKE_PROJECT_GIT_REV}") - message(STATUS " GIT_BRANCH: ${CMAKE_PROJECT_GIT_BRANCH}") - message(STATUS " VARIANT: ${CMAKE_PROJECT_VARIANT}") - message(STATUS " BUILD_ID: ${CMAKE_PROJECT_BUILD_ID}") - message(STATUS " BUILD_DATE: ${CMAKE_PROJECT_BUILD_DATE}") - endif() + message(STATUS " VERSION: ${CMAKE_PROJECT_VERSION}") message(STATUS " ARCH: ${CMAKE_SYSTEM_PROCESSOR}") message(STATUS " OS: ${CMAKE_SYSTEM_NAME}") endif() diff --git a/README.md b/README.md index 3e20b0a60..618866719 100644 --- a/README.md +++ b/README.md @@ -50,10 +50,9 @@ For attribution, please refer to the SPDX headers in each file. The [Apache 2.0 license](./LICENSE) covers most of the codebase and is preferred for new contributions. License compliance is automatically checked in CI, including validation of licenses in the `LICENSES/` directory. -We kindly ask all academic publications employing components of VILLASframework to cite one of the following papers: +We kindly ask all academic publications employing components of VILLASframework to cite one of the following paper: -- A. Monti et al., "[A Global Real-Time Superlab: Enabling High Penetration of Power Electronics in the Electric Grid](https://ieeexplore.ieee.org/document/8458285/)," in IEEE Power Electronics Magazine, vol. 5, no. 3, pp. 35-44, Sept. 2018. -- S. Vogel, M. Mirz, L. Razik and A. Monti, "[An open solution for next-generation real-time power system simulation](http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=8245739&isnumber=8244404)," 2017 IEEE Conference on Energy Internet and Energy System Integration (EI2), Beijing, 2017, pp. 1-6. +- S. Vogel, N. Eiling, M. Pitz, A. Bach, M. Stevic, and P. A. Monti, “VILLASnode: An Open-Source Real-time Multi-protocol Gateway,” Journal of Open Source Software, vol. 10, no. 112, p. 8401, Aug. 2025, doi: [10.21105/joss.08401](https://doi.org/10.21105/joss.08401). For other licensing options please consult [Prof. Antonello Monti](mailto:amonti@eonerc.rwth-aachen.de). diff --git a/cmake/GetVersion.cmake b/cmake/GetVersion.cmake deleted file mode 100644 index 9fdc6f71f..000000000 --- a/cmake/GetVersion.cmake +++ /dev/null @@ -1,105 +0,0 @@ -# CMakeLists.txt. -# -# Author: Steffen Vogel -# SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University -# SPDX-License-Identifier: Apache-2.0 -# -# VILLASnode - - -# This CMake function sets the following variables: -# -# ${PREFIX}_VERSION_STR v0.6.3 -# ${PREFIX}_VERSION 0.6.3 -# ${PREFIX}_MAJOR_VERSION 0 -# ${PREFIX}_MINOR_VERSION 6 -# ${PREFIX}_PATCH_VERSION 3 -# ${PREFIX}_RELEASE 1.ci_tests_release.20180823git1cd25c2f -# ${PREFIX}_GIT_REV 1cd25c2f -# ${PREFIX}_GIT_BRANCH ci-tests -# ${PREFIX}_GIT_BRANCH_NORM ci_tests -# ${PREFIX}_VARIANT release -# ${PREFIX}_VARIANT_NORM release -# ${PREFIX}_BUILD_ID v0.6.3-1cd25c2f-release -# ${PREFIX}_BUILD_DATE 20180823 - -function(GetVersion DIR PREFIX) - execute_process( - COMMAND git describe --tags --abbrev=0 --match "v*" - WORKING_DIRECTORY ${DIR} - OUTPUT_VARIABLE VERSION_STR - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_QUIET - RESULT_VARIABLE RC - ) - - if(NOT RC EQUAL 0) - set(FOUND_GIT_VERSION OFF PARENT_SCOPE) - message(WARNING - "Failed to retrieve version information from Git. " - "Make sure that the source directory is a Git repo and " - "contains at least one valid tag like 'v0.1.0'" - ) - else() - set(FOUND_GIT_VERSION ON PARENT_SCOPE) - - string(REGEX REPLACE "^v([0-9]+\\.[0-9]+\\.[0-9]+)$" "\\1" VERSION ${VERSION_STR}) - string(REGEX REPLACE "^v([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\1" MAJOR_VERSION ${VERSION_STR}) - string(REGEX REPLACE "^v([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\2" MINOR_VERSION ${VERSION_STR}) - string(REGEX REPLACE "^v([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\3" PATCH_VERSION ${VERSION_STR}) - - string(TIMESTAMP BUILD_DATE "%Y%m%d") - - if(CMAKE_BUILD_TYPE) - string(TOLOWER "${CMAKE_BUILD_TYPE}" VARIANT) - else() - set(VARIANT "release") - endif() - - if(DEFINED ENV{CI}) - string(APPEND VARIANT "-ci") - string(SUBSTRING $ENV{CI_COMMIT_SHA} 0 7 GIT_REV) - set(GIT_BRANCH $ENV{CI_COMMIT_REF_NAME}) - else() - execute_process( - COMMAND git rev-parse --short=7 HEAD - WORKING_DIRECTORY ${DIR} - OUTPUT_VARIABLE GIT_REV - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - - execute_process( - COMMAND git rev-parse --abbrev-ref HEAD - WORKING_DIRECTORY ${DIR} - OUTPUT_VARIABLE GIT_BRANCH - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - endif() - - if(DEFINED ENV{CI_COMMIT_TAG}) - set(RELEASE 1) - else() - string(REPLACE "-" "_" GIT_BRANCH_NORM ${GIT_BRANCH}) - string(REPLACE "-" "_" VARIANT_NORM ${VARIANT}) - - set(RELEASE "1.${GIT_BRANCH_NORM}_${VARIANT_NORM}.${BUILD_DATE}git${GIT_REV}") - endif() - - set(BUILD_ID "v${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}-${GIT_REV}-${VARIANT}" ) - - # Return results to parent scope - set(${PREFIX}_VERSION_STR ${VERSION_STR} PARENT_SCOPE) - set(${PREFIX}_VERSION ${VERSION} PARENT_SCOPE) - set(${PREFIX}_MAJOR_VERSION ${MAJOR_VERSION} PARENT_SCOPE) - set(${PREFIX}_MINOR_VERSION ${MINOR_VERSION} PARENT_SCOPE) - set(${PREFIX}_PATCH_VERSION ${PATCH_VERSION} PARENT_SCOPE) - set(${PREFIX}_RELEASE ${RELEASE} PARENT_SCOPE) - set(${PREFIX}_GIT_REV ${GIT_REV} PARENT_SCOPE) - set(${PREFIX}_GIT_BRANCH ${GIT_BRANCH} PARENT_SCOPE) - set(${PREFIX}_GIT_BRANCH_NORM ${GIT_BRANCH_NORM} PARENT_SCOPE) - set(${PREFIX}_VARIANT ${VARIANT} PARENT_SCOPE) - set(${PREFIX}_VARIANT_NORM ${VARIANT_NORM} PARENT_SCOPE) - set(${PREFIX}_BUILD_ID ${BUILD_ID} PARENT_SCOPE) - set(${PREFIX}_BUILD_DATE ${BUILD_DATE} PARENT_SCOPE) - endif() -endfunction(GetVersion) diff --git a/cmake/VILLASnodePackaging.cmake b/cmake/VILLASnodePackaging.cmake index 57fbe67e8..f6e4de349 100644 --- a/cmake/VILLASnodePackaging.cmake +++ b/cmake/VILLASnodePackaging.cmake @@ -10,15 +10,9 @@ list(REMOVE_ITEM CPACK_COMPONENTS_ALL "Unspecified") set(CPACK_BUILD_SOURCE_DIRS ${PROJECT_SOURCE_DIR}/src;${PROJECT_SOURCE_DIR}/lib;${PROJECT_SOURCE_DIR}/include) -set(CPACK_PACKAGE_NAME "villas-node") set(CPACK_PACKAGE_VENDOR ${PROJECT_AUTHOR}) -set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Connecting real-time power grid simulation equipment") -set(CPACK_PACKAGE_VERSION ${CMAKE_PROJECT_VERSION}) -set(CPACK_PACKAGE_VERSION_MAJOR ${CMAKE_PROJECT_MAJOR_VERSION}) -set(CPACK_PACKAGE_VERSION_MINOR ${CMAKE_PROJECT_MINOR_VERSION}) -set(CPACK_PACKAGE_VERSION_PATCH ${CMAKE_PROJECT_PATCH_VERSION}) -set(CPACK_RPM_PACKAGE_RELEASE ${CMAKE_PROJECT_RELEASE}) +set(CPACK_RPM_PACKAGE_RELEASE ${CMAKE_PROJECT_VERSION_TWEAK}) set(CPACK_RPM_PACKAGE_ARCHITECTURE "x86_64") set(CPACK_RPM_COMPONENT_INSTALL ON) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 709017938..f794a6950 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -13,7 +13,6 @@ find_package(OpenSSL 1.0.0 REQUIRED) find_package(CURL 7.29 REQUIRED) find_package(spdlog 1.6.0 REQUIRED) find_package(fmt 6.0.0 REQUIRED) -find_package(Criterion) pkg_check_modules(JANSSON IMPORTED_TARGET REQUIRED jansson>=2.7) pkg_check_modules(LIBCONFIG IMPORTED_TARGET libconfig>=1.4.9) diff --git a/common/include/villas/config.hpp.in b/common/include/villas/config.hpp.in index 0567d5df0..8babceb18 100644 --- a/common/include/villas/config.hpp.in +++ b/common/include/villas/config.hpp.in @@ -12,24 +12,11 @@ // clang-format off -#define PROJECT_VERSION_STR "@CMAKE_PROJECT_VERSION_STR@" #define PROJECT_VERSION "@CMAKE_PROJECT_VERSION@" -#define PROJECT_MAJOR_VERSION @CMAKE_PROJECT_MAJOR_VERSION@ -#define PROJECT_MINOR_VERSION @CMAKE_PROJECT_MINOR_VERSION@ -#define PROJECT_PATCH_VERSION @CMAKE_PROJECT_PATCH_VERSION@ -#define PROJECT_RELEASE "@CMAKE_PROJECT_RELEASE@" -#define PROJECT_GIT_REV "@CMAKE_PROJECT_GIT_REV@" -#define PROJECT_GIT_BRANCH "@CMAKE_PROJECT_GIT_BRANCH@" -#define PROJECT_GIT_BRANCH_NORM "@CMAKE_PROJECT_GIT_BRANCH_NORM@" -#define PROJECT_VARIANT "@CMAKE_PROJECT_VARIANT@" -#define PROJECT_VARIANT_NORM "@CMAKE_PROJECT_VARIANT_NORM@" -#define PROJECT_BUILD_ID "@CMAKE_PROJECT_BUILD_ID@" -#define PROJECT_BUILD_DATE "@CMAKE_PROJECT_BUILD_DATE@" - +#define PROJECT_NAME "@CMAKE_PROJECT_NAME@" #define PROJECT_HOMEPAGE_URL "@CMAKE_PROJECT_HOMEPAGE_URL@" -#define PROJECT_NAME "@CMAKE_PROJECT_DESCRIPTION@" -#define HTTP_USER_AGENT PROJECT_NAME " (" PROJECT_BUILD_ID ")" +#define HTTP_USER_AGENT PROJECT_NAME " (" PROJECT_VERSION ")" // Hard-coded cache line size #if defined(__x86_64__) || defined(__i386__) || defined(__arm__) || \ diff --git a/common/lib/tool.cpp b/common/lib/tool.cpp index 19e6a481e..d00992d52 100644 --- a/common/lib/tool.cpp +++ b/common/lib/tool.cpp @@ -18,7 +18,7 @@ void Tool::staticHandler(int signal, siginfo_t *sinfo, void *ctx) { void Tool::printCopyright() { // cppcheck-suppress unknownMacro - std::cout << PROJECT_NAME " " << CLR_BLU(PROJECT_BUILD_ID) + std::cout << PROJECT_NAME " " << CLR_BLU(PROJECT_VERSION) << " (built on " CLR_MAG(__DATE__) " " CLR_MAG(__TIME__) ")" << std::endl << " Copyright 2014-2025 The VILLASframework Authors" << std::endl @@ -26,7 +26,7 @@ void Tool::printCopyright() { } // cppcheck-suppress unknownMacro -void Tool::printVersion() { std::cout << PROJECT_BUILD_ID << std::endl; } +void Tool::printVersion() { std::cout << PROJECT_VERSION << std::endl; } Tool::Tool(int ac, char *av[], const std::string &nme, const std::list &sigs) @@ -41,7 +41,7 @@ int Tool::run() { int ret; logger->info("This is VILLASnode {} (built on {}, {})", - CLR_BLD(CLR_YEL(PROJECT_BUILD_ID)), CLR_BLD(CLR_MAG(__DATE__)), + CLR_BLD(CLR_YEL(PROJECT_VERSION)), CLR_BLD(CLR_MAG(__DATE__)), CLR_BLD(CLR_MAG(__TIME__))); ret = utils::signalsInit(staticHandler, handlerSignals); diff --git a/fpga/CMakeLists.txt b/fpga/CMakeLists.txt index a665d2c50..59c747a4c 100644 --- a/fpga/CMakeLists.txt +++ b/fpga/CMakeLists.txt @@ -4,15 +4,6 @@ # SPDX-FileCopyrightText: 2018 Institute for Automation of Complex Power Systems, RWTH Aachen University # SPDX-License-Identifier: Apache-2.0 -include(FindPkgConfig) - -set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/local/share/pkgconfig:/usr/lib64/pkgconfig") - -pkg_check_modules(JANSSON REQUIRED IMPORTED_TARGET jansson) - -find_package(Threads) -find_package(Criterion) - include_directories(thirdparty/CLI11) include_directories(thirdparty/rang) @@ -23,23 +14,3 @@ add_subdirectory(src) if(CRITERION_FOUND) add_subdirectory(tests/unit) endif() - -# Project settings -set(PROJECT_NAME "VILLASfpga") -set(PROJECT_DESCRIPTION "Host library for configuring and communicating with VILLASfpga") -set(PROJECT_VENDOR "Institute for Automation of Complex Power Systems, RWTH Aachen University") -set(PROJECT_URL "https://www.fein-aachen.org/projects/villas-fpga/") -set(PROJECT_VERSION_MAJOR "0") -set(PROJECT_VERSION_MINOR "1") -set(PROJECT_VERSION_PATCH "0") -set(PROJECT_RELEASE "1") - -# pkg-config -configure_file("libvillas-fpga.pc.in" "libvillas-fpga.pc" @ONLY) -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libvillas-fpga.pc" DESTINATION "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig") - -# As close as possible to Fedoras naming -set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_RPM_PACKAGE_RELEASE}.${CPACK_RPM_PACKAGE_ARCHITECTURE}") - -set(CPACK_GENERATOR "RPM") -include(CPack) diff --git a/fpga/libvillas-fpga.pc.in b/fpga/libvillas-fpga.pc.in deleted file mode 100644 index a837c35cd..000000000 --- a/fpga/libvillas-fpga.pc.in +++ /dev/null @@ -1,13 +0,0 @@ -# SPDX-FileCopyrightText: 2017 Institute for Automation of Complex Power Systems, RWTH Aachen University -# SPDX-License-Identifier: Apache-2.0 - -prefix=@CMAKE_INSTALL_PREFIX@ -exec_prefix=${prefix} -includedir=${prefix}/include -libdir=${exec_prefix}/lib - -Name: @PROJECT_NAME@ -Description: @CPACK_PACKAGE_DESCRIPTION_SUMMARY@ -URL: @PROJECT_URL@ -Version: @PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_PATCH@ -Cflags: -I${includedir} diff --git a/lib/api/requests/status.cpp b/lib/api/requests/status.cpp index a97b5d5f2..3189f19b7 100644 --- a/lib/api/requests/status.cpp +++ b/lib/api/requests/status.cpp @@ -63,31 +63,60 @@ class StatusRequest : public Request { json_error_t err; json_t *json_status = json_pack_ex( &err, 0, - "{ s: s, s: s, s: s, s: s, s: s, s: s, s: s, s: f, s: f, s: { s: s, s: " - "I, s: b }, s: { s: s, s: s, s: s, s: s, s: s, s: s}, s: { s: i, s: i, " - "s: I, s: I, s: [ f, f, f ], s: { s: I, s, I, s: I, s: I }, s: { s: I, " - "s: I }, s: { s: I, s: I } } }", - "state", stateToString(sn->getState()).c_str(), "version", - PROJECT_VERSION_STR, "release", PROJECT_RELEASE, "build_id", - PROJECT_BUILD_ID, "build_date", PROJECT_BUILD_DATE, "hostname", hname, - "uuid", uuid::toString(sn->getUuid()).c_str(), "time_now", - time_to_double(&now), "time_started", time_to_double(&started), - "timezone", "name", tzname[daylight], "offset", (json_int_t)timezone, - "dst", daylight, "kernel", "sysname", uts.sysname, "nodename", - uts.nodename, "release", uts.release, "version", uts.version, "machine", - uts.machine, "domainname", uts.domainname, "system", "cores_configured", - get_nprocs_conf(), "cores", get_nprocs(), "processes", - (json_int_t)sinfo.procs, "uptime", (json_int_t)sinfo.uptime, "load", - f_load * sinfo.loads[0], f_load * sinfo.loads[1], - f_load * sinfo.loads[2], "ram", "total", - (json_int_t)(sinfo.totalram * sinfo.mem_unit), "free", - (json_int_t)(sinfo.freeram * sinfo.mem_unit), "shared", - (json_int_t)(sinfo.sharedram * sinfo.mem_unit), "buffer", - (json_int_t)(sinfo.bufferram * sinfo.mem_unit), "swap", "total", - (json_int_t)(sinfo.totalswap * sinfo.mem_unit), "free", - (json_int_t)(sinfo.freeswap * sinfo.mem_unit), "highmem", "total", - (json_int_t)(sinfo.totalhigh * sinfo.mem_unit), "free", - (json_int_t)(sinfo.freehigh * sinfo.mem_unit)); + "{" + "s: s, s: s, s: s, s: s, s: f, s: f," + /* timezone */ "s: { s: s, s: I, s: b }," + /* kernel */ "s: { s: s, s: s, s: s, s: s, s: s, s: s}," + /* system */ "s: { s: i, s: i, s: I, s: I," + /* system load */ "s: [ f, f, f ]," + /* system ram */ "s: { s: I, s, I, s: I, s: I }," + /* system swap */ "s: { s: I, s: I }," + /* system highmem */ "s: { s: I, s: I }}}", // + + "state", stateToString(sn->getState()).c_str(), // + "version", PROJECT_VERSION, // + "hostname", hname, // + "uuid", uuid::toString(sn->getUuid()).c_str(), // + "time_now", time_to_double(&now), // + "time_started", time_to_double(&started), // + + "timezone", // + "name", tzname[daylight], // + "offset", (json_int_t)timezone, // + "dst", daylight, // + + "kernel", // + "sysname", uts.sysname, // + "nodename", uts.nodename, // + "release", uts.release, // + "version", uts.version, // + "machine", uts.machine, // + "domainname", uts.domainname, // + + "system", // + "cores_configured", get_nprocs_conf(), // + "cores", get_nprocs(), // + "processes", (json_int_t)sinfo.procs, // + "uptime", (json_int_t)sinfo.uptime, // + + /* system */ "load", // + f_load * sinfo.loads[0], // + f_load * sinfo.loads[1], // + f_load * sinfo.loads[2], // + + /* system */ "ram", // + "total", (json_int_t)(sinfo.totalram * sinfo.mem_unit), // + "free", (json_int_t)(sinfo.freeram * sinfo.mem_unit), // + "shared", (json_int_t)(sinfo.sharedram * sinfo.mem_unit), // + "buffer", (json_int_t)(sinfo.bufferram * sinfo.mem_unit), // + + /* system */ "swap", // + "total", (json_int_t)(sinfo.totalswap * sinfo.mem_unit), // + "free", (json_int_t)(sinfo.freeswap * sinfo.mem_unit), // + + /* system */ "highmem", // + "total", (json_int_t)(sinfo.totalhigh * sinfo.mem_unit), // + "free", (json_int_t)(sinfo.freehigh * sinfo.mem_unit)); if (!json_status) throw Error(HTTP_STATUS_INTERNAL_SERVER_ERROR, "Failed to prepare response: {}", err.text); diff --git a/lib/api/requests/universal/info.cpp b/lib/api/requests/universal/info.cpp index bacd52dab..976cbae19 100644 --- a/lib/api/requests/universal/info.cpp +++ b/lib/api/requests/universal/info.cpp @@ -26,12 +26,13 @@ class InfoRequest : public UniversalRequest { if (body != nullptr) throw BadRequest("This endpoint does not accept any body data"); - auto *info = json_pack("{ s: s, s: s, s: { s: s, s: s, s: s } }", "id", - node->getNameShort().c_str(), "uuid", - uuid::toString(node->getUuid()).c_str(), + auto *info = json_pack("{ s: s, s: s, s: { s: s, s: s } }", // + "id", node->getNameShort().c_str(), // + "uuid", uuid::toString(node->getUuid()).c_str(), - "transport", "type", "villas", "version", - PROJECT_VERSION, "build", PROJECT_BUILD_ID); + "transport", // + "type", "villas", // + "version", PROJECT_VERSION); return new JsonResponse(session, HTTP_STATUS_OK, info); } diff --git a/packaging/docker/Dockerfile.rocky b/packaging/docker/Dockerfile.rocky index 9a21e3746..67a4ba0f3 100644 --- a/packaging/docker/Dockerfile.rocky +++ b/packaging/docker/Dockerfile.rocky @@ -4,8 +4,9 @@ # SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University # SPDX-License-Identifier: Apache-2.0 -ARG DISTRO=rockylinux -ARG ROCKY_VERSION=9.3 +ARG DISTRO=quay.io/rockylinux/rockylinux +ARG ROCKY_VERSION=10.0 +ARG CMAKE_OPTS="" FROM ${DISTRO}:${ROCKY_VERSION} AS dev @@ -13,7 +14,7 @@ ARG DISTRO USER root -# Enable Extra Packages for Enterprise Linux (EPEL) repo and PowerTools +# Enable Extra Packages for Enterprise Linux (EPEL) and CRB (CodeReady Builder) repository RUN dnf -y install epel-release dnf-plugins-core RUN dnf config-manager --set-enabled crb @@ -22,6 +23,7 @@ RUN dnf --allowerasing -y install \ gcc gcc-c++ \ pkgconfig cmake make \ autoconf automake libtool \ + meson ninja-build \ flex bison \ texinfo git git-svn curl tar patchutils \ protobuf-compiler protobuf-c-compiler \ @@ -29,26 +31,28 @@ RUN dnf --allowerasing -y install \ # Dependencies RUN dnf -y install \ - openssl-devel \ + fmt-devel \ graphviz-devel \ - protobuf-devel \ - protobuf-c-devel \ - libuuid-devel \ + hiredis-devel \ + jansson-devel \ libconfig-devel \ - libnl3-devel \ libcurl-devel \ - jansson-devel \ - zeromq-devel \ + libibverbs-devel \ + libnice-devel \ + libnl3-devel \ librabbitmq-devel \ - mosquitto-devel \ librdkafka-devel \ - libibverbs-devel \ librdmacm-devel \ libusb1-devel \ + libuuid-devel \ + libwebsockets-devel \ lua-devel \ - hiredis-devel \ - libnice-devel \ - libmodbus-devel + mosquitto-devel \ + openssl-devel \ + protobuf-c-devel \ + protobuf-devel \ + spdlog-devel \ + zeromq-devel # Install unpackaged dependencies from source ADD packaging/patches /deps/patches diff --git a/packaging/libvillas.pc.in b/packaging/libvillas.pc.in index f1a9a2573..65a622cf4 100644 --- a/packaging/libvillas.pc.in +++ b/packaging/libvillas.pc.in @@ -6,9 +6,9 @@ libdir=@CMAKE_INSTALL_LIBDIR@ sharedlibdir=@CMAKE_INSTALL_LIBDIR@ includedir=@CMAKE_INSTALL_INCLUDEDIR@ -Name: @PROJECT_NAME@ -Description: @PROJECT_DESCRIPTION@ -Version: @PROJECT_VERSION@ +Name: @CMAKE_PROJECT_NAME@ +Description: @CMAKE_PROJECT_DESCRIPTION@ +Version: @CMAKE_PROJECT_VERSION@ Requires: Libs: -L${libdir} -L${sharedlibdir} -lz diff --git a/packaging/nix/patches.nix b/packaging/nix/patches.nix index 6df227b45..72f04359a 100644 --- a/packaging/nix/patches.nix +++ b/packaging/nix/patches.nix @@ -4,23 +4,20 @@ # This overlay contains patches to dependencies of villas-node. # It is only guaranteed to work for the locked version of nixpkgs, # future updates to upstream nixpkgs may make these obsolete. -final: prev: let +final: prev: +let inherit (final) lib; -in { +in +{ libiec61850 = prev.libiec61850.overrideAttrs { patches = [ ./libiec61850_debug_r_session.patch ]; - cmakeFlags = (prev.cmakeFlags or []) ++ [ + cmakeFlags = (prev.cmakeFlags or [ ]) ++ [ "-DCONFIG_USE_EXTERNAL_MBEDTLS_DYNLIB=ON" "-DCONFIG_EXTERNAL_MBEDTLS_DYNLIB_PATH=${final.mbedtls}/lib" "-DCONFIG_EXTERNAL_MBEDTLS_INCLUDE_PATH=${final.mbedtls}/include" ]; - nativeBuildInputs = (prev.nativeBuildInputs or []) ++ [ final.buildPackages.cmake ]; + nativeBuildInputs = (prev.nativeBuildInputs or [ ]) ++ [ final.buildPackages.cmake ]; buildInputs = [ final.mbedtls ]; separateDebugInfo = true; }; - - lib60870 = prev.lib60870.overrideAttrs { - buildInputs = [ final.mbedtls ]; - cmakeFlags = [ (lib.cmakeBool "WITH_MBEDTLS3" true) ]; - }; } diff --git a/packaging/nix/reverse-struct-group.patch b/packaging/nix/reverse-struct-group.patch deleted file mode 100644 index b05ec0d5b..000000000 --- a/packaging/nix/reverse-struct-group.patch +++ /dev/null @@ -1,32 +0,0 @@ -# SPDX-FileCopyrightText: 2025, OPAL-RT Germany GmbH -# SPDX-License-Identifier: Apache-2.0 ---- b/include/linux/pkt_cls.h -+++ a/include/linux/pkt_cls.h -@@ -246,19 +246,16 @@ - }; - struct tc_u32_sel { -+ unsigned char flags; -+ unsigned char offshift; -+ unsigned char nkeys; -+ -+ __be16 offmask; -+ __u16 off; -+ short offoff; -+ -+ short hoff; -+ __be32 hmask; -- /* New members MUST be added within the __struct_group() macro below. */ -- __struct_group(tc_u32_sel_hdr, hdr, /* no attrs */, -- unsigned char flags; -- unsigned char offshift; -- unsigned char nkeys; -- -- __be16 offmask; -- __u16 off; -- short offoff; -- -- short hoff; -- __be32 hmask; -- ); - struct tc_u32_key keys[]; - }; diff --git a/packaging/nix/villas.nix b/packaging/nix/villas.nix index bad541caf..d87f7dcad 100644 --- a/packaging/nix/villas.nix +++ b/packaging/nix/villas.nix @@ -48,16 +48,19 @@ stdenv, system, # Optional dependencies + boxfort, comedilib, criterion, curl, czmq, + cyrus_sasl, ethercat, gnugrep, jansson, lib60870, libconfig, libdatachannel, + libffi, libiec61850, libgit2, libmodbus, @@ -147,7 +150,13 @@ stdenv.mkDerivation { spdlog bash ] - ++ lib.optionals withExtraTesting [ criterion pcre2 libgit2 ] + ++ lib.optionals withExtraTesting [ + boxfort + criterion + libffi + libgit2 + pcre2 + ] ++ lib.optionals withExtraGraphviz [ graphviz ] ++ lib.optionals withHookLua [ lua ] ++ lib.optionals withNodeAmqp [ rabbitmq-c ] @@ -155,7 +164,10 @@ stdenv.mkDerivation { ++ lib.optionals withNodeEthercat [ ethercat ] ++ lib.optionals withNodeIec60870 [ lib60870 ] ++ lib.optionals withNodeIec61850 [ libiec61850 ] - ++ lib.optionals withNodeKafka [ rdkafka ] + ++ lib.optionals withNodeKafka [ + rdkafka + cyrus_sasl + ] ++ lib.optionals withNodeModbus [ libmodbus ] ++ lib.optionals withNodeMqtt [ mosquitto ] ++ lib.optionals withNodeNanomsg [ nanomsg ] @@ -183,13 +195,6 @@ stdenv.mkDerivation { ++ lib.optionals withNodeInfiniband [ rdma-core ] ++ lib.optionals withExtraConfig [ libconfig ]; - # TODO: Remove once pkgs.linuxHeaders has been upgrade to 6.14 - preBuild = '' - mkdir -p include/linux - cp ${linuxHeaders}/include/linux/pkt_cls.h include/linux - patch -F10 -u -p1 < ${./reverse-struct-group.patch} - ''; - meta = { mainProgram = "villas"; description = "a tool connecting real-time power grid simulation equipment"; diff --git a/python/pyproject.toml b/python/pyproject.toml index 079186e8b..882af94cf 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -22,7 +22,7 @@ classifiers = [ dependencies = [ 'linuxfd==1.5; platform_system=="Linux"', 'requests==2.32.3', - 'protobuf==6.30.2', + 'protobuf==6.31.1', ] optional-dependencies.dev = [ 'black==25.1.0', diff --git a/python/villas/node/villas_pb2.py b/python/villas/node/villas_pb2.py index 13793bf80..a3aa59453 100644 --- a/python/villas/node/villas_pb2.py +++ b/python/villas/node/villas_pb2.py @@ -2,7 +2,7 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: villas.proto -# Protobuf Python Version: 5.29.3 +# Protobuf Python Version: 6.31.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -11,9 +11,9 @@ from google.protobuf.internal import builder as _builder _runtime_version.ValidateProtobufRuntimeVersion( _runtime_version.Domain.PUBLIC, - 5, - 29, - 3, + 6, + 31, + 1, '', 'villas.proto' ) diff --git a/src/villas-relay.cpp b/src/villas-relay.cpp index f02313024..c4f29bed2 100644 --- a/src/villas-relay.cpp +++ b/src/villas-relay.cpp @@ -258,11 +258,14 @@ int Relay::httpProtocolCallback(lws *wsi, enum lws_callback_reasons reason, } json_body = json_pack("{ s: o, s: s, s: s, s: s, s: { s: b, s: i, s: s } }", - "sessions", json_sessions, "version", - PROJECT_VERSION_STR, "hostname", r->hostname.c_str(), - "uuid", uuid::toString(r->uuid).c_str(), "options", - "loopback", r->loopback, "port", r->port, "protocol", - r->protocol.c_str()); + "sessions", json_sessions, // + "version", PROJECT_VERSION, // + "hostname", r->hostname.c_str(), // + "uuid", uuid::toString(r->uuid).c_str(), // + + "options", "loopback", r->loopback, // + "port", r->port, // + "protocol", r->protocol.c_str()); if (!json_body) return -1;