instance-enb.jinja2.cfg 8.87 KB
Newer Older
1 2 3 4 5 6
[buildout]
parts =
  directory
  ltelogs
  lte-enb-config
  lte-enb-service
7
  amarisoft-stats-service
8
  sdr-busy-promise
9 10
  cell-gain-saturated-promise
  rx-saturated-promise
11
  baseband-latency-promise
12
  amarisoft-stats-log-promise
13 14 15 16
{% if slapparameter_dict.get('rrh', '') == "Lopcomm ORAN" %}
  lopcomm-rrh-stats-service
  vswr-promise
{% endif %}
17 18 19
{% if not slapparameter_dict.get("sub-instance", False) %}
  cpu-temperature-promise
{% endif %}
20
  monitor-base
21 22 23 24 25 26 27 28 29
  publish-connection-information

extends = {{ monitor_template }}

eggs-directory = {{ eggs_directory }}
develop-eggs-directory = {{ develop_eggs_directory }}
offline = true

[slap-configuration]
30
recipe = slapos.cookbook:slapconfiguration.serialised
31 32 33 34 35 36
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'] }}

37 38
configuration.network_name = RAPIDSPACE
configuration.domain = rapid.space
39 40 41 42 43 44 45 46 47 48 49 50
configuration.mme_ws_port = 9000
configuration.enb_ws_port = 9002
configuration.ims_ws_port = 9003
configuration.ims_addr = 127.0.0.1
configuration.ims_bind = 127.0.0.2
configuration.enb_addr = 127.0.1.1
configuration.default_dl_earfcn = {{ default_dl_earfcn }}
configuration.default_lte_dl_freq = {{ default_lte_dl_freq }}
configuration.default_lte_band = {{ default_lte_band }}
configuration.default_lte_n_rb_dl = {{ default_lte_n_rb_dl }}
configuration.default_lte_tx_gain = {{ default_lte_tx_gain }}
configuration.default_lte_rx_gain = {{ default_lte_rx_gain }}
51
configuration.default_lte_inactivity_timer = {{ default_lte_inactivity_timer }}
52 53
configuration.default_n_antenna_dl = {{ default_n_antenna_dl }}
configuration.default_n_antenna_ul = {{ default_n_antenna_ul }}
54 55 56 57 58 59 60 61 62

[directory]
recipe = slapos.cookbook:mkdirectory
software = {{ buildout_directory }}
home = ${buildout:directory}
etc = ${:home}/etc
var = ${:home}/var
etc = ${:home}/etc
bin = ${:home}/bin
63
tmp = ${:home}/tmp
64 65 66 67 68 69 70 71
run = ${:var}/run
script = ${:etc}/run
service = ${:etc}/service
promise = ${:etc}/promise
log = ${:var}/log

[ltelogs]
recipe = slapos.recipe.template:jinja2
72 73
url = {{ ltelogs_template }}
output = ${directory:home}/ltelogs.sh
74 75 76 77
extensions = jinja2.ext.do
context =
  section directory directory

78 79 80 81 82 83 84 85
{% if slapparameter_dict.get("enb_config_link", None) %}
[enb-config-dl]
recipe = slapos.recipe.build:download
url = {{ slapparameter_dict.get("enb_config_link") }}
version = {{ slapparameter_dict.get("enb_config_version") }}
offline = false
{% endif %}

86
[lte-enb-sh-wrapper]
87 88
recipe = slapos.recipe.template
output = ${directory:bin}/${:_buildout_section_name_}
89
enb-log = ${directory:log}/enb-output.log
90 91
inline =
  #!/bin/sh
Joanne Hugé's avatar
Joanne Hugé committed
92
{% if not slapparameter_dict.get("testing", False) %}
93 94 95
  sudo /opt/amarisoft/rm-tmp-lte;
  sudo /opt/amarisoft/init-sdr;
  sudo /opt/amarisoft/init-enb;
