Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release version 1.2.0 #33

Merged
merged 16 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ env:
jobs:

build_version:
runs-on: ubuntu-latest
#runs-on: ubuntu-latest
runs-on: [self-hosted, Linux, X64]

outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Get tag version
id : version
Expand All @@ -33,7 +34,8 @@ jobs:
fi

build:
runs-on: ubuntu-latest
#runs-on: ubuntu-latest
runs-on: [self-hosted, Linux, X64]
needs: build_version
strategy:
fail-fast: false # continues with matrix even if an element fails
Expand All @@ -45,7 +47,7 @@ jobs:
steps:

- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ needs.build_version.outputs.version }}
Expand All @@ -55,10 +57,10 @@ jobs:

- name: Build
# Build your program with the given configuration
run: cmake --build /build --config ${{ env.BUILD_TYPE }}
run: cmake --build /build --config ${{ env.BUILD_TYPE }} -- -j$(nproc)

- name: Upload build artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ github.event_name == 'release' }}
with:
name: ${{ env.MODULE }}.${{ matrix.architecture }}
Expand All @@ -70,7 +72,8 @@ jobs:

upload_to_release: # when tag is created
if: ${{ github.event_name == 'release' }}
runs-on: ubuntu-latest
#runs-on: ubuntu-latest
runs-on: [self-hosted, Linux, X64]
needs: [build_version, build]
strategy:
fail-fast: false # continues with matrix even if an element fails
Expand All @@ -80,7 +83,7 @@ jobs:
steps:

