Commit 921c4183 authored by Ivan Tyagov's avatar Ivan Tyagov

Moved to slapos.git .

parent 15da123e
[instance-profile]
filename = instance-modbus.cfg.in
md5sum = 8637c6b714a0bb9f27c86f3928049b98
filename = instance-opc-ua.cfg.in
md5sum = 71be79d7e6fa350efb34d0c79bc88bee
filename = instance-opc-ua-virtual.cfg.in
md5sum = d10c8e58066b944058489b1b59b2bb53
#############################
#
# Deploy OSIE coupler instance
#
#############################
[buildout]
parts =
directory
publish-connection-parameter
coupler-modbus
coupler-modbus-promise
# Define egg directories to be the one from Software Release
# (/opt/slapgrid/...)
# Always the same.
eggs-directory = {{ buildout['eggs-directory'] }}
develop-eggs-directory = {{ buildout['develop-eggs-directory'] }}
offline = true
extends = {{ template_monitor }}
[instance-parameter]
# Fetch arbitrary parameters defined by the user in SlapOS Master for his instance.
# We use the slapconfiguration recipe with a few parameters (partition id,
# computer id, certificate, etc).
# It will then authenticate to SlapOS Master and fetch the instance parameters.
# The parameters are accessible from ${instance-parameter:configuration.name-of-parameter}
# Always the same. Just copy/paste.
# See docstring of slapos.cookbook:slapconfiguration for more information.
recipe = slapos.cookbook:slapconfiguration
computer = ${slap-connection:computer-id}
partition = ${slap-connection:partition-id}
url = ${slap-connection:server-url}
key = ${slap-connection:key-file}
cert = ${slap-connection:cert-file}
configuration.coupler_block_device =
configuration.coupler_i2c_slave_list =
# Define default parameter(s) that will be used later, in case user didn't
# specify it.
# All possible parameters should have a default.
# In our use case, we are expecting from the user to specify one (optional) parameter: "name". We put the default value here if he doesn't specify it, so that it doesn't crash.
configuration.interface = 0.0.0.0
configuration.modbus_port = 1502
# If our use case requires that the user can specify a mail address so that his instance can mail to him (for example), we can do:
# configuration.mail-address =
# If the user doesn't specify it, it won't break and the recipe can handle it (i.e don't send any mail for example).
# Create all needed directories, depending on your needs
[directory]
recipe = slapos.cookbook:mkdirectory
home = ${buildout:directory}
etc = ${:home}/etc
var = ${:home}/var
# Executables put here will be started but not monitored (for startup scripts)
script = ${:etc}/run/
# Executables put here will be started and monitored (for daemons)
service = ${:etc}/service
# Path of the log directory used by our service (see [helloweb])
log = ${:var}/log
[coupler-modbus]
# the service will log here
logfile = ${directory:log}/coupler-modbus.log
# Actual script that starts the service:
# This recipe will try to "exec" the command-line after separating parameters.
recipe = slapos.cookbook:wrapper
command-line =
{{ buildout['bin-directory'] }}/pythonwitheggs {{ buildout['parts-directory'] }}/osie/eggs/osie_coupler/osie_modbus.py -p ${instance-parameter:configuration.modbus_port}
# Put this shell script in the "etc/service" directory. Each executable of this
# repository will be started and monitored by supervisord. If a service
# exits/crashes, it will trigger a "bang" and cause a re-run of the instance.
wrapper-path = ${directory:service}/coupler-modbus
# promise, that checks that helloweb service is alive
[coupler-modbus-promise]
<= monitor-promise-base
module = check_port_listening
name = coupler.py
config-hostname= ${instance-parameter:configuration.interface}
config-port = ${instance-parameter:configuration.modbus_port}
# Publish all the parameters needed for the user to connect to the instance.
# It can be anything: URL(s), password(s), or arbitrary parameters.
# Here we'll just echo back the entered name as instance parameter
[publish-connection-parameter]
recipe = slapos.cookbook:publish
modbus_port = ${instance-parameter:configuration.modbus_port}
interface = ${instance-parameter:configuration.interface}
#############################
#
# Deploy OSIE coupler instance
#
#############################
[buildout]
parts =
directory
publish-connection-parameter
coupler-opc-ua
eggs-directory = {{ buildout['eggs-directory'] }}
develop-eggs-directory = {{ buildout['develop-eggs-directory'] }}
offline = true
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 =
{{ buildout['bin-directory'] }}/server -d ${instance-parameter:configuration.coupler_block_device} -s ${instance-parameter:configuration.coupler_i2c_slave_list} -m 1 -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}
wrapper-path = ${directory:service}/coupler-opc-ua-virtual
[instance-parameter]
recipe = slapos.cookbook:slapconfiguration
computer = ${slap-connection:computer-id}
partition = ${slap-connection:partition-id}
url = ${slap-connection:server-url}
key = ${slap-connection:key-file}
cert = ${slap-connection:cert-file}
configuration.coupler_block_device = /dev/i2c-1
configuration.coupler_i2c_slave_list = 0x58
configuration.interface = 0.0.0.0
configuration.opc_ua_port = 4840
configuration.username =
configuration.password =
configuration.id = 0
configuration.heart_beat = 0
configuration.heart_beat_interval = 500
configuration.heart_beat_id_list =
configuration.network_address_url_data_type = opc.udp://224.0.0.22:4840/
configuration.heart_beat_timeout_interval = 2000
# Create all needed directories, depending on your needs
[directory]
recipe = slapos.cookbook:mkdirectory
home = ${buildout:directory}
etc = ${:home}/etc
var = ${:home}/var
script = ${:etc}/run/
service = ${:etc}/service
log = ${:var}/log
[publish-connection-parameter]
recipe = slapos.cookbook:publish
opc_ua_port = ${instance-parameter:configuration.opc_ua_port}
interface = ${instance-parameter:configuration.interface}
#############################
#
# Deploy OSIE coupler instance
#
#############################
[buildout]
parts =
directory
publish-connection-parameter
coupler-opc-ua
# Define egg directories to be the one from Software Release
# (/opt/slapgrid/...)
# Always the same.
eggs-directory = {{ buildout['eggs-directory'] }}
develop-eggs-directory = {{ buildout['develop-eggs-directory'] }}
offline = true
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 =
{{ buildout['bin-directory'] }}/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}
wrapper-path = ${directory:service}/coupler-opc-ua
[instance-parameter]
recipe = slapos.cookbook:slapconfiguration
computer = ${slap-connection:computer-id}
partition = ${slap-connection:partition-id}
url = ${slap-connection:server-url}
key = ${slap-connection:key-file}
cert = ${slap-connection:cert-file}
# below are the default as set in coupler's application
configuration.coupler_block_device = /dev/i2c-1
configuration.coupler_i2c_slave_list = 0x58
configuration.username =
configuration.password =
configuration.interface = 0.0.0.0
configuration.opc_ua_port = 4840
configuration.id = 0
configuration.heart_beat = 0
configuration.heart_beat_interval = 500
configuration.heart_beat_id_list =
configuration.network_address_url_data_type = opc.udp://224.0.0.22:4840/
configuration.heart_beat_timeout_interval = 2000
# Create all needed directories, depending on your needs
[directory]
recipe = slapos.cookbook:mkdirectory
home = ${buildout:directory}
etc = ${:home}/etc
var = ${:home}/var
script = ${:etc}/run/
service = ${:etc}/service
log = ${:var}/log
[publish-connection-parameter]
recipe = slapos.cookbook:publish
opc_ua_port = ${instance-parameter:configuration.opc_ua_port}
interface = ${instance-parameter:configuration.interface}
# the default SlapOs profile which setup a modbus server instance usually over OSIE's coupler
[buildout]
allow-picked-versions = true
extends =
https://lab.nexedi.com/nexedi/slapos/raw/master/stack/monitor/buildout.cfg
https://lab.nexedi.com/nexedi/slapos/raw/master/stack/slapos.cfg
https://lab.nexedi.com/nexedi/slapos/raw/master/component/python3/buildout.cfg
parts =
osie-repository
python-interpreter
osie-coupler-egg
slapos-cookbook
instance-profile
# fix for pypi: https://mail.python.org/pipermail/distutils-sig/2017-October/031712.html
index = https://pypi.python.org/simple/
[python]
part = python3
[pymodbus]
recipe = zc.recipe.egg:custom
egg = pymodbus[twisted]
setup-eggs =
six
[Twisted]
recipe = zc.recipe.egg:custom
egg = Twisted
setup-eggs =
incremental
[Automat]
recipe = zc.recipe.egg:custom
egg = Automat
setup-eggs =
m2r
setuptools-scm
[python-interpreter]
recipe = zc.recipe.egg
interpreter = pythonwitheggs
eggs = click
prompt_toolkit
pygments
bitarray
pyA20Lime2
${Automat:egg}
${Twisted:egg}
${pymodbus:egg}
[osie-repository]
recipe = slapos.recipe.build:gitclone
git-executable = ${git:location}/bin/git
repository = https://lab.nexedi.com/nexedi/osie.git
location = ${buildout:parts-directory}/osie
[osie-coupler-egg]
recipe = zc.recipe.egg:develop
egg = osie-coupler
setup = ${osie-repository:location}/eggs/osie_coupler/
interpreter = ${python-interpreter:interpreter}
[versions]
six = 1.15.0
attrs = 19.2.0
zope.interface = 4.4.2
Automat = 20.2.0
Pygments = 2.9.0
Twisted = 21.2.0
appdirs = 1.4.4
bcrypt = 3.2.0
bitarray = 2.1.2
constantly = 15.1.0
hyperlink = 21.0.0
incremental = 21.3.0
prompt-toolkit = 3.0.18
pymodbus = 2.5.2
pyserial = 3.5
m2r = 0.2.1
pyA20Lime2 = 0.2.1
docutils = 0.17.1
mistune = 0.8.4
setuptools-scm = 6.0.1
setuptools = 45
bcrypt = 3.2.0
cffi = 1.12
[instance-profile]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance-modbus.cfg.in
mode = 0644
rendered = ${buildout:directory}/instance.cfg
extensions = jinja2.ext.do
#filename = instance.cfg.in
context =
section buildout buildout
raw template_monitor ${monitor2-template:rendered}
# md5sum is fetched from buildout.hash.cfg and can be recalculated automatically by
# calling update-hash
# this software release compiles coupler for x86 CPU type
# this is usefull for testing purposes
[buildout]
extends =
software-opc-ua.cfg
[instance-profile]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance-opc-ua-virtual.cfg.in
mode = 0644
rendered = ${buildout:directory}/instance.cfg
extensions = jinja2.ext.do
context =
section buildout buildout
raw template_monitor ${monitor2-template:output}
key open62541_location open62541:location
key mbedtls_location mbedtls:location
[buildout]
parts =
mbedtls
open62541
compile-coupler
slapos-cookbook
instance-profile
extends =
https://lab.nexedi.com/nexedi/slapos/raw/master/stack/monitor/buildout.cfg
https://lab.nexedi.com/nexedi/slapos/raw/master/stack/slapos.cfg
https://lab.nexedi.com/nexedi/slapos/raw/master/component/cmake/buildout.cfg
https://lab.nexedi.com/nexedi/slapos/raw/master/component/git/buildout.cfg
https://lab.nexedi.com/nexedi/slapos/raw/master/component/python3/buildout.cfg
https://lab.nexedi.com/nexedi/slapos/raw/master/component/mbedtls/buildout.cfg
# use latest 2.xx release
[mbedtls]
recipe = slapos.recipe.cmmi
url = https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/v2.16.12.tar.gz
md5sum = f3a7b041c43b35c883632a1773bf61a6
configure-command = ${cmake:location}/bin/cmake -DUSE_SHARED_MBEDTLS_LIBRARY=On -DCMAKE_INSTALL_PREFIX=
[open62541-source]
recipe = slapos.recipe.build:gitclone
repository = https://github.com/open62541/open62541.git
branch = pack/v1.3.4
git-executable = ${git:location}/bin/git
[open62541]
recipe = slapos.recipe.cmmi
path = ${open62541-source:location}
configure-command =
${git:location}/bin/git submodule update --init --recursive
${cmake:location}/bin/cmake
configure-options =
-DBUILD_SHARED_LIBS=ON
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-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
[osie-repository]
recipe = slapos.recipe.build:gitclone
git-executable = ${git:location}/bin/git
repository = https://lab.nexedi.com/nexedi/osie.git
location = ${buildout:parts-directory}/osie
[compile-coupler]
recipe = slapos.recipe.cmmi
path = ${osie-repository:location}/coupler/opc-ua-server/
environment =
C_COMPILER = gcc
OPEN62541_HOME = ${open62541:location}
OPEN62541_SOURCE_HOME = ${open62541-source:location}
BINARY_OUT_DIR = ${buildout:directory}/bin
C_COMPILER_EXTRA_FLAGS = -L ${mbedtls:location}/lib -lmbedtls -lmbedx509 -lmbedcrypto -l:libopen62541.so -L${open62541:location}/lib -I${open62541:location}/include -I${open62541-source:location}/src/pubsub/ -I${open62541-source:location}/deps
# actually configure-command is useless here but needed by convention
configure-command =
${cmake:location}/bin/cmake
[instance-profile]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance-opc-ua.cfg.in
mode = 0644
rendered = ${buildout:directory}/instance.cfg
extensions = jinja2.ext.do
context =
section buildout buildout
raw template_monitor ${monitor2-template:output}
key open62541_location open62541:location
key mbedtls_location mbedtls:location
software-opc-ua.cfg
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment