Commit 38cd0aca authored by Joanne Hugé's avatar Joanne Hugé

software/ors-amarisoft: add amarisoft stack and LTE softwares

parent 19fe9436
# THIS IS NOT A BUILDOUT FILE, despite purposedly using a compatible syntax.
# The only allowed lines here are (regexes):
# - "^#" comments, copied verbatim
# - "^[" section beginings, copied verbatim
# - lines containing an "=" sign which must fit in the following categorie.
# - "^\s*filename\s*=\s*path\s*$" where "path" is relative to this file
# But avoid directories, they are not portable.
# Copied verbatim.
# - "^\s*hashtype\s*=.*" where "hashtype" is one of the values supported
# by the re-generation script.
# Re-generated.
# - other lines are copied verbatim
# Substitution (${...:...}), extension ([buildout] extends = ...) and
# section inheritance (< = ...) are NOT supported (but you should really
# not need these here).
[template]
filename = instance.cfg
md5sum = cc4f374a1cd654e15e1b2f9e97788ffd
[template-lte-default]
_update_hash_filename_ = instance-default.jinja2.cfg
md5sum = efa0cc58edd2c8502185eaccc75dafe4
[template-lte-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
md5sum = 929c5e83292cb2eeb4c03a9b2b8f86d5
[template-lte-mme]
_update_hash_filename_ = instance-mme.jinja2.cfg
md5sum = ca24e07b7eb16553b6eb9c34550c9aa1
[template-lte-license]
_update_hash_filename_ = instance-license.jinja2.cfg
md5sum = f819d298e0bd3d1281f827e46722711b
[template-lte-ims]
_update_hash_filename_ = instance-ims.jinja2.cfg
md5sum = 1d7cfface26d69f2c3a09ea4a425b96c
[template-lte-mbms]
_update_hash_filename_ = instance-mbms.jinja2.cfg
md5sum = c1431ef4f18c2ba91daa14896c5a8140
[ue_db.py.in]
filename = ue_db.py.in
md5sum = 67160bb2cab08955e567190e5f173cdf
#
# Deploy LTE instance
#
[buildout]
parts =
directory
lte-enb-request
lte-epc-request
lte-ims-request
monitor-base
publish-connection-information
extends = {{ monitor_template }}
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
[instance]
recipe = slapos.cookbook:slapconfiguration.serialised
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'] }}
[directory]
recipe = slapos.cookbook:mkdirectory
software = {{ buildout_directory }}
home = ${buildout:directory}
etc = ${:home}/etc
var = ${:home}/var
etc = ${:home}/etc
bin = ${:home}/bin
run = ${:var}/run
script = ${:etc}/run
service = ${:etc}/service
promise = ${:etc}/promise
log = ${:var}/log
[request-common-base]
recipe = slapos.cookbook:request.serialised
software-url = {{ slap_connection['software-release-url'] }}
server-url = {{ slap_connection['server-url'] }}
computer-id = {{ slap_connection['computer-id'] }}
partition-id = {{ slap_connection['partition-id'] }}
key-file = {{ slap_connection['key-file'] }}
cert-file = {{ slap_connection['cert-file'] }}
{% if slapparameter_dict.get("log", None) %}
config-log = {{ dumps(slapparameter_dict["log"]) }}
{% endif %}
{% if slapparameter_dict.get("license_key_path", None) %}
config-license_key_path = {{ dumps(slapparameter_dict["license_key_path"]) }}
{% endif %}
config-monitor-password = ${monitor-htpasswd:passwd}
return = monitor-base-url
[lte-epc-request]
<= request-common-base
name = EPC
software-type = epc
config-name = epc
[lte-enb-request]
<= request-common-base
name = eNB
software-type = enb
config-name = enb
{% if slapparameter_dict.get("gtp_addr", None) %}
config-gtp_addr = {{ dumps(slapparameter_dict["gtp_addr"]) }}
{% endif %}
{% if slapparameter_dict.get("rf_params", None) %}
config-rf_params = {{ dumps(slapparameter_dict["rf_params"]) }}
{% endif %}
{% if slapparameter_dict.get("cell_list", None) %}
config-cell_list = {{ dumps(slapparameter_dict["cell_list"]) }}
{% endif %}
{% if slapparameter_dict.get("ue_db_path", None) %}
config-ue_db_path = {{ dumps(slapparameter_dict["ue_db_path"]) }}
{% endif %}
[lte-ims-request]
<= request-common-base
name = IMS
software-type = ims
config-name = ims
{% if slapparameter_dict.get("ue_db_path", None) %}
config-ue_db_path = {{ dumps(slapparameter_dict["ue_db_path"]) }}
{% endif %}
[monitor-base-url-dict]
lte-epc-request = ${lte-epc-request:connection-monitor-base-url}
lte-enb-request = ${lte-enb-request:connection-monitor-base-url}
lte-ims-request = ${lte-ims-request:connection-monitor-base-url}
[publish-connection-information]
recipe = slapos.cookbook:publish
monitor-setup-url = https://monitor.app.officejs.com/#page=settings_configurator&url=${monitor-publish-parameters:monitor-url}&username=${monitor-publish-parameters:monitor-user}&password=${monitor-publish-parameters:monitor-password}
{
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Input Parameters",
"properties": {
"log": {
"type": "object",
"title": "Log Configuration",
"properties": {
"options": {
"title": "Log Options",
"description": "Log Options",
"type": "string",
"default": "all.level=debug,all.max_size=32"
}
}
},
"license_key_path": {
"title": "License Key Path",
"description": "Path to where the license *.key files are on the filesytem (to replace ~/.license folder",
"type": "string",
"default": ""
},
"gtp_addr": {
"title": "GTP bind address",
"description": "IP address of the network interface connected to the core network",
"type": "string",
"default": "127.0.1.1"
},
"mme_addr": {
"title": "MME address",
"description": "address of MME for S1AP connection",
"type": "string",
"default": "127.0.1.100"
},
"rf_params": {
"type": "object",
"title": "RF Parameters",
"properties": {
"tx_gain": {
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": 90.0
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 53.0
}
}
},
"cell_list": {
"title": "Cell List",
"description": "Cell List",
"patternProperties": {
".*": {
"properties": {
"plmnt_list": {
"title": "PLMNs (one per line)",
"description": "PLMNs",
"type": "array"
},
"dl_earfcn": {
"title": "DL EARFCN",
"description": "Downlink EARFCN of the cell",
"type": "number",
"default": 3350
},
"cell_id": {
"title": "Cell Id",
"description": "Cell Id",
"type": "number"
},
"n_rb_dl": {
"title": "DL RB",
"description": "number of DL resource blocks",
"type": "number",
"default": 100
},
"n_id_cell": {
"title": "Physical cell ID",
"description": "Physical cell ID",
"type": "number",
"default": 1
},
"tac": {
"title": "TAC",
"description": "TAC",
"type": "number",
"default": 1
},
"root_sequence_index": {
"title": "PRACH root seq. index",
"description": "PRACH root seq. index",
"type": "number",
"default": 1
},
"n_antenna_dl": {
"title": "DL Antenna Count",
"description": "DL Antenna Count",
"type": "number",
"default": 1
},
"n_antenna_ul": {
"title": "UL Antenna Count",
"description": "UL Antenna Count",
"type": "number",
"default": 1
},
"cyclic_prefix": {
"title": "Cyclic prefix",
"description": "Cyclic prefix",
"type": "string",
"default": "normal",
"enums": [ "normal", "extended"]
},
"inactivity_timer": {
"title": "Inactivity timer",
"description": "Inactivity timer",
"type": "number",
"default": 10000
},
"srs_dedicated": {
"title": "SRS",
"description": "SRS",
"patternProperties": {
".*": {
"properties": {
"srs_period": {
"title": "Pediod",
"description": "Period",
"type": "number",
"default": 40
},
"srs_bandwidth": {
"title": "Bandwidth",
"description": "Bandwith",
"type": "number",
"default": 1
},
"srs_hopping_bandwidth": {
"title": "Hopping Bandwidth",
"description": "Bandwith",
"type": "number",
"default": 0
}
}
}
},
"type": "object"
}
},
"type": "object"
},
"type": "object"
},
"type": "object"
}
}
}
#
# Deploy LTE instance
#
[buildout]
parts =
directory
# publish-connection-parameter
ltelogs
lte-enb-config
lte-enb-service
monitor-base
publish-connection-information
extends = {{ monitor_template }}
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
[instance]
recipe = slapos.cookbook:slapconfiguration.serialised
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.network_name = VIFIB
configuration.domain = vifib.com
# Identifier of frequency and band is given by one number (e.g. 3200 for 2600Mhz band 7)
#configuration.frequency = 2600
#configuration.band = 7
configuration.log_size = 50M
configuration.mme_ws_port = 9000
configuration.mbms_ws_port= 9001
configuration.enb_ws_port = 9002
configuration.ims_ws_port = 9003
configuration.mme_addr = 127.0.1.100
configuration.ims_addr = 127.0.0.1
configuration.ims_bind = 127.0.0.2
configuration.mbms_addr = 127.0.2.1
configuration.mbms_bind = 127.0.1.200
configuration.enb_addr = 127.0.1.1
configuration.mbms_multicast_addr = 225.1.0.1
configuration.mbms_multicast_port = 7053
configuration.rf_driver = sdr
configuration.rf_driver_number = 0
[lte-config]
# use configuration for current instance
#mme_ws_port = ${instance:port_1}
#mbms_ws_port = ${instance:port_2}
#enb_ws_port = ${instance:port_3}
#ims_ws_port = ${instance:port_4}
#mme_addr = ${instance:ipv4_local_1}
#ims_addr = ${instance:ipv4_local_2}
#ims_bind = ${instance:ipv4_local_3}
#mbms_addr = ${instance:ipv4_local_4}
#mbms_bind = ${instance:ipv4_local_5}
#enb_addr = ${instance:ipv4_local_6}
#mbms_multicast_addr = ${instance:ipv4_multicast_1}
#mbms_multicast_port = ${instance:port_5}
[directory]
recipe = slapos.cookbook:mkdirectory
software = {{ buildout_directory }}
home = ${buildout:directory}
etc = ${:home}/etc
var = ${:home}/var
etc = ${:home}/etc
bin = ${:home}/bin
run = ${:var}/run
script = ${:etc}/run
service = ${:etc}/service
promise = ${:etc}/promise
log = ${:var}/log
[ltelogs]
recipe = slapos.recipe.template:jinja2
template = {{ ltelogs_template }}
rendered = ${directory:home}/ltelogs.sh
mode = 0775
extensions = jinja2.ext.do
context =
section directory directory
### eNodeB (enb)
[lte-enb-service]
recipe = slapos.cookbook:wrapper
init = ${ltelogs:rendered} ${directory:log}/enb.log; sleep 2
command-line = {{ enb }}/lteenb ${directory:etc}/enb.cfg
wrapper-path = ${directory:service}/lte-enb
mode = 0775
reserve-cpu = True
pidfile = ${directory:run}/enb.pid
{% if slapparameter_dict.get("license_key_path", None) %}
environment_amarisoft = AMARISOFT_PATH={{ slapparameter_dict.get("license_key_path", None) }}
{% else %}
environment_amarisoft =
{% endif %}
environment =
LD_LIBRARY_PATH={{ openssl_location }}/lib
${:environment_amarisoft}
[config-base]
recipe = slapos.recipe.template:jinja2
mode = 0664
extensions = jinja2.ext.do
context =
section directory directory
section instance instance
key slapparameter_dict instance:configuration
import netaddr netaddr
[lte-enb-config]
<= config-base
template = {{ enb_template }}
rendered = ${directory:etc}/enb.cfg
[publish-connection-information]
recipe = slapos.cookbook:publish.serialised
{% if slapparameter_dict.get("monitor-password", None) %}
monitor-base-url = ${monitor-instance-parameter:monitor-base-url}
{% else %}
monitor-setup-url = https://monitor.app.officejs.com/#page=settings_configurator&url=${monitor-publish-parameters:monitor-url}&username=${monitor-publish-parameters:monitor-user}&password=${monitor-publish-parameters:monitor-password}
{% endif %}
{% if slapparameter_dict.get("monitor-password", None) %}
[monitor-instance-parameter]
monitor-title = {{ slapparameter_dict['name'] }}
password = {{ slapparameter_dict['monitor-password'] }}
{% endif %}
{
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema",
"title": "EPC Input Parameters",
"properties": {
"log": {
"type": "object",
"title": "Log Configuration",
"properties": {
"options": {
"title": "Log Options",
"description": "Log Options",
"type": "string",
"default": "all.level=debug,all.max_size=32"
}
}
},
"plmn": {
"title": "PLMN",
"description": "PLMN",
"type": "string",
"default": ""
},
"mme_group_id": {
"title": "Group ID",
"description": "Group ID",
"type": "string",
"default": ""
},
"mme_code": {
"title": "Code",
"description": "Code",
"type": "string",
"default": ""
},
"license_key_path" : {
"title": "License Key Path",
"description": "Path to where the license *.key files are on the filesytem (to replace ~/.license folder",
"type": "string",
"default": ""
},
"gtp_addr": {
"title": "GTP bind address",
"description": "IP address of the network interface connected to the core network",
"type": "string",
"default": "127.0.1.1"
},
"gtp_addr": {
"title": "GTP bind address",
"description": "IP address of the network interface connected to the core network",
"type": "string",
"default": "127.0.1.1"
},
"mme_addr": {
"title": "MME address",
"description": "address of MME for S1AP connection",
"type": "string",
"default": "127.0.1.100"
},
"ims_list": {
"title": "IMS Address List",
"description": "List of IMSAddresses",
"type": "object",
"patternProperties": {
".*": {
"properties": {
"address": {
"title": "IMS address",
"description": "IMS Address",
"type": "string"
}
}
}
}
},
"rx": {
"type": "object",
"title": "RX interface",
"properties": {
"audio_qci": {
"title": "Audio QCI",
"description": "Audio QCI",
"type": "number",
"default": 1
},
"video_qci": {
"title": "Video QCI",
"description": "Video QCI",
"type": "number",
"default": 2
}
}
},
"network_name": {
"title": "Network name",
"description": "Network name",
"type": "string",
"default": "Amarisoft Network"
},
"network_short_name": {
"title": "Network short name",
"description": "Network Short Name",
"type": "string",
"default": "Amarisoft"
},
"cp_ciot_opt": {
"title": "Control Plane Cellular IoT EPS optimization",
"description": "Control Plane Cellular IoT EPS optimisation",
"type": "boolean"
},
"pdn_list": {
"title": "PDN List",
"description": "List of available Packet Data Networks",
"patternProperties": {
".*": {
"properties": {
"access_point_name": {
"title": "APN",
"description": "Access Point Name",
"type": "string",
"default": "defaultt"
},
"pdn_type": {
"title": "PDN TYPE",
"description": "PDN type can be ipv4, ipv6, ipv4v6, non-ip",
"type": "string",
"default": "ipv4"
},
"first_ip_addr": {
"title": "First IP Address",
"description": "First available IPv4 address",
"type": "string",
"default": "192.168.2.2"
},
"last_ip_addr": {
"title": "Last IP Address",
"description": "Last available IPv4 address",
"type": "string",
"default": "192.168.2.254"
},
"dns_addr": {
"title": "DNS Address",
"description": "Last available IPv4 address",
"type": "string",
"default": "8.8.8.8"
}
},
"type": "object"
},
"type": "object"
},
"type": "object"
},
"ue_db_path" : {
"title": "UE configuration path (optional)",
"description": "ue_db_path is used to extend configuration for include ue_db configuration",
"type": "string",
"default": ""
}
}
}
{
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Input Parameters",
"properties": {
"log": {
"type": "object",
"title": "Log Configuration",
"properties": {
"options": {
"title": "Log Options",
"description": "Log Options",
"type": "string",
"default": "all.level=debug,all.max_size=32"
}
}
},
"ue_db_path" : {
"title": "UE configuration path (optional)",
"description": "ue_db_path is used to extend configuration for include ue_db configuration",
"type": "string",
"default": ""
},
"license_key_path" : {
"title": "License Key Path",
"description": "Path to where the license *.key files are on the filesytem (to replace ~/.license folder",
"type": "string",
"default": ""
}
}
}
#
# Deploy EPC instance
#
[buildout]
parts =
directory
# publish-connection-parameter
ltelogs
lte-ims-config
lte-ims-service
monitor-base
publish-connection-information
neouedb
extends = {{ monitor_template }}
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
[instance]
recipe = slapos.cookbook:slapconfiguration.serialised
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.network_name = VIFIB
configuration.domain = vifib.com
# Identifier of frequency and band is given by one number (e.g. 3200 for 2600Mhz band 7)
#configuration.frequency = 2600
#configuration.band = 7
configuration.log_size = 50M
configuration.mme_ws_port = 9000
configuration.mbms_ws_port= 9001
configuration.enb_ws_port = 9002
configuration.ims_ws_port = 9003
configuration.mme_addr = 127.0.1.100
configuration.ims_addr = 127.0.0.1
configuration.ims_bind = 127.0.0.2
configuration.mbms_addr = 127.0.2.1
configuration.mbms_bind = 127.0.1.200
configuration.enb_addr = 127.0.1.1
configuration.mbms_multicast_addr = 225.1.0.1
configuration.mbms_multicast_port = 7053
configuration.rf_driver = sdr
configuration.rf_driver_number = 0
#tun-ipv4-addr = 172.0.0.1
[directory]
recipe = slapos.cookbook:mkdirectory
software = {{ buildout_directory }}
home = ${buildout:directory}
etc = ${:home}/etc
var = ${:home}/var
etc = ${:home}/etc
bin = ${:home}/bin
run = ${:var}/run
script = ${:etc}/run
service = ${:etc}/service
promise = ${:etc}/promise
log = ${:var}/log
[ltelogs]
recipe = slapos.recipe.template:jinja2
template = {{ ltelogs_template }}
rendered = ${directory:home}/ltelogs.sh
mode = 0775
extensions = jinja2.ext.do
context =
section directory directory
### IMS
[lte-ims-service]
recipe = slapos.cookbook:wrapper
init = ${ltelogs:rendered} ${directory:log}/ims.log; sleep 1
command-line = {{ mme }}/lteims ${directory:etc}/ims.cfg
wrapper-path = ${directory:service}/lte-ims
mode = 0775
pidfile = ${directory:run}/ims.pid
{% if slapparameter_dict.get("license_key_path", None) %}
environment = AMARISOFT_PATH={{ slapparameter_dict.get("license_key_path", None) }}
{% endif %}
[neouedb]
recipe = slapos.cookbook:wrapper
command-line = {{ ue_db_py }}
wrapper-path = ${directory:bin}/neouedb
mode = 0775
pidfile = ${directory:run}/neouedb.pid
[config-base]
recipe = slapos.recipe.template:jinja2
mode = 0664
extensions = jinja2.ext.do
context =
section directory directory
section instance instance
key slapparameter_dict instance:configuration
import netaddr netaddr
[lte-ims-config]
<= config-base
template = {{ ims_template }}
rendered = ${directory:etc}/ims.cfg
[publish-connection-information]
recipe = slapos.cookbook:publish.serialised
{% if slapparameter_dict.get("monitor-password", None) %}
monitor-base-url = ${monitor-instance-parameter:monitor-base-url}
{% else %}
monitor-setup-url = https://monitor.app.officejs.com/#page=settings_configurator&url=${monitor-publish-parameters:monitor-url}&username=${monitor-publish-parameters:monitor-user}&password=${monitor-publish-parameters:monitor-password}
{% endif %}
{% if slapparameter_dict.get("monitor-password", None) %}
[monitor-instance-parameter]
monitor-title = {{ slapparameter_dict['name'] }}
password = {{ slapparameter_dict['monitor-password'] }}
{% endif %}
{
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema",
"title": "EPC Input Parameters",
"properties": {
}
}
#
# Deploy LTE instance
#
[buildout]
parts =
directory
publish-connection-information
lte-license-config
lte-license-service
monitor-base
extends = {{ monitor_template }}
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
[instance]
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.licenses =
[lte-config]
# use configuration for current instance
#mme_ws_port = ${instance:port_1}
#mbms_ws_port = ${instance:port_2}
#enb_ws_port = ${instance:port_3}
#ims_ws_port = ${instance:port_4}
#mme_addr = ${instance:ipv4_local_1}
#ims_addr = ${instance:ipv4_local_2}
#ims_bind = ${instance:ipv4_local_3}
#mbms_addr = ${instance:ipv4_local_4}
#mbms_bind = ${instance:ipv4_local_5}
#enb_addr = ${instance:ipv4_local_6}
#mbms_multicast_addr = ${instance:ipv4_multicast_1}
#mbms_multicast_port = ${instance:port_5}
[directory]
recipe = slapos.cookbook:mkdirectory
software = {{ buildout_directory }}
home = ${buildout:directory}
etc = ${:home}/etc
var = ${:home}/var
etc = ${:home}/etc
run = ${:var}/run
script = ${:etc}/run
service = ${:etc}/service
promise = ${:etc}/promise
log = ${:var}/log
### LICENSE
[lte-license-service]
recipe = slapos.cookbook:wrapper
command-line = {{ license }}/ltelicense_server ${directory:etc}/license.cfg
input = ${directory:run}/license.sock
wrapper-path = ${directory:service}/lte-license
mode = 0775
pidfile = ${directory:run}/license.pid
[lte-license-config]
recipe = slapos.recipe.template:jinja2
template = ${directory:software}/config/license.jinja2.cfg
rendered = ${directory:etc}/license.cfg
mode = 0664
extensions = jinja2.ext.do
context =
section directory directory
section instance instance
[publish-connection-information]
recipe = slapos.cookbook:publish
url = ${instance:ipv6-random}:9050
monitor-setup-url = https://monitor.app.officejs.com/#page=settings_configurator&url=${monitor-publish-parameters:monitor-url}&username=${monitor-publish-parameters:monitor-user}&password=${monitor-publish-parameters:monitor-password}
{
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Input Parameters",
"properties": {
"Log": {
"type": "object",
"title": "Log Configuration",
"properties": {
"options": {
"title": "Log Options",
"description": "Log Options",
"type": "string",
"default": "all.level=debug,all.max_size=32"
}
}
},
"gtp_addr": {
"title": "GTP bind address",
"description": "IP address of the network interface connected to the core network",
"type": "string",
"default": "127.0.1.1"
},
"mme_addr": {
"title": "MME address",
"description": "address of MME for S1AP connection",
"type": "string",
"default": "127.0.1.100"
},
"ue_db_path" : {
"title": "UE configuration path (optional)",
"description": "ue_db_path is used to extend configuration for include ue_db configuration",
"type": "string",
"default": ""
},
"rf_params": {
"type": "object",
"title": "RF Parameters",
"properties": {
"tx_gain": {
"title": "Tx gain",
"description": "Tx gain (in dB)",
"type": "number",
"default": 90.0
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 53.0
}
}
},
"license_key_path" : {
"title": "License Key Path",
"description": "Path to where the license *.key files are on the filesytem (to replace ~/.license folder",
"type": "string",
"default": ""
},
"cell_list": {
"title": "Cell List",
"description": "Cell List",
"type": "object",
"patternProperties": {
".*": {
"properties": {
"dl_earfcn": {
"title": "DL EARFCN",
"description": "Downlink EARFCN of the cell",
"type": "number",
"default": 3350
},
"n_id_cell": {
"title": "Physical cell ID",
"description": "Physical cell ID",
"type": "number",
"default": 1
}
},
"type": "object"
}
}
}
}
}
{
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Input Parameters",
"properties": {
"log": {
"type": "object",
"title": "Log Configuration",
"properties": {
"options": {
"title": "Log Options",
"description": "Log Options",
"type": "string",
"default": "all.level=debug,all.max_size=32"
}
}
},
"license_key_path" : {
"title": "License Key Path",
"description": "Path to where the license *.key files are on the filesytem (to replace ~/.license folder",
"type": "string",
"default": ""
}
}
}
#
# Deploy EPC instance
#
[buildout]
parts =
directory
# publish-connection-parameter
ltelogs
lte-mbms-config
lte-mbms-service
monitor-base
publish-connection-information
extends = {{ monitor_template }}
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
[instance]
recipe = slapos.cookbook:slapconfiguration.serialised
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.network_name = VIFIB
configuration.domain = vifib.com
# Identifier of frequency and band is given by one number (e.g. 3200 for 2600Mhz band 7)
#configuration.frequency = 2600
#configuration.band = 7
configuration.log_size = 50M
configuration.mme_ws_port = 9000
configuration.mbms_ws_port= 9001
configuration.enb_ws_port = 9002
configuration.ims_ws_port = 9003
configuration.mme_addr = 127.0.1.100
configuration.ims_addr = 127.0.0.1
configuration.ims_bind = 127.0.0.2
configuration.mbms_addr = 127.0.2.1
configuration.mbms_bind = 127.0.1.200
configuration.enb_addr = 127.0.1.1
configuration.mbms_multicast_addr = 225.1.0.1
configuration.mbms_multicast_port = 7053
configuration.rf_driver = sdr
configuration.rf_driver_number = 0
[directory]
recipe = slapos.cookbook:mkdirectory
software = {{ buildout_directory }}
home = ${buildout:directory}
etc = ${:home}/etc
var = ${:home}/var
etc = ${:home}/etc
bin = ${:home}/bin
run = ${:var}/run
script = ${:etc}/run
service = ${:etc}/service
promise = ${:etc}/promise
log = ${:var}/log
[ltelogs]
recipe = slapos.recipe.template:jinja2
template = {{ ltelogs_template }}
rendered = ${directory:home}/ltelogs.sh
mode = 0775
extensions = jinja2.ext.do
context =
section directory directory
### MBMS
[lte-mbms-service]
recipe = slapos.cookbook:wrapper
init = ${ltelogs:rendered} ${directory:log}/mbms.log; sleep 3
command-line = {{ mbms }}/ltembmsgw ${directory:etc}/mbms.cfg
wrapper-path = ${directory:service}/lte-mbms
mode = 0775
pidfile = ${directory:run}/mbms.pid
{% if slapparameter_dict.get("license_key_path", None) %}
environment = AMARISOFT_PATH={{ slapparameter_dict.get("license_key_path", None) }}
{% endif %}
[config-base]
recipe = slapos.recipe.template:jinja2
mode = 0664
extensions = jinja2.ext.do
context =
section directory directory
section instance instance
key slapparameter_dict instance:configuration
import netaddr netaddr
[lte-mbms-config]
<= config-base
template = {{ mbms_template }}
rendered = ${directory:etc}/mbms.cfg
[publish-connection-information]
recipe = slapos.cookbook:publish.serialised
{% if slapparameter_dict.get("monitor-password", None) %}
monitor-base-url = ${monitor-instance-parameter:monitor-base-url}
{% else %}
monitor-setup-url = https://monitor.app.officejs.com/#page=settings_configurator&url=${monitor-publish-parameters:monitor-url}&username=${monitor-publish-parameters:monitor-user}&password=${monitor-publish-parameters:monitor-password}
{% endif %}
{% if slapparameter_dict.get("monitor-password", None) %}
[monitor-instance-parameter]
monitor-title = {{ slapparameter_dict['name'] }}
password = {{ slapparameter_dict['monitor-password'] }}
{% endif %}
#
# Deploy EPC instance
#
[buildout]
parts =
directory
# publish-connection-parameter
ltelogs
lte-mme-config
lte-mme-service
monitor-base
publish-connection-information
extends = {{ monitor_template }}
eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true
[instance]
recipe = slapos.cookbook:slapconfiguration.serialised
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.network_name = VIFIB
configuration.domain = vifib.com
# Identifier of frequency and band is given by one number (e.g. 3200 for 2600Mhz band 7)
#configuration.frequency = 2600
#configuration.band = 7
configuration.log_size = 50M
configuration.mme_ws_port = 9000
configuration.mbms_ws_port= 9001
configuration.enb_ws_port = 9002
configuration.ims_ws_port = 9003
configuration.mme_addr = 127.0.1.100
configuration.ims_addr = 127.0.0.1
configuration.ims_bind = 127.0.0.2
configuration.mbms_addr = 127.0.2.1
configuration.mbms_bind = 127.0.1.200
configuration.enb_addr = 127.0.1.1
configuration.mbms_multicast_addr = 225.1.0.1
configuration.mbms_multicast_port = 7053
configuration.rf_driver = sdr
configuration.rf_driver_number = 0
#tun-ipv4-network = 172.0.0.0/8
#tun-ipv4-addr = 172.0.0.1
#tun-name = tunabc
[directory]
recipe = slapos.cookbook:mkdirectory
software = {{ buildout_directory }}
home = ${buildout:directory}
etc = ${:home}/etc
var = ${:home}/var
etc = ${:home}/etc
bin = ${:home}/bin
run = ${:var}/run
script = ${:etc}/run
service = ${:etc}/service
promise = ${:etc}/promise
log = ${:var}/log
[ltelogs]
recipe = slapos.recipe.template:jinja2
template = {{ ltelogs_template }}
rendered = ${directory:home}/ltelogs.sh
mode = 0775
extensions = jinja2.ext.do
context =
section directory directory
### MME
[lte-mme-service]
recipe = slapos.cookbook:wrapper
init = ${ltelogs:rendered} ${directory:log}/mme.log
command-line = {{ mme }}/ltemme ${directory:etc}/mme.cfg
wrapper-path = ${directory:service}/lte-mme
mode = 0775
pidfile = ${directory:run}/mme.pid
{% if slapparameter_dict.get("license_key_path", None) %}
environment_amarisoft = AMARISOFT_PATH={{ slapparameter_dict.get("license_key_path", None) }}
{% else %}
environment_amarisoft =
{% endif %}
environment =
LD_LIBRARY_PATH={{ openssl_location }}/lib:{{ nghttp2_location }}/lib
${:environment_amarisoft}
[neouedb]
recipe = slapos.cookbook:wrapper
command-line = {{ ue_db_py }}
wrapper-path = ${directory:bin}/neouedb
mode = 0775
pidfile = ${directory:run}/neouedb.pid
### EMPTY mme-ifup script
[lte-mme-ifup-empty]
recipe = slapos.cookbook:wrapper
wrapper-path = ${directory:bin}/mme-ifup-empty
command-line = echo Using interface
mode = 775
[config-base]
recipe = slapos.recipe.template:jinja2
mode = 0664
extensions = jinja2.ext.do
context =
section directory directory
section instance instance
key slapparameter_dict instance:configuration
import netaddr netaddr
[lte-mme-config]
<= config-base
template = {{ mme_template }}
rendered = ${directory:etc}/mme.cfg
context =
section directory directory
section instance instance
key slapparameter_dict instance:configuration
import netaddr netaddr
key ifup_empty lte-mme-ifup-empty:wrapper-path
[publish-connection-information]
recipe = slapos.cookbook:publish.serialised
{% if slapparameter_dict.get("monitor-password", None) %}
monitor-base-url = ${monitor-instance-parameter:monitor-base-url}
{% else %}
monitor-setup-url = https://monitor.app.officejs.com/#page=settings_configurator&url=${monitor-publish-parameters:monitor-url}&username=${monitor-publish-parameters:monitor-user}&password=${monitor-publish-parameters:monitor-password}
{% endif %}
{% if slapparameter_dict.get("monitor-password", None) %}
[monitor-instance-parameter]
monitor-title = {{ slapparameter_dict['name'] }}
password = {{ slapparameter_dict['monitor-password'] }}
{% endif %}
[buildout]
parts =
dynamic-template-lte-default
switch-softwaretype
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[instance]
recipe = slapos.cookbook:slapconfiguration.serialised
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}
[jinja2-template-base]
recipe = slapos.recipe.template:jinja2
rendered = $${buildout:directory}/$${:filename}
extra-context =
context =
import json_module json
key eggs_directory buildout:eggs-directory
key develop_eggs_directory buildout:develop-eggs-directory
raw buildout_directory ${buildout:directory}
section slap_connection slap-connection
key slapparameter_dict instance:configuration
$${:extra-context}
[switch-softwaretype]
recipe = slapos.cookbook:softwaretype
default = $${dynamic-template-lte-default:rendered}
enb = $${dynamic-template-lte-enb:rendered}
epc = $${dynamic-template-lte-mme:rendered}
ims = $${dynamic-template-lte-ims:rendered}
[dynamic-template-lte-default]
< = jinja2-template-base
template = ${template-lte-default:target}
filename = instance-lte-default.cfg
extensions = jinja2.ext.do
extra-context =
raw monitor_template ${monitor2-template:rendered}
[dynamic-template-lte-enb]
< = jinja2-template-base
template = ${template-lte-enb:target}
filename = instance-lte-enb.cfg
extensions = jinja2.ext.do
extra-context =
raw monitor_template ${monitor2-template:rendered}
raw enb ${enb:destination}
raw enb_template ${enb.jinja2.cfg:target}
raw ltelogs_template ${ltelogs.jinja2.sh:target}
raw openssl_location ${openssl:location}
[dynamic-template-lte-mme]
< = jinja2-template-base
template = ${template-lte-mme:target}
filename = instance-lte-mme.cfg
extensions = jinja2.ext.do
extra-context =
raw monitor_template ${monitor2-template:rendered}
raw mme ${mme:destination}
raw mme_template ${mme.jinja2.cfg:target}
raw ltelogs_template ${ltelogs.jinja2.sh:target}
raw ue_db_py ${ue_db.py.in:rendered}
raw openssl_location ${openssl:location}
raw nghttp2_location ${nghttp2:location}
[dynamic-template-lte-ims]
< = jinja2-template-base
template = ${template-lte-ims:target}
filename = instance-lte-ims.cfg
extensions = jinja2.ext.do
extra-context =
raw monitor_template ${monitor2-template:rendered}
raw mme ${mme:destination}
raw ims_template ${ims.jinja2.cfg:target}
raw ltelogs_template ${ltelogs.jinja2.sh:target}
raw ue_db_py ${ue_db.py.in:rendered}
[buildout]
extends =
buildout.hash.cfg
../../stack/amarisoft/buildout.cfg
parts +=
template
[ue_db.py.in]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/${:filename}
rendered = ${buildout:directory}/bin/neouedb
mode = 0755
context =
key python python-with-eggs:interpreter
key directory buildout:directory
[template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/template.cfg
mode = 0644
[download-base]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:_update_hash_filename_}
mode = 0644
[template-lte-default]
<= download-base
[template-lte-enb]
<= download-base
[template-lte-mme]
<= download-base
[template-lte-ims]
<= download-base
[template-lte-mbms]
<= download-base
[versions]
apache-libcloud = 2.2.1
gitdb2 = 2.0.3
slapos.recipe.template = 4.2
smmap2 = 2.0.3
BTrees = 4.5.0:whl
ZODB = 5.4.0
cython-zstd = 0.2
msgpack-python = 0.5.6
mysqlclient = 1.3.12
neoppod = 1.9
persistent = 4.2.4.2
transaction = 2.2.1
zeodbpickle = 1.0.1
ZODB3 = 3.11.0
zodbpickle = 1.0.4
ZEO = 5.2.2
# Required by:
# ZODB==5.4.0
ZConfig = 3.2.0
# Required by:
# neoppod==1.9
python-dateutil = 2.7.3:whl
# Required by:
# ZODB==5.4.0
zc.lockfile = 1.3.0
# Required by:
# ZEO==5.2.2
# trollius==2.2.post1
futures = 3.3.0
# Required by:
# ZEO==5.2.2
trollius = 2.2.post1
{
"name": "LTE",
"description": "LTE",
"serialisation": "json-in-xml",
"software-type": {
"enb": {
"title": "eNB",
"software-type": "enb",
"description": "eNodeB Configuration",
"request": "instance-enb-input-schema.json",
"response": "instance-enb-schema.json",
"index": 0
},
"epc": {
"title": "EPC",
"software-type": "epc",
"description": "EPC Configuration",
"request": "instance-epc-input-schema.json",
"response": "instance-epc-schema.json",
"index": 1
},
"ims": {
"title": "IMS",
"software-type": "ims",
"description": "IMS Configuration",
"request": "instance-ims-input-schema.json",
"response": "instance-ims-schema.json",
"index": 2
},
"ims": {
"title": "MBMS",
"software-type": "mbms",
"description": "MBMS Configuration",
"request": "instance-mbms-input-schema.json",
"response": "instance-mbms-schema.json",
"index": 2
},
"license-server": {
"title": "License Server",
"software-type": "license",
"description": "License Server",
"request": "instance-license-server-input-schema.json",
"response": "instance-license-schema.json",
"index": 2
},
"default": {
"title": "Default",
"software-type": "default",
"description": "Default",
"request": "instance-lte-input-schema.json",
"response": "instance-lte-schema.json",
"index": 3
}
}
}
#!{{directory}}/bin/{{ python }}
from ZODB import DB
from BTrees.OOBTree import OOBTree
from neo.client.Storage import Storage
from neo.lib import logging
from time import sleep
import argparse
import json
import transaction
import hashlib
def main():
parser = argparse.ArgumentParser(
description="Save a dict on NEO Storage",
)
_ = parser.add_argument
_('--ca', help="Path to the ca.crt file.")
_('--key', help="Path to the neo.crt file.")
_('--cert', help="Path to the neo.crt file.")
_('--ue_db', help="Path to the ue_db file.")
_('--master', help="Address to a NEO Master Node.",
default='[2001:67c:1254:e:ad::a164]:2051')
_('--log', help="Path to the log file.",
default="x.log")
_('--name', help="Name of the Database to store the json.",
default='simcarddb')
_('-v', '--verbose', action='store_true',
help="Show the results on stdout.")
config = parser.parse_args()
logging.backlog(max_size=None, max_packet=None) # log everything & without bufferring
kw= {
'master_nodes': config.master, # M on webr-wneo-2
'name': config.name, #'simcarddb',
#'read_only': True,
'logfile': config.log,
'ca': config.ca,
'cert': config.cert,
'key': config.key
}
stor = Storage(**kw)
db = DB(stor)
conn = db.open()
root = conn.root()
try:
tree = root["v1"]
except KeyError:
root["v1"] = OOBTree()
root["v1"].update({"index": "NOT_SET_YET"})
try:
with open(config.ue_db + '.index', "r") as f:
index = f.read()
except (ValueError, IOError):
# File don't exist yet
index = ""
if index == root["v1"]['index']:
print "Nothing to do"
return
ue_db = []
for ek in root["v1"]["json"]:
sim_entry = "\n"
entry = root["v1"]["json"][ek]
for k in ["sim_algo", "imsi", "opc",
"amf", "sqn", "K", "impu", "impi"]:
value = entry.get(k, None)
if value is not None:
if "[" in value:
sim_entry += ' %s: %s,\n' % (k, value)
else:
sim_entry += ' %s: "%s",\n' % (k, value)
if sim_entry != "\n":
ue_db.append(sim_entry)
output_db = """ue_db: [{ %s }]
""" % ('},{'.join(ue_db))
with open(config.ue_db, "w") as f:
f.write(output_db)
with open(config.ue_db + '.index', "w") as f:
f.write(root["v1"]['index'])
print "Updated to %s." % root["v1"]['index']
if __name__ == '__main__':
main()
{
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Input Parameters",
"properties": {
}
}
{
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema",
"title": "Input Parameters",
"properties": {
"sim_algo": {
"title": "sim_algo",
"description": "",
"type": "string",
"default": ""
},
"imsi": {
"title": "imsi",
"description": "imsi",
"type": "string",
"default": ""
},
"op": {
"title": "op",
"description": "op",
"type": "string",
"default": ""
},
"opc": {
"title": "opc",
"description": "opc",
"type": "string",
"default": ""
},
"amf": {
"title": "amf",
"description": "amf",
"type": "string",
"default": ""
},
"sqn": {
"title": "sqn",
"description": "sqn",
"type": "string",
"default": ""
},
"K": {
"title": "K",
"description": "K",
"type": "string",
"default": ""
},
"impu": {
"title": "impu",
"description": "impu",
"type": "string",
"default": ""
},
"impi": {
"title": "impi",
"description": "impi",
"type": "string",
"default": ""
},
"authent_type": {
"title": "authent_type",
"description": "authent_type",
"type": "string",
"default": ""
},
"domain": {
"title": "domain",
"description": "domain",
"type": "string",
"default": ""
}
}
}
[buildout]
extends =
../../stack/simcarddb/buildout.cfg
[versions]
pyasn1 = 0.4.2
zope.testing = 4.6.2
# Required by:
# ZODB==4.4.5
# zodburi==2.3.0
ZConfig = 3.2.0
# Required by:
# slapos.toolbox==0.76
erp5.util = 0.4.50
# Required by:
# neoppod==1.9
python-dateutil = 2.7.2
# Required by:
# ZODB==4.4.5
zc.lockfile = 1.2.1
{
"name": "SimcardDB",
"description": "SimcardDB",
"serialisation": "xml",
"software-type": {
"default-slave": {
"title": "SimCard",
"software-type": "default",
"description": "Input your Simcard Information",
"request": "instance-simcarddb-slave-input-schema.json",
"response": "instance-simcarddb-slave-outuput-schema.json",
"shared": true,
"index": 1
},
"default": {
"title": "Server",
"software-type": "default",
"description": "Server",
"request": "instance-simcarddb-input-schema.json",
"response": "instance-simcarddb-outuput-schema.json",
"index": 2
}
}
}
[buildout]
extends =
../slapos.cfg
../monitor/buildout.cfg
../../component/logrotate/buildout.cfg
../../component/gzip/buildout.cfg
../../component/msgpack-python/buildout.cfg
../../component/cython-zstd/buildout.cfg
../../component/python-mysqlclient/buildout.cfg
../../component/python-mysqlclient/buildout.cfg
../../component/nghttp2/buildout.cfg
parts =
slapos-cookbook
directory
python-with-eggs
monitor2-template
ltelogs.jinja2.sh
# copy all configs by default
mme.jinja2.cfg
ims.jinja2.cfg
enb.jinja2.cfg
mbms.jinja2.cfg
# license.jinja2.cfg
# sdr driver is dependent on ENB thus should be added explicitely by software.cfg
sdr-driver
# unimplemented parts - the http monitor and better log handling using logrotate
# apache-php
# logrotate
gzip
[neoppod-repository]
recipe = slapos.recipe.build:gitclone
repository = https://lab.nexedi.com/nexedi/neoppod.git
git-executable = ${git:location}/bin/git
[neoppod-setup-env]
PATH = ${git:location}/bin:%(PATH)s
[neoppod-develop]
recipe = zc.recipe.egg:develop
setup = ${neoppod-repository:location}
environment = neoppod-setup-env
[python-with-eggs]
recipe = zc.recipe.egg
interpreter = ${:_buildout_section_name_}
eggs =
neoppod[client]
BTrees
ZODB
[directory]
recipe = plone.recipe.command
config = ${buildout:directory}/config
command = mkdir -p ${buildout:directory}/config
stop-on-error = true
[amarisoft]
path = /opt/amarisoft
[copy-to-instance]
recipe = slapos.recipe.build:download
url = ${amarisoft:path}/${:_buildout_section_name_}
[copy-config-to-instance]
recipe = slapos.recipe.build:download
url = ${amarisoft:path}/config/${:_buildout_section_name_}
filename = ${:_buildout_section_name_}
[unpack-to-instance]
recipe = slapos.recipe.build:download-unpacked
lte-version = 2020-09-14
url = ${amarisoft:path}/${:lte-version}/lte${:_buildout_section_name_}-linux-${:lte-version}.tar.gz
destination = ${buildout:directory}/${:_buildout_section_name_}
strip-top-level-dir = true
ignore-existing = true
on-update = true
[enb.jinja2.cfg]
<= copy-config-to-instance
md5sum = 1716acb27dec624613eed7a8fe3fb499
[ltelogs.jinja2.sh]
<= copy-to-instance
md5sum = 1ba2e065bdf14a6411e95e80db17dcfd
[mme.jinja2.cfg]
<= copy-config-to-instance
md5sum = 295435feabd729c85eba4f2beeb33cbe
[ims.jinja2.cfg]
<= copy-config-to-instance
md5sum = 0dfa8f76838d9287ebe18e1276e21a80
[mbms.jinja2.cfg]
<= copy-config-to-instance
md5sum = d0a30c80ea8b0060db6a52320048549a
[license.jinja2.cfg]
<= copy-config-to-instance
md5sum = 1fd59d9f593122ab243881155e01c4f6
[enb]
<= unpack-to-instance
md5sum = ${lteenb-linux-2020-09-14:md5sum}
[mbmsgw]
<= unpack-to-instance
md5sum = ${ltembmsgw-linux-2020-09-14:md5sum}
[mme]
<= unpack-to-instance
md5sum = ${ltemme-linux-2020-09-14:md5sum}
[md5sum]
enb = ${enb.jinja2.cfg:md5sum}
mme = ${mme.jinja2.cfg:md5sum}
mbms = ${mbms.jinja2.cfg:md5sum}
ims = ${ims.jinja2.cfg:md5sum}
[sdr]
<= unpack-to-instance
url = ${amarisoft:path}/${:lte-version}/trx_${:_buildout_section_name_}-linux-${:lte-version}.tar.gz
destination = ${enb:destination}/x86_64
md5sum = ${trx_sdr-linux-2020-09-14:md5sum}
[lms]
<= unpack-to-instance
url = ${amarisoft:path}/${:lte-version}/trx_${:_buildout_section_name_}-linux-${:lte-version}.tar.gz
destination = ${enb:destination}/x86_64
md5sum = ${trx_lms-linux-2020-09-14:md5sum}
[sdr-driver]
# move trx_sdr.so next to lteenb binary
recipe = slapos.recipe.build:download
url = ${sdr:destination}/trx_sdr.so
destination = ${enb:destination}/trx_sdr.so
#md5sum = 16cd39307bc85c17dcb7ff05157e2cff
[lteenb-linux-2020-09-14]
filename = 2020-09-14/lteenb-linux-2020-09-14.tar.gz
md5sum = afa275e8c16512d55f63690abeb08372
[ltembmsgw-linux-2020-09-14]
filename = 2020-09-14/ltembmsgw-linux-2020-09-14.tar.gz
md5sum = 0ac8c5fa4a0161a44d88ce406c548f7b
[ltemme-linux-2020-09-14]
filename = 2020-09-14/ltemme-linux-2020-09-14.tar.gz
md5sum = bb5dd3456f616d045dc2f207df03d2f7
[ltewww-linux-2020-09-14]
filename = 2020-09-14/ltewww-linux-2020-09-14.tar.gz
md5sum = a251e7a3f1584d5ee4d8c8bb496b1bb8
[trx_sdr-linux-2020-09-14]
filename = 2020-09-14/trx_sdr-linux-2020-09-14.tar.gz
md5sum = 19a11cdc49473cb91e21dc47459f575a
# this archive contains symbolic links
#[www]
#<= unpack-to-instance
#url = ${amarisoft:path}/ltewww-linux-${:lte-version}.tar.gz
[buildout]
extends =
https://lab.nexedi.com/nexedi/slapos/raw/07021e01b6ba9b3aee1eb7e1b4c1b68f44272193/software/neoppod/software-common.cfg
parts +=
template
[directory]
recipe = slapos.cookbook:mkdirectory
home = ${buildout:directory}
config = ${:home}/config
parts +=
# NEO instanciation
template
[instance-neo-storage-sqlite]
<= download-base-neo
md5sum = 5f0b84fb9644b76722655b1b50ed5ed5
url = ${:_profile_base_location_}/${:_buildout_section_name_}.cfg.in
[instance-slave-db]
<= download-base-neo
md5sum = 417bde0fe84ac8322d17b1dd340e5f01
url = ${:_profile_base_location_}/${:_buildout_section_name_}.json.in
[instance-simcarddb-cluster]
<= download-base-neo
md5sum = 8033c8256ac94c9896af3d4c7a19b015
url = ${:_profile_base_location_}/${:_buildout_section_name_}.cfg.in
[store.py.in]
<= download-base-neo
md5sum = 6c18e41bdd5c5ddc1f91061f608e7e6b
url = ${:_profile_base_location_}/${:_buildout_section_name_}
[template]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance.cfg.in
md5sum = 2f43e6637c5a7bb8fa1340f2037a511a
# XXX: "template.cfg" is hardcoded in instanciation recipe
rendered = ${buildout:directory}/template.cfg
context =
key bin_directory buildout:bin-directory
key instance_common_cfg instance-common:rendered
key neo_storage_sqlite instance-neo-storage-sqlite:target
key cluster instance-simcarddb-cluster:target
key neo_cluster cluster:target
key store_py_in store.py.in:target
key root_common root-common:target
key instance_slave_db_json instance-slave-db:target
[cluster]
<= download-base-neo
md5sum = ee8401a4e7d82bf488a57e3399f9ce48
[neoppod]
interpreter = pythonwitheggs
#!/bin/sh -e
DAYS=2000
at_exit() { rm -f "$CAkey"; }
trap at_exit 0
CAkey=`mktemp`
openssl req -new -x509 -nodes -keyout "$CAkey" -out ca.crt -subj /CN=CA -days $DAYS
openssl req -new -nodes -keyout node.key -subj /CN=node |
openssl x509 -CA ca.crt -CAkey "$CAkey" -req -out node.crt -set_serial 1 -days $DAYS
{% macro section(name) %}{% do part_list.append(name) %}{{ name }}{% endmacro -%}
{% set part_list = [] -%}
{% set init_list = [] -%}
{% set master_list = [] -%}
{% set admin_list = [] -%}
{% for k, v in slapparameter_dict.iteritems() -%}
{% if k.startswith('master-') and v -%}
{% do master_list.append(v) -%}
{% endif -%}
{% if k.startswith('admin-') and v -%}
{% do admin_list.append(v) -%}
{% endif -%}
{% endfor -%}
[publish]
recipe = slapos.cookbook:publish.serialised
# TODO: make port a partition parameter
ip = {{ "[%s]" % list(ipv6_set)[0] if ipv6_set else list(ipv4_set)[0] }}
{% set admin = slapparameter_dict.get('admin', 2050) -%}
{% set master = slapparameter_dict.get('master', 2051) -%}
{% if master -%}
port-master = {{ master }}
master = ${:ip}:${:port-master}
{% else -%}
master =
{% endif -%}
{% if admin -%}
port-admin = {{ admin }}
admin = ${:ip}:${:port-admin}
{% else -%}
admin =
{% endif -%}
masters = {{ ' '.join(sorted(master_list)) }}
{%- if admin_list %}
admins = {{ ' '.join(sorted(admin_list)) }}
{%- endif %}
{#- Hack to deploy SSL certs via instance parameters #}
{%- for name, pem in zip(('ca.crt', 'neo.crt', 'neo.key'),
slapparameter_dict['ssl']) %}
{%- if pem %}
[{{ section(name) }}]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:etc}/{{name}}
template = inline:{{'{{'}}pem}}
context = key pem :pem
pem = {{dumps(pem)}}
{%- endif %}
{%- endfor %}
{#- endhack #}
[neo-storage]
recipe = slapos.cookbook:neoppod.storage
binary = {{ bin_directory }}/neostorage
ip = ${publish:ip}
ssl = {{ dumps(bool(slapparameter_dict['ssl'])) }}
cluster = {{ dumps(slapparameter_dict['cluster']) }}
masters = ${publish:masters}
database-adapter = SQLite
wait-database = -1
engine = {{ slapparameter_dict.get('engine', '') }}
dedup = {{ dumps(bool(slapparameter_dict.get('data-deduplication'))) }}
disable-drop-partitions = {{ dumps(bool(slapparameter_dict.get('disable-drop-partitions'))) }}
{% for i in range(slapparameter_dict.get('storage-count', 1)) -%}
{% set storage_id = 'neo-storage-' ~ i -%}
[{{ section(storage_id) }}]
< = neo-storage
wrapper = ${directory:etc_run}/{{ 'neostorage-' ~ i }}
logfile = ${directory:log}/{{ 'neostorage-' ~ i }}.log
{% do init_list.append('CREATE DATABASE IF NOT EXISTS neo' ~ i ~ ';') -%}
database-parameters = ${directory:var}/neo{{ i }}.db
[{{ section('logrotate-storage-' ~ i) }}]
< = logrotate-entry-base
name = {{ storage_id }}
log = {{ '${' + storage_id + ':logfile}' }}
post = {{ bin_directory }}/slapos-kill -s RTMIN+1 -- {{ bin_directory }}/neostorage -l ${:log}
{% endfor -%}
[init-script]
recipe = slapos.recipe.template:jinja2
# XXX: is there a better location ?
rendered = ${directory:etc}/mariadb_initial_setup.sql
template = inline:
{{ init_list | join('\n\t') }}
[directory]
recipe = slapos.cookbook:mkdirectory
promises = ${buildout:directory}/etc/promises
bin = ${buildout:directory}/bin
etc = ${buildout:directory}/etc
var = ${buildout:directory}/var
etc_run = ${:etc}/run
var_run = ${:var}/run
srv_mariadb = ${buildout:directory}/srv/mariadb
log = ${buildout:directory}/var/log
tmp = ${buildout:directory}/tmp
[buildout]
extends =
{{ logrotate_cfg }}
{%- if master %}
{{ master_cfg }}
{%- endif %}
{%- if admin %}
{{ admin_cfg }}
{%- endif %}
parts +=
{{ '\n '.join(part_list) }}
[buildout]
extends = {{ neo_cluster }}
parts += directory
store-service
[slap-parameter]
# Fetches parameters defined in SlapOS Master for this instance.
# Always the same.
recipe = slapos.cookbook:slapconfiguration.serialised
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}
[directory]
recipe = slapos.cookbook:mkdirectory
srv = ${buildout:directory}/srv
bin = ${buildout:directory}/bin
etc = ${buildout:directory}/etc
run = ${:etc}/run
var = ${buildout:directory}/var
log = ${buildout:directory}/var/log
var_run = ${buildout:directory}/var/run
[ca.crt]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:etc}/ca.crt
template = inline:{{'{{'}}pem}}
context = key pem :pem
pem = ${slap-parameter:configuration._ca}
[neo.crt]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:etc}/neo.crt
template = inline:{{'{{'}}pem}}
context = key pem :pem
pem = ${slap-parameter:configuration._cert}
[neo.key]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:etc}/neo.key
template = inline:{{'{{'}}pem}}
context = key pem :pem
pem = ${slap-parameter:configuration._key}
[slave_db]
recipe = slapos.recipe.template:jinja2
template = {{ instance_slave_db_json }}
rendered = ${directory:srv}/db.json
extensions = jinja2.ext.do
context =
import json_module json
key slave_instance_list slap-parameter:slave-instance-list
[store_db]
recipe = slapos.recipe.template:jinja2
template = {{ store_py_in }}
rendered = ${directory:bin}/neostore
extensions = jinja2.ext.do
store_exectutable = {{ bin_directory }}/pythonwitheggs
context =
import json_module json
key executable store_db:store_exectutable
[store-service]
recipe = slapos.cookbook:wrapper
command-line = ${store_db:rendered} --ca ${ca.crt:rendered} --cert ${neo.crt:rendered} --name simcarddb --master ${node-0-final:connection-masters} --key ${neo.key:rendered} --json ${slave_db:rendered} --log ${directory:log}/store.log
wrapper-path = ${directory:run}/store_simcarddb
mode = 0775
pidfile = ${directory:var_run}/neo.pid
{# format the json to determinate the API #}
{% set db_dict = {} %}
{% for slave in slave_instance_list %}
{% do db_dict.__setitem__(slave.get('slave_reference'), slave) %}
{% endfor %}
{{ json_module.dumps(db_dict) }}
[buildout]
extends = {{ instance_common_cfg }}
[jinja2-template-base]
rendered = ${buildout:parts-directory}/${:_buildout_section_name_}.cfg
[neo-cluster]
<= jinja2-template-base
template = {{ neo_cluster }}
extra-context =
import urlparse urlparse
import-list =
rawfile root_common {{ root_common }}
[simcard-cluster]
<= jinja2-template-base
template = {{ cluster }}
extra-context =
import urlparse urlparse
raw instance_slave_db_json {{ instance_slave_db_json }}
raw store_py_in {{ store_py_in }}
key neo_cluster neo-cluster:rendered
[neo-storage-sqlite]
<= jinja2-template-base
template = {{ neo_storage_sqlite }}
extra-context =
key master_cfg neo-master:rendered
key admin_cfg neo-admin:rendered
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
override = {{ dumps(override_switch_softwaretype |default) }}
default = simcard-cluster:rendered
# BBB
RootSoftwareInstance = ${:default}
neo = neo-storage-sqlite:rendered
#!{{executable}}
from ZODB import DB
from BTrees.OOBTree import OOBTree
from neo.client.Storage import Storage
from neo.lib import logging
from time import sleep
import argparse
import json
import transaction
import hashlib
def main():
parser = argparse.ArgumentParser(
description="Save a dict on NEO Storage",
)
_ = parser.add_argument
_('--ca', help="Path to the ca.crt file.")
_('--key', help="Path to the neo.crt file.")
_('--cert', help="Path to the neo.crt file.")
_('--json', help="Path to the json file.")
_('--master', help="Address to a NEO Master Node.",
default='[2001:67c:1254:e:ad::a164]:2051')
_('--log', help="Path to the log file.",
default="x.log")
_('--name', help="Name of the Database to store the json.",
default='simcarddb')
_('-v', '--verbose', action='store_true',
help="Show the results on stdout.")
config = parser.parse_args()
master = config.master
if master.startswith("!py!"):
master = master[4:]
if master.startswith("u["):
master = master[1:]
logging.backlog(max_size=None, max_packet=None) # log everything & without bufferring
kw= {
'master_nodes': master, # M on webr-wneo-2
'name': config.name, #'simcarddb',
#'read_only': True,
'logfile': config.log,
'ca': config.ca,
'cert': config.cert,
'key': config.key
}
stor = Storage(**kw)
db = DB(stor)
conn = db.open()
root = conn.root()
try:
tree = root["v1"]
except KeyError:
root["v1"] = OOBTree()
root["v1"].update({"index": "NOT_SET_YET"})
with open(config.json) as f:
j = json.load(f)
index = hashlib.md5(str(j)).hexdigest()
if index == root["v1"]['index']:
print "Nothing to do"
return
root["v1"].update({"index": index,
"json": j})
transaction.commit()
print "Updated to %s." % root["v1"]['index']
if __name__ == '__main__':
main()
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