96 97 98 99
  (echo && echo && date "+[%Y/%m/%d %T.%N %Z] Starting eNB software..." && echo) >> ${:enb-log};
  tail -c 1M ${:enb-log} > ${:enb-log}.tmp;
  mv ${:enb-log}.tmp ${:enb-log};
  {{ enb }}/lteenb ${directory:etc}/enb.cfg >> ${:enb-log} 2>> ${:enb-log};
Joanne Hugé's avatar
Joanne Hugé committed
100
{% endif %}
101

102 103 104
### eNodeB (enb)
[lte-enb-service]
recipe = slapos.cookbook:wrapper
105 106
init = ${ltelogs:output} ${directory:log}/enb.log; sleep 2
command-line = ${lte-enb-sh-wrapper:output}
107 108 109 110 111
wrapper-path = ${directory:service}/lte-enb
mode = 0775
reserve-cpu = True
pidfile = ${directory:run}/enb.pid
hash-files =
112 113
  ${lte-enb-config:output}
  ${lte-enb-sh-wrapper:output}
114 115 116 117
environment =
  LD_LIBRARY_PATH={{ openssl_location }}/lib
  AMARISOFT_PATH=/opt/amarisoft/.amarisoft

118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
[amarisoft-stats-template]
recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do
log-output = ${directory:var}/log/amarisoft-stats.json.log
context =
  section directory directory
  key slapparameter_dict slap-configuration:configuration
  key log_file :log-output
  raw stats_period {{ slapparameter_dict.get("enb_stats_fetch_period", 60) }}
  raw testing {{ slapparameter_dict.get("testing", False) }}
  raw python_path {{ buildout_directory}}/bin/pythonwitheggs
mode = 0775
url = {{ amarisoft_stats_template }}
output = ${directory:bin}/amarisoft-stats.py

133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
[lopcomm-rrh-stats-template]
recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do
log-output = ${directory:var}/log/lopcomm-rrh-stats.log
json-log-output = ${directory:var}/log/lopcomm-rrh-stats.json.log
context =
  section directory directory
  key slapparameter_dict slap-configuration:configuration
  key log_file :log-output
  key json_log_file :json-log-output
  raw testing {{ slapparameter_dict.get("testing", False) }}
  raw python_path {{ buildout_directory}}/bin/pythonwitheggs
mode = 0775
url = {{ lopcomm_rrh_stats_template }}
output = ${directory:bin}/lopcomm-rrh-stats.py

149 150 151 152 153 154 155 156
[amarisoft-stats-service]
recipe = slapos.cookbook:wrapper
command-line = ${amarisoft-stats-template:output}
wrapper-path = ${directory:service}/amarisoft-stats
mode = 0775
hash-files =
  ${amarisoft-stats-template:output}

157 158 159 160 161 162 163 164
[lopcomm-rrh-stats-service]
recipe = slapos.cookbook:wrapper
command-line = ${lopcomm-rrh-stats-template:output}
wrapper-path = ${directory:service}/lopcomm-rrh-stats
mode = 0775
hash-files =
  ${lopcomm-rrh-stats-template:output}

165 166 167 168 169 170 171
[config-base]
recipe = slapos.recipe.template:jinja2
extensions = jinja2.ext.do
context =
  section directory directory
  section slap_configuration slap-configuration
  key slapparameter_dict slap-configuration:configuration
172 173
  key gtp_addr_v6 slap-configuration:ipv6-random
  raw gtp_addr_v4 {{ epc_ipv4 }}
174
  raw sib23 {{ sib23 }}
175 176 177 178
  import  netaddr netaddr

[lte-enb-config]
<= config-base
179
{% if slapparameter_dict.get("enb_config_link", None) %}
180
url = ${enb-config-dl:target}
181
{% else %}
182
url = {{ enb_template }}
183
{% endif %}
184
output = ${directory:etc}/enb.cfg
185 186

[publish-connection-information]
187
<= monitor-publish
188
recipe = slapos.cookbook:publish.serialised
189 190

[monitor-instance-parameter]
191
{% if slapparameter_dict.get("name", None) %}
192
monitor-title = {{ slapparameter_dict['name'] | string }}
193 194
{% endif %}
{% if slapparameter_dict.get("monitor-password", None) %}
195
password = {{ slapparameter_dict['monitor-password'] | string }}
196
{% endif %}
197 198 199 200

