Jeremy Ronquillo | 5263c73 | 2020-10-13 09:42:19 -0700 | [diff] [blame] | 1 | # Copyright 2018-present Open Networking Foundation |
| 2 | # |
Andy Bavier | 2c42773 | 2022-02-03 15:16:46 -0700 | [diff] [blame] | 3 | # SPDX-License-Identifier: Apache-2.0 |
Jeremy Ronquillo | 5263c73 | 2020-10-13 09:42:19 -0700 | [diff] [blame] | 4 | |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 5 | SHELL := /bin/bash |
| 6 | BUILD ?= /tmp/build |
| 7 | M ?= $(BUILD)/milestones |
| 8 | MAKEDIR := $(dir $(realpath $(firstword $(MAKEFILE_LIST)))) |
Jeremy Ronquillo | af084f3 | 2020-08-24 13:18:47 -0700 | [diff] [blame] | 9 | SCRIPTDIR := $(MAKEDIR)/scripts |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 10 | RESOURCEDIR := $(MAKEDIR)/resources |
| 11 | WORKSPACE ?= $(HOME) |
Jeremy Ronquillo | d3cab74 | 2020-08-24 11:49:00 -0700 | [diff] [blame] | 12 | VENV ?= $(BUILD)/venv/aiab |
Andy Bavier | ebf479c | 2021-09-08 15:47:58 -0700 | [diff] [blame] | 13 | |
Andy Bavier | 31dfb9e | 2022-02-15 15:24:57 -0700 | [diff] [blame] | 14 | 4G_CORE_VALUES ?= $(MAKEDIR)/sd-core-4g-values.yaml |
| 15 | 5G_CORE_VALUES ?= $(MAKEDIR)/sd-core-5g-values.yaml |
Andy Bavier | ebf479c | 2021-09-08 15:47:58 -0700 | [diff] [blame] | 16 | OAISIM_VALUES ?= $(MAKEDIR)/oaisim-values.yaml |
Andy Bavier | 794566f | 2022-02-04 16:10:18 -0700 | [diff] [blame] | 17 | ROC_VALUES ?= $(MAKEDIR)/roc-values.yaml |
Andy Bavier | 794566f | 2022-02-04 16:10:18 -0700 | [diff] [blame] | 18 | ROC_4G_MODELS ?= $(MAKEDIR)/roc-4g-models.json |
| 19 | ROC_5G_MODELS ?= $(MAKEDIR)/roc-5g-models.json |
Osman Amjad | 488a022 | 2022-01-12 11:58:43 -0600 | [diff] [blame] | 20 | TEST_APP_VALUES?= $(MAKEDIR)/5g-test-apps-values.yaml |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 21 | |
Hyunsun Moon | 8c3fe40 | 2021-10-04 18:06:07 -0700 | [diff] [blame] | 22 | KUBESPRAY_VERSION ?= release-2.17 |
| 23 | DOCKER_VERSION ?= '20.10' |
| 24 | K8S_VERSION ?= v1.20.11 |
| 25 | HELM_VERSION ?= v3.6.3 |
Amit Wankhede | 01b20c3 | 2021-12-01 12:45:58 +0530 | [diff] [blame] | 26 | ENABLE_SUBSCRIBER_PROXY ?= false |
Andy Bavier | cd93a20 | 2022-01-10 18:03:26 -0800 | [diff] [blame] | 27 | GNBSIM_COLORS ?= true |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 28 | |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 29 | HELM_GLOBAL_ARGS ?= |
Andy Bavier | eda466b | 2021-08-27 15:00:36 -0700 | [diff] [blame] | 30 | |
| 31 | # Allow installing local charts or specific versions of published charts. |
| 32 | # E.g., to install the Aether 1.5 release: |
| 33 | # CHARTS=release-1.5 make test |
| 34 | # Default is to install from the local charts. |
| 35 | CHARTS ?= local |
| 36 | CONFIGFILE := configs/$(CHARTS) |
| 37 | include $(CONFIGFILE) |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 38 | |
| 39 | cpu_family := $(shell lscpu | grep 'CPU family:' | awk '{print $$3}') |
| 40 | cpu_model := $(shell lscpu | grep 'Model:' | awk '{print $$2}') |
| 41 | os_vendor := $(shell lsb_release -i -s) |
| 42 | os_release := $(shell lsb_release -r -s) |
Andy Bavier | 9ee69d0 | 2022-02-11 10:31:21 -0700 | [diff] [blame] | 43 | USER := $(shell whoami) |
| 44 | |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 45 | |
Badhrinath | 3e081e2 | 2020-12-02 15:02:08 -0600 | [diff] [blame] | 46 | omec: $(M)/system-check $(M)/omec |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 47 | oaisim: $(M)/oaisim |
Badhrinath | 3e081e2 | 2020-12-02 15:02:08 -0600 | [diff] [blame] | 48 | 5gc: $(M)/system-check $(M)/5g-core |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 49 | |
Andy Bavier | 8819b9f | 2022-01-28 16:54:06 -0700 | [diff] [blame] | 50 | .PHONY: omec oaisim 5gc test reset-test reset-ue 5g-core reset-5g-test clean |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 51 | |
| 52 | $(M): |
| 53 | mkdir -p $(M) |
| 54 | |
| 55 | $(M)/system-check: | $(M) |
| 56 | @if [[ $(cpu_family) -eq 6 ]]; then \ |
| 57 | if [[ $(cpu_model) -lt 60 ]]; then \ |
| 58 | echo "FATAL: haswell CPU or newer is required."; \ |
| 59 | exit 1; \ |
| 60 | fi \ |
| 61 | else \ |
| 62 | echo "FATAL: unsupported CPU family."; \ |
| 63 | exit 1; \ |
| 64 | fi |
| 65 | @if [[ $(os_vendor) =~ (Ubuntu) ]]; then \ |
Hyunsun | 7b64051 | 2020-10-27 19:49:51 -0500 | [diff] [blame] | 66 | if [[ ! $(os_release) =~ (18.04) ]]; then \ |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 67 | echo "WARN: $(os_vendor) $(os_release) has not been tested."; \ |
| 68 | fi; \ |
| 69 | if dpkg --compare-versions 4.15 gt $(shell uname -r); then \ |
| 70 | echo "FATAL: kernel 4.15 or later is required."; \ |
| 71 | echo "Please upgrade your kernel by running" \ |
| 72 | "apt install --install-recommends linux-generic-hwe-$(os_release)"; \ |
| 73 | exit 1; \ |
| 74 | fi \ |
| 75 | else \ |
| 76 | echo "FAIL: unsupported OS."; \ |
| 77 | exit 1; \ |
| 78 | fi |
| 79 | touch $@ |
| 80 | |
| 81 | $(M)/setup: | $(M) |
| 82 | sudo $(SCRIPTDIR)/cloudlab-disksetup.sh |
Hyunsun Moon | 82e47c2 | 2021-06-28 12:30:20 -0500 | [diff] [blame] | 83 | sudo apt update; sudo apt install -y software-properties-common python3 python3-pip python3-venv jq httpie ipvsadm |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 84 | touch $@ |
| 85 | |
| 86 | $(BUILD)/kubespray: | $(M)/setup |
| 87 | mkdir -p $(BUILD) |
| 88 | cd $(BUILD); git clone https://github.com/kubernetes-incubator/kubespray.git -b $(KUBESPRAY_VERSION) |
| 89 | |
| 90 | $(VENV)/bin/activate: | $(M)/setup |
Hyunsun Moon | 82e47c2 | 2021-06-28 12:30:20 -0500 | [diff] [blame] | 91 | python3 -m venv $(VENV) |
Wei-Yu Chen | 7edb7e7 | 2021-07-28 11:37:55 +0800 | [diff] [blame] | 92 | source "$(VENV)/bin/activate" && \ |
| 93 | python -m pip install -U pip && \ |
| 94 | deactivate |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 95 | |
| 96 | $(M)/kubespray-requirements: $(BUILD)/kubespray | $(VENV)/bin/activate |
| 97 | source "$(VENV)/bin/activate" && \ |
| 98 | pip install -r $(BUILD)/kubespray/requirements.txt |
| 99 | touch $@ |
| 100 | |
| 101 | $(M)/k8s-ready: | $(M)/setup $(BUILD)/kubespray $(VENV)/bin/activate $(M)/kubespray-requirements |
| 102 | source "$(VENV)/bin/activate" && cd $(BUILD)/kubespray; \ |
| 103 | ansible-playbook -b -i inventory/local/hosts.ini \ |
| 104 | -e "{'override_system_hostname' : False, 'disable_swap' : True}" \ |
| 105 | -e "{'docker_version' : $(DOCKER_VERSION)}" \ |
| 106 | -e "{'docker_iptables_enabled' : True}" \ |
| 107 | -e "{'kube_version' : $(K8S_VERSION)}" \ |
Hyunsun | 84f0f17 | 2020-09-23 15:40:08 -0500 | [diff] [blame] | 108 | -e "{'kube_network_plugin_multus' : True, 'multus_version' : stable, 'multus_cni_version' : 0.3.1}" \ |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 109 | -e "{'kube_proxy_metrics_bind_address' : 0.0.0.0:10249}" \ |
| 110 | -e "{'kube_pods_subnet' : 192.168.0.0/17, 'kube_service_addresses' : 192.168.128.0/17}" \ |
| 111 | -e "{'kube_apiserver_node_port_range' : 2000-36767}" \ |
| 112 | -e "{'kubeadm_enabled': True}" \ |
| 113 | -e "{'kube_feature_gates' : [SCTPSupport=True]}" \ |
| 114 | -e "{'kubelet_custom_flags' : [--allowed-unsafe-sysctls=net.*]}" \ |
| 115 | -e "{'dns_min_replicas' : 1}" \ |
| 116 | -e "{'helm_enabled' : True, 'helm_version' : $(HELM_VERSION)}" \ |
| 117 | cluster.yml |
| 118 | mkdir -p $(HOME)/.kube |
| 119 | sudo cp -f /etc/kubernetes/admin.conf $(HOME)/.kube/config |
| 120 | sudo chown $(shell id -u):$(shell id -g) $(HOME)/.kube/config |
| 121 | kubectl wait pod -n kube-system --for=condition=Ready --all |
Andy Bavier | 9ee69d0 | 2022-02-11 10:31:21 -0700 | [diff] [blame] | 122 | sudo adduser $(USER) docker |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 123 | touch $@ |
| 124 | |
| 125 | $(M)/helm-ready: | $(M)/k8s-ready |
Woojoong Kim | 8425cb3 | 2021-01-08 16:18:53 -0800 | [diff] [blame] | 126 | helm repo add incubator https://charts.helm.sh/incubator |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 127 | helm repo add cord https://charts.opencord.org |
Andy Bavier | eda466b | 2021-08-27 15:00:36 -0700 | [diff] [blame] | 128 | helm repo add atomix https://charts.atomix.io |
| 129 | helm repo add onosproject https://charts.onosproject.org |
Andy Bavier | 9ee69d0 | 2022-02-11 10:31:21 -0700 | [diff] [blame] | 130 | helm repo add aether https://charts.aetherproject.org |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 131 | touch $@ |
| 132 | |
Andy Bavier | 9ee69d0 | 2022-02-11 10:31:21 -0700 | [diff] [blame] | 133 | node-prep: | $(M)/k8s-ready $(M)/fabric $(M)/oaisim-lo |
| 134 | |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 135 | /opt/cni/bin/simpleovs: | $(M)/k8s-ready |
| 136 | sudo cp $(RESOURCEDIR)/simpleovs /opt/cni/bin/ |
| 137 | |
| 138 | /opt/cni/bin/static: | $(M)/k8s-ready |
| 139 | mkdir -p $(BUILD)/cni-plugins; cd $(BUILD)/cni-plugins; \ |
| 140 | wget https://github.com/containernetworking/plugins/releases/download/v0.8.2/cni-plugins-linux-amd64-v0.8.2.tgz && \ |
| 141 | tar xvfz cni-plugins-linux-amd64-v0.8.2.tgz |
| 142 | sudo cp $(BUILD)/cni-plugins/static /opt/cni/bin/ |
| 143 | |
| 144 | # TODO: need to connect ONOS |
| 145 | $(M)/fabric: | $(M)/setup /opt/cni/bin/simpleovs /opt/cni/bin/static |
| 146 | sudo apt install -y openvswitch-switch |
| 147 | sudo ovs-vsctl --may-exist add-br br-enb-net |
| 148 | sudo ovs-vsctl --may-exist add-port br-enb-net enb -- set Interface enb type=internal |
| 149 | sudo ip addr add 192.168.251.4/24 dev enb || true |
| 150 | sudo ip link set enb up |
| 151 | sudo ethtool --offload enb tx off |
| 152 | sudo ip route replace 192.168.252.0/24 via 192.168.251.1 dev enb |
| 153 | kubectl apply -f $(RESOURCEDIR)/router.yaml |
| 154 | kubectl wait pod -n default --for=condition=Ready -l app=router --timeout=300s |
Andy Bavier | eda466b | 2021-08-27 15:00:36 -0700 | [diff] [blame] | 155 | kubectl -n default exec router -- ip route add 172.250.0.0/16 via 192.168.250.3 |
Jeremy Ronquillo | af084f3 | 2020-08-24 13:18:47 -0700 | [diff] [blame] | 156 | kubectl delete net-attach-def core-net |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 157 | touch $@ |
| 158 | |
Andy Bavier | e969089 | 2022-03-14 18:04:09 -0700 | [diff] [blame^] | 159 | $(M)/omec: | $(M)/helm-ready /opt/cni/bin/simpleovs /opt/cni/bin/static $(M)/fabric |
Scott Baker | 17b70d1 | 2020-09-29 23:26:21 -0700 | [diff] [blame] | 160 | kubectl get namespace omec 2> /dev/null || kubectl create namespace omec |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 161 | helm repo update |
Andy Bavier | 31dfb9e | 2022-02-15 15:24:57 -0700 | [diff] [blame] | 162 | if [[ "${CHARTS}" == "local" || "${CHARTS}" == "local-sdcore" ]]; then helm dep up $(SD_CORE_CHART); fi |
Andy Bavier | ebf479c | 2021-09-08 15:47:58 -0700 | [diff] [blame] | 163 | helm upgrade --install --wait $(HELM_GLOBAL_ARGS) \ |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 164 | --namespace omec \ |
Andy Bavier | ebf479c | 2021-09-08 15:47:58 -0700 | [diff] [blame] | 165 | --values $(4G_CORE_VALUES) \ |
Andy Bavier | 31dfb9e | 2022-02-15 15:24:57 -0700 | [diff] [blame] | 166 | sd-core \ |
| 167 | $(SD_CORE_CHART) |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 168 | touch $@ |
| 169 | |
Andy Bavier | e969089 | 2022-03-14 18:04:09 -0700 | [diff] [blame^] | 170 | $(M)/5g-core: | $(M)/helm-ready /opt/cni/bin/simpleovs /opt/cni/bin/static $(M)/fabric |
Badhrinath | 3e081e2 | 2020-12-02 15:02:08 -0600 | [diff] [blame] | 171 | kubectl get namespace omec 2> /dev/null || kubectl create namespace omec |
| 172 | helm repo update |
Andy Bavier | 31dfb9e | 2022-02-15 15:24:57 -0700 | [diff] [blame] | 173 | if [[ "${CHARTS}" == "local" || "${CHARTS}" == "local-sdcore" ]]; then helm dep up $(SD_CORE_CHART); fi |
Andy Bavier | ebf479c | 2021-09-08 15:47:58 -0700 | [diff] [blame] | 174 | helm upgrade --install --wait $(HELM_GLOBAL_ARGS) \ |
Badhrinath | 3e081e2 | 2020-12-02 15:02:08 -0600 | [diff] [blame] | 175 | --namespace omec \ |
Andy Bavier | ebf479c | 2021-09-08 15:47:58 -0700 | [diff] [blame] | 176 | --values $(5G_CORE_VALUES) \ |
Andy Bavier | 31dfb9e | 2022-02-15 15:24:57 -0700 | [diff] [blame] | 177 | sd-core \ |
| 178 | $(SD_CORE_CHART) |
Badhrinath | 3e081e2 | 2020-12-02 15:02:08 -0600 | [diff] [blame] | 179 | touch $@ |
| 180 | |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 181 | # UE images includes kernel module, ue_ip.ko |
| 182 | # which should be built in the exactly same kernel version of the host machine |
| 183 | $(BUILD)/openairinterface: | $(M)/setup |
| 184 | mkdir -p $(BUILD) |
| 185 | cd $(BUILD); git clone https://github.com/opencord/openairinterface.git |
| 186 | |
Andy Bavier | d6de561 | 2021-11-08 10:39:17 -0700 | [diff] [blame] | 187 | download-ue-image: | $(M)/k8s-ready |
Andy Bavier | 9ee69d0 | 2022-02-11 10:31:21 -0700 | [diff] [blame] | 188 | sg docker -c "docker pull ${OAISIM_UE_IMAGE} && \ |
| 189 | docker tag ${OAISIM_UE_IMAGE} omecproject/lte-uesoftmodem:1.1.0" |
Andy Bavier | d6de561 | 2021-11-08 10:39:17 -0700 | [diff] [blame] | 190 | touch $(M)/ue-image |
| 191 | |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 192 | $(M)/ue-image: | $(M)/k8s-ready $(BUILD)/openairinterface |
| 193 | cd $(BUILD)/openairinterface; \ |
Andy Bavier | 9ee69d0 | 2022-02-11 10:31:21 -0700 | [diff] [blame] | 194 | sg docker -c "docker build . --target lte-uesoftmodem \ |
Hyunsun | 7b64051 | 2020-10-27 19:49:51 -0500 | [diff] [blame] | 195 | --build-arg build_base=omecproject/oai-base:1.1.0 \ |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 196 | --file Dockerfile.ue \ |
Andy Bavier | 9ee69d0 | 2022-02-11 10:31:21 -0700 | [diff] [blame] | 197 | --tag omecproject/lte-uesoftmodem:1.1.0" |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 198 | touch $@ |
| 199 | |
Andy Bavier | 9ee69d0 | 2022-02-11 10:31:21 -0700 | [diff] [blame] | 200 | $(M)/oaisim-lo: |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 201 | sudo ip addr add 127.0.0.2/8 dev lo || true |
Andy Bavier | 9ee69d0 | 2022-02-11 10:31:21 -0700 | [diff] [blame] | 202 | touch $@ |
| 203 | |
| 204 | $(M)/oaisim: | $(M)/ue-image $(M)/omec $(M)/oaisim-lo |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 205 | $(eval mme_iface=$(shell ip -4 route list default | awk -F 'dev' '{ print $$2; exit }' | awk '{ print $$1 }')) |
Andy Bavier | ebf479c | 2021-09-08 15:47:58 -0700 | [diff] [blame] | 206 | helm upgrade --install $(HELM_GLOBAL_ARGS) --namespace omec oaisim cord/oaisim -f $(OAISIM_VALUES) \ |
Jeremy Ronquillo | af084f3 | 2020-08-24 13:18:47 -0700 | [diff] [blame] | 207 | --set config.enb.networks.s1_mme.interface=$(mme_iface) \ |
| 208 | --set images.pullPolicy=IfNotPresent |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 209 | kubectl rollout status -n omec statefulset ue |
| 210 | @timeout 60s bash -c \ |
| 211 | "until ip addr show oip1 | grep -q inet; \ |
| 212 | do \ |
| 213 | echo 'Waiting for UE 1 gets IP address'; \ |
| 214 | sleep 3; \ |
| 215 | done" |
| 216 | touch $@ |
| 217 | |
Andy Bavier | ebf479c | 2021-09-08 15:47:58 -0700 | [diff] [blame] | 218 | roc: $(M)/roc |
| 219 | $(M)/roc: $(M)/helm-ready |
| 220 | kubectl get namespace aether-roc 2> /dev/null || kubectl create namespace aether-roc |
| 221 | helm repo update |
| 222 | if [ "$(CHARTS)" == "local" ]; then helm dep up $(AETHER_ROC_UMBRELLA_CHART); fi |
| 223 | helm upgrade --install --wait $(HELM_GLOBAL_ARGS) \ |
| 224 | --namespace kube-system \ |
| 225 | --values $(ROC_VALUES) \ |
| 226 | atomix-controller \ |
| 227 | $(ATOMIX_CONTROLLER_CHART) |
| 228 | helm upgrade --install --wait $(HELM_GLOBAL_ARGS) \ |
| 229 | --namespace kube-system \ |
| 230 | --values $(ROC_VALUES) \ |
| 231 | atomix-raft-storage \ |
| 232 | $(ATOMIX_RAFT_STORAGE_CHART) |
| 233 | helm upgrade --install --wait $(HELM_GLOBAL_ARGS) \ |
| 234 | --namespace kube-system \ |
| 235 | --values $(ROC_VALUES) \ |
| 236 | onos-operator \ |
| 237 | $(ONOS_OPERATOR_CHART) |
| 238 | helm upgrade --install --wait $(HELM_GLOBAL_ARGS) \ |
| 239 | --namespace aether-roc \ |
| 240 | --values $(ROC_VALUES) \ |
| 241 | aether-roc-umbrella \ |
| 242 | $(AETHER_ROC_UMBRELLA_CHART) |
| 243 | touch $@ |
| 244 | |
| 245 | # Load the ROC 4G models. Disable loading network slice from SimApp. |
| 246 | roc-4g-models: $(M)/roc |
| 247 | sed -i 's/provision-network-slice: true/provision-network-slice: false/' $(4G_CORE_VALUES) |
| 248 | sed -i 's/# syncUrl/syncUrl/' $(4G_CORE_VALUES) |
Amit Wankhede | 01b20c3 | 2021-12-01 12:45:58 +0530 | [diff] [blame] | 249 | if [ "${ENABLE_SUBSCRIBER_PROXY}" == "true" ] ; then \ |
Amit Wankhede | fdf10ff | 2022-02-16 08:37:20 -0600 | [diff] [blame] | 250 | sed -i 's/# sub-proxy-endpt:/sub-proxy-endpt:/' $(4G_CORE_VALUES) ; \ |
| 251 | sed -i 's/# addr: sub/ addr: sub/' $(4G_CORE_VALUES) ; \ |
| 252 | sed -i 's/# port: 5000/ port: 5000/' $(4G_CORE_VALUES) ; \ |
Amit Wankhede | 01b20c3 | 2021-12-01 12:45:58 +0530 | [diff] [blame] | 253 | fi |
Andy Bavier | ebf479c | 2021-09-08 15:47:58 -0700 | [diff] [blame] | 254 | $(eval ONOS_CLI_POD := $(shell kubectl -n aether-roc get pods -l name=onos-cli -o name)) |
| 255 | echo "ONOS CLI pod: ${ONOS_CLI_POD}" |
| 256 | until kubectl -n aether-roc exec ${ONOS_CLI_POD} -- \ |
| 257 | curl -s -f -L -X PATCH "http://aether-roc-api:8181/aether-roc-api" \ |
| 258 | --header 'Content-Type: application/json' \ |
| 259 | --data-raw "$$(cat ${ROC_4G_MODELS})"; do sleep 5; done |
| 260 | |
| 261 | # Load the ROC 5G models. Disable loading network slice from SimApp. |
| 262 | roc-5g-models: $(M)/roc |
| 263 | sed -i 's/provision-network-slice: true/provision-network-slice: false/' $(5G_CORE_VALUES) |
| 264 | sed -i 's/# syncUrl/syncUrl/' $(5G_CORE_VALUES) |
Amit Wankhede | 01b20c3 | 2021-12-01 12:45:58 +0530 | [diff] [blame] | 265 | if [ "${ENABLE_SUBSCRIBER_PROXY}" == "true" ] ; then \ |
Amit Wankhede | fdf10ff | 2022-02-16 08:37:20 -0600 | [diff] [blame] | 266 | sed -i 's/# sub-proxy-endpt:/sub-proxy-endpt:/' $(5G_CORE_VALUES) ; \ |
| 267 | sed -i 's/# addr: sub/ addr: sub/' $(5G_CORE_VALUES) ; \ |
| 268 | sed -i 's/# port: 5000/ port: 5000/' $(5G_CORE_VALUES) ; \ |
Amit Wankhede | 01b20c3 | 2021-12-01 12:45:58 +0530 | [diff] [blame] | 269 | fi |
Andy Bavier | ebf479c | 2021-09-08 15:47:58 -0700 | [diff] [blame] | 270 | $(eval ONOS_CLI_POD := $(shell kubectl -n aether-roc get pods -l name=onos-cli -o name)) |
| 271 | echo "ONOS CLI pod: ${ONOS_CLI_POD}" |
| 272 | until kubectl -n aether-roc exec ${ONOS_CLI_POD} -- \ |
| 273 | curl -s -f -L -X PATCH "http://aether-roc-api:8181/aether-roc-api" \ |
| 274 | --header 'Content-Type: application/json' \ |
| 275 | --data-raw "$$(cat ${ROC_5G_MODELS})"; do sleep 5; done |
| 276 | |
| 277 | roc-clean: |
| 278 | @echo "This could take 2-3 minutes..." |
| 279 | sed -i 's/provision-network-slice: false/provision-network-slice: true/' $(4G_CORE_VALUES) |
| 280 | sed -i 's/ syncUrl/ # syncUrl/' $(4G_CORE_VALUES) |
Amit Wankhede | fdf10ff | 2022-02-16 08:37:20 -0600 | [diff] [blame] | 281 | sed -i 's/ sub-proxy-endpt:/ # sub-proxy-endpt:/' $(4G_CORE_VALUES) |
| 282 | sed -i 's/ addr: sub/ # addr: sub/' $(4G_CORE_VALUES) |
| 283 | sed -i 's/ port: 5000/ # port: 5000/' $(4G_CORE_VALUES) |
Andy Bavier | ebf479c | 2021-09-08 15:47:58 -0700 | [diff] [blame] | 284 | sed -i 's/provision-network-slice: false/provision-network-slice: true/' $(5G_CORE_VALUES) |
| 285 | sed -i 's/ syncUrl/ # syncUrl/' $(5G_CORE_VALUES) |
Amit Wankhede | fdf10ff | 2022-02-16 08:37:20 -0600 | [diff] [blame] | 286 | sed -i 's/ sub-proxy-endpt:/ # sub-proxy-endpt:/' $(5G_CORE_VALUES) |
| 287 | sed -i 's/ addr: sub/ # addr: sub/' $(5G_CORE_VALUES) |
| 288 | sed -i 's/ port: 5000/ # port: 5000/' $(5G_CORE_VALUES) |
Andy Bavier | ebf479c | 2021-09-08 15:47:58 -0700 | [diff] [blame] | 289 | kubectl delete namespace aether-roc || true |
| 290 | rm -rf $(M)/roc |
| 291 | |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 292 | test: | $(M)/fabric $(M)/omec $(M)/oaisim |
| 293 | @sleep 5 |
| 294 | @echo "Test1: ping from UE to SGI network gateway" |
Hyunsun Moon | 0bd8cec | 2020-09-28 00:38:26 -0500 | [diff] [blame] | 295 | ping -I oip1 192.168.250.1 -c 15 |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 296 | @echo "Test2: ping from UE to 8.8.8.8" |
| 297 | ping -I oip1 8.8.8.8 -c 3 |
Hyunsun Moon | 0bd8cec | 2020-09-28 00:38:26 -0500 | [diff] [blame] | 298 | @echo "Test3: ping from UE to google.com" |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 299 | ping -I oip1 google.com -c 3 |
| 300 | @echo "Finished to test" |
| 301 | |
Andy Bavier | 0a055a5 | 2022-01-07 10:46:17 -0700 | [diff] [blame] | 302 | 5g-test: | $(M)/5g-core |
Andy Bavier | 31dfb9e | 2022-02-15 15:24:57 -0700 | [diff] [blame] | 303 | @if [[ "${CHARTS}" == "release-1.6" ]]; then echo "[NOTE] 5G Test not supported for Aether 1.6, exiting..."; exit 1; fi |
Andy Bavier | 0a055a5 | 2022-01-07 10:46:17 -0700 | [diff] [blame] | 304 | @echo "Test: Registration + UE initiated PDU Session Establishment + User Data packets" |
Andy Bavier | 0e4906f | 2022-03-03 15:31:48 -0700 | [diff] [blame] | 305 | @sleep 60 |
Andy Bavier | 0a055a5 | 2022-01-07 10:46:17 -0700 | [diff] [blame] | 306 | @rm -f /tmp/gnbsim.out |
Andy Bavier | cd93a20 | 2022-01-10 18:03:26 -0800 | [diff] [blame] | 307 | @if [[ ${GNBSIM_COLORS} == "true" ]]; then \ |
| 308 | kubectl -n omec exec gnbsim-0 -- ./gnbsim 2>&1 | tee /tmp/gnbsim.out; \ |
| 309 | else \ |
| 310 | kubectl -n omec exec gnbsim-0 -- ./gnbsim 2>&1 | sed -u "s,\x1B\[[0-9;]*[a-zA-Z],,g" | tee /tmp/gnbsim.out; \ |
| 311 | fi |
Andy Bavier | 094d6ef | 2022-03-08 13:21:52 -0700 | [diff] [blame] | 312 | @grep -q "Simulation Result: PASS" /tmp/gnbsim.out |
Andy Bavier | 0a055a5 | 2022-01-07 10:46:17 -0700 | [diff] [blame] | 313 | |
Andy Bavier | 1ead275 | 2022-01-07 17:58:48 -0700 | [diff] [blame] | 314 | cleanup-omec: |
Andy Bavier | 73d9c71 | 2022-01-19 14:18:48 -0700 | [diff] [blame] | 315 | helm delete -n omec $$(helm -n omec ls -qa) || true |
Andy Bavier | 1ead275 | 2022-01-07 17:58:48 -0700 | [diff] [blame] | 316 | @echo "" |
| 317 | @echo "Wait for all pods to terminate..." |
| 318 | kubectl wait -n omec --for=delete --all=true -l app!=ue pod --timeout=180s || true |
| 319 | |
| 320 | reset-test: cleanup-omec |
Jeremy Ronquillo | b2b64ea | 2020-12-09 13:49:03 -0800 | [diff] [blame] | 321 | kubectl delete po router || true |
| 322 | cd $(M); rm -f oaisim omec fabric |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 323 | |
Andy Bavier | 8819b9f | 2022-01-28 16:54:06 -0700 | [diff] [blame] | 324 | reset-ue: |
| 325 | helm delete -n omec oaisim || true |
| 326 | kubectl wait -n omec --for=delete pod enb-0 || true |
| 327 | kubectl wait -n omec --for=delete pod ue-0 || true |
| 328 | cd $(M); rm -f oaisim |
| 329 | |
Andy Bavier | 1ead275 | 2022-01-07 17:58:48 -0700 | [diff] [blame] | 330 | reset-5g-test: cleanup-omec |
Badhrinath | 3e081e2 | 2020-12-02 15:02:08 -0600 | [diff] [blame] | 331 | cd $(M); rm -f 5g-core |
| 332 | |
Osman Amjad | 488a022 | 2022-01-12 11:58:43 -0600 | [diff] [blame] | 333 | reset-dbtestapp: |
| 334 | helm uninstall --namespace omec 5g-test-app |
| 335 | |
| 336 | dbtestapp: |
| 337 | helm repo update |
| 338 | if [ "$(CHARTS)" == "local" ]; then helm dep up $(5G_TEST_APPS_CHART); fi |
| 339 | helm upgrade --install --wait $(HELM_GLOBAL_ARGS) \ |
| 340 | --namespace omec \ |
| 341 | 5g-test-app \ |
| 342 | --values $(TEST_APP_VALUES) \ |
| 343 | $(5G_TEST_APPS_CHART) |
| 344 | @echo "Finished to dbtestapp" |
| 345 | |
Andy Bavier | 01e0a1c | 2021-11-05 12:41:36 -0700 | [diff] [blame] | 346 | clean: |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 347 | kubectl delete po router || true |
Jeremy Ronquillo | af084f3 | 2020-08-24 13:18:47 -0700 | [diff] [blame] | 348 | kubectl delete net-attach-def core-net || true |
| 349 | sudo ovs-vsctl del-br br-access-net || true |
| 350 | sudo ovs-vsctl del-br br-core-net || true |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 351 | sudo apt remove --purge openvswitch-switch -y |
| 352 | source "$(VENV)/bin/activate" && cd $(BUILD)/kubespray; \ |
Andy Bavier | 125baa0 | 2021-10-26 16:26:44 -0700 | [diff] [blame] | 353 | ansible-playbook -b -i inventory/local/hosts.ini reset.yml --extra-vars "reset_confirmation=yes" |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 354 | @if [ -d /usr/local/etc/emulab ]; then \ |
| 355 | mount | grep /mnt/extra/kubelet/pods | cut -d" " -f3 | sudo xargs umount; \ |
| 356 | sudo rm -rf /mnt/extra/kubelet; \ |
| 357 | fi |
| 358 | rm -rf $(M) |