fix(deploy): isolate demo settings and monitoring
This commit is contained in:
1 parent
6dd5a0d54a
commit
6d6aa9ffe8
7 files changed
+331
-36
No files matched your search
+38
-12
@@ -47,7 +47,7 @@ LINCODEX_RELEASE_TAG ?= $(shell PYTHONDONTWRITEBYTECODE=1 python3 "$(RELEASE_SCR
|
||||
# Isolated demonstration stand (deploy/scripts/demo.sh). Every demo target
|
||||
# needs DEMO_MODE=isolated on the command line and acts only on DEMO_PROJECT.
|
||||
DEMO_MODE ?=
|
||||
DEMO_PROJECT ?= lincodex-demo
|
||||
DEMO_PROJECT ?=
|
||||
DEMO_HTTP_PORT ?= 8090
|
||||
DEMO_PUBLIC_URL ?= http://localhost:$(DEMO_HTTP_PORT)
|
||||
DEMO_SUBNET ?= 172.29.84.0/24
|
||||
@@ -62,6 +62,8 @@ DEMO_SCRIPT_ENV = DOCKER="$(DOCKER)" DEMO_MODE="$(DEMO_MODE)" DEMO_PROJECT="$(DE
|
||||
ENV_FILE="$(ENV_FILE)" DEMO_ENV_FILE="$(DEMO_ENV)" DEMO_HTTP_PORT="$(DEMO_HTTP_PORT)" DEMO_PUBLIC_URL="$(DEMO_PUBLIC_URL)" \
|
||||
DEMO_SUBNET="$(DEMO_SUBNET)" DEMO_FRONTEND_IP="$(DEMO_FRONTEND_IP)" DEMO_ACTOR="$(DEMO_ACTOR)" \
|
||||
DEMO_RELEASE_MANIFEST="$(DEMO_RELEASE_MANIFEST)"
|
||||
DEMO_MONITORING_SCRIPT_ENV = DOCKER="$(DOCKER)" DEMO_MODE="$(DEMO_MODE)" DEMO_PROJECT="$(DEMO_PROJECT)" \
|
||||
DEMO_ENV_FILE="$(DEMO_ENV)" APP_PROJECT="$(APP_PROJECT)" MONITORING_PROJECT="$(MONITORING_PROJECT)"
|
||||
PLAYWRIGHT_VERSION := $(shell sed -n 's/^ *"@playwright\/test": "\([^"]*\)",\{0,1\}$$/\1/p' "$(ROOT)/frontend/package.json")
|
||||
|
||||
.PHONY: help config build up down logs monitoring-config monitoring-up monitoring-down monitoring-logs ml-config ml-build ml-up ml-down ml-logs runner-dev-config runner-dev-build runner-dev-up runner-dev-down runner-dev-logs check-runner-dev check-runner-vm check check-workflows check-release check-perimeter check-e2e-mail check-demo perimeter-test smoke test-e2e test-e2e-registration release-build release-smoke release-e2e release-manifest release-manifest-verify release-manifest-check release-up release-down release-clean demo-seed demo-reset demo-down
|
||||
@@ -99,20 +101,44 @@ logs: ## Follow core service logs
|
||||
@test -f "$(ENV_FILE)" || { printf 'Missing %s.\n' "$(ENV_FILE)" >&2; exit 2; }
|
||||
APP_PROJECT="$(APP_PROJECT)" APP_NETWORK="$(APP_NETWORK)" $(DOCKER) compose --env-file "$(ENV_FILE)" -p "$(APP_PROJECT)" -f "$(CORE_FILE)" logs -f
|
||||
|
||||
monitoring-config: ## Render the separate monitoring Compose file
|
||||
APP_PROJECT="$(APP_PROJECT)" APP_NETWORK="$(APP_NETWORK)" IDENTITY_KEY_SECRET="$(CHECK_IDENTITY_KEY_SECRET)" $(DOCKER) compose --env-file "$(CHECK_ENV_FILE)" -p "$(MONITORING_PROJECT)" -f "$(MONITORING_FILE)" config --quiet
|
||||
monitoring-config: ## Render core monitoring, or the isolated demo with DEMO_MODE=isolated
|
||||
@if [ "$(DEMO_MODE)" = isolated ]; then \
|
||||
ENV_FILE="$(CHECK_ENV_FILE)" $(DEMO_MONITORING_SCRIPT_ENV) bash scripts/demo-monitoring.sh config; \
|
||||
elif [ -n "$(DEMO_MODE)" ]; then \
|
||||
printf 'Refusing monitoring config: DEMO_MODE must be isolated.\n' >&2; exit 2; \
|
||||
else \
|
||||
APP_PROJECT="$(APP_PROJECT)" APP_NETWORK="$(APP_NETWORK)" IDENTITY_KEY_SECRET="$(CHECK_IDENTITY_KEY_SECRET)" $(DOCKER) compose --env-file "$(CHECK_ENV_FILE)" -p "$(MONITORING_PROJECT)" -f "$(MONITORING_FILE)" config --quiet; \
|
||||
fi
|
||||
|
||||
monitoring-up: ## Start monitoring as a separate Compose project
|
||||
@test -f "$(ENV_FILE)" || { printf 'Missing %s. Copy .env.example to .env and replace the placeholder passwords.\n' "$(ENV_FILE)" >&2; exit 2; }
|
||||
APP_PROJECT="$(APP_PROJECT)" APP_NETWORK="$(APP_NETWORK)" $(DOCKER) compose --env-file "$(ENV_FILE)" -p "$(MONITORING_PROJECT)" -f "$(MONITORING_FILE)" up -d
|
||||
monitoring-up: ## Start core monitoring, or the isolated demo with DEMO_MODE=isolated
|
||||
@if [ "$(DEMO_MODE)" = isolated ]; then \
|
||||
ENV_FILE="$(ENV_FILE)" $(DEMO_MONITORING_SCRIPT_ENV) bash scripts/demo-monitoring.sh up; \
|
||||
elif [ -n "$(DEMO_MODE)" ]; then \
|
||||
printf 'Refusing monitoring up: DEMO_MODE must be isolated.\n' >&2; exit 2; \
|
||||
else \
|
||||
test -f "$(ENV_FILE)" || { printf 'Missing %s. Copy .env.example to .env and replace the placeholder passwords.\n' "$(ENV_FILE)" >&2; exit 2; }; \
|
||||
APP_PROJECT="$(APP_PROJECT)" APP_NETWORK="$(APP_NETWORK)" $(DOCKER) compose --env-file "$(ENV_FILE)" -p "$(MONITORING_PROJECT)" -f "$(MONITORING_FILE)" up -d; \
|
||||
fi
|
||||
|
||||
monitoring-down: ## Stop monitoring and keep named volumes
|
||||
@test -f "$(ENV_FILE)" || { printf 'Missing %s.\n' "$(ENV_FILE)" >&2; exit 2; }
|
||||
APP_PROJECT="$(APP_PROJECT)" APP_NETWORK="$(APP_NETWORK)" $(DOCKER) compose --env-file "$(ENV_FILE)" -p "$(MONITORING_PROJECT)" -f "$(MONITORING_FILE)" down
|
||||
monitoring-down: ## Stop core monitoring, or the isolated demo with DEMO_MODE=isolated
|
||||
@if [ "$(DEMO_MODE)" = isolated ]; then \
|
||||
ENV_FILE="$(ENV_FILE)" $(DEMO_MONITORING_SCRIPT_ENV) bash scripts/demo-monitoring.sh down; \
|
||||
elif [ -n "$(DEMO_MODE)" ]; then \
|
||||
printf 'Refusing monitoring down: DEMO_MODE must be isolated.\n' >&2; exit 2; \
|
||||
else \
|
||||
test -f "$(ENV_FILE)" || { printf 'Missing %s.\n' "$(ENV_FILE)" >&2; exit 2; }; \
|
||||
APP_PROJECT="$(APP_PROJECT)" APP_NETWORK="$(APP_NETWORK)" $(DOCKER) compose --env-file "$(ENV_FILE)" -p "$(MONITORING_PROJECT)" -f "$(MONITORING_FILE)" down; \
|
||||
fi
|
||||
|
||||
monitoring-logs: ## Follow monitoring service logs
|
||||
@test -f "$(ENV_FILE)" || { printf 'Missing %s.\n' "$(ENV_FILE)" >&2; exit 2; }
|
||||
APP_PROJECT="$(APP_PROJECT)" APP_NETWORK="$(APP_NETWORK)" $(DOCKER) compose --env-file "$(ENV_FILE)" -p "$(MONITORING_PROJECT)" -f "$(MONITORING_FILE)" logs -f
|
||||
monitoring-logs: ## Follow core monitoring logs, or the isolated demo with DEMO_MODE=isolated
|
||||
@if [ "$(DEMO_MODE)" = isolated ]; then \
|
||||
ENV_FILE="$(ENV_FILE)" $(DEMO_MONITORING_SCRIPT_ENV) bash scripts/demo-monitoring.sh logs; \
|
||||
elif [ -n "$(DEMO_MODE)" ]; then \
|
||||
printf 'Refusing monitoring logs: DEMO_MODE must be isolated.\n' >&2; exit 2; \
|
||||
else \
|
||||
test -f "$(ENV_FILE)" || { printf 'Missing %s.\n' "$(ENV_FILE)" >&2; exit 2; }; \
|
||||
APP_PROJECT="$(APP_PROJECT)" APP_NETWORK="$(APP_NETWORK)" $(DOCKER) compose --env-file "$(ENV_FILE)" -p "$(MONITORING_PROJECT)" -f "$(MONITORING_FILE)" logs -f; \
|
||||
fi
|
||||
|
||||
ml-config: ## Render the separate ML Compose file
|
||||
APP_PROJECT="$(APP_PROJECT)" APP_NETWORK="$(APP_NETWORK)" IDENTITY_KEY_SECRET="$(CHECK_IDENTITY_KEY_SECRET)" $(DOCKER) compose --env-file "$(CHECK_ENV_FILE)" -p "$(ML_PROJECT)" -f "$(ML_FILE)" config --quiet
|
||||
|
||||
Reference in new issue
Block a user