From f335b96d1880d9fbd72c78ab8ba7bbc71978e0ff Mon Sep 17 00:00:00 2001 From: sampocs Date: Thu, 8 Aug 2024 16:46:58 -0500 Subject: [PATCH] added makefile command for startup logs --- integration-tests/Makefile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/integration-tests/Makefile b/integration-tests/Makefile index 5beca28de4..e7b105cfce 100644 --- a/integration-tests/Makefile +++ b/integration-tests/Makefile @@ -23,6 +23,28 @@ define build_and_push_docker @$(DOCKER) push $(GCR_REPO)/$(3) endef +check-empty-namespace: + @POD_COUNT=$$($(KUBECTL) get pods --no-headers -n $(K8S_NAMESPACE) | wc -l); \ + if [ $$POD_COUNT -eq 0 ]; then exit 0; else exit 1; fi + +wait-for-startup: + @echo "---" && sleep 1 + @printf "Waiting for network to startup..." + @elapsed=0; \ + while true; do \ + not_ready_pods=$$($(KUBECTL) get pods --no-headers -n $(K8S_NAMESPACE) | grep -v '1/1 *Running' | wc -l); \ + if [ $$not_ready_pods -eq 0 ]; then \ + printf "Ready! 🚀\n"; \ + break; \ + fi; \ + if [ $$elapsed -eq 30 ]; then \ + printf "\nThe network's taking longer than expected to startup. Please investigate\n"; \ + exit 1; \ + fi; \ + sleep 1 && printf "."; \ + elapsed=$$((elapsed + 1)); \ + done + python-install: conda create --name $(VENV_NAME) python=3.11 -y $(PYTHON) -m pip install -r api/requirements.txt @@ -54,6 +76,7 @@ local-init-chain: start: @$(HELM) install $(HELM_CHART) $(HELM_CHART) --values $(HELM_CHART)/values.yaml -n $(K8S_NAMESPACE) + @$(MAKE) wait-for-startup stop: @$(HELM) uninstall $(HELM_CHART) -n $(K8S_NAMESPACE)