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

Version 2.3 deviceType rest interface parameter #356

Merged
merged 41 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
1a65154
initial device type rest argument
wsobel Oct 5, 2023
a41377a
Version 2.2.0.8 – fixed boundry race condition between replay of samp…
wsobel Oct 6, 2023
4c982e3
Merge pull request #336 from mtconnect/period-filter-round-2
wsobel Oct 6, 2023
89a18d7
Fixed agent id
wsobel Oct 13, 2023
6c893d9
added agent device uuid test. version 2.2.0.9
wsobel Oct 16, 2023
79e8be5
Merge pull request #341 from mtconnect/fixed_agent_uuid
wsobel Oct 17, 2023
546d44b
Change mqtt sink to support device topic and probe topic as aliases. …
wsobel Oct 17, 2023
a3d76bb
Merge branch 'main' into device_topic_for_mqtt_sink_2
wsobel Oct 17, 2023
777f4de
Merge pull request #346 from mtconnect/device_topic_for_mqtt_sink_2
wsobel Oct 17, 2023
1eeac02
docker workflow updates
wsobel Oct 18, 2023
f130664
Added matrix for multiple docker image builds
wsobel Oct 18, 2023
91f5eb1
build all dependencies from source
wsobel Oct 18, 2023
ea89b71
limit build to one docker image for now
wsobel Oct 18, 2023
0d34aee
Added cmake build from source for cross compilation
wsobel Oct 18, 2023
a2252b5
Use system version of tools if available
wsobel Oct 18, 2023
4030d83
Fixed crash on out of range streaming from. Added mosquitto configura…
wsobel Oct 19, 2023
c3e2aa3
fixed windows cmake check
wsobel Oct 19, 2023
aad5f11
Added gallon and pint conversions for gps to lps
wsobel Oct 19, 2023
c4d61f4
Added spec tests for streaming sample out of range. Started added dox…
wsobel Oct 19, 2023
cb8e6ae
Update agent schema files to match schemas repo
wsobel Oct 19, 2023
cd0abd5
Merge pull request #349 from mtconnect/docker_image_workflow_builds
wsobel Oct 19, 2023
9e8439f
Added Heartbeat to the SHDR adapter to override
wsobel Oct 19, 2023
784f8aa
Only trigger docker workflow on push of tags
wsobel Oct 19, 2023
97007e3
Fixed issue with publishing conditions without state
wsobel Oct 19, 2023
89cb69a
Reduced image size for demo and builds
wsobel Oct 20, 2023
5199e27
Merge pull request #352 from mtconnect/fix_mqtt_service_condition_han…
wsobel Oct 20, 2023
afa2294
Merge branch 'main' into add_adapter_configuration_to_override_ping_rate
wsobel Oct 20, 2023
7d1b2cc
Merge branch 'main' into reduce_docker_image_size
wsobel Oct 20, 2023
3b25761
Update Dockerfile
wsobel Oct 20, 2023
1a2de47
Merge pull request #351 from mtconnect/add_adapter_configuration_to_o…
wsobel Oct 20, 2023
72fdbda
Fixes to the dockerfiles
wsobel Oct 20, 2023
fbbe38e
Base demo on the dockerhub mtconnect/agent image
wsobel Oct 20, 2023
8052c2f
Merge branch 'main' into reduce_docker_image_size
wsobel Oct 20, 2023
0d4626a
Updated workflow to build demo dockerfile. Changed replicator to use …
wsobel Oct 20, 2023
8896bdc
Changed compose demos to use mtconnect/agent image
wsobel Oct 20, 2023
57d432e
Fixed race condition in file cache and async observer under load
wsobel Oct 21, 2023
d3eec2c
Merge pull request #353 from mtconnect/reduce_docker_image_size
wsobel Oct 21, 2023
0d966f5
Merge branch 'main' into version-2.3-device-type-rest-interface
wsobel Oct 22, 2023
eb15f9f
added deviceType and tests
wsobel Oct 22, 2023
2742c25
Version 2.3.0.0 RC 1
wsobel Oct 22, 2023
02adeeb
Merge branch 'main-dev' into version-2.3-device-type-rest-interface
wsobel Oct 27, 2023
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
35 changes: 23 additions & 12 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ env:
# when to run workflow
on:
# # run on push or pull request events for the master branch
# push:
# branches: [ main ]
# pull_request:
# branches: [ main ]
push:
tags:
- "v*.*.*"

# allows you to run this workflow manually from the actions tab
workflow_dispatch:
Expand All @@ -35,6 +34,14 @@ jobs:
build:
# the type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
include:
- dockerfile: docker/alpine/Dockerfile
name: agent
- dockerfile: demo/Dockerfile
name: demo

# steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -46,30 +53,34 @@ jobs:
# the QEMU emulator lets us build for arm processors also
# see https://github.com/docker/setup-qemu-action
- name: Set up QEMU emulator
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3

# see https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}


- name: Remove leading v from the version
run: |
echo "VERSION=$(echo ${{ github.ref_name }} | sed 's/^v//')" >> $GITHUB_ENV

# see https://github.com/docker/build-push-action
- name: Build image and push to DockerHub
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
file: ${{ matrix.dockerfile }}
platforms: ${{ env.PLATFORMS }}

# docker hub user/repo:tag
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/agent:latest
${{ secrets.DOCKERHUB_USERNAME }}/agent:${{ github.ref_name }}
${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.name }}:latest
${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.name }}:${{ env.VERSION }}

# push to docker hub
push: true
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# The version number.
set(AGENT_VERSION_MAJOR 2)
set(AGENT_VERSION_MINOR 2)
set(AGENT_VERSION_MINOR 3)
set(AGENT_VERSION_PATCH 0)
set(AGENT_VERSION_BUILD 7)
set(AGENT_VERSION_RC "")
set(AGENT_VERSION_BUILD 0)
set(AGENT_VERSION_RC "_RC1")

# This minimum version is to support Visual Studio 2019 and C++ feature checking and FetchContent
cmake_minimum_required(VERSION 3.23 FATAL_ERROR)
Expand Down
173 changes: 99 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,31 @@ Configuration Parameters

*Default*: false

* `JsonVersion` - JSON Printer format. Old format: 1, new format: 2

*Default*: 2

* `SchemaVersion` - Change the schema version to a different version number.

*Default*: 2.0

* `MaxAssets` - The maximum number of assets the agent can hold in its buffer. The
number is the actual count, not an exponent.

*Default*: 1024

* `MonitorConfigFiles` - Monitor agent.cfg and Devices.xml files and restart agent if they change.

*Default*: false

* `MinimumConfigReloadAge` - The minimum age of a config file before an agent reload is triggered (seconds).

*Default*: 15

* `Pretty` - Pretty print the output with indententation

*Default*: false

* `PidFile` - UNIX only. The full path of the file that contains the
process id of the daemon. This is not supported in Windows.

Expand All @@ -609,96 +634,95 @@ Configuration Parameters

*Default*: MTConnect Agent

* `Port` - The port number the agent binds to for requests.

*Default*: 5000

* `ServerIp` - The server IP Address to bind to. Can be used to select the interface in IPV4 or IPV6.

*Default*: 0.0.0.0

* `AllowPut` - Allow HTTP PUT or POST of data item values or assets.
* `SuppressIPAddress` - Suppress the Adapter IP Address and port when creating the Agent Device ids and names. This applies to all adapters.

*Default*: false

* `AllowPutFrom` - Allow HTTP PUT or POST from a specific host or
list of hosts. Lists are comma (,) separated and the host names will
be validated by translating them into IP addresses.
* `WorkerThreads` - The number of operating system threads dedicated to the Agent

*Default*: none
*Default*: 1

#### Adapter General Configuration

* `JsonVersion` - JSON Printer format. Old format: 1, new format: 2
These can be overridden on a per-adapter basis

*Default*: 2
* `ConversionRequired` - Global default for data item units conversion in the agent.
Assumes the adapter has already done unit conversion.

* `LegacyTimeout` - The default length of time an adapter can be silent before it
is disconnected. This is only for legacy adapters that do not support heartbeats.
*Default*: true

* `EnableSourceDeviceModels` - Allow adapters and data sources to supply Device
configuration

*Default*: 600
*Default*: false

* `Heartbeat` – Overrides the heartbeat interval sent back from the adapter in the
`* PONG <hb>`. The heartbeat will always be this value in milliseconds.

* `ReconnectInterval` - The amount of time between adapter reconnection attempts.
This is useful for implementation of high performance adapters where availability
needs to be tracked in near-real-time. Time is specified in milliseconds (ms).

*Default*: 10000

*Default*: _None_

* `IgnoreTimestamps` - Overwrite timestamps with the agent time. This will correct
clock drift but will not give as accurate relative time since it will not take into
consideration network latencies. This can be overridden on a per adapter basis.

*Default*: false

* `LegacyTimeout` - The default length of time an adapter can be silent before it
is disconnected. This is only for legacy adapters that do not support heartbeats.

*Default*: 600

