Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Romain Courteaud
slapos
Commits
3ba38a18
Commit
3ba38a18
authored
Jun 12, 2024
by
Léo-Paul Géneau
👾
Browse files
Options
Browse Files
Download
Plain Diff
Move osie-coupler in a component
See merge request
nexedi/slapos!1592
parents
9ff41437
e454f525
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
60 deletions
+73
-60
component/open62541/buildout.cfg
component/open62541/buildout.cfg
+14
-1
component/osie-coupler/buildout.cfg
component/osie-coupler/buildout.cfg
+28
-0
software/osie-coupler/buildout.hash.cfg
software/osie-coupler/buildout.hash.cfg
+1
-1
software/osie-coupler/instance.cfg.in
software/osie-coupler/instance.cfg.in
+0
-2
software/osie-coupler/software.cfg
software/osie-coupler/software.cfg
+2
-55
software/osie-coupler/test/test.py
software/osie-coupler/test/test.py
+28
-1
No files found.
component/open62541/buildout.cfg
View file @
3ba38a18
...
...
@@ -5,9 +5,10 @@ parts =
open62541
extends =
../cmake/buildout.cfg
../git/buildout.cfg
../mbedtls/buildout.cfg
../patch/buildout.cfg
../python3/buildout.cfg
../gcc/buildout.cfg
../defaults.cfg
[gcc]
...
...
@@ -27,6 +28,7 @@ pre-configure =
# remove old FindPython3 which does not know about python > 3.8 to
# use FindPython3 bundled with slapos' cmake
rm tools/cmake/FindPython3.cmake tools/cmake/FindPython/Support.cmake
${git:location}/bin/git clone -b v1.1.6 https://github.com/LiamBindle/MQTT-C.git deps/mqtt-c
configure-command =
${cmake:location}/bin/cmake
configure-options =
...
...
@@ -34,9 +36,20 @@ configure-options =
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=@@LOCATION@@
-DUA_ENABLE_PUBSUB=ON
-DUA_ENABLE_PUBSUB_MONITORING=ON
-DUA_ENABLE_PUBSUB_ETH_UADP=ON
-DUA_ENABLE_SUBSCRIPTIONS=ON
-DUA_NAMESPACE_ZERO=REDUCED
-DUA_ENABLE_ENCRYPTION=MBEDTLS
-DUA_ENABLE_ENCRYPTION_MBEDTLS=ON
-DMBEDTLS_INCLUDE_DIRS=${mbedtls:location}/include
-DMBEDTLS_LIBRARY=${mbedtls:location}/lib/libmbedtls.so
-DMBEDX509_LIBRARY=${mbedtls:location}/lib/libmbedx509.so
-DMBEDCRYPTO_LIBRARY=${mbedtls:location}/lib/libmbedcrypto.so
-DUA_ENABLE_PUBSUB_INFORMATIONMODEL=ON
-DUA_ENABLE_PUBSUB_MQTT=ON
post-install =
cp src/pubsub/*.h deps/open62541_queue.h @@LOCATION@@/include
environment =
PATH=${gcc:prefix}/bin:${python3:location}/bin:${patch:location}/bin:%(PATH)s
LDFLAGS=-L${mbedtls:location}/lib -Wl,-rpath=${mbedtls:location}/lib
component/osie-coupler/buildout.cfg
0 → 100644
View file @
3ba38a18
[buildout]
extends =
../git/buildout.cfg
../mbedtls/buildout.cfg
../open62541/buildout.cfg
../defaults.cfg
parts = osie-coupler
[gcc]
# we want this SR to use a fixed gcc (so that we have the same gcc as open62541 component)
max_version = 0
[osie-repository]
recipe = slapos.recipe.build:gitclone
git-executable = ${git:location}/bin/git
repository = https://lab.nexedi.com/nexedi/osie.git
revision = dd9aea8
[osie-coupler]
recipe = slapos.recipe.cmmi
path = ${osie-repository:location}/coupler
bin_dir = ${:path}/bin/
environment =
PATH=${gcc:prefix}/bin:/usr/bin
C_INCLUDE_PATH=${open62541:location}/include:${open62541:location}/deps:${open62541:location}/src/pubsub
LDFLAGS=-L${open62541:location}/lib -Wl,-rpath=${open62541:location}/lib -L ${mbedtls:location}/lib -Wl,-rpath=${mbedtls:location}/lib
configure-command = true
software/osie-coupler/buildout.hash.cfg
View file @
3ba38a18
[instance-profile]
filename = instance.cfg.in
md5sum =
17549c62b5ad20cfe2520fb2ef133c22
md5sum =
5bff4e422a2b22bec348bc5e4cb2f3b7
software/osie-coupler/instance.cfg.in
View file @
3ba38a18
...
...
@@ -16,8 +16,6 @@ extends = {{ template_monitor }}
[coupler-opc-ua]
recipe = slapos.cookbook:wrapper
environment =
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:{{ open62541_location }}/lib:{{ mbedtls_location }}/lib
command-line =
{{ coupler_location }}server -d ${instance-parameter:configuration.coupler_block_device} -s ${instance-parameter:configuration.coupler_i2c_slave_list} -p ${instance-parameter:configuration.opc_ua_port} -u ${instance-parameter:configuration.username} -w ${instance-parameter:configuration.password} -b ${instance-parameter:configuration.heart_beat} -t ${instance-parameter:configuration.heart_beat_interval} -l ${instance-parameter:configuration.heart_beat_id_list} -n ${instance-parameter:configuration.network_address_url_data_type} -o ${instance-parameter:configuration.heart_beat_timeout_interval} -i ${instance-parameter:configuration.id} -m ${instance-parameter:configuration.mode} -j ${instance-parameter:configuration.network_interface}
wrapper-path = ${directory:service}/coupler-opc-ua
...
...
software/osie-coupler/software.cfg
View file @
3ba38a18
[buildout]
parts =
open62541
compile-coupler
slapos-cookbook
instance-profile
extends =
../../component/git/buildout.cfg
../../component/mbedtls/buildout.cfg
../../component/open62541/buildout.cfg
../../stack/monitor/buildout.cfg
../../stack/slapos.cfg
../../component/
defaults
.cfg
../../component/
osie-coupler/buildout
.cfg
[gcc]
# we want this SR to use a fixed gcc (so that we have the same gcc as open62541 component)
max_version = 0
[open62541]
pre-configure +=
${git:location}/bin/git clone -b v1.1.6 https://github.com/LiamBindle/MQTT-C.git deps/mqtt-c
configure-options =
-DBUILD_SHARED_LIBS=ON
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=@@LOCATION@@
-DUA_ENABLE_PUBSUB=ON
-DUA_ENABLE_PUBSUB_MONITORING=ON
-DUA_ENABLE_PUBSUB_ETH_UADP=ON
-DUA_NAMESPACE_ZERO=REDUCED
-DUA_ENABLE_ENCRYPTION=MBEDTLS
-DUA_ENABLE_ENCRYPTION_MBEDTLS=ON
-DMBEDTLS_INCLUDE_DIRS=${mbedtls:location}/include
-DMBEDTLS_LIBRARY=${mbedtls:location}/lib/libmbedtls.so
-DMBEDX509_LIBRARY=${mbedtls:location}/lib/libmbedx509.so
-DMBEDCRYPTO_LIBRARY=${mbedtls:location}/lib/libmbedcrypto.so
-DUA_ENABLE_PUBSUB_INFORMATIONMODEL=ON
-DUA_ENABLE_PUBSUB_MQTT=ON
environment +=
LDFLAGS=-L${mbedtls:location}/lib -Wl,-rpath=${mbedtls:location}/lib
# we need open62541's sources even after compiling and linking in [open62541]
# section. Reasons is that coupler's C application depends on it.
keep-compile-dir = true
source-location = @@LOCATION@@/.build/open62541-pack-${open62541:tag}
[osie-repository]
recipe = slapos.recipe.build:gitclone
git-executable = ${git:location}/bin/git
repository = https://lab.nexedi.com/nexedi/osie.git
revision = 5d193e57b50a7ebb3df147e403917201eb9cb6c6
[compile-coupler]
recipe = slapos.recipe.cmmi
path = ${osie-repository:location}/coupler
bin_dir = ${:path}/bin/
environment =
PATH=${gcc:prefix}/bin:/usr/bin
OPEN62541_HOME = ${open62541:location}
OPEN62541_SOURCE_HOME = ${open62541:source-location}
C_COMPILER_EXTRA_FLAGS = -L ${mbedtls:location}/lib -Wl,-rpath=${mbedtls:location}/lib -l:libopen62541.so -L${open62541:location}/lib -Wl,-rpath=${open62541:location}/lib -I${open62541:location}/include -I${open62541:source-location}/src/pubsub/ -I${open62541:source-location}/deps
configure-command = true
[instance-profile]
recipe = slapos.recipe.template:jinja2
...
...
@@ -69,6 +18,4 @@ extensions = jinja2.ext.do
context =
section buildout buildout
raw template_monitor ${monitor2-template:output}
key open62541_location open62541:location
key mbedtls_location mbedtls:location
key coupler_location compile-coupler:bin_dir
key coupler_location osie-coupler:bin_dir
software/osie-coupler/test/test.py
View file @
3ba38a18
...
...
@@ -35,10 +35,37 @@ setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass(
class
OsieTestCase
(
SlapOSInstanceTestCase
):
MULTICAST_INTERFACE
=
'lo'
MULTICAST_GROUP_COUNT
=
2
MULTICAST_GROUP
=
'224.0.0.22'
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
"mode"
:
1
}
return
{
"mode"
:
1
,
"network_interface"
:
"127.0.0.1"
,
"heart_beat_id_list"
:
"1"
}
def
test
(
self
):
parameter_dict
=
self
.
computer_partition
.
getConnectionParameterDict
()
self
.
assertIn
(
'url-ipv6'
,
parameter_dict
)
def
test_process
(
self
):
with
self
.
slap
.
instance_supervisor_rpc
as
supervisor
:
process_names
=
[
process
[
'name'
]
for
process
in
supervisor
.
getAllProcessInfo
()]
self
.
assertIn
(
'coupler-opc-ua-on-watch'
,
process_names
)
def
IPV4_to_little_endian_hex_str
(
self
,
ipv4_str
):
hex_str_list
=
[]
for
int_str
in
ipv4_str
.
split
(
'.'
):
hex_str_list
.
append
(
'%0.2X'
%
int
(
int_str
))
return
''
.
join
(
reversed
(
hex_str_list
))
def
test_joined_multicast_grp
(
self
):
with
open
(
'/proc/net/igmp'
)
as
f
:
igmp_content
=
f
.
readlines
()
for
igmp_line
in
(
'1
\
t
%s : %s V3
\
n
'
%
(
self
.
MULTICAST_INTERFACE
,
self
.
MULTICAST_GROUP_COUNT
),
'
\
t
\
t
\
t
\
t
%s 1 0:00000000
\
t
\
t
0
\
n
'
%
self
.
IPV4_to_little_endian_hex_str
(
self
.
MULTICAST_GROUP
),
):
self
.
assertIn
(
igmp_line
,
igmp_content
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment