Init commit for standalone enodebd

Change-Id: I88eeef5135dd7ba8551ddd9fb6a0695f5325337b
diff --git a/magma_configs/control_proxy.yml b/magma_configs/control_proxy.yml
new file mode 100644
index 0000000..f245362
--- /dev/null
+++ b/magma_configs/control_proxy.yml
@@ -0,0 +1,52 @@
+---
+#
+# Copyright 2020 The Magma Authors.
+
+# This source code is licensed under the BSD-style license found in the
+# LICENSE file in the root directory of this source tree.
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# nghttpx config will be generated here and used
+nghttpx_config_location: /var/tmp/nghttpx.conf
+
+# Location for certs
+rootca_cert: /var/opt/magma/certs/rootCA.pem
+gateway_cert: /var/opt/magma/certs/gateway.crt
+gateway_key: /var/opt/magma/certs/gateway.key
+
+# Listening port of the proxy for local services. The port would be closed
+# for the rest of the world.
+local_port: 8443
+
+# Cloud address for reaching out to the cloud.
+cloud_address: controller.magma.test
+cloud_port: 7443
+
+bootstrap_address: bootstrapper-controller.magma.test
+bootstrap_port: 7444
+
+fluentd_address: fluentd.magma.test
+fluentd_port: 24224
+
+# Option to use nghttpx for proxying. If disabled, the individual
+# services would establish the TLS connections themselves.
+proxy_cloud_connections: True
+
+# Allows http_proxy usage if the environment variable is present
+allow_http_proxy: False
+
+# [Experimental] Sentry related configs
+# If set, the Sentry Python SDK will be initialized for all python services
+sentry_url_python: ""
+# If set, the Sentry Native SDK will be initialized for MME and SessionD
+sentry_url_native: ""
+# If set, /var/log/mme.log will be uploaded along MME crashreports
+sentry_upload_mme_log: false
+# Rate at which we want to sample Python error events
+# Should be a number between 0 (0% of errors sent) and 1 (100% of errors sent)
+sentry_sample_rate: 1.0
\ No newline at end of file
diff --git a/magma_configs/enodebd.yml b/magma_configs/enodebd.yml
new file mode 100644
index 0000000..84e636f
--- /dev/null
+++ b/magma_configs/enodebd.yml
@@ -0,0 +1,49 @@
+---
+#
+# Copyright 2020 The Magma Authors.
+
+# This source code is licensed under the BSD-style license found in the
+# LICENSE file in the root directory of this source tree.
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# log_level is set in mconfig. It can be overridden here
+
+tr069:
+  interface: en0 # NOTE: this value must be consistent with dnsmasq.conf
+  port: 48080
+  perf_mgmt_port: 8081
+  # NOTE: this is the IP which enodeb will communicate with enodebd
+  #       if this is ever changed in dnsd.yml, this needs to be updated too
+  public_ip: 192.88.99.142
+
+# TODO: @amar: This is a temp workaround to allow for testing until we
+# connect enodebd with the domain proxy which is responsible for talking to
+# SAS.
+sas:
+  sas_enabled: True
+  sas_server_url: "https://spectrum-connect.federatedwireless.com/v1.2/"
+  sas_uid: "INVALID_ID"
+  sas_category: "A"
+  sas_channel_type: "GAA"
+  sas_cert_subject: "INVALID_CERT_SUBJECT"
+  sas_icg_group_id: ""
+  sas_location: "indoor"
+  sas_height_type: "AMSL"
+
+# Reboot eNodeB if eNodeB should be connected to MME but isn't
+# This is a workaround for a bug with BaiCells eNodeB where the S1 connection
+# gets into a bad state
+reboot_enodeb_on_mme_disconnected: True
+
+# Enable webui for debugging for a list of eNB serial numbers.
+# Not supported on all enodeb models
+web_ui_enable_list: []
+
+# Network interface to terminate S1
+s1_interface: eth1
+
diff --git a/magma_configs/magmad.yml b/magma_configs/magmad.yml
new file mode 100644
index 0000000..ccc7ff9
--- /dev/null
+++ b/magma_configs/magmad.yml
@@ -0,0 +1,174 @@
+---
+################################################################################
+# Copyright 2020 The Magma Authors.
+
+# This source code is licensed under the BSD-style license found in the
+# LICENSE file in the root directory of this source tree.
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+################################################################################
+
+# log_level is set in mconfig. it can be overridden here
+
+print_grpc_payload: False
+
+# List of services for magmad to control
+magma_services:
+  # - control_proxy
+  # - subscriberdb
+  # - mobilityd
+  # - directoryd
+  - enodebd
+  # - sessiond
+  # - mme
+  # - pipelined
+  # - envoy_controller
+  # - redis
+  # - dnsd
+  # - policydb
+  # - state
+  # - eventd
+  # - smsd
+  # - ctraced
+  # - health
+  # - kernsnoopd
+  # - liagentd
+
+# List of services that don't provide service303 interface
+# non_service303_services:
+  # - control_proxy
+  # - dnsd
+  # - redis
+  # - td-agent-bit
+
+# List of all possible dynamic services (enabled from gateway.mconfig)
+# registered_dynamic_services:
+  # - redirectd
+  # - td-agent-bit
+  # - monitord
+  # - dpid
+
+# A list of group of services which are linked together in systemd
+# linked_services:
+  # -
+  #  - mme
+  #  - pipelined
+  #  - mobilityd
+  #  - sessiond
+
+# list of services that are required to have meta before checking in
+# (meta = data gathered via MagmaService.register_get_status_callback())
+# skip limit specified by config 'max_skipped_checkins'
+skip_checkin_if_missing_meta_services: []
+
+# default = 3, use 0 for "infinity"
+# max_skipped_checkins: 3
+
+# Init system to use to control services
+# Supported systems include: [systemd, runit, docker]
+init_system: systemd
+
+# bootstrap_manager config
+bootstrap_config:
+  # location of the challenge key
+  challenge_key: /var/opt/magma/certs/gw_challenge.key
+
+# Flags indicating the magmad features to be enabled
+enable_config_streamer: True
+enable_upgrade_manager: True
+enable_network_monitor: True
+enable_sync_rpc: True
+enable_kernel_version_checking: True
+
+network_monitor_config:
+  # How long to sleep between statistic collections
+  sampling_period: 60
+
+  # ping stats config
+  ping_config:
+    hosts:
+      - 8.8.8.8
+    num_packets: 1
+    timeout_secs: 20
+
+upgrader_factory:
+  # Module where the UpgraderFactory implementation is located
+  module: magma.magmad.upgrade.magma_upgrader
+  # Name of the UpgraderFactory implementation
+  class: MagmaUpgraderFactory
+mconfig_modules:
+  - orc8r.protos.mconfig.mconfigs_pb2
+  - lte.protos.mconfig.mconfigs_pb2
+  # - feg.protos.mconfig.mconfigs_pb2
+
+metricsd:
+  log_level: INFO
+  collect_interval: 60 # How frequently to collect metrics samples in seconds
+  sync_interval: 60 # How frequently to sync to cloud in seconds
+  grpc_timeout: 30 # Timeout in seconds
+  max_grpc_msg_size_mb: 4 # Max message size for gRPC channel in MBs
+
+  # An optional function  to mutate metrics before they are sent to the cloud
+  # A string in the form path.to.module.fn_name
+  # @see magma.magmad.metrics_collector.example_metrics_postprocessor
+  post_processing_fn: magma.magmad.metrics_collector.do_nothing_metrics_postprocessor
+  # List of services for metricsd to poll
+  services:
+    - subscriberdb
+    - mobilityd
+    - mme
+    - magmad
+    - enodebd
+    - pipelined
+    - state
+    - sessiond
+#    - kernsnoopd
+
+generic_command_config:
+  module: magma.magmad.generic_command.shell_command_executor
+  class: ShellCommandExecutor
+  shell_commands:
+    - name: bash
+      command: "bash {}"
+      allow_params: True
+    - name: fab
+      command: "fab {}"
+      allow_params: True
+    - name: echo
+      command: "echo {}"
+      allow_params: True
+    - name: reboot_enodeb
+      command: "enodebd_cli.py reboot_enodeb {}"
+      allow_params: True
+    - name: reboot_all_enodeb
+      command: "enodebd_cli.py reboot_all_enodeb"
+      allow_params: False
+    - name: health
+      command: "health_cli.py {}"
+      allow_params: True
+    - name: agw_health
+      command: "agw_health_cli.py {}"
+      allow_params: True
+    - name: get_flows
+      command: "sudo pipelined_cli.py debug display_flows"
+      allow_params: False
+    - name: get_subscriber_table
+      command: "mobility_cli.py get_subscriber_table"
+      allow_params: False
+    - name: check_stateless
+      command: "magmad_cli.py check_stateless"
+      allow_params: False
+    - name: configure_stateless
+      command: "magmad_cli.py config_stateless {}"
+      allow_params: True
+
+# Services for which magmad grpc status check restart recovery is enabled
+services_to_restart:
+  - pipelined
+
+# How many times can grpc status check fail before restarting the services above
+restart_timeout_threshold: 15
\ No newline at end of file
diff --git a/magma_configs/service_registry.yml b/magma_configs/service_registry.yml
new file mode 100644
index 0000000..83735cc
--- /dev/null
+++ b/magma_configs/service_registry.yml
@@ -0,0 +1,115 @@
+---
+services:
+  # NOTE: do NOT include dash(-) in your service name. Use underscore instead.
+  # Example service name that contains dash: hello-world-blah
+  # As we use "-" in nghttpx config to connect service name and hostname,
+  # "-" is used as a delimiter in dispatcher to parse out service names.
+
+  hello:
+    ip_address: 127.0.0.1
+    port: 50050
+  magmad:
+    ip_address: 127.0.0.1
+    port: 50052
+  control_proxy:
+    ip_address: 127.0.0.1
+    port: 50053
+  subscriberdb:
+    ip_address: 127.0.0.1
+    port: 50051
+  mobilityd:
+    ip_address: 127.0.0.1
+    port: 60051
+  enodebd:
+    ip_address: 127.0.0.1
+    port: 60055
+  mme:
+    ip_address: 127.0.0.1
+    port: 50061
+  spgw:
+    ip_address: 127.0.0.1
+    port: 50062
+  pipelined:
+    ip_address: 127.0.0.1
+    port: 50063
+  sessiond:
+    ip_address: 127.0.0.1
+    port: 50065
+  abort_session_service:
+    ip_address: 127.0.0.1
+    port: 50065
+  test_service:
+    ip_address: 127.0.0.1
+    port: 50066
+  directoryd:
+    ip_address: 127.0.0.1
+    port: 50067
+  policydb:
+    ip_address: 127.0.0.1
+    port: 50068
+  vpnservice:
+    ip_address: 127.0.0.1
+    port: 50070
+  redirectd:
+    ip_address: 127.0.0.1
+    port: 50071
+  sgs_service:
+    ip_address: 127.0.0.1
+    port: 50073
+  sms_mme_service:
+    ip_address: 127.0.0.1
+    port: 50073
+  s1ap_service:
+    ip_address: 127.0.0.1
+    port: 50073
+  s6a_service:
+    ip_address: 127.0.0.1
+    port: 50073
+  s6a_async_service:
+    ip_address: 127.0.0.1
+    port: 50085
+  spgw_service:
+    ip_address: 127.0.0.1
+    port: 50073
+  amf_service:
+    ip_address: 127.0.0.1
+    port: 50073
+  ha_service:
+    ip_address: 127.0.0.1
+    port: 50073
+  s8_service:
+    ip_address: 127.0.0.1
+    port: 50073
+  state:
+    ip_address: 127.0.0.1
+    port: 50074
+  eventd:
+    ip_address: 127.0.0.1
+    port: 50075
+  monitord:
+    ip_address: 127.0.0.1
+    port: 50076
+  dpid:
+    ip_address: 127.0.0.1
+    port: 50077
+  smsd:
+    ip_address: 127.0.0.1
+    port: 50078
+  ctraced:
+    ip_address: 127.0.0.1
+    port: 50079
+  health:
+    ip_address: 127.0.0.1
+    port: 50080
+  envoy_controller:
+    ip_address: 127.0.0.1
+    port: 50081
+  connectiond:
+    ip_address: 127.0.0.1
+    port: 50082
+  liagentd:
+    ip_address: 127.0.0.1
+    port: 50083
+  kernsnoopd:
+    ip_address: 127.0.0.1
+    port: 50084
\ No newline at end of file