* `PreserveUUID` - Do not overwrite the UUID with the UUID from the adapter, preserve
the UUID in the Devices.xml file. This can be overridden on a per adapter basis.

*Default*: true

* `SchemaVersion` - Change the schema version to a different version number.

*Default*: 2.0

* `ConversionRequired` - Global default for data item units conversion in the agent.
Assumes the adapter has already done unit conversion.
* `ReconnectInterval` - The amount of time between adapter reconnection attempts.
This is useful for implementation of high performance adapters where availability
needs to be tracked in near-real-time. Time is specified in milliseconds (ms).

*Default*: 10000

* `ShdrVersion` - Specifies the SHDR protocol version used by the adapter. When greater than one (1),
allows multiple complex observations, like `Condition` and `Message` on the same line. If it equials one (1),
then any observation requiring more than a key/value pair need to be on separate lines. This is the default for all adapters.

*Default*: true
*Default*: 1
* `UpcaseDataItemValue` - Always converts the value of the data items to upper case.

*Default*: true

* `MaxAssets` - The maximum number of assets the agent can hold in its buffer. The
number is the actual count, not an exponent.
#### REST Service Configuration

*Default*: 1024

* `MonitorConfigFiles` - Monitor agent.cfg and Devices.xml files and restart agent if they change.
* `AllowPut` - Allow HTTP PUT or POST of data item values or assets.

*Default*: false

* `MinimumConfigReloadAge` - The minimum age of a config file before an agent reload is triggered (seconds).

*Default*: 15

* `Pretty` - Pretty print the output with indententation
* `AllowPutFrom` - Allow HTTP PUT or POST from a specific host or
list of hosts. Lists are comma (,) separated and the host names will
be validated by translating them into IP addresses.

*Default*: false
*Default*: none

* `HttpHeaders` - Additional headers to add to the HTTP Response for CORS Security

* `ShdrVersion` - Specifies the SHDR protocol version used by the adapter. When greater than one (1), allows multiple complex observations, like `Condition` and `Message` on the same line. If it equials one (1), then any observation requiring more than a key/value pair need to be on separate lines. This is the default for all adapters.
> Example: ```
> HttpHeaders {
> Access-Control-Allow-Origin = *
> Access-Control-Allow-Methods = GET
> Access-Control-Allow-Headers = Content-Type
> }```

*Default*: 1

* `SuppressIPAddress` - Suppress the Adapter IP Address and port when creating the Agent Device ids and names. This applies to all adapters.
* `Port` - The port number the agent binds to for requests.

*Default*: false
*Default*: 5000

* `ServerIp` - The server IP Address to bind to. Can be used to select the interface in IPV4 or IPV6.

* `WorkerThreads` - The number of operating system threads dedicated to the Agent
*Default*: 0.0.0.0

*Default*: 1

* `EnableSourceDeviceModels` -

*Default*: false

#### Configuration Pameters for TLS (https) Support ####

The following parameters must be present to enable https requests. If there is no password on the certificate, `TlsCertificatePassword` may be omitted.
Expand All @@ -707,31 +731,35 @@ The following parameters must be present to enable https requests. If there is n

*Default*: *NULL*

* `TlsPrivateKey` - The name of the file containing the private key for the certificate
* `TlsCertificatePassword` - The password used when creating the certificate. If none was supplied, do not use.

*Default*: *NULL*

* `TlsDHKey` - The name of the file containing the Diffie–Hellman key
* `TlsClientCAs` - For `TlsVerifyClientCertificate`, specifies a file that contains additional certificate authorities for verification

*Default*: *NULL*

* `TlsCertificatePassword` - The password used when creating the certificate. If none was supplied, do not use.
* `TlsDHKey` - The name of the file containing the Diffie–Hellman key

*Default*: *NULL*

* `TlsOnly` - Only allow secure connections, http requests will be rejected

*Default*: false

* `TlsPrivateKey` - The name of the file containing the private key for the certificate

*Default*: *NULL*

* `TlsVerifyClientCertificate` - Request and verify the client certificate against root authorities

*Default*: false

* `TlsClientCAs` - For `TlsVerifyClientCertificate`, specifies a file that contains additional certificate authorities for verification
### MQTT Configuration

* `MqttCaCert` - CA Certificate for MQTT TLS connection to the MTT Broker

*Default*: *NULL*

### MQTT Configuration

* `MqttHost` - IP Address or name of the MQTT Broker

Expand All @@ -741,10 +769,6 @@ The following parameters must be present to enable https requests. If there is n

*Default*: 1883

* `MqttCaCert` - CA Certificate for MQTT TLS connection to the MTT Broker

*Default*: *NULL*

