Commit 7d027445 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, @lu.xu, @xavier_thompson, @Daetalus
parent cbc3929c
......@@ -16,7 +16,7 @@
[template]
filename = instance.cfg
md5sum = e2e286ba8d40790da3da462d55276e29
md5sum = d20eadffc71f23e090700b78eb132290
[amarisoft-stats.jinja2.py]
_update_hash_filename_ = amarisoft-stats.jinja2.py
......@@ -28,7 +28,7 @@ md5sum = ab666fdfadbfc7d8a16ace38d295c883
[ru_libinstance.jinja2.cfg]
_update_hash_filename_ = ru/libinstance.jinja2.cfg
md5sum = 91ef336b7e913c07d89b82b27ffad11d
md5sum = b34fb7a98e3b18cc7dade663cd1fbba2
[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 = 815d57a36c7e3b4361230fbd3c76a9ef
md5sum = 6bc5cd526ee462a3126320865c24f609
[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
......@@ -119,39 +116,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_}
......
......@@ -296,7 +296,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
......
......@@ -130,6 +130,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