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 |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 6 | MAKEDIR := $(dir $(realpath $(firstword $(MAKEFILE_LIST)))) |
Andy Bavier | 99f31c8 | 2022-04-14 16:16:26 -0700 | [diff] [blame] | 7 | BUILD ?= $(MAKEDIR)/build |
| 8 | M ?= $(BUILD)/milestones |
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 |
Fatemeh Rouzbeh | a0b26e2 | 2022-04-07 12:45:12 -0700 | [diff] [blame] | 23 | DOCKER_VERSION ?= '20.10' |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 24 | HELM_VERSION ?= v3.6.3 |
Fatemeh Rouzbeh | a0b26e2 | 2022-04-07 12:45:12 -0700 | [diff] [blame] | 25 | KUBECTL_VERSION ?= v1.23.0 |
| 26 | |
| 27 | RKE2_K8S_VERSION ?= v1.23.4+rke2r1 |
| 28 | K8S_VERSION ?= v1.20.11 |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 29 | |
| 30 | ENABLE_ROUTER ?= true |
| 31 | ENABLE_OAISIM ?= true |
| 32 | ENABLE_GNBSIM ?= true |
Amit Wankhede | 01b20c3 | 2021-12-01 12:45:58 +0530 | [diff] [blame] | 33 | ENABLE_SUBSCRIBER_PROXY ?= false |
Andy Bavier | cd93a20 | 2022-01-10 18:03:26 -0800 | [diff] [blame] | 34 | GNBSIM_COLORS ?= true |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 35 | |
Fatemeh Rouzbeh | a0b26e2 | 2022-04-07 12:45:12 -0700 | [diff] [blame] | 36 | K8S_INSTALL := rke2 |
Andy Bavier | 99f31c8 | 2022-04-14 16:16:26 -0700 | [diff] [blame] | 37 | CTR_CMD := sudo /var/lib/rancher/rke2/bin/ctr --address /run/k3s/containerd/containerd.sock --namespace k8s.io |
Fatemeh Rouzbeh | a0b26e2 | 2022-04-07 12:45:12 -0700 | [diff] [blame] | 38 | |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 39 | DATA_IFACE ?= data |
| 40 | ifeq ($(DATA_IFACE), data) |
| 41 | RAN_SUBNET := 192.168.251.0/24 |
| 42 | else |
| 43 | RAN_SUBNET := $(shell ip route | grep $${DATA_IFACE} | awk '/kernel/ {print $$1}') |
Andy Bavier | 99f31c8 | 2022-04-14 16:16:26 -0700 | [diff] [blame] | 44 | DATA_IFACE_PATH := $(shell find /*/systemd/network -maxdepth 1 -not -type d -name '*$(DATA_IFACE).network' -print) |
| 45 | DATA_IFACE_CONF ?= $(shell basename $(DATA_IFACE_PATH)).d |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 46 | endif |
Hyunsun Moon | 4e5795a | 2022-04-07 09:27:12 -0700 | [diff] [blame] | 47 | |
Andy Bavier | 99f31c8 | 2022-04-14 16:16:26 -0700 | [diff] [blame] | 48 | # systemd-networkd and systemd configs |
| 49 | LO_NETCONF := /etc/systemd/network/20-aiab-lo.network |
| 50 | OAISIM_NETCONF := $(LO_NETCONF) /etc/systemd/network/10-aiab-enb.netdev /etc/systemd/network/20-aiab-enb.network |
| 51 | ROUTER_POD_NETCONF := /etc/systemd/network/10-aiab-dummy.netdev /etc/systemd/network/20-aiab-dummy.network |
| 52 | ROUTER_HOST_NETCONF := /etc/systemd/network/10-aiab-access.netdev /etc/systemd/network/20-aiab-access.network /etc/systemd/network/10-aiab-core.netdev /etc/systemd/network/20-aiab-core.network /etc/systemd/network/$(DATA_IFACE_CONF)/macvlan.conf |
| 53 | UE_NAT_CONF := /etc/systemd/system/aiab-ue-nat.service |
| 54 | |
Andy Bavier | 7d5f055 | 2022-05-23 16:01:45 -0700 | [diff] [blame^] | 55 | # monitoring |
| 56 | RANCHER_MONITORING_CRD_CHART := rancher/rancher-monitoring-crd |
| 57 | RANCHER_MONITORING_CHART := rancher/rancher-monitoring |
| 58 | MONITORING_VALUES ?= $(MAKEDIR)/monitoring.yaml |
| 59 | |
Hyunsun Moon | 4e5795a | 2022-04-07 09:27:12 -0700 | [diff] [blame] | 60 | NODE_IP ?= $(shell ip route get 8.8.8.8 | grep -oP 'src \K\S+') |
| 61 | ifndef NODE_IP |
| 62 | $(error NODE_IP is not set) |
| 63 | endif |
| 64 | |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 65 | MME_IP ?= |
| 66 | |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 67 | HELM_GLOBAL_ARGS ?= |
Andy Bavier | eda466b | 2021-08-27 15:00:36 -0700 | [diff] [blame] | 68 | |
| 69 | # Allow installing local charts or specific versions of published charts. |
| 70 | # E.g., to install the Aether 1.5 release: |
| 71 | # CHARTS=release-1.5 make test |
| 72 | # Default is to install from the local charts. |
| 73 | CHARTS ?= local |
| 74 | CONFIGFILE := configs/$(CHARTS) |
| 75 | include $(CONFIGFILE) |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 76 | |
| 77 | cpu_family := $(shell lscpu | grep 'CPU family:' | awk '{print $$3}') |
| 78 | cpu_model := $(shell lscpu | grep 'Model:' | awk '{print $$2}') |
| 79 | os_vendor := $(shell lsb_release -i -s) |
| 80 | os_release := $(shell lsb_release -r -s) |
Andy Bavier | 9ee69d0 | 2022-02-11 10:31:21 -0700 | [diff] [blame] | 81 | USER := $(shell whoami) |
| 82 | |
Fatemeh Rouzbeh | a0b26e2 | 2022-04-07 12:45:12 -0700 | [diff] [blame] | 83 | .PHONY: 4g-core 5g-core oaisim test reset-test reset-ue reset-5g-test node-prep clean |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 84 | |
| 85 | $(M): |
| 86 | mkdir -p $(M) |
| 87 | |
| 88 | $(M)/system-check: | $(M) |
| 89 | @if [[ $(cpu_family) -eq 6 ]]; then \ |
| 90 | if [[ $(cpu_model) -lt 60 ]]; then \ |
| 91 | echo "FATAL: haswell CPU or newer is required."; \ |
| 92 | exit 1; \ |
| 93 | fi \ |
| 94 | else \ |
| 95 | echo "FATAL: unsupported CPU family."; \ |
| 96 | exit 1; \ |
| 97 | fi |
| 98 | @if [[ $(os_vendor) =~ (Ubuntu) ]]; then \ |
Hyunsun | 7b64051 | 2020-10-27 19:49:51 -0500 | [diff] [blame] | 99 | if [[ ! $(os_release) =~ (18.04) ]]; then \ |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 100 | echo "WARN: $(os_vendor) $(os_release) has not been tested."; \ |
| 101 | fi; \ |
| 102 | if dpkg --compare-versions 4.15 gt $(shell uname -r); then \ |
| 103 | echo "FATAL: kernel 4.15 or later is required."; \ |
| 104 | echo "Please upgrade your kernel by running" \ |
| 105 | "apt install --install-recommends linux-generic-hwe-$(os_release)"; \ |
| 106 | exit 1; \ |
| 107 | fi \ |
| 108 | else \ |
| 109 | echo "FAIL: unsupported OS."; \ |
| 110 | exit 1; \ |
| 111 | fi |
| 112 | touch $@ |
| 113 | |
Andy Bavier | 99f31c8 | 2022-04-14 16:16:26 -0700 | [diff] [blame] | 114 | $(M)/interface-check: | $(M) |
| 115 | ifeq ($(DATA_IFACE_CONF), .d) |
| 116 | @echo |
| 117 | @echo FATAL: Could not find systemd-networkd config for interface $(DATA_IFACE), exiting now!; exit 1 |
| 118 | endif |
| 119 | touch $@ |
| 120 | |
Fatemeh Rouzbeh | a0b26e2 | 2022-04-07 12:45:12 -0700 | [diff] [blame] | 121 | ifeq ($(K8S_INSTALL),kubespray) |
Andy Bavier | 99f31c8 | 2022-04-14 16:16:26 -0700 | [diff] [blame] | 122 | $(M)/setup: | $(M) $(M)/interface-check |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 123 | sudo $(SCRIPTDIR)/cloudlab-disksetup.sh |
Hyunsun Moon | 82e47c2 | 2021-06-28 12:30:20 -0500 | [diff] [blame] | 124 | 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] | 125 | touch $@ |
Fatemeh Rouzbeh | a0b26e2 | 2022-04-07 12:45:12 -0700 | [diff] [blame] | 126 | endif |
| 127 | |
| 128 | ifeq ($(K8S_INSTALL),rke2) |
Andy Bavier | 99f31c8 | 2022-04-14 16:16:26 -0700 | [diff] [blame] | 129 | $(M)/setup: | $(M) $(M)/interface-check |
Fatemeh Rouzbeh | a0b26e2 | 2022-04-07 12:45:12 -0700 | [diff] [blame] | 130 | sudo $(SCRIPTDIR)/cloudlab-disksetup.sh |
| 131 | sudo apt update; sudo apt install -y software-properties-common python3 python3-pip python3-venv jq httpie ipvsadm apparmor apparmor-utils |
| 132 | systemctl list-units --full -all | grep "docker.service" || sudo apt install -y docker.io |
| 133 | sudo adduser $(USER) docker || true |
| 134 | touch $@ |
| 135 | endif |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 136 | |
| 137 | $(BUILD)/kubespray: | $(M)/setup |
| 138 | mkdir -p $(BUILD) |
| 139 | cd $(BUILD); git clone https://github.com/kubernetes-incubator/kubespray.git -b $(KUBESPRAY_VERSION) |
| 140 | |
| 141 | $(VENV)/bin/activate: | $(M)/setup |
Hyunsun Moon | 82e47c2 | 2021-06-28 12:30:20 -0500 | [diff] [blame] | 142 | python3 -m venv $(VENV) |
Wei-Yu Chen | 7edb7e7 | 2021-07-28 11:37:55 +0800 | [diff] [blame] | 143 | source "$(VENV)/bin/activate" && \ |
| 144 | python -m pip install -U pip && \ |
| 145 | deactivate |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 146 | |
| 147 | $(M)/kubespray-requirements: $(BUILD)/kubespray | $(VENV)/bin/activate |
| 148 | source "$(VENV)/bin/activate" && \ |
| 149 | pip install -r $(BUILD)/kubespray/requirements.txt |
| 150 | touch $@ |
| 151 | |
Fatemeh Rouzbeh | a0b26e2 | 2022-04-07 12:45:12 -0700 | [diff] [blame] | 152 | ifeq ($(K8S_INSTALL),kubespray) |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 153 | $(M)/k8s-ready: | $(M)/setup $(BUILD)/kubespray $(VENV)/bin/activate $(M)/kubespray-requirements |
| 154 | source "$(VENV)/bin/activate" && cd $(BUILD)/kubespray; \ |
| 155 | ansible-playbook -b -i inventory/local/hosts.ini \ |
| 156 | -e "{'override_system_hostname' : False, 'disable_swap' : True}" \ |
| 157 | -e "{'docker_version' : $(DOCKER_VERSION)}" \ |
| 158 | -e "{'docker_iptables_enabled' : True}" \ |
| 159 | -e "{'kube_version' : $(K8S_VERSION)}" \ |
Hyunsun | 84f0f17 | 2020-09-23 15:40:08 -0500 | [diff] [blame] | 160 | -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] | 161 | -e "{'kube_proxy_metrics_bind_address' : 0.0.0.0:10249}" \ |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 162 | -e "{'kube_pods_subnet' : 192.168.84.0/24, 'kube_service_addresses' : 192.168.85.0/24}" \ |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 163 | -e "{'kube_apiserver_node_port_range' : 2000-36767}" \ |
| 164 | -e "{'kubeadm_enabled': True}" \ |
| 165 | -e "{'kube_feature_gates' : [SCTPSupport=True]}" \ |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 166 | -e "{'kubelet_custom_flags' : [--allowed-unsafe-sysctls=net.*, --node-ip=$(NODE_IP)]}" \ |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 167 | -e "{'dns_min_replicas' : 1}" \ |
| 168 | -e "{'helm_enabled' : True, 'helm_version' : $(HELM_VERSION)}" \ |
| 169 | cluster.yml |
| 170 | mkdir -p $(HOME)/.kube |
| 171 | sudo cp -f /etc/kubernetes/admin.conf $(HOME)/.kube/config |
| 172 | sudo chown $(shell id -u):$(shell id -g) $(HOME)/.kube/config |
| 173 | kubectl wait pod -n kube-system --for=condition=Ready --all |
Andy Bavier | 9ee69d0 | 2022-02-11 10:31:21 -0700 | [diff] [blame] | 174 | sudo adduser $(USER) docker |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 175 | touch $@ |
| 176 | |
| 177 | $(M)/helm-ready: | $(M)/k8s-ready |
Woojoong Kim | 8425cb3 | 2021-01-08 16:18:53 -0800 | [diff] [blame] | 178 | helm repo add incubator https://charts.helm.sh/incubator |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 179 | helm repo add cord https://charts.opencord.org |
Andy Bavier | eda466b | 2021-08-27 15:00:36 -0700 | [diff] [blame] | 180 | helm repo add atomix https://charts.atomix.io |
| 181 | helm repo add onosproject https://charts.onosproject.org |
Andy Bavier | 9ee69d0 | 2022-02-11 10:31:21 -0700 | [diff] [blame] | 182 | helm repo add aether https://charts.aetherproject.org |
Andy Bavier | 7d5f055 | 2022-05-23 16:01:45 -0700 | [diff] [blame^] | 183 | helm repo add rancher http://charts.rancher.io/ |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 184 | touch $@ |
Fatemeh Rouzbeh | a0b26e2 | 2022-04-07 12:45:12 -0700 | [diff] [blame] | 185 | endif |
| 186 | |
| 187 | ifeq ($(K8S_INSTALL),rke2) |
| 188 | $(M)/k8s-ready: | $(M)/setup |
| 189 | sudo mkdir -p /etc/rancher/rke2/ |
| 190 | [ -d /usr/local/etc/emulab ] && [ ! -e /var/lib/rancher ] && sudo ln -s /var/lib/rancher /mnt/extra/rancher || true # that link gets deleted on cleanup |
| 191 | echo "cni: multus,calico" >> config.yaml |
| 192 | echo "cluster-cidr: 192.168.84.0/24" >> config.yaml |
| 193 | echo "service-cidr: 192.168.85.0/24" >> config.yaml |
| 194 | echo "kubelet-arg:" >> config.yaml |
| 195 | echo "- --allowed-unsafe-sysctls="net.*"" >> config.yaml |
| 196 | echo "- --node-ip="$(NODE_IP)"" >> config.yaml |
| 197 | echo "pause-image: k8s.gcr.io/pause:3.3" >> config.yaml |
| 198 | echo "kube-proxy-arg:" >> config.yaml |
| 199 | echo "- --metrics-bind-address="0.0.0.0:10249"" >> config.yaml |
| 200 | echo "- --proxy-mode="ipvs"" >> config.yaml |
| 201 | echo "kube-apiserver-arg:" >> config.yaml |
| 202 | echo "- --service-node-port-range="2000-36767"" >> config.yaml |
| 203 | sudo mv config.yaml /etc/rancher/rke2/ |
| 204 | curl -sfL https://get.rke2.io | sudo INSTALL_RKE2_VERSION=$(RKE2_K8S_VERSION) sh - |
| 205 | sudo systemctl enable rke2-server.service |
| 206 | sudo systemctl start rke2-server.service |
| 207 | sudo /var/lib/rancher/rke2/bin/kubectl --kubeconfig /etc/rancher/rke2/rke2.yaml wait nodes --for=condition=Ready --all --timeout=300s |
| 208 | sudo /var/lib/rancher/rke2/bin/kubectl --kubeconfig /etc/rancher/rke2/rke2.yaml wait deployment -n kube-system --for=condition=available --all --timeout=300s |
| 209 | curl -LO "https://dl.k8s.io/release/$(KUBECTL_VERSION)/bin/linux/amd64/kubectl" |
| 210 | sudo chmod +x kubectl |
| 211 | sudo mv kubectl /usr/local/bin/ |
| 212 | kubectl version --client |
| 213 | mkdir -p $(HOME)/.kube |
| 214 | sudo cp /etc/rancher/rke2/rke2.yaml $(HOME)/.kube/config |
| 215 | sudo chown -R $(shell id -u):$(shell id -g) $(HOME)/.kube |
| 216 | touch $@ |
| 217 | |
| 218 | $(M)/helm-ready: | $(M)/k8s-ready |
| 219 | curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 |
| 220 | chmod 700 get_helm.sh |
| 221 | sudo DESIRED_VERSION=$(HELM_VERSION) ./get_helm.sh |
| 222 | helm repo add incubator https://charts.helm.sh/incubator |
| 223 | helm repo add cord https://charts.opencord.org |
| 224 | helm repo add atomix https://charts.atomix.io |
| 225 | helm repo add onosproject https://charts.onosproject.org |
| 226 | helm repo add aether https://charts.aetherproject.org |
Andy Bavier | 7d5f055 | 2022-05-23 16:01:45 -0700 | [diff] [blame^] | 227 | helm repo add rancher http://charts.rancher.io/ |
Fatemeh Rouzbeh | a0b26e2 | 2022-04-07 12:45:12 -0700 | [diff] [blame] | 228 | touch $@ |
| 229 | endif |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 230 | |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 231 | /opt/cni/bin/static: | $(M)/k8s-ready |
| 232 | mkdir -p $(BUILD)/cni-plugins; cd $(BUILD)/cni-plugins; \ |
| 233 | wget https://github.com/containernetworking/plugins/releases/download/v0.8.2/cni-plugins-linux-amd64-v0.8.2.tgz && \ |
| 234 | tar xvfz cni-plugins-linux-amd64-v0.8.2.tgz |
| 235 | sudo cp $(BUILD)/cni-plugins/static /opt/cni/bin/ |
| 236 | |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 237 | node-prep: | $(M)/helm-ready /opt/cni/bin/static |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 238 | |
Andy Bavier | 99f31c8 | 2022-04-14 16:16:26 -0700 | [diff] [blame] | 239 | $(M)/router-pod: $(ROUTER_POD_NETCONF) |
| 240 | sudo systemctl restart systemd-networkd |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 241 | DATA_IFACE=$(DATA_IFACE) envsubst < $(RESOURCEDIR)/router.yaml | kubectl apply -f - |
| 242 | kubectl wait pod -n default --for=condition=Ready -l app=router --timeout=300s |
| 243 | @touch $@ |
| 244 | |
Andy Bavier | 99f31c8 | 2022-04-14 16:16:26 -0700 | [diff] [blame] | 245 | $(M)/router-host: $(ROUTER_HOST_NETCONF) $(UE_NAT_CONF) |
| 246 | sudo systemctl daemon-reload |
| 247 | sudo systemctl enable aiab-ue-nat.service |
| 248 | sudo systemctl start aiab-ue-nat.service |
| 249 | sudo systemctl restart systemd-networkd |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 250 | $(eval oiface := $(shell ip route list default | awk -F 'dev' '{ print $$2; exit }' | awk '{ print $$1 }')) |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 251 | @touch $@ |
| 252 | |
| 253 | 4g-core: node-prep |
| 254 | ifeq ($(ENABLE_ROUTER),true) |
| 255 | ifeq ($(ENABLE_OAISIM),true) |
| 256 | 4g-core: $(M)/router-pod |
| 257 | else |
| 258 | 4g-core: $(M)/router-host |
| 259 | endif |
| 260 | endif |
| 261 | 4g-core: $(M)/omec |
| 262 | $(M)/omec: |
| 263 | @if [[ "${CHARTS}" == "local" || "${CHARTS}" == "local-sdcore" ]]; then \ |
| 264 | helm dep up $(SD_CORE_CHART); \ |
| 265 | else \ |
| 266 | helm repo update; \ |
| 267 | fi |
| 268 | NODE_IP=${NODE_IP} DATA_IFACE=${DATA_IFACE} RAN_SUBNET=${RAN_SUBNET} envsubst < $(4G_CORE_VALUES) | \ |
| 269 | helm upgrade --create-namespace --install --wait $(HELM_GLOBAL_ARGS) \ |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 270 | --namespace omec \ |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 271 | --values - \ |
Andy Bavier | 31dfb9e | 2022-02-15 15:24:57 -0700 | [diff] [blame] | 272 | sd-core \ |
| 273 | $(SD_CORE_CHART) |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 274 | @if [[ "${ENABLE_OAISIM}" == "false" ]]; then \ |
| 275 | $(eval mme_ip := $(shell ip -4 -o addr show $${DATA_IFACE} | awk '{print $$4}' | cut -d'/' -f1)) \ |
| 276 | echo "Your MME IP is $(mme_ip)"; \ |
| 277 | fi |
| 278 | @touch $@ |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 279 | |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 280 | 5g-core: node-prep |
| 281 | ifeq ($(ENABLE_ROUTER),true) |
| 282 | ifeq ($(ENABLE_GNBSIM),true) |
| 283 | 5g-core: $(M)/router-pod |
| 284 | else |
| 285 | 5g-core: $(M)/router-host |
| 286 | endif |
| 287 | endif |
| 288 | 5g-core: $(M)/5g-core |
| 289 | $(M)/5g-core: |
| 290 | @if [[ "${CHARTS}" == "local" || "${CHARTS}" == "local-sdcore" ]]; then \ |
| 291 | helm dep up $(SD_CORE_CHART); \ |
| 292 | else \ |
| 293 | helm repo update; \ |
| 294 | fi |
| 295 | NODE_IP=${NODE_IP} DATA_IFACE=${DATA_IFACE} RAN_SUBNET=${RAN_SUBNET} envsubst < $(5G_CORE_VALUES) | \ |
| 296 | helm upgrade --create-namespace --install --wait $(HELM_GLOBAL_ARGS) \ |
Badhrinath | 3e081e2 | 2020-12-02 15:02:08 -0600 | [diff] [blame] | 297 | --namespace omec \ |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 298 | --values - \ |
Andy Bavier | 31dfb9e | 2022-02-15 15:24:57 -0700 | [diff] [blame] | 299 | sd-core \ |
| 300 | $(SD_CORE_CHART) |
Badhrinath | 3e081e2 | 2020-12-02 15:02:08 -0600 | [diff] [blame] | 301 | touch $@ |
| 302 | |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 303 | # UE images includes kernel module, ue_ip.ko |
| 304 | # which should be built in the exactly same kernel version of the host machine |
| 305 | $(BUILD)/openairinterface: | $(M)/setup |
| 306 | mkdir -p $(BUILD) |
| 307 | cd $(BUILD); git clone https://github.com/opencord/openairinterface.git |
| 308 | |
Fatemeh Rouzbeh | a0b26e2 | 2022-04-07 12:45:12 -0700 | [diff] [blame] | 309 | ifeq ($(K8S_INSTALL),kubespray) |
| 310 | download-ue-image: | $(M)/k8s-ready $(BUILD)/openairinterface |
Andy Bavier | 9ee69d0 | 2022-02-11 10:31:21 -0700 | [diff] [blame] | 311 | sg docker -c "docker pull ${OAISIM_UE_IMAGE} && \ |
| 312 | docker tag ${OAISIM_UE_IMAGE} omecproject/lte-uesoftmodem:1.1.0" |
Andy Bavier | d6de561 | 2021-11-08 10:39:17 -0700 | [diff] [blame] | 313 | touch $(M)/ue-image |
| 314 | |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 315 | $(M)/ue-image: | $(M)/k8s-ready $(BUILD)/openairinterface |
| 316 | cd $(BUILD)/openairinterface; \ |
Andy Bavier | 9ee69d0 | 2022-02-11 10:31:21 -0700 | [diff] [blame] | 317 | sg docker -c "docker build . --target lte-uesoftmodem \ |
Hyunsun | 7b64051 | 2020-10-27 19:49:51 -0500 | [diff] [blame] | 318 | --build-arg build_base=omecproject/oai-base:1.1.0 \ |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 319 | --file Dockerfile.ue \ |
Andy Bavier | 9ee69d0 | 2022-02-11 10:31:21 -0700 | [diff] [blame] | 320 | --tag omecproject/lte-uesoftmodem:1.1.0" |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 321 | touch $@ |
Fatemeh Rouzbeh | a0b26e2 | 2022-04-07 12:45:12 -0700 | [diff] [blame] | 322 | endif |
| 323 | |
| 324 | ifeq ($(K8S_INSTALL),rke2) |
| 325 | download-ue-image: | $(M)/k8s-ready $(BUILD)/openairinterface |
| 326 | sg docker -c "docker pull ${OAISIM_UE_IMAGE} && \ |
| 327 | docker tag ${OAISIM_UE_IMAGE} omecproject/lte-uesoftmodem:1.1.0 && \ |
| 328 | docker save -o /tmp/lte-uesoftmodem.tar omecproject/lte-uesoftmodem:1.1.0" |
| 329 | $(CTR_CMD) images import /tmp/lte-uesoftmodem.tar |
| 330 | touch $(M)/ue-image |
| 331 | |
| 332 | $(M)/ue-image: $(M)/k8s-ready $(BUILD)/openairinterface |
| 333 | cd $(BUILD)/openairinterface; \ |
| 334 | sg docker -c "docker build . --target lte-uesoftmodem \ |
| 335 | --build-arg build_base=omecproject/oai-base:1.1.0 \ |
| 336 | --file Dockerfile.ue \ |
| 337 | --tag omecproject/lte-uesoftmodem:1.1.0 && \ |
| 338 | docker save -o /tmp/lte-uesoftmodem.tar omecproject/lte-uesoftmodem:1.1.0" |
| 339 | $(CTR_CMD) images import /tmp/lte-uesoftmodem.tar |
| 340 | touch $@ |
| 341 | endif |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 342 | |
Andy Bavier | 99f31c8 | 2022-04-14 16:16:26 -0700 | [diff] [blame] | 343 | /etc/systemd/%: |
| 344 | @sudo mkdir -p $(@D) |
| 345 | @sed 's/DATA_IFACE/$(DATA_IFACE)/g' $(MAKEDIR)/systemd/$(@F) > /tmp/$(@F) |
| 346 | @sudo cp /tmp/$(@F) $@ |
| 347 | echo "Installed $@" |
Andy Bavier | 9ee69d0 | 2022-02-11 10:31:21 -0700 | [diff] [blame] | 348 | |
Andy Bavier | 99f31c8 | 2022-04-14 16:16:26 -0700 | [diff] [blame] | 349 | oaisim-standalone: | $(M)/helm-ready $(M)/ue-image $(LO_NETCONF) |
| 350 | sudo systemctl restart systemd-networkd |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 351 | @ip link show $(DATA_IFACE) > /dev/null || (echo DATA_IFACE is not set or does not exist; exit 1) |
| 352 | @if [[ "${MME_IP}" == "" ]]; then \ |
| 353 | echo MME_IP is not set; \ |
| 354 | exit 1; \ |
| 355 | else \ |
| 356 | ping -c 3 $(MME_IP) > /dev/null || (echo MME $(MME_IP) is not reachable; exit 1) \ |
| 357 | fi |
| 358 | sudo ip route add 192.168.252.0/24 via $(MME_IP) |
Andy Bavier | 7b01b68 | 2022-03-17 13:26:55 -0700 | [diff] [blame] | 359 | helm repo update |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 360 | helm upgrade --create-namespace --install $(HELM_GLOBAL_ARGS) --namespace omec oaisim cord/oaisim -f $(OAISIM_VALUES) \ |
| 361 | --set config.enb.networks.s1u.interface=$(DATA_IFACE) \ |
| 362 | --set config.enb.networks.s1_mme.interface=$(DATA_IFACE) \ |
| 363 | --set config.enb.mme.address=$(MME_IP) \ |
| 364 | --set config.enb.mme.isLocal=false \ |
| 365 | --set images.pullPolicy=IfNotPresent |
Andy Bavier | 7b01b68 | 2022-03-17 13:26:55 -0700 | [diff] [blame] | 366 | kubectl rollout status -n omec statefulset ue |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 367 | @echo "Test: registration" |
Andy Bavier | 7b01b68 | 2022-03-17 13:26:55 -0700 | [diff] [blame] | 368 | @timeout 60s bash -c \ |
| 369 | "until ip addr show oip1 | grep -q inet; \ |
| 370 | do \ |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 371 | echo 'Waiting for UE 1 gets IP address'; \ |
| 372 | sleep 3; \ |
Andy Bavier | 7b01b68 | 2022-03-17 13:26:55 -0700 | [diff] [blame] | 373 | done" |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 374 | @echo "Test: ping from UE to 8.8.8.8" |
| 375 | ping -I oip1 8.8.8.8 -c 3 |
| 376 | @touch $(M)/oaisim $(M)/omec |
Andy Bavier | 7b01b68 | 2022-03-17 13:26:55 -0700 | [diff] [blame] | 377 | |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 378 | oaisim: | $(M)/oaisim |
Andy Bavier | 99f31c8 | 2022-04-14 16:16:26 -0700 | [diff] [blame] | 379 | $(M)/oaisim: | $(M)/ue-image $(M)/router-pod $(OAISIM_NETCONF) |
| 380 | sudo systemctl restart systemd-networkd |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 381 | helm upgrade --create-namespace --install $(HELM_GLOBAL_ARGS) --namespace omec oaisim cord/oaisim -f $(OAISIM_VALUES) \ |
Jeremy Ronquillo | af084f3 | 2020-08-24 13:18:47 -0700 | [diff] [blame] | 382 | --set images.pullPolicy=IfNotPresent |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 383 | kubectl rollout status -n omec statefulset ue |
| 384 | @timeout 60s bash -c \ |
| 385 | "until ip addr show oip1 | grep -q inet; \ |
| 386 | do \ |
| 387 | echo 'Waiting for UE 1 gets IP address'; \ |
| 388 | sleep 3; \ |
| 389 | done" |
| 390 | touch $@ |
| 391 | |
Andy Bavier | ebf479c | 2021-09-08 15:47:58 -0700 | [diff] [blame] | 392 | roc: $(M)/roc |
| 393 | $(M)/roc: $(M)/helm-ready |
| 394 | kubectl get namespace aether-roc 2> /dev/null || kubectl create namespace aether-roc |
| 395 | helm repo update |
| 396 | if [ "$(CHARTS)" == "local" ]; then helm dep up $(AETHER_ROC_UMBRELLA_CHART); fi |
| 397 | helm upgrade --install --wait $(HELM_GLOBAL_ARGS) \ |
| 398 | --namespace kube-system \ |
| 399 | --values $(ROC_VALUES) \ |
| 400 | atomix-controller \ |
| 401 | $(ATOMIX_CONTROLLER_CHART) |
| 402 | helm upgrade --install --wait $(HELM_GLOBAL_ARGS) \ |
| 403 | --namespace kube-system \ |
| 404 | --values $(ROC_VALUES) \ |
| 405 | atomix-raft-storage \ |
| 406 | $(ATOMIX_RAFT_STORAGE_CHART) |
| 407 | helm upgrade --install --wait $(HELM_GLOBAL_ARGS) \ |
| 408 | --namespace kube-system \ |
| 409 | --values $(ROC_VALUES) \ |
| 410 | onos-operator \ |
| 411 | $(ONOS_OPERATOR_CHART) |
| 412 | helm upgrade --install --wait $(HELM_GLOBAL_ARGS) \ |
| 413 | --namespace aether-roc \ |
| 414 | --values $(ROC_VALUES) \ |
| 415 | aether-roc-umbrella \ |
| 416 | $(AETHER_ROC_UMBRELLA_CHART) |
| 417 | touch $@ |
| 418 | |
| 419 | # Load the ROC 4G models. Disable loading network slice from SimApp. |
| 420 | roc-4g-models: $(M)/roc |
| 421 | sed -i 's/provision-network-slice: true/provision-network-slice: false/' $(4G_CORE_VALUES) |
| 422 | sed -i 's/# syncUrl/syncUrl/' $(4G_CORE_VALUES) |
Amit Wankhede | 01b20c3 | 2021-12-01 12:45:58 +0530 | [diff] [blame] | 423 | if [ "${ENABLE_SUBSCRIBER_PROXY}" == "true" ] ; then \ |
Amit Wankhede | fdf10ff | 2022-02-16 08:37:20 -0600 | [diff] [blame] | 424 | sed -i 's/# sub-proxy-endpt:/sub-proxy-endpt:/' $(4G_CORE_VALUES) ; \ |
| 425 | sed -i 's/# addr: sub/ addr: sub/' $(4G_CORE_VALUES) ; \ |
| 426 | sed -i 's/# port: 5000/ port: 5000/' $(4G_CORE_VALUES) ; \ |
Amit Wankhede | 01b20c3 | 2021-12-01 12:45:58 +0530 | [diff] [blame] | 427 | fi |
Andy Bavier | ebf479c | 2021-09-08 15:47:58 -0700 | [diff] [blame] | 428 | $(eval ONOS_CLI_POD := $(shell kubectl -n aether-roc get pods -l name=onos-cli -o name)) |
| 429 | echo "ONOS CLI pod: ${ONOS_CLI_POD}" |
| 430 | until kubectl -n aether-roc exec ${ONOS_CLI_POD} -- \ |
| 431 | curl -s -f -L -X PATCH "http://aether-roc-api:8181/aether-roc-api" \ |
| 432 | --header 'Content-Type: application/json' \ |
| 433 | --data-raw "$$(cat ${ROC_4G_MODELS})"; do sleep 5; done |
| 434 | |
| 435 | # Load the ROC 5G models. Disable loading network slice from SimApp. |
| 436 | roc-5g-models: $(M)/roc |
| 437 | sed -i 's/provision-network-slice: true/provision-network-slice: false/' $(5G_CORE_VALUES) |
| 438 | sed -i 's/# syncUrl/syncUrl/' $(5G_CORE_VALUES) |
Amit Wankhede | 01b20c3 | 2021-12-01 12:45:58 +0530 | [diff] [blame] | 439 | if [ "${ENABLE_SUBSCRIBER_PROXY}" == "true" ] ; then \ |
Amit Wankhede | fdf10ff | 2022-02-16 08:37:20 -0600 | [diff] [blame] | 440 | sed -i 's/# sub-proxy-endpt:/sub-proxy-endpt:/' $(5G_CORE_VALUES) ; \ |
| 441 | sed -i 's/# addr: sub/ addr: sub/' $(5G_CORE_VALUES) ; \ |
| 442 | sed -i 's/# port: 5000/ port: 5000/' $(5G_CORE_VALUES) ; \ |
Amit Wankhede | 01b20c3 | 2021-12-01 12:45:58 +0530 | [diff] [blame] | 443 | fi |
Andy Bavier | ebf479c | 2021-09-08 15:47:58 -0700 | [diff] [blame] | 444 | $(eval ONOS_CLI_POD := $(shell kubectl -n aether-roc get pods -l name=onos-cli -o name)) |
| 445 | echo "ONOS CLI pod: ${ONOS_CLI_POD}" |
| 446 | until kubectl -n aether-roc exec ${ONOS_CLI_POD} -- \ |
| 447 | curl -s -f -L -X PATCH "http://aether-roc-api:8181/aether-roc-api" \ |
| 448 | --header 'Content-Type: application/json' \ |
| 449 | --data-raw "$$(cat ${ROC_5G_MODELS})"; do sleep 5; done |
| 450 | |
| 451 | roc-clean: |
| 452 | @echo "This could take 2-3 minutes..." |
| 453 | sed -i 's/provision-network-slice: false/provision-network-slice: true/' $(4G_CORE_VALUES) |
| 454 | sed -i 's/ syncUrl/ # syncUrl/' $(4G_CORE_VALUES) |
Amit Wankhede | fdf10ff | 2022-02-16 08:37:20 -0600 | [diff] [blame] | 455 | sed -i 's/ sub-proxy-endpt:/ # sub-proxy-endpt:/' $(4G_CORE_VALUES) |
| 456 | sed -i 's/ addr: sub/ # addr: sub/' $(4G_CORE_VALUES) |
| 457 | sed -i 's/ port: 5000/ # port: 5000/' $(4G_CORE_VALUES) |
Andy Bavier | ebf479c | 2021-09-08 15:47:58 -0700 | [diff] [blame] | 458 | sed -i 's/provision-network-slice: false/provision-network-slice: true/' $(5G_CORE_VALUES) |
| 459 | sed -i 's/ syncUrl/ # syncUrl/' $(5G_CORE_VALUES) |
Amit Wankhede | fdf10ff | 2022-02-16 08:37:20 -0600 | [diff] [blame] | 460 | sed -i 's/ sub-proxy-endpt:/ # sub-proxy-endpt:/' $(5G_CORE_VALUES) |
| 461 | sed -i 's/ addr: sub/ # addr: sub/' $(5G_CORE_VALUES) |
| 462 | sed -i 's/ port: 5000/ # port: 5000/' $(5G_CORE_VALUES) |
Andy Bavier | ebf479c | 2021-09-08 15:47:58 -0700 | [diff] [blame] | 463 | kubectl delete namespace aether-roc || true |
| 464 | rm -rf $(M)/roc |
| 465 | |
Andy Bavier | 7d5f055 | 2022-05-23 16:01:45 -0700 | [diff] [blame^] | 466 | monitoring: $(M)/monitoring |
| 467 | $(M)/monitoring: $(M)/helm-ready |
| 468 | helm upgrade --install --wait $(HELM_GLOBAL_ARGS) \ |
| 469 | --namespace=cattle-monitoring-system \ |
| 470 | --create-namespace \ |
| 471 | --values=$(MONITORING_VALUES) \ |
| 472 | rancher-monitoring-crd \ |
| 473 | $(RANCHER_MONITORING_CRD_CHART) |
| 474 | helm upgrade --install --wait $(HELM_GLOBAL_ARGS) \ |
| 475 | --namespace=cattle-monitoring-system \ |
| 476 | --create-namespace \ |
| 477 | --values=$(MONITORING_VALUES) \ |
| 478 | rancher-monitoring \ |
| 479 | $(RANCHER_MONITORING_CHART) |
| 480 | touch $(M)/monitoring |
| 481 | |
| 482 | monitoring-4g: $(M)/monitoring |
| 483 | kubectl create namespace omec || true |
| 484 | kubectl create namespace cattle-dashboards || true |
| 485 | kubectl apply -k resources/4g-monitoring |
| 486 | |
| 487 | |
| 488 | monitoring-clean: |
| 489 | helm -n cattle-monitoring-system delete rancher-monitoring || true |
| 490 | helm -n cattle-monitoring-system delete rancher-monitoring-crd || true |
| 491 | kubectl delete namespace cattle-dashboards cattle-monitoring-system || true |
| 492 | rm $(M)/monitoring |
| 493 | |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 494 | omec-clean: |
| 495 | helm delete -n omec $$(helm -n omec ls -qa) || true |
| 496 | @echo "" |
| 497 | @echo "Wait for all pods to terminate..." |
| 498 | kubectl wait -n omec --for=delete --all=true -l app!=ue pod --timeout=180s || true |
| 499 | |
| 500 | router-clean: |
| 501 | @kubectl delete net-attach-def router-net 2>/dev/null || true |
| 502 | @kubectl delete po router 2>/dev/null || true |
| 503 | kubectl wait --for=delete -l app=router pod --timeout=180s 2>/dev/null || true |
| 504 | sudo ip link del access || true |
| 505 | sudo ip link del core || true |
| 506 | $(eval oiface := $(shell ip route list default | awk -F 'dev' '{ print $$2; exit }' | awk '{ print $$1 }')) |
| 507 | sudo iptables -t nat -D POSTROUTING -s 172.250.0.0/16 -o $(oiface) -j MASQUERADE || true |
| 508 | @sudo ip link del data 2>/dev/null || true |
| 509 | @cd $(M); rm -f router-pod router-host |
| 510 | |
| 511 | oaisim-clean: reset-ue |
| 512 | @sudo ip addr del 127.0.0.2/8 dev lo 2>/dev/null || true |
| 513 | @sudo ip link del enb 2>/dev/null || true |
| 514 | @sudo ip route del 192.168.252.0/24 || true |
| 515 | @cd $(M); rm -f oaisim-lo |
| 516 | |
Andy Bavier | 7d5f055 | 2022-05-23 16:01:45 -0700 | [diff] [blame^] | 517 | 4g-test: test |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 518 | test: | 4g-core $(M)/oaisim |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 519 | @sleep 5 |
| 520 | @echo "Test1: ping from UE to SGI network gateway" |
Hyunsun Moon | 0bd8cec | 2020-09-28 00:38:26 -0500 | [diff] [blame] | 521 | ping -I oip1 192.168.250.1 -c 15 |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 522 | @echo "Test2: ping from UE to 8.8.8.8" |
| 523 | ping -I oip1 8.8.8.8 -c 3 |
Hyunsun Moon | 0bd8cec | 2020-09-28 00:38:26 -0500 | [diff] [blame] | 524 | @echo "Test3: ping from UE to google.com" |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 525 | ping -I oip1 google.com -c 3 |
| 526 | @echo "Finished to test" |
| 527 | |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 528 | 5g-test: | 5g-core |
Andy Bavier | 31dfb9e | 2022-02-15 15:24:57 -0700 | [diff] [blame] | 529 | @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] | 530 | @echo "Test: Registration + UE initiated PDU Session Establishment + User Data packets" |
Andy Bavier | 0e4906f | 2022-03-03 15:31:48 -0700 | [diff] [blame] | 531 | @sleep 60 |
Andy Bavier | 0a055a5 | 2022-01-07 10:46:17 -0700 | [diff] [blame] | 532 | @rm -f /tmp/gnbsim.out |
Andy Bavier | cd93a20 | 2022-01-10 18:03:26 -0800 | [diff] [blame] | 533 | @if [[ ${GNBSIM_COLORS} == "true" ]]; then \ |
| 534 | kubectl -n omec exec gnbsim-0 -- ./gnbsim 2>&1 | tee /tmp/gnbsim.out; \ |
| 535 | else \ |
| 536 | kubectl -n omec exec gnbsim-0 -- ./gnbsim 2>&1 | sed -u "s,\x1B\[[0-9;]*[a-zA-Z],,g" | tee /tmp/gnbsim.out; \ |
| 537 | fi |
Andy Bavier | 094d6ef | 2022-03-08 13:21:52 -0700 | [diff] [blame] | 538 | @grep -q "Simulation Result: PASS" /tmp/gnbsim.out |
Andy Bavier | 0a055a5 | 2022-01-07 10:46:17 -0700 | [diff] [blame] | 539 | |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 540 | reset-test: | oaisim-clean omec-clean router-clean |
| 541 | @cd $(M); rm -f omec oaisim 5g-core |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 542 | |
Andy Bavier | 8819b9f | 2022-01-28 16:54:06 -0700 | [diff] [blame] | 543 | reset-ue: |
| 544 | helm delete -n omec oaisim || true |
| 545 | kubectl wait -n omec --for=delete pod enb-0 || true |
| 546 | kubectl wait -n omec --for=delete pod ue-0 || true |
| 547 | cd $(M); rm -f oaisim |
| 548 | |
Hyunsun Moon | cbdac11 | 2022-03-19 22:01:27 -0600 | [diff] [blame] | 549 | reset-5g-test: omec-clean |
Badhrinath | 3e081e2 | 2020-12-02 15:02:08 -0600 | [diff] [blame] | 550 | cd $(M); rm -f 5g-core |
| 551 | |
Osman Amjad | 488a022 | 2022-01-12 11:58:43 -0600 | [diff] [blame] | 552 | reset-dbtestapp: |
| 553 | helm uninstall --namespace omec 5g-test-app |
| 554 | |
Andy Bavier | 99f31c8 | 2022-04-14 16:16:26 -0700 | [diff] [blame] | 555 | refresh-4g: reset-ue |
| 556 | kubectl -n omec delete pod mme-0 |
| 557 | kubectl wait -n omec --for='condition=ready' pod mme-0 --timeout=300s |
| 558 | |
Osman Amjad | 488a022 | 2022-01-12 11:58:43 -0600 | [diff] [blame] | 559 | dbtestapp: |
| 560 | helm repo update |
| 561 | if [ "$(CHARTS)" == "local" ]; then helm dep up $(5G_TEST_APPS_CHART); fi |
| 562 | helm upgrade --install --wait $(HELM_GLOBAL_ARGS) \ |
| 563 | --namespace omec \ |
| 564 | 5g-test-app \ |
| 565 | --values $(TEST_APP_VALUES) \ |
| 566 | $(5G_TEST_APPS_CHART) |
| 567 | @echo "Finished to dbtestapp" |
| 568 | |
Andy Bavier | 99f31c8 | 2022-04-14 16:16:26 -0700 | [diff] [blame] | 569 | clean-systemd: |
| 570 | cd /etc/systemd/network && sudo rm -f 10-aiab* 20-aiab* */macvlan.conf |
| 571 | cd /etc/systemd/system && sudo rm -f aiab*.service && sudo systemctl daemon-reload |
| 572 | |
Fatemeh Rouzbeh | a0b26e2 | 2022-04-07 12:45:12 -0700 | [diff] [blame] | 573 | ifeq ($(K8S_INSTALL),rke2) |
Andy Bavier | 5b5ad56 | 2022-04-19 13:02:31 -0700 | [diff] [blame] | 574 | clean: | roc-clean oaisim-clean router-clean clean-systemd |
Andy Bavier | 99f31c8 | 2022-04-14 16:16:26 -0700 | [diff] [blame] | 575 | sudo /usr/local/bin/rke2-uninstall.sh || true |
Fatemeh Rouzbeh | a0b26e2 | 2022-04-07 12:45:12 -0700 | [diff] [blame] | 576 | sudo rm -rf /usr/local/bin/kubectl |
| 577 | rm -rf $(M) |
| 578 | endif |
| 579 | |
| 580 | ifeq ($(K8S_INSTALL),kubespray) |
Andy Bavier | 5b5ad56 | 2022-04-19 13:02:31 -0700 | [diff] [blame] | 581 | clean: | roc-clean oaisim-clean router-clean clean-systemd |
Jeremy Ronquillo | 6be909e | 2020-08-24 09:36:13 -0700 | [diff] [blame] | 582 | source "$(VENV)/bin/activate" && cd $(BUILD)/kubespray; \ |
Andy Bavier | 125baa0 | 2021-10-26 16:26:44 -0700 | [diff] [blame] | 583 | 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] | 584 | @if [ -d /usr/local/etc/emulab ]; then \ |
| 585 | mount | grep /mnt/extra/kubelet/pods | cut -d" " -f3 | sudo xargs umount; \ |
| 586 | sudo rm -rf /mnt/extra/kubelet; \ |
| 587 | fi |
| 588 | rm -rf $(M) |
Fatemeh Rouzbeh | a0b26e2 | 2022-04-07 12:45:12 -0700 | [diff] [blame] | 589 | endif |