From be3066f4630296ab8ace98ca1357d07dbc711a20 Mon Sep 17 00:00:00 2001 From: Marcelo Guerrero Date: Fri, 29 Nov 2024 13:07:11 +0100 Subject: [PATCH] Fix run-alarms target It includes changes due to communication with the resource server Signed-off-by: Marcelo Guerrero --- Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 963e952d..1ce96ba2 100644 --- a/Makefile +++ b/Makefile @@ -432,7 +432,8 @@ markdownlint: markdownlint-image ## run the markdown linter ##@ O-RAN Alarms Server .PHNOY: alarms -alarms: bundle deploy clean-am-service connect-postgres run-alarms-migrate create-am-service run-alarms ##Run full alarms stack +alarms: ##Run full alarms stack + IMG=$(IMAGE_TAG_BASE):latest make bundle deploy clean-am-service connect-postgres connect-resource-server run-alarms-migrate create-am-service run-alarms create-am-service: ##Creates alarm manager service and endpoint to expose a DNS entry. oc apply -k ./internal/service/alarms/k8s/base --wait=true @@ -444,7 +445,8 @@ clean-am-service: ##Deletes alarm manager service and endpoint. .PHONY: run-alarms run-alarms: go-generate binary ##Run alarms server locally - POSTGRES_HOSTNAME=localhost ORAN_O2IMS_ALARMS_PASSWORD=$(ORAN_O2IMS_ALARMS_PASSWORD) $(LOCALBIN)/$(BINARY_NAME) alarms-server serve + @oc exec -n $(OCLOUD_MANAGER_NAMESPACE) $(shell oc get pods -n $(OCLOUD_MANAGER_NAMESPACE) -l app=alarms-server -o=jsonpath='{.items[0].metadata.name}') -- cat /var/run/secrets/kubernetes.io/serviceaccount/token > /tmp/token + TOKEN_PATH=/tmp/token RESOURCE_SERVER_URL="https://localhost:8001" INSECURE_SKIP_VERIFY=true POSTGRES_HOSTNAME=localhost ORAN_O2IMS_ALARMS_PASSWORD=$(ORAN_O2IMS_ALARMS_PASSWORD) $(LOCALBIN)/$(BINARY_NAME) alarms-server serve run-alarms-migrate: binary ##Migrate all the way up DEBUG=yes POSTGRES_HOSTNAME=localhost INSECURE_SKIP_VERIFY=true ORAN_O2IMS_ALARMS_PASSWORD=$(ORAN_O2IMS_ALARMS_PASSWORD) $(LOCALBIN)/$(BINARY_NAME) alarms-server migrate @@ -459,3 +461,8 @@ connect-postgres: ##Connect to O-RAN postgres oc wait --for=condition=Ready pod -l app=postgres-server -n oran-o2ims --timeout=30s @echo "Starting port-forward in background on port 5432:5432 to postgres-server in namespace oran-o2ims" nohup oc port-forward --address localhost svc/postgres-server 5432:5432 -n oran-o2ims > pgproxy.log 2>&1 & + +.PHONY: connect-resource-server +connect-resource-server: ##Connect to resource server svc + @echo "Starting port-forward in background on port 8001:8000 to resource server svc in namespace oran-o2ims" + nohup oc port-forward --address localhost svc/resource-server 8001:8000 -n oran-o2ims > pgproxy_resource.log 2>&1 &