- name: Download ${{ matrix.architecture }} binary
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ env.MODULE }}.${{ matrix.architecture }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
release:
runs-on: ubuntu-latest
runs-on: [self-hosted, Linux, X64]

steps:

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
build:
name: Build
runs-on: ubuntu-22.04
#runs-on: [self-hosted, Linux, X64]
env:
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
steps:
Expand Down
49 changes: 49 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,59 @@
# Changelog
All notable changes to this project will be documented in this file.

## [1.2.0] - 2024-06-18

### Changed

- Concern separation for metrics retrieval
- Updated to thinger-iotmp 1.3.0
- Cmd resource now based on thinger-iotmp
- Removed reboot and update resources

### Fix

- Removed 'new' pointer for buffer in S3 upload parts

## [1.1.0] - 2023-10-04

### Changed

- Mongodb backup is compressed in gzip by default
- Influxdb and mongodb backups are created in default mounted directory of container

### Removed

- Backup of influxdb v1 is no longer needed

## [1.0.0] - 2023-08-22

### Changed

- Set thinger-iotmp dependency as production version 1.1.0

## [0.0.9] - 2023-07-18

### Fix

- Format logs before calling log macro
- Don't fail when backing up and restoring plugins without docker images

## [0.0.8] - 2023-06-26

### Fix

- Auto provisioning of servers when hostname is less than 32 chars

## [0.0.7] - 2023-05-30

### Added

- Added verbosity level (up to 3) as parameter option
- New network resources: network total speed and network total data transfer
- Monitor resource is accessible through localhost endpoint

### Changed

- Connection to Thinger Console is done through IOTMP protocol
- Renamed `nw_default_total_incoming` to `nw_default_transfer_incoming`
- Renamed `nw_default_total_outgoing` to `nw_default_transfer_outgoing`
Expand All @@ -39,6 +64,7 @@ All notable changes to this project will be documented in this file.
- No direct calls to spdlog, instead it call the IOTMP LOG macros

### Fix

- Network speed was not reporting correctly
- Network data transfer not reporting decimals
- Network, filesystem and drive stats on first retrieval are not real
Expand All @@ -47,26 +73,33 @@ All notable changes to this project will be documented in this file.
- Add libatomic for armv7 static compilation

### Security

- Integrated with OpenSSL 3

### Removed

- Resources, backups and storage properties from local configuration

## [0.0.6] - 2022-09-08

### Changed

- InfluxDB version detection for backup and restore is done through REST API
- Removed creation of TMPDIR for influxdb2 restore as it is no longer neccesary
- Improved log output using spdlog library

### Fix

- When exec command fails internally function will return false
- Restore on influxdb2 was not restarting container
- Memory swap was not being correctly monitored
- Resources were being duplicated with default and own name
- Endpoint calling in restore not sending payload

## [0.0.5] - 2022-04-25

### Added

- Backup and restore available for influxdb 2.1
- Tag configurable in backup resource
- Backup, Restore and Cmd resources may call endpoint on finished
Expand All @@ -75,49 +108,62 @@ All notable changes to this project will be documented in this file.
- Backup and restore return json as payload with details when calling endpoint

### Fix

- Segmentation fault when checking internal interface IP
- Backup and restore resources accessible once backups property is set without restarting
- Backup and restore are now asyncronous and blocking between each other
- System update is asyncronous and blocking against backup and restore

## [0.0.4] - 2022-03-14

### Added

- New configuration options for backup and restore operations
- Added S3 upload and retrieval capabilities for backups
- Installer now allows installation of a specific version
- New distro release upgrade resource
- Check on token if device exists and change credentials of the device

### Changed

- Moved backup and restore scritps to thinger resource
- Superseded base64 class with new one
- Update and reboot resources only available when executed with root
- Service restarts by its own if it crashes
- Upload to S3 of backups is done by multipart upload instead of loading full file in memory

## [0.0.3] - 2022-01-03

### Added

- Backups and restore scripts with S3 as storage backend
- Device name in configuration file
- Kernel version as metric

### Changed

- Device name is set to hostname by default

## [0.0.2] - 2021-11-30

### Added

- Uptime as system information metric

### Changed

- Installer takes into account remote updates

### Fix

- System updates not showing
- Command execution input resource request body as JSON
- Declared input and output for update and restart resources

## [0.0.1] - 2021-11-25

### Added

- System information metrics
- CPU usage and load metrics
- RAM and swap capacity metrics
Expand All @@ -127,6 +173,9 @@ All notable changes to this project will be documented in this file.
- Module configuration
- Execution of commands

[1.1.1]: https://github.com/thinger-io/monitoring-client/compare/1.1.0...1.1.1
[1.1.0]: https://github.com/thinger-io/monitoring-client/compare/1.0.0...1.1.0
[1.0.0]: https://github.com/thinger-io/monitoring-client/compare/0.0.9...1.0.0
[0.0.9]: https://github.com/thinger-io/monitoring-client/compare/0.0.8...0.0.9
[0.0.8]: https://github.com/thinger-io/monitoring-client/compare/0.0.7...0.0.8
[0.0.7]: https://github.com/thinger-io/monitoring-client/compare/0.0.6...0.0.7
Expand Down
44 changes: 30 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ endif()
OPTION(ENABLE_OPENSSL "Enable use of OpenSSL" ON)
OPTION(STATIC "Enable cross compilation and static linking" OFF)
OPTION(BIN_EXTENSION "Set binary file extension" OFF)
OPTION(ASIO_CLIENT "Enable ASIO CLIENT" ON)

SET(ARCH "x86_64" CACHE STRING "Compiler architecture")

Expand All @@ -52,7 +51,9 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
endif()

# Add atomic for 32 bit arm
if("${ARCH}" MATCHES "^armv7m")
if("${ARCH}" MATCHES "^armv7m" OR
"${ARCH}" MATCHES "^mips" OR
"${ARCH}" MATCHES "^x32")
message(STATUS "Linking against libatomic")
list(APPEND ADDITIONAL_LIBS atomic)
endif()
Expand Down Expand Up @@ -94,7 +95,17 @@ else()
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread -Wno-psabi")
endif()

set(SOURCE_FILES src/main.cpp)
#set(SOURCE_FILES src/main.cpp)
# src/thinger/resources/rmonitor/monitor.cpp)

# Source files
file(GLOB_RECURSE SOURCE_FILES
"src/*.hpp"
"src/*.h"
"src/*.cpp"
"src/*.cc"
"src/*.c"
)

include(FetchContent)

Expand All @@ -105,15 +116,15 @@ include(FetchContent)
# list(APPEND ADDITIONAL_LIBS fmt::fmt)
#endif()
# fmt
FetchContent_Declare(fmt URL https://github.com/fmtlib/fmt/releases/download/9.1.0/fmt-9.1.0.zip)
FetchContent_Declare(fmt URL https://github.com/fmtlib/fmt/releases/download/10.2.1/fmt-10.2.1.zip)
FetchContent_MakeAvailable(fmt)
list(APPEND ADDITIONAL_LIBS fmt::fmt)

# spdlog
FetchContent_Declare(
spdlog
GIT_REPOSITORY https://github.com/gabime/spdlog.git
GIT_TAG v1.11.0
GIT_TAG v1.14.1
)
add_compile_definitions(SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE)
FetchContent_MakeAvailable(spdlog)
Expand All @@ -127,18 +138,18 @@ list(APPEND ADDITIONAL_LIBS nlohmann_json::nlohmann_json)
FetchContent_Declare(
httplib
GIT_REPOSITORY https://github.com/yhirose/cpp-httplib.git
GIT_TAG v0.12.0
GIT_TAG v0.16.0
)
FetchContent_MakeAvailable(httplib)
list(APPEND ADDITIONAL_LIBS httplib::httplib)

FetchContent_Declare(
thinger-iotmp
thinger_iotmp
GIT_REPOSITORY https://github.com/thinger-io/IOTMP-Linux.git
GIT_TAG 1.1.0
GIT_TAG 1.3.0
)
FetchContent_MakeAvailable(thinger-iotmp)
list(APPEND ADDITIONAL_LIBS thinger-iotmp)
FetchContent_MakeAvailable(thinger_iotmp)
list(APPEND ADDITIONAL_LIBS thinger_iotmp)

# libarchive
find_package(LibArchive REQUIRED)
Expand All @@ -162,9 +173,9 @@ export(TARGETS httplib
NAMESPACE httplib::
FILE ${CMAKE_CURRENT_BINARY_DIR}/httplibTargets.cmake)

export(TARGETS fmt
NAMESPACE fmt::
FILE ${CMAKE_CURRENT_BINARY_DIR}/fmtTargets.cmake)
#export(TARGETS fmt
# NAMESPACE fmt::
# FILE ${CMAKE_CURRENT_BINARY_DIR}/fmtTargets.cmake)

export(TARGETS spdlog
NAMESPACE spdlog::
Expand All @@ -174,12 +185,17 @@ export(TARGETS spdlog
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v3.3.2
GIT_TAG v3.6.0
)
FetchContent_MakeAvailable(Catch2)

# Source files
file(GLOB_RECURSE TEST_FILES
"src/thinger/*.hpp"
"src/thinger/*.h"
"src/thinger/*.cpp"
"src/thinger/*.cc"
"src/thinger/*.c"
"test/*.hpp"
"test/*.h"
"test/*.cpp"
Expand Down
2 changes: 1 addition & 1 deletion run.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env sh
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_OPENSSL=ON -DBUILD_VERSION=0.0.7 ../
cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_OPENSSL=ON -DSTATIC=ON -DOPENSSL_ROOT_DIR=/usr/lib/ssl -DOPENSSL_LIBRARIES=/usr/lib/ssl ../
make -j$((`grep -c ^processor /proc/cpuinfo`+1)) thinger_monitor
#./test
#make thinger_monitor
Expand Down
Loading
Loading