[sdr-busy-promise]
recipe = slapos.cookbook:promise.plugin
eggs = slapos.core
201
file = {{ sdr_busy_promise }}
202
output = ${directory:plugins}/check-sdr-busy.py
203
config-testing = {{ slapparameter_dict.get("testing", False) }}
204
config-sdr = {{ sdr }}
205 206 207

[cell-gain-saturated-promise]
recipe = slapos.cookbook:promise.plugin
208 209 210
eggs =
  slapos.core
  python-dateutil
211 212 213 214 215 216 217 218
file = {{ cell_gain_saturated_promise }}
output = ${directory:plugins}/check-cell-gain-saturated.py
config-testing = {{ slapparameter_dict.get("testing", False) }}
config-amarisoft-stats-log = ${amarisoft-stats-template:log-output}
config-stats-period = {{ slapparameter_dict.get("enb_stats_fetch_period", 60) }}

[rx-saturated-promise]
recipe = slapos.cookbook:promise.plugin
219 220 221
eggs =
  slapos.core
  python-dateutil
222 223 224 225 226 227 228
file = {{ rx_saturated_promise }}
output = ${directory:plugins}/check-rx-saturated.py
config-testing = {{ slapparameter_dict.get("testing", False) }}
config-amarisoft-stats-log = ${amarisoft-stats-template:log-output}
config-stats-period = {{ slapparameter_dict.get("enb_stats_fetch_period", 60) }}
config-max-rx-sample-db = {{ slapparameter_dict.get("max_rx_sample_db", 0) }}

229 230 231 232 233 234 235 236 237 238 239 240 241
[baseband-latency-promise]
recipe = slapos.cookbook:promise.plugin
eggs =
  slapos.core
  python-dateutil
file = {{ baseband_latency_promise }}
output = ${directory:plugins}/check-baseband-latency.py
config-testing = {{ slapparameter_dict.get("testing", False) }}
config-amarisoft-stats-log = ${amarisoft-stats-template:log-output}
config-stats-period = {{ slapparameter_dict.get("enb_stats_fetch_period", 60) }}
config-min-txrx-delay = {{ slapparameter_dict.get("min_txrx_delay", 5) }}
config-avg-txrx-delay = {{ slapparameter_dict.get("avg_txrx_delay", 7) }}

242 243 244 245 246 247 248 249 250 251
[vswr-promise]
recipe = slapos.cookbook:promise.plugin
eggs =
  slapos.core
  python-dateutil
file = {{ vswr_promise }}
output = ${directory:plugins}/check-vswr.py
config-testing = {{ slapparameter_dict.get("testing", False) }}
config-lopcomm-stats-log = ${lopcomm-rrh-stats-template:json-log-output}

252 253
[amarisoft-stats-log-promise]
recipe = slapos.cookbook:promise.plugin
254 255 256
eggs =
  slapos.core
  python-dateutil
257 258 259 260 261 262 263
file = {{ amarisoft_stats_log_promise }}
output = ${directory:plugins}/check-amarisoft-stats-log.py
config-amarisoft-stats-log = ${amarisoft-stats-template:log-output}
config-stats-period = {{ slapparameter_dict.get("enb_stats_fetch_period", 60) }}

[cpu-temperature-promise]
recipe = slapos.cookbook:promise.plugin
264 265 266
eggs =
  slapos.core
  python-dateutil
267 268 269
file = {{ cpu_temperature_promise }}
output = ${directory:plugins}/check-cpu-temperature.py
config-testing = {{ slapparameter_dict.get("testing", False) }}
270 271 272
config-max-temp = {{ slapparameter_dict.get("promise_cpu_temperature_threshold", 90) }}
config-max-avg-temp = {{ slapparameter_dict.get("promise_cpu_avg_temperature_threshold", 80) }}
config-max-avg-temp-duration = {{ slapparameter_dict.get("promise_cpu_avg_temperature_threshold_duration", 600) }}