Skip to content

Commit

Permalink
Merge branch 'main' into main-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
wsobel committed Jun 21, 2024
2 parents 3b2eae0 + 43331b2 commit 28a6d56
Show file tree
Hide file tree
Showing 24 changed files with 200 additions and 203 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ jobs:
max-parallel: 1
matrix:
include:
- dockerfile: docker/alpine/Dockerfile
- dockerfile: docker/ubuntu/Dockerfile
name: agent
- dockerfile: demo/Dockerfile
name: demo
# - dockerfile: demo/Dockerfile
# name: demo

# steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down
2 changes: 1 addition & 1 deletion conan/mqtt_cpp/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class MqttcppConan(ConanFile):
url = "https://github.com/redboltz/mqtt_cpp"
description = "MQTT client/server for C++14 based on Boost.Asio"
topics = ("mqtt")
requires = ["boost/1.84.0"]
requires = ["boost/1.85.0"]
no_copy_source = True
exports_sources = "include/*"

Expand Down
111 changes: 1 addition & 110 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,116 +9,7 @@

class MTConnectAgentConan(ConanFile):
name = "mtconnect_agent"
version = "2.5"
url = "https://github.com/mtconnect/cppagent.git"
license = "Apache License 2.0"
settings = "os", "compiler", "arch", "build_type"
options = { "without_ipv6": [True, False],
"with_ruby": [True, False],
"development" : [True, False],
"shared": [True, False],
"winver": [None, "ANY"],
"with_docs" : [True, False],
"cpack": [True, False],
"agent_prefix": [None, "ANY"],
"fPIC": [True, False],
"cpack_destination": [None, "ANY"],
"cpack_name": [None, "ANY"],
"cpack_generator": [None, "ANY"]
}

description = "MTConnect reference C++ agent copyright Association for Manufacturing Technology"

build_policy = "missing"
default_options = {
"without_ipv6": False,
"with_ruby": True,
"development": False,
"shared": False,
"winver": "0x0602",
"with_docs": False,
"cpack": False,
"agent_prefix": None,
"fPIC": True,
"cpack_destination": None,
"cpack_name": None,
"cpack_generator": None,

"boost*:shared": False,
"boost*:without_python": True,
"boost*:without_test": True,
"boost*:without_graph": True,
"boost*:without_test": True,
"boost*:without_nowide": True,
"boost*:without_fiber": True,
"boost*:without_math": True,
"boost*:without_contract": True,
"boost*:without_serialization": True,
"boost*:without_wave": True,
"boost*:without_graph_parallel": True,

"libxml2*:shared": False,
"libxml2*:include_utils": False,
"libxml2*:http": False,
"libxml2*:ftp": False,
"libxml2*:iconv": False,
"libxml2*:zlib": False,

"gtest*:shared": False,

"openssl*:shared": False,

"date*:use_system_tz_db": True
}

exports_sources = "*", "!build", "!test_package/build", "!*~"
exports = "conan/mqtt_cpp/*", "conan/mruby/*"

def validate(self):
if is_msvc(self) and self.options.shared and self.settings.compiler.runtime != 'dynamic':
raise ConanInvalidConfiguration("Shared can only be built with DLL runtime.")
if "libcxx" in self.settings.compiler.fields and self.settings.compiler.libcxx == "libstdc++":
raise ConanInvalidConfiguration("This package is only compatible with libstdc++11, add -s compiler.libcxx=libstdc++11")

def layout(self):
self.folders.build_folder_vars = ["options.shared", "settings.arch"]
cmake_layout(self)

def layout(self):
self.folders.build_folder_vars = ["options.shared", "settings.arch"]
cmake_layout(self)

def config_options(self):
if is_msvc(self):
self.options.rm_safe("fPIC")

def tool_requires_version(self, package, version):
self.output.info(f"Checking version of {package} > {version}")
buf = io.StringIO()
command = f"{package} --version"
res = self.run(command, shell=True, stdout=buf)
ver = [0, 0, 0]
if res == 0:
text = buf.getvalue()
self.output.debug(f"{command} returned:\n{text}")
ver = [int(d) for d in re.search(r"\d+\.\d+\.\d+", text).group(0).split('.')]
self.output.info(f"Version of {package} is {ver}")
else:
self.output.info(f"Command: '{command}' returned {res}")
if ver < version:
ver_text = '.'.join([str(x) for x in version])
self.output.info(f"Old version of {package}, requesting tool {package}/{ver_text}")
self.tool_requires(f"{package}/{ver_text}")
else:
self.output.info(f"Using system version {package}: {ver}")

