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