blob: e1b001f1771b495139a0bee9a8edda57079963b7 [file] [log] [blame]
Jeremy Ronquillo5263c732020-10-13 09:42:19 -07001# Copyright 2018-present Open Networking Foundation
2#
Andy Bavier2c427732022-02-03 15:16:46 -07003# SPDX-License-Identifier: Apache-2.0
Jeremy Ronquillo5263c732020-10-13 09:42:19 -07004
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -07005SHELL := /bin/bash
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -07006MAKEDIR := $(dir $(realpath $(firstword $(MAKEFILE_LIST))))
Andy Bavier99f31c82022-04-14 16:16:26 -07007BUILD ?= $(MAKEDIR)/build
8M ?= $(BUILD)/milestones
Jeremy Ronquilloaf084f32020-08-24 13:18:47 -07009SCRIPTDIR := $(MAKEDIR)/scripts
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -070010RESOURCEDIR := $(MAKEDIR)/resources
11WORKSPACE ?= $(HOME)
Jeremy Ronquillod3cab742020-08-24 11:49:00 -070012VENV ?= $(BUILD)/venv/aiab
Andy Bavierebf479c2021-09-08 15:47:58 -070013
Sean Condone184e6e2023-01-12 09:59:40 +0000144G_CORE_VALUES ?= $(MAKEDIR)/sd-core-4g-values.yaml
155G_CORE_VALUES ?= $(MAKEDIR)/sd-core-5g-values.yaml
16OAISIM_VALUES ?= $(MAKEDIR)/oaisim-values.yaml
17ROC_VALUES ?= $(MAKEDIR)/roc-values.yaml
18ROC_DEFAULTENT_MODEL ?= $(MAKEDIR)/roc-defaultent-model.json
19ROC_4G_MODELS ?= $(MAKEDIR)/roc-4g-models.json
20ROC_5G_MODELS ?= $(MAKEDIR)/roc-5g-models.json
21TEST_APP_VALUES ?= $(MAKEDIR)/5g-test-apps-values.yaml
22GET_HELM = get_helm.sh
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -070023
Amol Jaikarf7402222023-01-17 15:15:07 -050024KUBESPRAY_VERSION ?= release-2.20
Fatemeh Rouzbeha0b26e22022-04-07 12:45:12 -070025DOCKER_VERSION ?= '20.10'
Amol Jaikarf7402222023-01-17 15:15:07 -050026HELM_VERSION ?= v3.10.3
27KUBECTL_VERSION ?= v1.23.15
Fatemeh Rouzbeha0b26e22022-04-07 12:45:12 -070028
Amol Jaikarf7402222023-01-17 15:15:07 -050029RKE2_K8S_VERSION ?= v1.23.15+rke2r1
30K8S_VERSION ?= v1.23.15
Hyunsun Mooncbdac112022-03-19 22:01:27 -060031
Andy Bavier6834b352022-06-22 14:54:16 -070032OAISIM_UE_IMAGE ?= andybavier/lte-uesoftmodem:1.1.0-$(shell uname -r)
Hyunsun Mooncbdac112022-03-19 22:01:27 -060033ENABLE_ROUTER ?= true
34ENABLE_OAISIM ?= true
35ENABLE_GNBSIM ?= true
Amit Wankhede01b20c32021-12-01 12:45:58 +053036ENABLE_SUBSCRIBER_PROXY ?= false
Andy Baviercd93a202022-01-10 18:03:26 -080037GNBSIM_COLORS ?= true
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -070038
Fatemeh Rouzbeh85654e72022-05-23 09:26:12 -070039K8S_INSTALL ?= rke2
Andy Bavier99f31c82022-04-14 16:16:26 -070040CTR_CMD := sudo /var/lib/rancher/rke2/bin/ctr --address /run/k3s/containerd/containerd.sock --namespace k8s.io
Fatemeh Rouzbeha0b26e22022-04-07 12:45:12 -070041
Fatemeh Rouzbeh85654e72022-05-23 09:26:12 -070042PROXY_ENABLED ?= false
43HTTP_PROXY ?= ${http_proxy}
44HTTPS_PROXY ?= ${https_proxy}
45NO_PROXY ?= ${no_proxy}
46
47ONECLOUD ?= false
48
Hyunsun Mooncbdac112022-03-19 22:01:27 -060049DATA_IFACE ?= data
50ifeq ($(DATA_IFACE), data)
51 RAN_SUBNET := 192.168.251.0/24
52else
Ajay Lotan Thakur5ee9e0e2022-09-28 23:34:56 -060053 RAN_SUBNET := $(shell ip route | grep $${DATA_IFACE} | awk '/kernel/ {print $$1}' | head -1)
Andy Bavier99f31c82022-04-14 16:16:26 -070054 DATA_IFACE_PATH := $(shell find /*/systemd/network -maxdepth 1 -not -type d -name '*$(DATA_IFACE).network' -print)
55 DATA_IFACE_CONF ?= $(shell basename $(DATA_IFACE_PATH)).d
Hyunsun Mooncbdac112022-03-19 22:01:27 -060056endif
Hyunsun Moon4e5795a2022-04-07 09:27:12 -070057
Andy Bavier99f31c82022-04-14 16:16:26 -070058# systemd-networkd and systemd configs
59LO_NETCONF := /etc/systemd/network/20-aiab-lo.network
60OAISIM_NETCONF := $(LO_NETCONF) /etc/systemd/network/10-aiab-enb.netdev /etc/systemd/network/20-aiab-enb.network
61ROUTER_POD_NETCONF := /etc/systemd/network/10-aiab-dummy.netdev /etc/systemd/network/20-aiab-dummy.network
62ROUTER_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
63UE_NAT_CONF := /etc/systemd/system/aiab-ue-nat.service
64
Andy Bavier7d5f0552022-05-23 16:01:45 -070065# monitoring
66RANCHER_MONITORING_CRD_CHART := rancher/rancher-monitoring-crd
67RANCHER_MONITORING_CHART := rancher/rancher-monitoring
68MONITORING_VALUES ?= $(MAKEDIR)/monitoring.yaml
69
Hyunsun Moon4e5795a2022-04-07 09:27:12 -070070NODE_IP ?= $(shell ip route get 8.8.8.8 | grep -oP 'src \K\S+')
71ifndef NODE_IP
72$(error NODE_IP is not set)
73endif
74
Hyunsun Mooncbdac112022-03-19 22:01:27 -060075MME_IP ?=
76
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -070077HELM_GLOBAL_ARGS ?=
Andy Baviereda466b2021-08-27 15:00:36 -070078
79# Allow installing local charts or specific versions of published charts.
80# E.g., to install the Aether 1.5 release:
81# CHARTS=release-1.5 make test
82# Default is to install from the local charts.
83CHARTS ?= local
84CONFIGFILE := configs/$(CHARTS)
85include $(CONFIGFILE)
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -070086
87cpu_family := $(shell lscpu | grep 'CPU family:' | awk '{print $$3}')
88cpu_model := $(shell lscpu | grep 'Model:' | awk '{print $$2}')
89os_vendor := $(shell lsb_release -i -s)
90os_release := $(shell lsb_release -r -s)
Andy Bavier9ee69d02022-02-11 10:31:21 -070091USER := $(shell whoami)
92
Fatemeh Rouzbeha0b26e22022-04-07 12:45:12 -070093.PHONY: 4g-core 5g-core oaisim test reset-test reset-ue reset-5g-test node-prep clean
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -070094
95$(M):
96 mkdir -p $(M)
97
98$(M)/system-check: | $(M)
99 @if [[ $(cpu_family) -eq 6 ]]; then \
100 if [[ $(cpu_model) -lt 60 ]]; then \
101 echo "FATAL: haswell CPU or newer is required."; \
102 exit 1; \
103 fi \
104 else \
105 echo "FATAL: unsupported CPU family."; \
106 exit 1; \
107 fi
108 @if [[ $(os_vendor) =~ (Ubuntu) ]]; then \
Hyunsun7b640512020-10-27 19:49:51 -0500109 if [[ ! $(os_release) =~ (18.04) ]]; then \
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700110 echo "WARN: $(os_vendor) $(os_release) has not been tested."; \
111 fi; \
112 if dpkg --compare-versions 4.15 gt $(shell uname -r); then \
113 echo "FATAL: kernel 4.15 or later is required."; \
114 echo "Please upgrade your kernel by running" \
115 "apt install --install-recommends linux-generic-hwe-$(os_release)"; \
116 exit 1; \
117 fi \
118 else \
119 echo "FAIL: unsupported OS."; \
120 exit 1; \
121 fi
122 touch $@
123
Andy Bavier99f31c82022-04-14 16:16:26 -0700124$(M)/interface-check: | $(M)
125ifeq ($(DATA_IFACE_CONF), .d)
126 @echo
127 @echo FATAL: Could not find systemd-networkd config for interface $(DATA_IFACE), exiting now!; exit 1
128endif
Fatemeh Rouzbeh85654e72022-05-23 09:26:12 -0700129 @echo "Add network configuration for enb interface"
130 @if [[ "${ONECLOUD}" == "true" ]]; then \
131 sudo cp netplan/01-enb-static-config.yaml /etc/netplan ; \
132 sudo netplan apply ; \
133 sleep 1 ; \
134 fi
Andy Bavier99f31c82022-04-14 16:16:26 -0700135 touch $@
136
Fatemeh Rouzbeha0b26e22022-04-07 12:45:12 -0700137ifeq ($(K8S_INSTALL),kubespray)
Andy Bavier99f31c82022-04-14 16:16:26 -0700138$(M)/setup: | $(M) $(M)/interface-check
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700139 sudo $(SCRIPTDIR)/cloudlab-disksetup.sh
Hyunsun Moon82e47c22021-06-28 12:30:20 -0500140 sudo apt update; sudo apt install -y software-properties-common python3 python3-pip python3-venv jq httpie ipvsadm
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700141 touch $@
Fatemeh Rouzbeha0b26e22022-04-07 12:45:12 -0700142endif
143
144ifeq ($(K8S_INSTALL),rke2)
Fatemeh Rouzbeh85654e72022-05-23 09:26:12 -0700145$(M)/initial-setup: | $(M) $(M)/interface-check
Fatemeh Rouzbeha0b26e22022-04-07 12:45:12 -0700146 sudo $(SCRIPTDIR)/cloudlab-disksetup.sh
147 sudo apt update; sudo apt install -y software-properties-common python3 python3-pip python3-venv jq httpie ipvsadm apparmor apparmor-utils
148 systemctl list-units --full -all | grep "docker.service" || sudo apt install -y docker.io
149 sudo adduser $(USER) docker || true
Andy Bavier23024432022-05-26 10:10:50 -0700150 touch $(M)/initial-setup
Fatemeh Rouzbeh85654e72022-05-23 09:26:12 -0700151
152ifeq ($(PROXY_ENABLED),true)
153$(M)/proxy-setting: | $(M)
154 echo "Defaults env_keep += \"HTTP_PROXY HTTPS_PROXY NO_PROXY http_proxy https_proxy no_proxy\"" | sudo EDITOR='tee -a' visudo -f /etc/sudoers.d/proxy
155 echo "HTTP_PROXY=$(HTTP_PROXY)" >> rke2-server
156 echo "HTTPS_PROXY=$(HTTPS_PROXY)" >> rke2-server
157 echo "NO_PROXY=$(NO_PROXY),.cluster.local,.svc,$(NODE_IP),192.168.84.0/24,192.168.85.0/24,$(RAN_SUBNET)" >> rke2-server
158 sudo mv rke2-server /etc/default/
159 echo "[Service]" >> http-proxy.conf
160 echo "Environment='HTTP_PROXY=$(HTTP_PROXY)'" >> http-proxy.conf
161 echo "Environment='HTTPS_PROXY=$(HTTPS_PROXY)'" >> http-proxy.conf
162 echo "Environment='NO_PROXY=$(NO_PROXY)'" >> http-proxy.conf
163 sudo mkdir -p /etc/systemd/system/docker.service.d
164 sudo mv http-proxy.conf /etc/systemd/system/docker.service.d
165 sudo systemctl daemon-reload
166 sudo systemctl restart docker
167 touch $(M)/proxy-setting
168else
169$(M)/proxy-setting: | $(M)
170 @echo -n ""
171 touch $(M)/proxy-setting
172endif
173
174$(M)/setup: | $(M)/initial-setup $(M)/proxy-setting
Fatemeh Rouzbeha0b26e22022-04-07 12:45:12 -0700175 touch $@
176endif
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700177
178$(BUILD)/kubespray: | $(M)/setup
179 mkdir -p $(BUILD)
180 cd $(BUILD); git clone https://github.com/kubernetes-incubator/kubespray.git -b $(KUBESPRAY_VERSION)
181
182$(VENV)/bin/activate: | $(M)/setup
Hyunsun Moon82e47c22021-06-28 12:30:20 -0500183 python3 -m venv $(VENV)
Wei-Yu Chen7edb7e72021-07-28 11:37:55 +0800184 source "$(VENV)/bin/activate" && \
185 python -m pip install -U pip && \
186 deactivate
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700187
188$(M)/kubespray-requirements: $(BUILD)/kubespray | $(VENV)/bin/activate
189 source "$(VENV)/bin/activate" && \
190 pip install -r $(BUILD)/kubespray/requirements.txt
191 touch $@
192
Fatemeh Rouzbeha0b26e22022-04-07 12:45:12 -0700193ifeq ($(K8S_INSTALL),kubespray)
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700194$(M)/k8s-ready: | $(M)/setup $(BUILD)/kubespray $(VENV)/bin/activate $(M)/kubespray-requirements
195 source "$(VENV)/bin/activate" && cd $(BUILD)/kubespray; \
196 ansible-playbook -b -i inventory/local/hosts.ini \
Fatemeh Rouzbeh85654e72022-05-23 09:26:12 -0700197 -e "{'http_proxy' : $(HTTP_PROXY)}" \
198 -e "{'https_proxy' : $(HTTPS_PROXY)}" \
199 -e "{'no_proxy' : $(NO_PROXY)}" \
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700200 -e "{'override_system_hostname' : False, 'disable_swap' : True}" \
201 -e "{'docker_version' : $(DOCKER_VERSION)}" \
202 -e "{'docker_iptables_enabled' : True}" \
203 -e "{'kube_version' : $(K8S_VERSION)}" \
Hyunsun84f0f172020-09-23 15:40:08 -0500204 -e "{'kube_network_plugin_multus' : True, 'multus_version' : stable, 'multus_cni_version' : 0.3.1}" \
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700205 -e "{'kube_proxy_metrics_bind_address' : 0.0.0.0:10249}" \
Hyunsun Mooncbdac112022-03-19 22:01:27 -0600206 -e "{'kube_pods_subnet' : 192.168.84.0/24, 'kube_service_addresses' : 192.168.85.0/24}" \
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700207 -e "{'kube_apiserver_node_port_range' : 2000-36767}" \
208 -e "{'kubeadm_enabled': True}" \
209 -e "{'kube_feature_gates' : [SCTPSupport=True]}" \
Hyunsun Mooncbdac112022-03-19 22:01:27 -0600210 -e "{'kubelet_custom_flags' : [--allowed-unsafe-sysctls=net.*, --node-ip=$(NODE_IP)]}" \
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700211 -e "{'dns_min_replicas' : 1}" \
212 -e "{'helm_enabled' : True, 'helm_version' : $(HELM_VERSION)}" \
213 cluster.yml
214 mkdir -p $(HOME)/.kube
215 sudo cp -f /etc/kubernetes/admin.conf $(HOME)/.kube/config
216 sudo chown $(shell id -u):$(shell id -g) $(HOME)/.kube/config
217 kubectl wait pod -n kube-system --for=condition=Ready --all
Andy Bavier9ee69d02022-02-11 10:31:21 -0700218 sudo adduser $(USER) docker
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700219 touch $@
220
221$(M)/helm-ready: | $(M)/k8s-ready
Woojoong Kim8425cb32021-01-08 16:18:53 -0800222 helm repo add incubator https://charts.helm.sh/incubator
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700223 helm repo add cord https://charts.opencord.org
Andy Baviereda466b2021-08-27 15:00:36 -0700224 helm repo add atomix https://charts.atomix.io
225 helm repo add onosproject https://charts.onosproject.org
Andy Bavier9ee69d02022-02-11 10:31:21 -0700226 helm repo add aether https://charts.aetherproject.org
Andy Bavier7d5f0552022-05-23 16:01:45 -0700227 helm repo add rancher http://charts.rancher.io/
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700228 touch $@
Fatemeh Rouzbeha0b26e22022-04-07 12:45:12 -0700229endif
230
231ifeq ($(K8S_INSTALL),rke2)
232$(M)/k8s-ready: | $(M)/setup
233 sudo mkdir -p /etc/rancher/rke2/
234 [ -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
235 echo "cni: multus,calico" >> config.yaml
236 echo "cluster-cidr: 192.168.84.0/24" >> config.yaml
237 echo "service-cidr: 192.168.85.0/24" >> config.yaml
238 echo "kubelet-arg:" >> config.yaml
239 echo "- --allowed-unsafe-sysctls="net.*"" >> config.yaml
240 echo "- --node-ip="$(NODE_IP)"" >> config.yaml
241 echo "pause-image: k8s.gcr.io/pause:3.3" >> config.yaml
242 echo "kube-proxy-arg:" >> config.yaml
243 echo "- --metrics-bind-address="0.0.0.0:10249"" >> config.yaml
244 echo "- --proxy-mode="ipvs"" >> config.yaml
245 echo "kube-apiserver-arg:" >> config.yaml
246 echo "- --service-node-port-range="2000-36767"" >> config.yaml
247 sudo mv config.yaml /etc/rancher/rke2/
248 curl -sfL https://get.rke2.io | sudo INSTALL_RKE2_VERSION=$(RKE2_K8S_VERSION) sh -
249 sudo systemctl enable rke2-server.service
250 sudo systemctl start rke2-server.service
251 sudo /var/lib/rancher/rke2/bin/kubectl --kubeconfig /etc/rancher/rke2/rke2.yaml wait nodes --for=condition=Ready --all --timeout=300s
252 sudo /var/lib/rancher/rke2/bin/kubectl --kubeconfig /etc/rancher/rke2/rke2.yaml wait deployment -n kube-system --for=condition=available --all --timeout=300s
253 curl -LO "https://dl.k8s.io/release/$(KUBECTL_VERSION)/bin/linux/amd64/kubectl"
254 sudo chmod +x kubectl
255 sudo mv kubectl /usr/local/bin/
256 kubectl version --client
257 mkdir -p $(HOME)/.kube
258 sudo cp /etc/rancher/rke2/rke2.yaml $(HOME)/.kube/config
259 sudo chown -R $(shell id -u):$(shell id -g) $(HOME)/.kube
260 touch $@
261
262$(M)/helm-ready: | $(M)/k8s-ready
Arrobo, Gabriel6e54e952022-06-23 21:36:00 +0000263 curl -fsSL -o ${GET_HELM} https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
264 chmod 700 ${GET_HELM}
265 sudo DESIRED_VERSION=$(HELM_VERSION) ./${GET_HELM}
Fatemeh Rouzbeha0b26e22022-04-07 12:45:12 -0700266 helm repo add incubator https://charts.helm.sh/incubator
267 helm repo add cord https://charts.opencord.org
268 helm repo add atomix https://charts.atomix.io
269 helm repo add onosproject https://charts.onosproject.org
270 helm repo add aether https://charts.aetherproject.org
Andy Bavier7d5f0552022-05-23 16:01:45 -0700271 helm repo add rancher http://charts.rancher.io/
Fatemeh Rouzbeha0b26e22022-04-07 12:45:12 -0700272 touch $@
273endif
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700274
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700275/opt/cni/bin/static: | $(M)/k8s-ready
276 mkdir -p $(BUILD)/cni-plugins; cd $(BUILD)/cni-plugins; \
277 wget https://github.com/containernetworking/plugins/releases/download/v0.8.2/cni-plugins-linux-amd64-v0.8.2.tgz && \
278 tar xvfz cni-plugins-linux-amd64-v0.8.2.tgz
279 sudo cp $(BUILD)/cni-plugins/static /opt/cni/bin/
280
Hyunsun Mooncbdac112022-03-19 22:01:27 -0600281node-prep: | $(M)/helm-ready /opt/cni/bin/static
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700282
Bavier, Andya1377572023-01-10 12:06:52 -0700283router-pod: | $(M)/router-pod
Andy Bavier99f31c82022-04-14 16:16:26 -0700284$(M)/router-pod: $(ROUTER_POD_NETCONF)
285 sudo systemctl restart systemd-networkd
Hyunsun Mooncbdac112022-03-19 22:01:27 -0600286 DATA_IFACE=$(DATA_IFACE) envsubst < $(RESOURCEDIR)/router.yaml | kubectl apply -f -
287 kubectl wait pod -n default --for=condition=Ready -l app=router --timeout=300s
288 @touch $@
289
Andy Bavier99f31c82022-04-14 16:16:26 -0700290$(M)/router-host: $(ROUTER_HOST_NETCONF) $(UE_NAT_CONF)
291 sudo systemctl daemon-reload
292 sudo systemctl enable aiab-ue-nat.service
293 sudo systemctl start aiab-ue-nat.service
294 sudo systemctl restart systemd-networkd
Hyunsun Mooncbdac112022-03-19 22:01:27 -0600295 $(eval oiface := $(shell ip route list default | awk -F 'dev' '{ print $$2; exit }' | awk '{ print $$1 }'))
Hyunsun Mooncbdac112022-03-19 22:01:27 -0600296 @touch $@
297
2984g-core: node-prep
299ifeq ($(ENABLE_ROUTER),true)
300ifeq ($(ENABLE_OAISIM),true)
3014g-core: $(M)/router-pod
302else
3034g-core: $(M)/router-host
304endif
305endif
3064g-core: $(M)/omec
307$(M)/omec:
308 @if [[ "${CHARTS}" == "local" || "${CHARTS}" == "local-sdcore" ]]; then \
309 helm dep up $(SD_CORE_CHART); \
310 else \
311 helm repo update; \
312 fi
313 NODE_IP=${NODE_IP} DATA_IFACE=${DATA_IFACE} RAN_SUBNET=${RAN_SUBNET} envsubst < $(4G_CORE_VALUES) | \
314 helm upgrade --create-namespace --install --wait $(HELM_GLOBAL_ARGS) \
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700315 --namespace omec \
Hyunsun Mooncbdac112022-03-19 22:01:27 -0600316 --values - \
Andy Bavier31dfb9e2022-02-15 15:24:57 -0700317 sd-core \
318 $(SD_CORE_CHART)
Hyunsun Mooncbdac112022-03-19 22:01:27 -0600319 @if [[ "${ENABLE_OAISIM}" == "false" ]]; then \
320 $(eval mme_ip := $(shell ip -4 -o addr show $${DATA_IFACE} | awk '{print $$4}' | cut -d'/' -f1)) \
321 echo "Your MME IP is $(mme_ip)"; \
322 fi
323 @touch $@
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700324
Hyunsun Mooncbdac112022-03-19 22:01:27 -06003255g-core: node-prep
326ifeq ($(ENABLE_ROUTER),true)
327ifeq ($(ENABLE_GNBSIM),true)
3285g-core: $(M)/router-pod
329else
3305g-core: $(M)/router-host
331endif
332endif
3335g-core: $(M)/5g-core
334$(M)/5g-core:
335 @if [[ "${CHARTS}" == "local" || "${CHARTS}" == "local-sdcore" ]]; then \
336 helm dep up $(SD_CORE_CHART); \
337 else \
338 helm repo update; \
339 fi
Andy Baviera0c15d92022-06-13 12:55:48 -0700340 NODE_IP=${NODE_IP} DATA_IFACE=${DATA_IFACE} RAN_SUBNET=${RAN_SUBNET} ENABLE_GNBSIM=${ENABLE_GNBSIM} envsubst < $(5G_CORE_VALUES) | \
Hyunsun Mooncbdac112022-03-19 22:01:27 -0600341 helm upgrade --create-namespace --install --wait $(HELM_GLOBAL_ARGS) \
Badhrinath3e081e22020-12-02 15:02:08 -0600342 --namespace omec \
Hyunsun Mooncbdac112022-03-19 22:01:27 -0600343 --values - \
Andy Bavier31dfb9e2022-02-15 15:24:57 -0700344 sd-core \
345 $(SD_CORE_CHART)
Badhrinath3e081e22020-12-02 15:02:08 -0600346 touch $@
347
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700348# UE images includes kernel module, ue_ip.ko
349# which should be built in the exactly same kernel version of the host machine
350$(BUILD)/openairinterface: | $(M)/setup
351 mkdir -p $(BUILD)
352 cd $(BUILD); git clone https://github.com/opencord/openairinterface.git
353
Fatemeh Rouzbeha0b26e22022-04-07 12:45:12 -0700354ifeq ($(K8S_INSTALL),kubespray)
355download-ue-image: | $(M)/k8s-ready $(BUILD)/openairinterface
Andy Bavier9ee69d02022-02-11 10:31:21 -0700356 sg docker -c "docker pull ${OAISIM_UE_IMAGE} && \
357 docker tag ${OAISIM_UE_IMAGE} omecproject/lte-uesoftmodem:1.1.0"
Andy Bavierd6de5612021-11-08 10:39:17 -0700358 touch $(M)/ue-image
359
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700360$(M)/ue-image: | $(M)/k8s-ready $(BUILD)/openairinterface
361 cd $(BUILD)/openairinterface; \
Andy Bavier9ee69d02022-02-11 10:31:21 -0700362 sg docker -c "docker build . --target lte-uesoftmodem \
Andy Bavier4db21452022-06-21 16:13:31 -0700363 --network=host \
Fatemeh Rouzbeh85654e72022-05-23 09:26:12 -0700364 --build-arg http_proxy=$(HTTP_PROXY)/ \
Hyunsun7b640512020-10-27 19:49:51 -0500365 --build-arg build_base=omecproject/oai-base:1.1.0 \
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700366 --file Dockerfile.ue \
Andy Bavier9ee69d02022-02-11 10:31:21 -0700367 --tag omecproject/lte-uesoftmodem:1.1.0"
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700368 touch $@
Fatemeh Rouzbeha0b26e22022-04-07 12:45:12 -0700369endif
370
371ifeq ($(K8S_INSTALL),rke2)
372download-ue-image: | $(M)/k8s-ready $(BUILD)/openairinterface
373 sg docker -c "docker pull ${OAISIM_UE_IMAGE} && \
374 docker tag ${OAISIM_UE_IMAGE} omecproject/lte-uesoftmodem:1.1.0 && \
375 docker save -o /tmp/lte-uesoftmodem.tar omecproject/lte-uesoftmodem:1.1.0"
376 $(CTR_CMD) images import /tmp/lte-uesoftmodem.tar
377 touch $(M)/ue-image
378
379$(M)/ue-image: $(M)/k8s-ready $(BUILD)/openairinterface
380 cd $(BUILD)/openairinterface; \
381 sg docker -c "docker build . --target lte-uesoftmodem \
Andy Bavier4db21452022-06-21 16:13:31 -0700382 --network=host \
Fatemeh Rouzbeh85654e72022-05-23 09:26:12 -0700383 --build-arg http_proxy=$(HTTP_PROXY)/ \
Fatemeh Rouzbeha0b26e22022-04-07 12:45:12 -0700384 --build-arg build_base=omecproject/oai-base:1.1.0 \
385 --file Dockerfile.ue \
386 --tag omecproject/lte-uesoftmodem:1.1.0 && \
387 docker save -o /tmp/lte-uesoftmodem.tar omecproject/lte-uesoftmodem:1.1.0"
388 $(CTR_CMD) images import /tmp/lte-uesoftmodem.tar
389 touch $@
390endif
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700391
Andy Bavier99f31c82022-04-14 16:16:26 -0700392/etc/systemd/%:
393 @sudo mkdir -p $(@D)
394 @sed 's/DATA_IFACE/$(DATA_IFACE)/g' $(MAKEDIR)/systemd/$(@F) > /tmp/$(@F)
395 @sudo cp /tmp/$(@F) $@
396 echo "Installed $@"
Andy Bavier9ee69d02022-02-11 10:31:21 -0700397
Andy Bavier99f31c82022-04-14 16:16:26 -0700398oaisim-standalone: | $(M)/helm-ready $(M)/ue-image $(LO_NETCONF)
399 sudo systemctl restart systemd-networkd
Hyunsun Mooncbdac112022-03-19 22:01:27 -0600400 @ip link show $(DATA_IFACE) > /dev/null || (echo DATA_IFACE is not set or does not exist; exit 1)
401 @if [[ "${MME_IP}" == "" ]]; then \
402 echo MME_IP is not set; \
403 exit 1; \
404 else \
405 ping -c 3 $(MME_IP) > /dev/null || (echo MME $(MME_IP) is not reachable; exit 1) \
406 fi
407 sudo ip route add 192.168.252.0/24 via $(MME_IP)
Andy Bavier7b01b682022-03-17 13:26:55 -0700408 helm repo update
Hyunsun Mooncbdac112022-03-19 22:01:27 -0600409 helm upgrade --create-namespace --install $(HELM_GLOBAL_ARGS) --namespace omec oaisim cord/oaisim -f $(OAISIM_VALUES) \
410 --set config.enb.networks.s1u.interface=$(DATA_IFACE) \
411 --set config.enb.networks.s1_mme.interface=$(DATA_IFACE) \
412 --set config.enb.mme.address=$(MME_IP) \
413 --set config.enb.mme.isLocal=false \
414 --set images.pullPolicy=IfNotPresent
Andy Bavier7b01b682022-03-17 13:26:55 -0700415 kubectl rollout status -n omec statefulset ue
Hyunsun Mooncbdac112022-03-19 22:01:27 -0600416 @echo "Test: registration"
Andy Bavier7b01b682022-03-17 13:26:55 -0700417 @timeout 60s bash -c \
418 "until ip addr show oip1 | grep -q inet; \
419 do \
Hyunsun Mooncbdac112022-03-19 22:01:27 -0600420 echo 'Waiting for UE 1 gets IP address'; \
421 sleep 3; \
Andy Bavier7b01b682022-03-17 13:26:55 -0700422 done"
Hyunsun Mooncbdac112022-03-19 22:01:27 -0600423 @echo "Test: ping from UE to 8.8.8.8"
424 ping -I oip1 8.8.8.8 -c 3
425 @touch $(M)/oaisim $(M)/omec
Andy Bavier7b01b682022-03-17 13:26:55 -0700426
Hyunsun Mooncbdac112022-03-19 22:01:27 -0600427oaisim: | $(M)/oaisim
Andy Bavier99f31c82022-04-14 16:16:26 -0700428$(M)/oaisim: | $(M)/ue-image $(M)/router-pod $(OAISIM_NETCONF)
429 sudo systemctl restart systemd-networkd
Fatemeh Rouzbeh85654e72022-05-23 09:26:12 -0700430 sleep 1
Hyunsun Mooncbdac112022-03-19 22:01:27 -0600431 helm upgrade --create-namespace --install $(HELM_GLOBAL_ARGS) --namespace omec oaisim cord/oaisim -f $(OAISIM_VALUES) \
Jeremy Ronquilloaf084f32020-08-24 13:18:47 -0700432 --set images.pullPolicy=IfNotPresent
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700433 kubectl rollout status -n omec statefulset ue
434 @timeout 60s bash -c \
435 "until ip addr show oip1 | grep -q inet; \
436 do \
437 echo 'Waiting for UE 1 gets IP address'; \
438 sleep 3; \
439 done"
440 touch $@
441
Andy Bavierebf479c2021-09-08 15:47:58 -0700442roc: $(M)/roc
443$(M)/roc: $(M)/helm-ready
444 kubectl get namespace aether-roc 2> /dev/null || kubectl create namespace aether-roc
445 helm repo update
446 if [ "$(CHARTS)" == "local" ]; then helm dep up $(AETHER_ROC_UMBRELLA_CHART); fi
SeanCondon254f6ce2022-12-01 09:22:13 +0000447 if [ "$(CHARTS)" == "release-2.0" -o "$(CHARTS)" == "release-1.6" ]; then \
448 helm upgrade --install --wait $(HELM_GLOBAL_ARGS) \
449 --namespace kube-system \
450 --values $(ROC_VALUES) \
451 atomix-controller \
452 $(ATOMIX_CONTROLLER_CHART); \
453 helm upgrade --install --wait $(HELM_GLOBAL_ARGS) \
454 --namespace kube-system \
455 --values $(ROC_VALUES) \
456 atomix-raft-storage \
457 $(ATOMIX_RAFT_STORAGE_CHART); \
458 else \
459 helm upgrade --install --wait $(HELM_GLOBAL_ARGS) \
460 --namespace kube-system \
461 --values $(ROC_VALUES) \
462 atomix-runtime \
463 $(ATOMIX_RUNTIME_CHART); \
464 fi
Andy Bavierebf479c2021-09-08 15:47:58 -0700465 helm upgrade --install --wait $(HELM_GLOBAL_ARGS) \
466 --namespace kube-system \
467 --values $(ROC_VALUES) \
468 onos-operator \
469 $(ONOS_OPERATOR_CHART)
470 helm upgrade --install --wait $(HELM_GLOBAL_ARGS) \
471 --namespace aether-roc \
472 --values $(ROC_VALUES) \
473 aether-roc-umbrella \
474 $(AETHER_ROC_UMBRELLA_CHART)
475 touch $@
476
477# Load the ROC 4G models. Disable loading network slice from SimApp.
478roc-4g-models: $(M)/roc
479 sed -i 's/provision-network-slice: true/provision-network-slice: false/' $(4G_CORE_VALUES)
480 sed -i 's/# syncUrl/syncUrl/' $(4G_CORE_VALUES)
Amit Wankhede01b20c32021-12-01 12:45:58 +0530481 if [ "${ENABLE_SUBSCRIBER_PROXY}" == "true" ] ; then \
Amit Wankhedefdf10ff2022-02-16 08:37:20 -0600482 sed -i 's/# sub-proxy-endpt:/sub-proxy-endpt:/' $(4G_CORE_VALUES) ; \
483 sed -i 's/# addr: sub/ addr: sub/' $(4G_CORE_VALUES) ; \
484 sed -i 's/# port: 5000/ port: 5000/' $(4G_CORE_VALUES) ; \
Amit Wankhede01b20c32021-12-01 12:45:58 +0530485 fi
Sean Condone184e6e2023-01-12 09:59:40 +0000486 @$(eval ONOS_CLI_POD := $(shell kubectl -n aether-roc get pods -l name=onos-cli -o name))
Andy Bavierebf479c2021-09-08 15:47:58 -0700487 echo "ONOS CLI pod: ${ONOS_CLI_POD}"
Sean Condone184e6e2023-01-12 09:59:40 +0000488 @$(eval API_SERVICE := $(shell kubectl -n aether-roc get --no-headers=true services -l app.kubernetes.io/name=aether-roc-api | awk '{print $$1}'))
489 echo "API SERVICE : ${API_SERVICE}"
SeanCondon47660272023-01-15 22:24:24 +0000490 if [ "$(CHARTS)" != "release-2.0" -a "$(CHARTS)" != "release-1.6" ]; then \
491 until kubectl -n aether-roc exec ${ONOS_CLI_POD} -- \
492 curl -s -f -L -X PATCH "http://${API_SERVICE}:8181/aether-roc-api" \
493 --header 'Content-Type: application/json' \
494 --data-raw "$$(cat ${ROC_DEFAULTENT_MODEL})"; do sleep 5; done; \
495 fi
Sean Condone184e6e2023-01-12 09:59:40 +0000496 until kubectl -n aether-roc exec ${ONOS_CLI_POD} -- \
497 curl -s -f -L -X PATCH "http://${API_SERVICE}:8181/aether-roc-api" \
Andy Bavierebf479c2021-09-08 15:47:58 -0700498 --header 'Content-Type: application/json' \
499 --data-raw "$$(cat ${ROC_4G_MODELS})"; do sleep 5; done
500
501# Load the ROC 5G models. Disable loading network slice from SimApp.
502roc-5g-models: $(M)/roc
503 sed -i 's/provision-network-slice: true/provision-network-slice: false/' $(5G_CORE_VALUES)
504 sed -i 's/# syncUrl/syncUrl/' $(5G_CORE_VALUES)
Amit Wankhede01b20c32021-12-01 12:45:58 +0530505 if [ "${ENABLE_SUBSCRIBER_PROXY}" == "true" ] ; then \
Amit Wankhedefdf10ff2022-02-16 08:37:20 -0600506 sed -i 's/# sub-proxy-endpt:/sub-proxy-endpt:/' $(5G_CORE_VALUES) ; \
507 sed -i 's/# addr: sub/ addr: sub/' $(5G_CORE_VALUES) ; \
508 sed -i 's/# port: 5000/ port: 5000/' $(5G_CORE_VALUES) ; \
Amit Wankhede01b20c32021-12-01 12:45:58 +0530509 fi
Sean Condone184e6e2023-01-12 09:59:40 +0000510 @$(eval ONOS_CLI_POD := $(shell kubectl -n aether-roc get pods -l name=onos-cli -o name))
Andy Bavierebf479c2021-09-08 15:47:58 -0700511 echo "ONOS CLI pod: ${ONOS_CLI_POD}"
Sean Condone184e6e2023-01-12 09:59:40 +0000512 @$(eval API_SERVICE := $(shell kubectl -n aether-roc get --no-headers=true services -l app.kubernetes.io/name=aether-roc-api | awk '{print $$1}'))
513 echo "API SERVICE : ${API_SERVICE}"
SeanCondon47660272023-01-15 22:24:24 +0000514 if [ "$(CHARTS)" != "release-2.0" -a "$(CHARTS)" != "release-1.6" ]; then \
515 until kubectl -n aether-roc exec ${ONOS_CLI_POD} -- \
516 curl -s -f -L -X PATCH "http://${API_SERVICE}:8181/aether-roc-api" \
517 --header 'Content-Type: application/json' \
518 --data-raw "$$(cat ${ROC_DEFAULTENT_MODEL})"; do sleep 5; done; \
519 fi
Sean Condone184e6e2023-01-12 09:59:40 +0000520 until kubectl -n aether-roc exec ${ONOS_CLI_POD} -- \
521 curl -s -f -L -X PATCH "http://${API_SERVICE}:8181/aether-roc-api" \
Andy Bavierebf479c2021-09-08 15:47:58 -0700522 --header 'Content-Type: application/json' \
523 --data-raw "$$(cat ${ROC_5G_MODELS})"; do sleep 5; done
524
525roc-clean:
526 @echo "This could take 2-3 minutes..."
527 sed -i 's/provision-network-slice: false/provision-network-slice: true/' $(4G_CORE_VALUES)
528 sed -i 's/ syncUrl/ # syncUrl/' $(4G_CORE_VALUES)
Amit Wankhedefdf10ff2022-02-16 08:37:20 -0600529 sed -i 's/ sub-proxy-endpt:/ # sub-proxy-endpt:/' $(4G_CORE_VALUES)
530 sed -i 's/ addr: sub/ # addr: sub/' $(4G_CORE_VALUES)
531 sed -i 's/ port: 5000/ # port: 5000/' $(4G_CORE_VALUES)
Andy Bavierebf479c2021-09-08 15:47:58 -0700532 sed -i 's/provision-network-slice: false/provision-network-slice: true/' $(5G_CORE_VALUES)
533 sed -i 's/ syncUrl/ # syncUrl/' $(5G_CORE_VALUES)
Amit Wankhedefdf10ff2022-02-16 08:37:20 -0600534 sed -i 's/ sub-proxy-endpt:/ # sub-proxy-endpt:/' $(5G_CORE_VALUES)
535 sed -i 's/ addr: sub/ # addr: sub/' $(5G_CORE_VALUES)
536 sed -i 's/ port: 5000/ # port: 5000/' $(5G_CORE_VALUES)
Andy Bavierebf479c2021-09-08 15:47:58 -0700537 kubectl delete namespace aether-roc || true
538 rm -rf $(M)/roc
Arrobo, Gabriel6e54e952022-06-23 21:36:00 +0000539 rm -f ${GET_HELM}
Andy Bavierebf479c2021-09-08 15:47:58 -0700540
Andy Bavier7d5f0552022-05-23 16:01:45 -0700541monitoring: $(M)/monitoring
542$(M)/monitoring: $(M)/helm-ready
543 helm upgrade --install --wait $(HELM_GLOBAL_ARGS) \
544 --namespace=cattle-monitoring-system \
545 --create-namespace \
546 --values=$(MONITORING_VALUES) \
547 rancher-monitoring-crd \
548 $(RANCHER_MONITORING_CRD_CHART)
549 helm upgrade --install --wait $(HELM_GLOBAL_ARGS) \
550 --namespace=cattle-monitoring-system \
551 --create-namespace \
552 --values=$(MONITORING_VALUES) \
553 rancher-monitoring \
554 $(RANCHER_MONITORING_CHART)
555 touch $(M)/monitoring
556
557monitoring-4g: $(M)/monitoring
558 kubectl create namespace omec || true
559 kubectl create namespace cattle-dashboards || true
560 kubectl apply -k resources/4g-monitoring
561
Ankur Upadhyaya9b9707a2022-11-24 10:48:33 -0600562monitoring-5g: $(M)/monitoring
563 kubectl create namespace omec || true
564 kubectl create namespace cattle-dashboards || true
565 kubectl apply -k resources/5g-monitoring
566
Wei-Yu Chena6ae6e22022-06-08 18:15:30 +0800567enodebd:
568 helm upgrade --install --wait $(HELM_GLOBAL_ARGS) \
569 --namespace=aether-apps \
570 --create-namespace \
571 enodebd \
572 ${ENODEBD_CHART}
573 touch $(M)/enodebd
574
575enodebd-clean:
576 helm -n aether-apps delete enodebd || true
577 rm $(M)/enodebd
Andy Bavier7d5f0552022-05-23 16:01:45 -0700578
579monitoring-clean:
580 helm -n cattle-monitoring-system delete rancher-monitoring || true
581 helm -n cattle-monitoring-system delete rancher-monitoring-crd || true
582 kubectl delete namespace cattle-dashboards cattle-monitoring-system || true
583 rm $(M)/monitoring
584
Hyunsun Mooncbdac112022-03-19 22:01:27 -0600585omec-clean:
586 helm delete -n omec $$(helm -n omec ls -qa) || true
587 @echo ""
588 @echo "Wait for all pods to terminate..."
589 kubectl wait -n omec --for=delete --all=true -l app!=ue pod --timeout=180s || true
590
591router-clean:
592 @kubectl delete net-attach-def router-net 2>/dev/null || true
593 @kubectl delete po router 2>/dev/null || true
594 kubectl wait --for=delete -l app=router pod --timeout=180s 2>/dev/null || true
595 sudo ip link del access || true
596 sudo ip link del core || true
597 $(eval oiface := $(shell ip route list default | awk -F 'dev' '{ print $$2; exit }' | awk '{ print $$1 }'))
598 sudo iptables -t nat -D POSTROUTING -s 172.250.0.0/16 -o $(oiface) -j MASQUERADE || true
599 @sudo ip link del data 2>/dev/null || true
600 @cd $(M); rm -f router-pod router-host
601
602oaisim-clean: reset-ue
603 @sudo ip addr del 127.0.0.2/8 dev lo 2>/dev/null || true
604 @sudo ip link del enb 2>/dev/null || true
605 @sudo ip route del 192.168.252.0/24 || true
606 @cd $(M); rm -f oaisim-lo
607
Andy Bavier7d5f0552022-05-23 16:01:45 -07006084g-test: test
Hyunsun Mooncbdac112022-03-19 22:01:27 -0600609test: | 4g-core $(M)/oaisim
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700610 @sleep 5
611 @echo "Test1: ping from UE to SGI network gateway"
Hyunsun Moon0bd8cec2020-09-28 00:38:26 -0500612 ping -I oip1 192.168.250.1 -c 15
Fatemeh Rouzbeh85654e72022-05-23 09:26:12 -0700613 @if [ "${PROXY_ENABLED}" == "false" ] ; then \
614 @echo "Test2: ping from UE to 8.8.8.8" ; \
615 ping -I oip1 8.8.8.8 -c 3 ; \
616 @echo "Test3: ping from UE to google.com" ; \
617 ping -I oip1 google.com -c 3 ; \
618 fi
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700619 @echo "Finished to test"
620
Hyunsun Mooncbdac112022-03-19 22:01:27 -06006215g-test: | 5g-core
Andy Bavier31dfb9e2022-02-15 15:24:57 -0700622 @if [[ "${CHARTS}" == "release-1.6" ]]; then echo "[NOTE] 5G Test not supported for Aether 1.6, exiting..."; exit 1; fi
Andy Bavier0a055a52022-01-07 10:46:17 -0700623 @echo "Test: Registration + UE initiated PDU Session Establishment + User Data packets"
Andy Bavier0e4906f2022-03-03 15:31:48 -0700624 @sleep 60
Andy Bavier0a055a52022-01-07 10:46:17 -0700625 @rm -f /tmp/gnbsim.out
Andy Baviercd93a202022-01-10 18:03:26 -0800626 @if [[ ${GNBSIM_COLORS} == "true" ]]; then \
627 kubectl -n omec exec gnbsim-0 -- ./gnbsim 2>&1 | tee /tmp/gnbsim.out; \
628 else \
629 kubectl -n omec exec gnbsim-0 -- ./gnbsim 2>&1 | sed -u "s,\x1B\[[0-9;]*[a-zA-Z],,g" | tee /tmp/gnbsim.out; \
630 fi
Andy Bavier025874a2022-07-29 13:20:04 -0700631 @grep -q "Simulation Result: PASS\|Profile Status: PASS" /tmp/gnbsim.out
Andy Bavier0a055a52022-01-07 10:46:17 -0700632
Hyunsun Mooncbdac112022-03-19 22:01:27 -0600633reset-test: | oaisim-clean omec-clean router-clean
634 @cd $(M); rm -f omec oaisim 5g-core
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700635
Andy Bavier8819b9f2022-01-28 16:54:06 -0700636reset-ue:
637 helm delete -n omec oaisim || true
638 kubectl wait -n omec --for=delete pod enb-0 || true
639 kubectl wait -n omec --for=delete pod ue-0 || true
640 cd $(M); rm -f oaisim
641
Hyunsun Mooncbdac112022-03-19 22:01:27 -0600642reset-5g-test: omec-clean
Badhrinath3e081e22020-12-02 15:02:08 -0600643 cd $(M); rm -f 5g-core
644
Osman Amjad488a0222022-01-12 11:58:43 -0600645reset-dbtestapp:
646 helm uninstall --namespace omec 5g-test-app
647
Andy Bavier99f31c82022-04-14 16:16:26 -0700648refresh-4g: reset-ue
649 kubectl -n omec delete pod mme-0
650 kubectl wait -n omec --for='condition=ready' pod mme-0 --timeout=300s
651
Osman Amjad488a0222022-01-12 11:58:43 -0600652dbtestapp:
653 helm repo update
654 if [ "$(CHARTS)" == "local" ]; then helm dep up $(5G_TEST_APPS_CHART); fi
655 helm upgrade --install --wait $(HELM_GLOBAL_ARGS) \
656 --namespace omec \
657 5g-test-app \
658 --values $(TEST_APP_VALUES) \
659 $(5G_TEST_APPS_CHART)
660 @echo "Finished to dbtestapp"
661
Andy Bavier99f31c82022-04-14 16:16:26 -0700662clean-systemd:
663 cd /etc/systemd/network && sudo rm -f 10-aiab* 20-aiab* */macvlan.conf
664 cd /etc/systemd/system && sudo rm -f aiab*.service && sudo systemctl daemon-reload
665
Fatemeh Rouzbeha0b26e22022-04-07 12:45:12 -0700666ifeq ($(K8S_INSTALL),rke2)
Andy Bavier5b5ad562022-04-19 13:02:31 -0700667clean: | roc-clean oaisim-clean router-clean clean-systemd
Andy Bavier99f31c82022-04-14 16:16:26 -0700668 sudo /usr/local/bin/rke2-uninstall.sh || true
Fatemeh Rouzbeha0b26e22022-04-07 12:45:12 -0700669 sudo rm -rf /usr/local/bin/kubectl
670 rm -rf $(M)
671endif
672
673ifeq ($(K8S_INSTALL),kubespray)
Andy Bavier5b5ad562022-04-19 13:02:31 -0700674clean: | roc-clean oaisim-clean router-clean clean-systemd
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700675 source "$(VENV)/bin/activate" && cd $(BUILD)/kubespray; \
Andy Bavier125baa02021-10-26 16:26:44 -0700676 ansible-playbook -b -i inventory/local/hosts.ini reset.yml --extra-vars "reset_confirmation=yes"
Jeremy Ronquillo6be909e2020-08-24 09:36:13 -0700677 @if [ -d /usr/local/etc/emulab ]; then \
678 mount | grep /mnt/extra/kubelet/pods | cut -d" " -f3 | sudo xargs umount; \
679 sudo rm -rf /mnt/extra/kubelet; \
680 fi
681 rm -rf $(M)
Fatemeh Rouzbeha0b26e22022-04-07 12:45:12 -0700682endif