Commit 17ea91a8 authored by Kirill Smelkov's avatar Kirill Smelkov

software/ors-amarisoft: Push code, that organizes DHCP server for Radio Units, into ru/

We already pushed dnsmasq part, that serves radio units into enb in 9f2b9db5.
However we need to push those bits further to ru/ for the following reasons:

- DHCP server is used to provide Radio Units with IP address only.
- without IP address assigned those RUs cannot be initialized and do not go to radio at all.
- in general we will need to initialize and setup radio units not only in eNB -
  for example UEsim will use the same code library to initialize radio units.
  Thus the proper place to keep everything required for RU to be operational have to
  be located inside ru/ and activated by that radio-units library.

/cc @jhuge, @xavier_thompson, @Daetalus
/reviewed-by @lu.xu
/reviewed-on !1479
parent f5a8747d
......@@ -16,7 +16,7 @@
[template]
filename = instance.cfg
md5sum = df4d6e24453b649cc20564d7fcc38e4b
md5sum = a9e416eaa3ad7d2ea29cb90ce2c41a60
[slaplte.jinja2]
_update_hash_filename_ = slaplte.jinja2
......@@ -32,7 +32,7 @@ md5sum = ab666fdfadbfc7d8a16ace38d295c883
[ru_libinstance.jinja2.cfg]
_update_hash_filename_ = ru/libinstance.jinja2.cfg
md5sum = a6b710ca5132276d72f90b76b873fe98
md5sum = ef1ba8b7404088942c4ed3d7413e0291
[ru_sdr_libinstance.jinja2.cfg]
_update_hash_filename_ = ru/sdr/libinstance.jinja2.cfg
......@@ -80,7 +80,7 @@ md5sum = 52da9fe3a569199e35ad89ae1a44c30e
[template-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
md5sum = b7eb14b96936b488280c00c67db06bd9
md5sum = 05c6562ec081f8d36e43f6ed2fd56092
[template-gnb]
_update_hash_filename_ = instance-gnb.jinja2.cfg
......@@ -134,8 +134,8 @@ md5sum = 3d7833ddba3242cedcd74c7db52390c6
filename = config/dnsmasq-core-network.jinja2.cfg
md5sum = f167b4be5e327b276b42267e0678f577
[dnsmasq-enb.jinja2.cfg]
filename = config/dnsmasq-enb.jinja2.cfg
[ru_dnsmasq.jinja2.cfg]
_update_hash_filename_ = ru/dnsmasq.jinja2.cfg
md5sum = 03e2e642d86b5c21181c7dba874cc08c
[ims.jinja2.cfg]
......
......@@ -13,9 +13,6 @@ parts =
sshd-service
sshd-add-authorized-key
sshd-promise
{% endif %}
{% if slapparameter_dict.get("dnsmasq", None) %}
dnsmasq-service
{% endif %}
check-sdr-busy.py
check-baseband-latency.py
......@@ -118,39 +115,6 @@ environment =
LD_LIBRARY_PATH={{ openssl_location }}/lib
AMARISOFT_PATH=/opt/amarisoft/.amarisoft
{% if slapparameter_dict.get("dnsmasq", None) %}
[dnsmasq-config]
recipe = slapos.recipe.template:jinja2
url = {{dnsmasq_template}}
filename = dnsmasq.cfg
extensions = jinja2.ext.do
output = ${directory:etc}/${:filename}
context =
import json_module json
import netaddr netaddr
section directory directory
section vtap_jdict vtap_jdict
json cell_list {{ rulib.cell_list | tojson }}
raw ru {{ ru }}
[dnsmasq-service]
recipe = slapos.cookbook:wrapper
port = 5353
ip = ${slap-configuration:tun-ipv4-addr}
command-line = {{ dnsmasq_location }}/sbin/dnsmasq --conf-file=${dnsmasq-config:output} -x ${directory:run}/dnsmasq.pid --local-service --keep-in-foreground
wrapper-path = ${directory:service}/dnsmasq
mode = 0775
hash-files =
${dnsmasq-config:output}
#[dnsmasq-listen-promise]
#<= monitor-promise-base
#promise = check_socket_listening
#name = dnsmasq-port-listening.py
#config-host = ${dnsmasq-service:ip}
#config-port = ${dnsmasq-service:port}
{% endif %}
[xamari-xlog-script]
recipe = slapos.recipe.template
output = ${directory:bin}/${:_buildout_section_name_}
......
......@@ -297,7 +297,7 @@ extra-context =
raw default_lte_inactivity_timer ${default-params:default-lte-inactivity-timer}
raw default_n_antenna_dl ${default-params:default-n-antenna-dl}
raw default_n_antenna_ul ${default-params:default-n-antenna-ul}
raw dnsmasq_template ${dnsmasq-enb.jinja2.cfg:target}
raw ru_dnsmasq_template ${ru_dnsmasq.jinja2.cfg:target}
raw dnsmasq_location ${dnsmasq:location}
raw fluent_bit_location ${fluent-bit:location}
raw openssh_location ${openssh:location}
......
......@@ -14,6 +14,9 @@ parts +=
[ru_libinstance.jinja2.cfg]
<= download-base
[ru_dnsmasq.jinja2.cfg]
<= download-base
[ru_tapsplit]
<= download-base
......
......@@ -113,6 +113,39 @@ init =
{%- endfor %}
{#- provide CPRI-based RUs IP address via DHCP #}
{%- if slapparameter_dict.get("dnsmasq", None) %}
[dnsmasq-config]
recipe = slapos.recipe.template:jinja2
url = {{ru_dnsmasq_template}}
filename = dnsmasq.cfg
extensions = jinja2.ext.do
output = ${directory:etc}/${:filename}
context =
import json_module json
import netaddr netaddr
section directory directory
section vtap_jdict vtap_jdict
json cell_list {{ cell_list | tojson }}
raw ru {{ ru }}
{{ part('dnsmasq-service') }}
recipe = slapos.cookbook:wrapper
port = 5353
ip = ${slap-configuration:tun-ipv4-addr}
command-line = {{ dnsmasq_location }}/sbin/dnsmasq --conf-file=${dnsmasq-config:output} -x ${directory:run}/dnsmasq.pid --local-service --keep-in-foreground
wrapper-path = ${directory:service}/dnsmasq
mode = 0775
hash-files =
${dnsmasq-config:output}
# {# promise('dnsmasq-listen') #}
#promise = check_socket_listening
#config-host = ${dnsmasq-service:ip}
#config-port = ${dnsmasq-service:port}
{%- endif %}
{#- go through all RUs and for each RU invoke
RU-specific buildout handler #}
{%- set ru_type = {'lopcomm': 'lopcomm', 'm2ru': 'sunwave'}.get(ru, 'sdr') %}
......
......@@ -24,7 +24,6 @@ parts +=
# copy all configs by default
mme.jinja2.cfg
dnsmasq-core-network.jinja2.cfg
dnsmasq-enb.jinja2.cfg
ims.jinja2.cfg
enb.jinja2.cfg
gnb.jinja2.cfg
......@@ -136,8 +135,6 @@ filename = ue_db.jinja2.cfg
filename = mme.jinja2.cfg
[dnsmasq-core-network.jinja2.cfg]
<= copy-config-to-instance
[dnsmasq-enb.jinja2.cfg]
<= copy-config-to-instance
[ims.jinja2.cfg]
<= copy-config-to-instance
filename = ims.jinja2.cfg
......
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