def build_requirements(self):
self.tool_requires_version("cmake", [3, 26, 4])
if self.options.with_docs:
self.tool_requires_version("doxygen", [1, 9, 4])

def requirements(self):
self.requires("boost/1.84.0", headers=True, libs=True, transitive_headers=True, transitive_libs=True)
self.requires("boost/1.85.0", headers=True, libs=True, transitive_headers=True, transitive_libs=True)
self.requires("libxml2/2.10.3", headers=True, libs=True, visible=True, transitive_headers=True, transitive_libs=True)
self.requires("date/2.4.1", headers=True, libs=True, transitive_headers=True, transitive_libs=True)
self.requires("nlohmann_json/3.9.1", headers=True, libs=False, transitive_headers=True, transitive_libs=False)
Expand Down
2 changes: 1 addition & 1 deletion demo/agent/agent.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Devices = Devices.xml
SchemaVersion = 2.2
SchemaVersion = 2.3
WorkerThreads = 3
MonitorConfigFiles = yes
Port = 5001
Expand Down
2 changes: 1 addition & 1 deletion demo/agent/agent.dock
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Devices = Devices.xml
SchemaVersion = 2.0
SchemaVersion = 2.3
WorkerThreads = 3
MonitorConfigFiles = yes
Port = 5000
Expand Down
2 changes: 1 addition & 1 deletion demo/agent/agent.mac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Devices = Devices.xml
SchemaVersion = 2.0
SchemaVersion = 2.3
WorkerThreads = 3
MonitorConfigFiles = yes
Port = 5001
Expand Down
7 changes: 5 additions & 2 deletions docker/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# ---------------------------------------------------------------------

# base image - alpine 3.18
FROM alpine:3.18 AS os
FROM alpine:3.19 AS os

# ---------------------------------------------------------------------
# build
Expand Down Expand Up @@ -63,7 +63,9 @@ RUN apk --update add \
python3 \
ruby \
ruby-rake \
&& PIP_ROOT_USER_ACTION='ignore' pip install conan
&& python3 -m venv /python/conan \
&& . /python/conan/bin/activate \
&& PIP_ROOT_USER_ACTION='ignore' pip install conan

