instance-epc.jinja2.cfg 4 KB
Newer Older
1 2 3 4 5 6
[buildout]
parts =
  directory
  ltelogs
  lte-mme-config
  lte-mme-service
7
  tun-up-promise
8 9 10 11 12 13 14 15 16 17
  monitor-base
  publish-connection-information

extends = {{ monitor_template }}

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

[slap-configuration]
18
recipe = slapos.cookbook:slapconfiguration
19 20 21 22 23 24
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'] }}

25 26
configuration.network_name = RAPIDSPACE
configuration.domain = rapid.space
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
configuration.log_size = 50M
configuration.mme_ws_port = 9000
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.enb_addr = 127.0.1.1

ue_db_path = {{ ue_db_path }}

[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
65
command-line = {{ mme }}/lteims ${directory:etc}/ims.cfg
66 67 68 69 70 71 72 73
wrapper-path = ${directory:service}/lte-ims
mode = 0775
pidfile = ${directory:run}/ims.pid
hash-files =
  ${lte-ims-config:rendered}
  {{ ue_db_path }}
environment = AMARISOFT_PATH=/opt/amarisoft/.amarisoft

74 75 76 77 78 79 80 81 82
[lte-mme-sh-wrapper]
recipe = slapos.recipe.template:jinja2
rendered = ${directory:bin}/${:_buildout_section_name_}
mode = 0700
template =
  inline:#!/bin/sh
  rm -f ${directory:var}/lte_ue.db;
  {{ mme }}/ltemme ${directory:etc}/mme.cfg >> ${directory:log}/mme-output.cfg 2>> ${directory:log}/mme-output.cfg

83 84 85
### MME
[lte-mme-service]
recipe = slapos.cookbook:wrapper
86 87
# When the machine shutdowns abruptly, lte_ue is not cleaned up which causes
# amarisoft ltemme to fail. TODO: find a cleaner way to handle this
88 89
init = ${ltelogs:rendered} ${directory:log}/mme.log
command-line = ${lte-mme-sh-wrapper:rendered}
90 91 92 93 94 95
wrapper-path = ${directory:service}/lte-mme
mode = 0775
pidfile = ${directory:run}/mme.pid
hash-files =
  ${lte-mme-config:rendered}
  {{ ue_db_path }}
96
  ${lte-mme-sh-wrapper:rendered}
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
environment =
  LD_LIBRARY_PATH={{ openssl_location }}/lib:{{ nghttp2_location }}/lib
  AMARISOFT_PATH=/opt/amarisoft/.amarisoft

### 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 slap_configuration slap-configuration
  key slapparameter_dict slap-configuration:configuration
  import  netaddr netaddr

[lte-ims-config]
<= config-base
template = {{ ims_template }}
rendered = ${directory:etc}/ims.cfg

[lte-mme-config]
<= config-base
template = {{ mme_template }}
rendered = ${directory:etc}/mme.cfg
context =
  section directory directory
  section slap_configuration slap-configuration
  key slapparameter_dict slap-configuration:configuration
  import  netaddr netaddr
  key ifup_empty lte-mme-ifup-empty:wrapper-path

[monitor-instance-parameter]
monitor-title = {{ slapparameter_dict['name'] }}
password = {{ slapparameter_dict['monitor-password'] }}
137

138 139 140 141
[publish-connection-information]
<= monitor-publish
recipe = slapos.cookbook:publish

142 143 144 145 146 147 148
# Add custom promise to check if /dev/sdr0 is busy
[tun-up-promise]
recipe = slapos.cookbook:promise.plugin
eggs = slapos.core
file = {{ interface_up_promise }}
output = ${directory:plugins}/check-tun-up.py
config-ifname = ${slap-configuration:tun-name}