Commit dc4190f2 authored by Joanne Hugé's avatar Joanne Hugé

software/ors-amarisoft: update Amarisoft to 2021-09-18, remove unused parts, move stack into lte

parent 38cd0aca
......@@ -19,28 +19,36 @@ md5sum = cc4f374a1cd654e15e1b2f9e97788ffd
[template-lte-default]
_update_hash_filename_ = instance-default.jinja2.cfg
md5sum = efa0cc58edd2c8502185eaccc75dafe4
md5sum = 6675abd2d45a65efbe5b3a8e2acfd001
[template-lte-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
md5sum = 929c5e83292cb2eeb4c03a9b2b8f86d5
md5sum = 961e5eb9aafd5f9c9540aa442099997b
[template-lte-mme]
_update_hash_filename_ = instance-mme.jinja2.cfg
md5sum = ca24e07b7eb16553b6eb9c34550c9aa1
[template-lte-license]
_update_hash_filename_ = instance-license.jinja2.cfg
md5sum = f819d298e0bd3d1281f827e46722711b
md5sum = 20402c2ba9146385781c025d488d8d06
[template-lte-ims]
_update_hash_filename_ = instance-ims.jinja2.cfg
md5sum = 1d7cfface26d69f2c3a09ea4a425b96c
[template-lte-mbms]
_update_hash_filename_ = instance-mbms.jinja2.cfg
md5sum = c1431ef4f18c2ba91daa14896c5a8140
md5sum = a20e375c9649bc40986202a1d0b70968
[ue_db.py.in]
filename = ue_db.py.in
md5sum = 67160bb2cab08955e567190e5f173cdf
[enb.jinja2.cfg]
filename = config/enb.jinja2.cfg
md5sum = cc43be65aa70ca73118d85e51966bea3
[ltelogs.jinja2.sh]
filename = ltelogs.jinja2.sh
md5sum = 1ba2e065bdf14a6411e95e80db17dcfd
[mme.jinja2.cfg]
filename = config/mme.jinja2.cfg
md5sum = b27c6c8b4f023a726d9b1e4e87e52845
[ims.jinja2.cfg]
filename = config/ims.jinja2.cfg
md5sum = b4aaaeec1b356f96d910634e68f46040
/* lteenb configuration file version 2021-09-18
* Copyright (C) 2015-2021 Amarisoft
*/
#define TDD 1 // Values: 0 (FDD), 1(TDD)
#define N_RB_DL {{ slapparameter_dict.get('n_rb_dl', 100) }} // Values: 6 (1.4 MHz), 15 (3MHz), 25 (5MHz), 50 (10MHz), 75 (15MHz), 100 (20MHz)
#define N_ANTENNA_DL 2 // Values: 1 (SISO), 2 (MIMO 2x2)
#define N_ANTENNA_UL 2 // Values: 1, 2
#define CHANNEL_SIM 0 // Values: 0 (channel simulator disabled), 1 (channel simulator enabled)
{
/* Log filter: syntax: layer.field=value[,...]
Possible layers are phy, mac, rlc, pdcp, rrc, nas, s1ap, x2ap, gtpu and
all. The 'all' layer is used to address all the layers at the
same time.
field values:
- 'level': the log level of each layer can be set to 'none',
'error', 'info' or 'debug'. Use 'debug' to log all the messages.
- 'max_size': set the maximum size of the hex dump. 0 means no
hex dump. -1 means no limit.
*/
log_options: "all.level=debug,all.max_size=32",
log_filename: "{{ directory['log'] }}/enb.log",
/* Enable remote API and Web interface */
com_addr: "[{{ instance['ipv6-random'] }}]:{{ instance['configuration.enb_ws_port'] }}",
/* RF driver configuration */
rf_driver: {
name: "sdr",
/* list of devices. 'dev0' is always the master. */
args: "dev0=/dev/sdr0",
/* synchronisation source: none, internal, gps, external (default = none) */
// sync: "gps",
rx_antenna:"tx_rx",
},
tx_gain: {{ slapparameter_dict.get('tx_gain', 70.0) }}, /* TX gain (in dB) */
rx_gain: {{ slapparameter_dict.get('rx_gain', 30.0) }}, /* RX gain (in dB) */
#if CHANNEL_SIM == 1
rf_ports: [
{
channel_dl: {
type: "awgn",
noise_level: -30,
},
}
],
#endif
mme_list: [
{
/* address of MME for S1AP connection. Must be modified if the MME
runs on a different host. */
mme_addr: "127.0.1.100"
},
],
/* GTP bind address (=address of the ethernet interface connected to
the MME). Must be modified if the MME runs on a different host. */
gtp_addr: "{{ slapparameter_dict.get('gtp_addr', '127.0.1.1') }}",
/* high 20 bits of SIB1.cellIdentifier */
enb_id: 0x1A2D0,
/* list of cells */
cell_list: [
{
/* Broadcasted PLMN identities */
plmn_list: [
"00101",
],
dl_earfcn: {{ slapparameter_dict.get('dl_earfcn', 38050) }},
n_id_cell: 1,
cell_id: 0x01,
tac: 0x0001,
root_sequence_index: 204, /* PRACH root sequence index */
},
], /* cell_list */
/* default cell parameters */
cell_default: {
n_antenna_dl: N_ANTENNA_DL, /* number of DL antennas */
n_antenna_ul: N_ANTENNA_UL, /* number of UL antennas */
#if TDD == 1
uldl_config: 2, /* TDD only */
sp_config: 7, /* TDD only */
#endif
n_rb_dl: N_RB_DL, /* Bandwidth: 25: 5 MHz, 50: 10 MHz, 75: 15 MHz, 100: 20 MHz */
cyclic_prefix: "normal",
phich_duration: "normal",
phich_resource: "1", /* ratio of NG */
/* SIB1 */
si_value_tag: 0, /* increment modulo 32 if SI is modified */
cell_barred: false, /* SIB1.cellBarred-r13 */
intra_freq_reselection: true, /* SIB1.intraFreqReselection */
q_rx_lev_min: -70, /* SIB1.q-RxLevMin */
p_max: 10, /* maximum power allowed for the UE (dBm) */
si_window_length: 40, /* ms */
sib_sched_list: [
{
filename: "{{ directory['software'] }}/enb/config/sib23.asn",
si_periodicity: 16, /* frames */
},
],
#if N_RB_DL == 6
si_coderate: 0.30, /* maximum code rate for SI/RA/P-RNTI messages */
#else
si_coderate: 0.20, /* maximum code rate for SI/RA/P-RNTI messages */
#endif
si_pdcch_format: 2, /* 2 or 3. Log2 of the number of CCEs for PDCCH
for SI/RA/P-RNTI */
n_symb_cch: 0, /* number of symbols for CCH (0 = auto) */
/* PDSCH dedicated config (currently same for all UEs) */
pdsch_dedicated: {
#if N_ANTENNA_DL == 4
p_a: -6,
#elif N_ANTENNA_DL == 2
p_a: -3,
#else
p_a: 0,
#endif
p_b: -1, /* -1 means automatic */
},
/* If defined, force for number of CCEs for UE specific PDCCH to
2^pdcch_format. Otherwise it is computed from the reported
CQI. Range: 0 to 3. */
#if N_RB_DL == 6
pdcch_format: 1,
#else
pdcch_format: 2,
#endif
/* if defined, force the PDSCH MCS for all UEs. Otherwise it is
computed from the reported CQI */
/* pdsch_mcs: 12, */
#if N_RB_DL == 6
prach_config_index: 15, /* subframe 9 every 20 ms */
#else
prach_config_index: 4, /* subframe 4 every 10 ms */
#endif
prach_freq_offset: -1, /* -1 means automatic */
/* PUCCH dedicated config (currently same for all UEs) */
pucch_dedicated: {
n1_pucch_sr_count: 11, /* increase if more UEs are needed */
cqi_pucch_n_rb: 1, /* increase if more UEs are needed */
#if TDD == 1
//tdd_ack_nack_feedback_mode: "bundling", /* TDD only */
tdd_ack_nack_feedback_mode: "multiplexing", /* TDD only */
#endif
},
/* PUSCH dedicated config (currently same for all UEs) */
pusch_dedicated: {
beta_offset_ack_index: 9,
beta_offset_ri_index: 6,
beta_offset_cqi_index: 6,
},
pusch_hopping_offset: -1, /* -1 means automatic */
/* MCS for Msg3 (=CCCH RRC Connection Request) */
pusch_msg3_mcs: 0,
/* this CQI value is assumed when none is received from the UE */
#if N_RB_DL == 6
initial_cqi: 5,
#else
initial_cqi: 3,
#endif
/* if defined, force the PUSCH MCS for all UEs. Otherwise it is
computed from the last received SRS/PUSCH. */
// pusch_mcs: 18,
dl_256qam: true,
ul_64qam: true,
/* Scheduling request period (ms). Must be >= 40 for HD-FDD */
sr_period: 20,
/* CQI report config */
cqi_period: 40, /* period (ms). Must be >= 32 for HD-FDD */
#if N_ANTENNA_DL >= 2
/* RI reporting is done with a period of m_ri * cqi_period.
m_ri = 0 (default) disables RI reporting. */
m_ri: 8,
/* transmission mode */
transmission_mode: 3,
#endif
/* SRS dedicated config. All UEs share these
parameters. srs_config_index and freq_domain_position are
allocated for each UE) */
srs_dedicated: {
#if N_RB_DL == 6
srs_bandwidth_config: 7,
srs_bandwidth: 1,
#elif N_RB_DL == 15
srs_bandwidth_config: 6,
srs_bandwidth: 1,
#elif N_RB_DL == 25
srs_bandwidth_config: 3,
srs_bandwidth: 1,
#elif N_RB_DL == 50
srs_bandwidth_config: 2,
srs_bandwidth: 2,
#elif N_RB_DL == 75
srs_bandwidth_config: 2,
srs_bandwidth: 2,
#else
srs_bandwidth_config: 2,
srs_bandwidth: 3,
#endif
srs_subframe_config: 3, /* 0 - 15 */
srs_period: 40, /* period (ms). Must be >= 40 for HD-FDD */
srs_hopping_bandwidth: 0,
},
/* MAC configuration (same for all UEs) */
mac_config: {
ul_max_harq_tx: 5, /* max number of HARQ transmissions for uplink */
dl_max_harq_tx: 5, /* max number of HARQ transmissions for downlink */
},
/* CPU load limitation */
pusch_max_its: 6, /* max number of turbo decoder iterations */
/* dynamic power control */
dpc: true,
dpc_pusch_snr_target: 25,
dpc_pucch_snr_target: 20,
/* RRC/UP ciphering algorithm preference. EEA0 is always the last. */
cipher_algo_pref: [],
/* RRC integrity algorithm preference. EIA0 is always the last. */
integ_algo_pref: [2, 1],
/* (in ms) send RRC connection release after this time of network
inactivity */
inactivity_timer: 10000,
/* SRB configuration */
srb_config: [
{
id: 1,
maxRetxThreshold: 32,
t_Reordering: 45,
t_PollRetransmit: 60,
},
{
id: 2 ,
maxRetxThreshold: 32,
t_Reordering: 45,
t_PollRetransmit: 60,
}
],
/* DRB configuration */
drb_config: "{{ directory['software'] }}/enb/config/drb.cfg",
},
}
/* lteims configuration file
* version 2021-09-18
* Copyright (C) 2015-2021 Amarisoft
*/
{
log_options: "all.level=debug,all.max_size=32",
log_filename: "{{ directory['log'] }}/ims.log",
/* SIP bind address */
//sip_addr: [
// {addr: "192.168.4.1", bind_addr: "192.168.4.1", port_min: 10000, port_max: 20000},
// "2001:468:3000:1::",
// {addr: "192.168.5.1", bind_addr: "192.168.5.1", port_min: 10000, port_max: 20000},
// "2001:468:4000:1::"
//],
/* SIP bind address */
sip_addr: [
{addr: "{{ instance['tun-ipv4-addr'] }}", bind_addr: "0.0.0.0", port_min: 10000, port_max: 20000},
{#" instance['tun-ipv6-addr'] ",#}
],
mms_server_bind_addr: "{{ netaddr.IPAddress(netaddr.IPNetwork(instance['tun-ipv4-network']).first) + 1 }}:1111",
/* MME connection for SMS over SG */
sctp_addr: "{{ instance['configuration.ims_addr'] }}",
/* Cx connection */
cx_server_addr: "127.0.1.100",
cx_bind_addr: "{{ instance['configuration.ims_addr'] }}",
/* Rx connection */
rx_server_addr: "127.0.1.100",
rx_bind_addr: "{{ instance['configuration.ims_addr'] }}",
/* Remote API */
com_addr: "[{{ instance['ipv6-random'] }}]:{{ instance['configuration.ims_ws_port'] }}",
/* Global domain name (May be overriden for each user) */
domain: "{{ instance['configuration.domain'] }}",
{% if instance.get("ue_db_path") %}
include "{{ instance.get("ue_db_path") }}",
{% else %}
/* user data base */
include "{{ directory['software'] }}/mme/config/ue_db-ims.cfg",
{% endif %}
{# Example of of s6a connection #}
{# s6: { #}
{# server_addr: "", #}
{# bind_addr: "", #}
{# origin_realm: "", #}
{# origin_host: "", #}
{# }, #}
/* Echo phone number */
echo: [
"tel:666",
"tel:+666",
{impu: "tel:404", code: 404}, /* 404 test */
{impu: "urn:service:sos", anonymous: true, authentication: false}, /* Emergency call */
{impu: "urn:service:sos.police", anonymous: true, authentication: false}, /* Emergency call */
],
/* Delay */
//sms_expires: 86400,
//binding_expires: 3600,
/* on: 3GPP mode allowed
* silent: 3GPP mode forced
* off: IETF mode
*/
precondition: "on",
"100rel": true,
/* IPsec */
ipsec_aalg_list: ["hmac-md5-96", "hmac-sha-1-96"],
ipsec_ealg_list: ["null", "aes-cbc", "des-cbc", "des-ede3-cbc"],
mt_call_sdp_file: "{{ directory['software'] }}/mme/config/mt_call.sdp",
ue_db_filename: "{{ directory['var'] }}/lte_ue_ims.db",
}
/* ltemme configuration file for ims
* version 2021-09-18
* Copyright (C) 2015-2021 Amarisoft
*/
{
/* Log filter: syntax: layer.field=value[,...]
Possible layers are nas, ip, s1ap, gtpu and all. The 'all' layer
is used to address all the layers at the same time.
field values:
- 'level': the log level of each layer can be set to 'none',
'error', 'info' or 'debug'. Use 'debug' to log all the messages.
- 'max_size': set the maximum size of the hex dump. 0 means no
hex dump. -1 means no limit.
*/
log_options: "all.level=debug,all.max_size=32",
log_filename: "{{ directory['log'] }}/mme.log",
/* Enable remote API and Web interface */
com_addr: "[{{ instance['ipv6-random'] }}]:{{ instance['configuration.mme_ws_port'] }}",
/* bind address for GTP-U. Normally = address of the PC, here bound
on local interface to be able to run ltemme on the same PC as
lteenb. By default, the S1AP SCTP connection is bound on the same
address. */
gtp_addr: "127.0.1.100",
plmn: "00101",
mme_group_id: 32769,
mme_code: 1,
ims_vops_eps: true, /* IMS supported */
ims_vops_5gs_3gpp: true, /* IMS supported */
ims_vops_5gs_n3gpp: true, /* IMS supported */
//emc_bs: true, /* emergency calls supported */
//emc: 3, /* NR/E-UTRA connected to 5GCN emergency calls supported */
//emc_n3gpp: true, /* non-3GPP emergency calls supported */
emergency_number_list: [
/* Category bits: (Table 10.5.135d/3GPP TS 24.008)
Bit 1 Police
Bit 2 Ambulance
Bit 3 Fire Brigade
Bit 4 Marine Guard
Bit 5 Mountain Rescue
*/
{ category: 0x1f, digits: "911" },
{ category: 0x1f, digits: "112" },
],
rx: {
qci: {audio: 1, video: 2},
},
/* network name and network short name sent in the EMM information
message to the UE */
network_name: "{{ instance['configuration.network_name'] }}",
network_short_name: "{{ instance['configuration.network_name'] }}",
/* Control Plane Cellular IoT EPS optimization support */
cp_ciot_opt: true,
/* DCNR support */
nr_support: true,
eps_5gs_interworking: "with_n26",
/* 15 bearers support */
fifteen_bearers: false,
ims_list: [
{
ims_addr: "{{ instance['configuration.ims_addr'] }}",
bind_addr: "{{ instance['configuration.ims_bind'] }}"
}
],
/* AMF slices configuration */
/*nssai: [
{
sst: 1,
},
{
sst: 2,
},
{
sst: 3,
sd: 50,
}
],*/
/* ePDG configuration */
//epdg: {
// bind_addr: "127.0.1.100:500",
// esp_duration: 900,
// certificate: "epdg.pem",
// /* required for some buggy Mediatek phones */
// //omit_auth_in_first_auth_rsp: true
//},
/* Public Data Networks. The first one is the default. */
pdn_list: [
{
pdn_type: "ipv4",
tun_ifname: "{{ instance['tun-name'] }}",
access_point_name: ["default", "internet", "ims", "sos"],
first_ip_addr: "{{ netaddr.IPAddress(netaddr.IPNetwork(instance['tun-ipv4-network']).first) + 2 }}",
last_ip_addr: "{{ netaddr.IPAddress(netaddr.IPNetwork(instance['tun-ipv4-network']).last) - 1 }}",
ip_addr_shift: 2, /* difference between allocated IP addresses is 4 */
dns_addr: "8.8.8.8", /* Google DNS address */
// TODO: enable this instead of Google's DNS above
// dns_addr: "{{ instance['tun-ipv4-addr'] }}",
p_cscf_addr: ["{{ instance['tun-ipv4-addr'] }}"],
erabs: [
{
qci: 9,
priority_level: 15,
pre_emption_capability: "shall_not_trigger_pre_emption",
pre_emption_vulnerability: "not_pre_emptable",
},
],
},
],
/* Setup script for the network interface.
If no script is given, no network interface is created.
Script is called for each PDN with following parameters:
1) Interface name
2) PDN index
3) Access Point Name
4) IP version: 'ipv4' or 'ipv6'
5) IP address: first IP address for ipv4 and link local address for IPv6
6) First IP address
7) Last IP address
SlapOS: We suplement the script by preparing the TUN interface in slapos format phase.
Gotcha: The script has to be presented
*/
tun_setup_script: "{{ ifup_empty }}",
/* If true, inter-UE routing is done inside the MME (hence no IP
packet is output to the virtual network interface in case of
inter-UE communication). Otherwise, it is done by the Linux IP
layer. */
ue_to_ue_forwarding: false,
/* NAS ciphering algorithm preference. EEA0 is always the last. */
nas_cipher_algo_pref: [ ],
/* NAS integrity algorithm preference. EIA0 is always the last. */
nas_integ_algo_pref: [ 2, 1 ],
{% if instance.get("ue_db_path") %}
include "{{ instance.get("ue_db_path") }}",
{% else %}
/* user data base */
include "{{ directory['software'] }}/mme/config/ue_db-ims.cfg",
{% endif %}
/* persistent user database */
ue_db_filename: "{{ directory['var'] }}/lte_ue.db"
}
......@@ -47,14 +47,6 @@ 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
......@@ -69,19 +61,21 @@ config-name = epc
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"]) }}
{% if slapparameter_dict.get("tx_gain", None) %}
config-tx_gain = {{ dumps(slapparameter_dict["tx_gain"]) }}
{% endif %}
{% if slapparameter_dict.get("cell_list", None) %}
config-cell_list = {{ dumps(slapparameter_dict["cell_list"]) }}
{% if slapparameter_dict.get("rx_gain", None) %}
config-rx_gain = {{ dumps(slapparameter_dict["rx_gain"]) }}
{% endif %}
{% if slapparameter_dict.get("dl_earfcn", None) %}
config-dl_earfcn = {{ dumps(slapparameter_dict["dl_earfcn"]) }}
{% endif %}
{% if slapparameter_dict.get("n_rb_dl", None) %}
config-n_rb_dl = {{ dumps(slapparameter_dict["n_rb_dl"]) }}
{% endif %}
{% if slapparameter_dict.get("ue_db_path", None) %}
config-ue_db_path = {{ dumps(slapparameter_dict["ue_db_path"]) }}
{% endif %}
......@@ -91,7 +85,6 @@ config-ue_db_path = {{ dumps(slapparameter_dict["ue_db_path"]) }}
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 %}
......
......@@ -4,24 +4,6 @@
"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",
......@@ -34,130 +16,29 @@
"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
"default": 70.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"
"default": 30.0
},
"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"
"default": 38050
},
"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"
}
}
}
......@@ -11,7 +11,6 @@ parts =
monitor-base
publish-connection-information
extends = {{ monitor_template }}
eggs-directory = {{ eggs_directory }}
......@@ -33,46 +32,15 @@ configuration.domain = vifib.com
#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 }}
......@@ -106,14 +74,9 @@ 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}
AMARISOFT_PATH=/opt/amarisoft/.amarisoft
[config-base]
recipe = slapos.recipe.template:jinja2
......
......@@ -33,12 +33,6 @@
"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",
......
......@@ -21,12 +21,6 @@
"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": ""
}
}
}
......@@ -36,24 +36,15 @@ configuration.domain = vifib.com
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]
......@@ -87,9 +78,7 @@ 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 %}
environment = AMARISOFT_PATH=/opt/amarisoft/.amarisoft
[neouedb]
recipe = slapos.cookbook:wrapper
......
{
"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}
......@@ -4,83 +4,41 @@
"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
"default": 70.0
},
"rx_gain": {
"title": "Rx gain",
"description": "Rx gain (in dB)",
"type": "number",
"default": 53.0
}
}
"default": 30.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
"default": 38050
},
"n_id_cell": {
"title": "Physical cell ID",
"description": "Physical cell ID",
"n_rb_dl": {
"title": "DL RB",
"description": "number of DL resource blocks",
"type": "number",
"default": 1
}
},
"type": "object"
}
}
"default": 100
}
}
}
{
"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 %}
......@@ -36,24 +36,15 @@ configuration.domain = vifib.com
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
......@@ -90,14 +81,9 @@ 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}
AMARISOFT_PATH=/opt/amarisoft/.amarisoft
[neouedb]
recipe = slapos.cookbook:wrapper
......
#!/bin/bash
# Copyright (C) 2012-2015 Amarisoft
# LTE system logger version 2016-10-13
# Path for multi environment support
export PATH="$PATH:/bin/:/usr/bin/:/usr/local/bin"
while [ "$1" != "" ] ; do
if [ -e "$1" ] ; then
# Avoid storing logs with comments only
HAS_LOG=$(grep -v -l "#" $1)
if [ "$HAS_LOG" != "" ] ; then
DATE=$(date -u +%Y%m%d.%H:%M:%S | sed -e "s/ /-/g")
FILE=$(basename $1)
mv $1 "{{ directory['log'] }}/${FILE}.${DATE}"
else
rm -f $1
fi
fi
shift
done
[buildout]
extends =
buildout.hash.cfg
../../stack/amarisoft/buildout.cfg
../../stack/slapos.cfg
../../stack/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 +=
template
slapos-cookbook
python-with-eggs
monitor2-template
ltelogs.jinja2.sh
# copy all configs by default
mme.jinja2.cfg
ims.jinja2.cfg
enb.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
[ue_db.py.in]
recipe = slapos.recipe.template:jinja2
......@@ -38,8 +60,116 @@ mode = 0644
[template-lte-ims]
<= download-base
[template-lte-mbms]
<= download-base
[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
[amarisoft]
lte-version = 2021-09-18
path = /opt/amarisoft/${:lte-version}
[copy-to-instance]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:_buildout_section_name_}
[copy-config-to-instance]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/config/${:_buildout_section_name_}
[unpack-to-instance]
recipe = slapos.recipe.build:download-unpacked
url = ${amarisoft:path}/${amarisoft:lte-version}/lte${:_buildout_section_name_}-linux-${amarisoft:lte-version}.tar.gz
destination = ${buildout:directory}/${:_buildout_section_name_}
strip-top-level-dir = true
ignore-existing = true
on-update = true
[enb]
<= unpack-to-instance
md5sum = ${lteenb-linux:md5sum}
[mme]
<= unpack-to-instance
md5sum = ${ltemme-linux:md5sum}
[enb.jinja2.cfg]
<= copy-config-to-instance
filename = enb.jinja2.cfg
[ltelogs.jinja2.sh]
<= copy-to-instance
filename = ltelogs.jinja2.sh
[mme.jinja2.cfg]
<= copy-config-to-instance
filename = mme.jinja2.cfg
[ims.jinja2.cfg]
<= copy-config-to-instance
filename = ims.jinja2.cfg
[md5sum]
enb = ${enb.jinja2.cfg:md5sum}
mme = ${mme.jinja2.cfg:md5sum}
ims = ${ims.jinja2.cfg:md5sum}
[sdr]
<= unpack-to-instance
url = ${amarisoft:path}/${amarisoft:lte-version}/trx_${:_buildout_section_name_}-linux-${amarisoft:lte-version}.tar.gz
destination = ${enb:destination}/x86_64
md5sum = ${trx_sdr-linux:md5sum}
[lms]
<= unpack-to-instance
url = ${amarisoft:path}/${amarisoft:lte-version}/trx_${:_buildout_section_name_}-linux-${amarisoft:lte-version}.tar.gz
destination = ${enb:destination}/x86_64
md5sum = ${trx_lms-linux: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
[enb]
<= unpack-to-instance
md5sum = ${lteenb-linux:md5sum}
[mme]
<= unpack-to-instance
md5sum = ${ltemme-linux:md5sum}
[lteenb-linux]
filename = ${amarisoft:lte-version}/lteenb-linux-${amarisoft:lte-version}.tar.gz
md5sum = 842b1526073472a30cb0b286d3b1528c
[ltemme-linux]
filename = ${amarisoft:lte-version}/ltemme-linux-${amarisoft:lte-version}.tar.gz
md5sum = 9d7917f90c7c7b2a8ba624d874595351
[ltewww-linux]
filename = ${amarisoft:lte-version}/ltewww-linux-${amarisoft:lte-version}.tar.gz
md5sum = 416b6167f70b12910fbbb9293038554c
[trx_sdr-linux]
filename = ${amarisoft:lte-version}/trx_sdr-linux-${amarisoft:lte-version}.tar.gz
md5sum = e6960e3460f1a32c2436f36b2082995d
# this archive contains symbolic links
#[www]
#<= unpack-to-instance
#url = ${amarisoft:path}/ltewww-linux-${amarisoft:lte-version}.tar.gz
[versions]
apache-libcloud = 2.2.1
......
[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