# make an agent directory and cd into it
WORKDIR /root/agent
Expand All @@ -80,6 +82,7 @@ RUN if [ -z "$WITH_TESTS" ] || [ "$WITH_TESTS" = "false" ]; then \
else \
WITH_TESTS_ARG=""; \
fi \
&& . /python/conan/bin/activate \
&& conan profile detect \
&& conan create cppagent \
--build=missing \
Expand Down
41 changes: 34 additions & 7 deletions schemas/MTConnectStreams_2.3.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -45125,6 +45125,15 @@ SUCH PARTY HAD ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.
</xs:annotation>
<xs:restriction base='xs:string'/>
</xs:simpleType>
<xs:simpleType name='ConditionIdType'>
<xs:annotation>
<xs:documentation>
Identifier of an individual condition activation provided by a piece of
equipment
</xs:documentation>
</xs:annotation>
<xs:restriction base='xs:string'/>
</xs:simpleType>
<xs:simpleType name='QualifierType'>
<xs:annotation>
<xs:documentation>
Expand Down Expand Up @@ -45192,7 +45201,25 @@ SUCH PARTY HAD ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name='conditionId' type='IDType' use='required'>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:element abstract='true' name='Condition' type='ConditionType'>
<xs:annotation>
<xs:documentation>
Description
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name='ActivatedConditionType' abstract='true'>
<xs:annotation>
<xs:documentation>
Condition that has transitioned from Normal to either Warning or Fault
</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base='ConditionType'>
<xs:attribute name='conditionId' type='ConditionIdType' use='required'>
<xs:annotation>
<xs:documentation>
Identifier of an individual condition activation provided by a
Expand All @@ -45203,10 +45230,10 @@ SUCH PARTY HAD ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:element abstract='true' name='Condition' type='ConditionType'>
<xs:element abstract='true' name='ActivatedCondition' type='ActivatedConditionType' substitutionGroup='Condition'>
<xs:annotation>
<xs:documentation>
Description
Condition that has transitioned from Normal to either Warning or Fault
</xs:documentation>
</xs:annotation>
</xs:element>
Expand Down Expand Up @@ -45254,10 +45281,10 @@ SUCH PARTY HAD ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.
</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base='ConditionType'/>
<xs:extension base='ActivatedConditionType'/>
</xs:simpleContent>
</xs:complexType>
<xs:element name='Warning' type='WarningType' substitutionGroup='Condition'>
<xs:element name='Warning' type='WarningType' substitutionGroup='ActivatedCondition'>
<xs:annotation>
<xs:documentation>
{{term(condition state)}} that requires concern and supervision and may
Expand All @@ -45273,10 +45300,10 @@ SUCH PARTY HAD ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.
</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base='ConditionType'/>
<xs:extension base='ActivatedConditionType'/>
</xs:simpleContent>
</xs:complexType>
<xs:element name='Fault' type='FaultType' substitutionGroup='Condition'>
<xs:element name='Fault' type='FaultType' substitutionGroup='ActivatedCondition'>
<xs:annotation>
<xs:documentation>
{{term(condition state)}} that requires intervention to continue
Expand Down
41 changes: 34 additions & 7 deletions schemas/MTConnectStreams_2.3_1.0.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -45125,6 +45125,15 @@ SUCH PARTY HAD ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.
</xs:annotation>
<xs:restriction base='xs:string'/>
</xs:simpleType>
<xs:simpleType name='ConditionIdType'>
<xs:annotation>
<xs:documentation>
Identifier of an individual condition activation provided by a piece of
equipment
</xs:documentation>
</xs:annotation>
<xs:restriction base='xs:string'/>
</xs:simpleType>
<xs:simpleType name='QualifierType'>
<xs:annotation>
<xs:documentation>
Expand Down Expand Up @@ -45192,7 +45201,25 @@ SUCH PARTY HAD ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name='conditionId' type='IDType' use='required'>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:element abstract='true' name='Condition' type='ConditionType'>
<xs:annotation>
<xs:documentation>
Description
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name='ActivatedConditionType' abstract='true'>
<xs:annotation>
<xs:documentation>
Condition that has transitioned from Normal to either Warning or Fault
</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base='ConditionType'>
<xs:attribute name='conditionId' type='ConditionIdType' use='required'>
<xs:annotation>
<xs:documentation>
Identifier of an individual condition activation provided by a
Expand All @@ -45203,10 +45230,10 @@ SUCH PARTY HAD ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:element abstract='true' name='Condition' type='ConditionType'>
<xs:element abstract='true' name='ActivatedCondition' type='ActivatedConditionType' substitutionGroup='Condition'>
<xs:annotation>
<xs:documentation>
Description
Condition that has transitioned from Normal to either Warning or Fault
</xs:documentation>
</xs:annotation>
</xs:element>
Expand Down Expand Up @@ -45254,10 +45281,10 @@ SUCH PARTY HAD ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.
</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base='ConditionType'/>
<xs:extension base='ActivatedConditionType'/>
</xs:simpleContent>
</xs:complexType>
<xs:element name='Warning' type='WarningType' substitutionGroup='Condition'>
<xs:element name='Warning' type='WarningType' substitutionGroup='ActivatedCondition'>
<xs:annotation>
<xs:documentation>
{{term(condition state)}} that requires concern and supervision and may
Expand All @@ -45273,10 +45300,10 @@ SUCH PARTY HAD ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.
</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base='ConditionType'/>
<xs:extension base='ActivatedConditionType'/>
</xs:simpleContent>
</xs:complexType>
<xs:element name='Fault' type='FaultType' substitutionGroup='Condition'>
<xs:element name='Fault' type='FaultType' substitutionGroup='ActivatedCondition'>
<xs:annotation>
<xs:documentation>
{{term(condition state)}} that requires intervention to continue
Expand Down
Loading

0 comments on commit 28a6d56

Please sign in to comment.