* `MqttTls` - TLS Certificate for secure connection to the MQTT Broker

*Default*: *NULL*
Expand Down Expand Up @@ -785,25 +809,26 @@ Sinks {
}
```

* `ProbeTopic` - Prefix for the Device Model topic
* `AssetTopic` - Prefix for the Assets

*Default*: `MTConnect/Asset/[device]`

* `CurrentTopic` - Prefix for the Current

*Default*: `MTConnect/Current/[device]`

* `ProbeTopic` or `DeviceTopic` - Prefix for the Device Model topic

> Note: The `[device]` will be replace with the uuid of each device. Other patterns can be created,
> for example: `MTConnect/[device]/Probe` will group by device instead of operation.
> `DeviceTopic` will also work.

*Default*: `MTConnect/Probe/[device]`

* `CurrentTopic` - Prefix for the Current

*Default*: `MTConnect/Current/[device]`

* `SampleTopic` - Prefix for the Sample

*Default*: `MTConnect/Current/[device]`

* `AssetTopic` - Prefix for the Assets

*Default*: `MTConnect/Asset/[device]`

* `MqttCurrentInterval` - The frequency to publish currents. Acts like a keyframe in a video stream.

*Default*: 10000ms
Expand Down
4 changes: 3 additions & 1 deletion agent_lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,9 @@ target_clangtidy_setup(agent_lib)

include(../cmake/document.cmake)
if (AGENT_WITH_DOCS AND DOXYGEN_FOUND)
doxygen_add_docs(docs ../README.md ${AGENT_SOURCES})
file(GLOB _tests ${CMAKE_CURRENT_SOURCE_DIR}/../test_package/*.hpp ${CMAKE_CURRENT_SOURCE_DIR}/../test_package/*.cpp)
doxygen_add_docs(docs README.md ${AGENT_SOURCES} ${_tests}
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/.." )
install(DIRECTORY "${PROJECT_BINARY_DIR}/Documentation/" DESTINATION "Documentation")
endif()

Expand Down
1 change: 1 addition & 0 deletions cmake/document.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ if (DOXYGEN_FOUND)
set(DOXYGEN_INCLUDE_PATH "${CONAN_INCLUDE_DIRS}")
set(DOXYGEN_HTML_COLORSTYLE "AUTO_DARK")
set(DOXYGEN_MAX_DOT_GRAPH_DEPTH 3)
set(DOXYGEN_GENERATE_TESTLIST YES)
endif()
25 changes: 25 additions & 0 deletions conan/cmake/conandata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
sources:
"3.19.8":
url: https://github.com/Kitware/CMake/releases/download/v3.19.8/cmake-3.19.8.tar.gz
sha256: 09b4fa4837aae55c75fb170f6a6e2b44818deba48335d1969deddfbb34e30369
"3.20.6":
url: https://github.com/Kitware/CMake/releases/download/v3.20.6/cmake-3.20.6.tar.gz
sha256: a0bd485e1a38dd13c0baec89d5f4adbf61c7fd32fddb38eabc69a75bc0b65d72
"3.21.7":
url: https://github.com/Kitware/CMake/releases/download/v3.21.7/cmake-3.21.7.tar.gz
sha256: 3523c4a5afc61ac3d7c92835301cdf092129c9b672a6ee17e68c92e928c1375a
"3.22.6":
url: https://github.com/Kitware/CMake/releases/download/v3.22.6/cmake-3.22.6.tar.gz
sha256: 73933163670ea4ea95c231549007b0c7243282293506a2cf4443714826ad5ec3
"3.23.5":
url: "https://github.com/Kitware/CMake/releases/download/v3.23.5/cmake-3.23.5.tar.gz"
sha256: "f2944cde7a140b992ba5ccea2009a987a92413762250de22ebbace2319a0f47d"
"3.24.3":
url: "https://github.com/Kitware/CMake/releases/download/v3.24.3/cmake-3.24.3.tar.gz"
sha256: "b53aa10fa82bff84ccdb59065927b72d3bee49f4d86261249fc0984b3b367291"
"3.25.2":
url: "https://github.com/Kitware/CMake/releases/download/v3.25.2/cmake-3.25.2.tar.gz"
sha256: "c026f22cb931dd532f648f087d587f07a1843c6e66a3dfca4fb0ea21944ed33c"
"3.26.4":
url: "https://github.com/Kitware/CMake/releases/download/v3.26.4/cmake-3.26.4.tar.gz"
sha256: "313b6880c291bd4fe31c0aa51d6e62659282a521e695f30d5cc0d25abbd5c208"
Loading
Loading