feat(deploy): add an isolated demo stand with synthetic seed and guarded reset
This commit is contained in:
1 parent
bd23c839fd
commit
e1df4ff77c
26 files changed
+3292
-2
No files matched your search
+30
-2
@@ -17,6 +17,7 @@ ML_FILE := $(ROOT)/deploy/docker/docker-compose.ml.yml
|
||||
MONITORING_FILE := $(ROOT)/deploy/docker/docker-compose.monitoring.yml
|
||||
E2E_FILE := $(ROOT)/deploy/docker/docker-compose.e2e.yml
|
||||
E2E_MAIL_FILE := $(ROOT)/deploy/docker/docker-compose.e2e-mail.yml
|
||||
DEMO_FILE := $(ROOT)/deploy/docker/docker-compose.demo.yml
|
||||
RELEASE_FILE := $(ROOT)/deploy/docker/docker-compose.release.yml
|
||||
ML_RELEASE_FILE := $(ROOT)/deploy/docker/docker-compose.ml.release.yml
|
||||
RELEASE_SCRIPT := $(ROOT)/deploy/scripts/release_manifest.py
|
||||
@@ -36,9 +37,23 @@ RELEASE_MANIFEST_ARG = $(if $(strip $(RELEASE_MANIFEST)),--manifest "$(RELEASE_M
|
||||
# Recursive on purpose: git is asked only by the targets that use the tag. The
|
||||
# project-specific name keeps a generic RELEASE_TAG from enabling release mode.
|
||||
LINCODEX_RELEASE_TAG ?= $(shell PYTHONDONTWRITEBYTECODE=1 python3 "$(RELEASE_SCRIPT)" tag)
|
||||
# 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_HTTP_PORT ?= 8090
|
||||
DEMO_PUBLIC_URL ?= http://localhost:$(DEMO_HTTP_PORT)
|
||||
DEMO_SUBNET ?= 172.29.84.0/24
|
||||
DEMO_FRONTEND_IP ?= 172.29.84.10
|
||||
DEMO_ACTOR ?= operator:demo-seed
|
||||
# demo.env is local; the checked-in example is used when it does not exist.
|
||||
DEMO_ENV ?= $(if $(wildcard $(ROOT)/deploy/demo/demo.env),$(ROOT)/deploy/demo/demo.env,$(ROOT)/deploy/demo/demo.env.example)
|
||||
DEMO_SCRIPT_ENV = DOCKER="$(DOCKER)" DEMO_MODE="$(DEMO_MODE)" DEMO_PROJECT="$(DEMO_PROJECT)" APP_PROJECT="$(APP_PROJECT)" \
|
||||
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)"
|
||||
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 check check-workflows check-release check-perimeter check-e2e-mail 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
|
||||
.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 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
|
||||
|
||||
help: ## Show deployment commands
|
||||
@awk 'BEGIN {FS = ":.*## "} /^[a-zA-Z0-9_-]+:.*## / {printf "%-24s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
||||
@@ -53,6 +68,7 @@ config: ## Render all Compose files with safe example values
|
||||
APP_PROJECT="$(APP_PROJECT)" APP_NETWORK="$(APP_NETWORK)" LINCODEX_RELEASE_TAG=000000000000 IDENTITY_KEY_SECRET="$(CHECK_IDENTITY_KEY_SECRET)" $(DOCKER) compose --env-file "$(CHECK_ENV_FILE)" -p "$(APP_PROJECT)" -f "$(CORE_FILE)" -f "$(RELEASE_FILE)" config --quiet
|
||||
APP_PROJECT="$(APP_PROJECT)" APP_NETWORK="$(APP_NETWORK)" LINCODEX_RELEASE_TAG=000000000000 IDENTITY_KEY_SECRET="$(CHECK_IDENTITY_KEY_SECRET)" $(DOCKER) compose --env-file "$(CHECK_ENV_FILE)" -p "$(ML_PROJECT)" -f "$(ML_FILE)" -f "$(ML_RELEASE_FILE)" config --quiet
|
||||
APP_PROJECT=lincodex-e2e-config APP_NETWORK=lincodex-e2e-config_default PLAYWRIGHT_VERSION="$(PLAYWRIGHT_VERSION)" E2E_UID=1000 E2E_GID=1000 E2E_SPEC_DIR="$(ROOT)/frontend/e2e" E2E_ARTIFACTS_DIR="$(ROOT)/frontend/test-results/e2e" IDENTITY_KEY_SECRET="$(CHECK_IDENTITY_KEY_SECRET)" $(DOCKER) compose --env-file "$(CHECK_ENV_FILE)" -p lincodex-e2e-config -f "$(CORE_FILE)" -f "$(E2E_FILE)" --profile e2e config --quiet
|
||||
APP_PROJECT=lincodex-demo-config APP_NETWORK=lincodex-demo-config_default DEMO_ACCOUNT_PASSWORD=render-only-demo-account-password IDENTITY_KEY_SECRET="$(CHECK_IDENTITY_KEY_SECRET)" $(DOCKER) compose --env-file "$(CHECK_ENV_FILE)" -p lincodex-demo-config -f "$(CORE_FILE)" -f "$(DEMO_FILE)" --profile demo-seed config --quiet
|
||||
E2E_COMPANY_FIXTURE_TOKEN=render-only-company-fixture-token-00000000000000000000000000000000 APP_PROJECT=lincodex-e2e-mail-config APP_NETWORK=lincodex-e2e-mail-config_default PLAYWRIGHT_VERSION="$(PLAYWRIGHT_VERSION)" E2E_UID=1000 E2E_GID=1000 E2E_SPEC_DIR="$(ROOT)/frontend/e2e" E2E_ARTIFACTS_DIR="$(ROOT)/frontend/test-results/e2e" IDENTITY_KEY_SECRET="$(CHECK_IDENTITY_KEY_SECRET)" $(DOCKER) compose --env-file "$(CHECK_ENV_FILE)" -p lincodex-e2e-mail-config -f "$(CORE_FILE)" -f "$(E2E_FILE)" -f "$(E2E_MAIL_FILE)" --profile e2e config --quiet
|
||||
|
||||
build: ## Build local frontend and backend images
|
||||
@@ -116,7 +132,7 @@ edge-render: ## Render the edge nginx config from deploy/edge/edge.env into depl
|
||||
edge-config: ## Render the edge templates and check the nginx config with nginx -t in a container
|
||||
@DOCKER="$(DOCKER)" EDGE_NGINX_IMAGE="$(EDGE_NGINX_IMAGE)" bash "$(EDGE_DIR)/scripts/check.sh" "$(EDGE_ENV)"
|
||||
|
||||
check: config check-workflows check-release check-perimeter check-e2e-mail ## Validate Compose files, CI workflow aggregates, release tooling, and network boundaries without starting services
|
||||
check: config check-workflows check-release check-perimeter check-e2e-mail check-demo ## Validate Compose files, CI workflow aggregates, release tooling, and network boundaries without starting services
|
||||
|
||||
check-workflows: ## Check that each workflow aggregate job requires every other job
|
||||
PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s "$(ROOT)/scripts" -p 'test_workflow_aggregate.py'
|
||||
@@ -130,6 +146,9 @@ check-perimeter: ## Check published ports, the app Nginx paths, limits, and the
|
||||
check-e2e-mail: ## Check that the mail fixture stays inside the explicit local E2E network
|
||||
PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s "$(ROOT)/deploy/scripts" -p 'test_e2e_mail.py'
|
||||
|
||||
check-demo: ## Check the guards of the demo targets and the demo overlay without starting services
|
||||
PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s "$(ROOT)/deploy/scripts" -p 'test_demo.py'
|
||||
|
||||
perimeter-test: ## Start throwaway Nginx containers and test denied paths, limits, headers, and forwarded headers over HTTP
|
||||
LINCODEX_PERIMETER_LIVE=1 DOCKER="$(DOCKER)" PERIMETER_NGINX_IMAGE="$(EDGE_NGINX_IMAGE)" PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -v -s "$(ROOT)/deploy/scripts" -p 'test_perimeter.py'
|
||||
|
||||
@@ -170,3 +189,12 @@ release-down: ## Stop the release project selected by the immutable manifest and
|
||||
|
||||
release-clean: ## Remove local release image references not retained by an immutable manifest
|
||||
@$(RELEASE) clean-images
|
||||
|
||||
demo-seed: ## Start the isolated demo stand when needed and seed its synthetic data (needs DEMO_MODE=isolated)
|
||||
@$(DEMO_SCRIPT_ENV) bash scripts/demo.sh seed
|
||||
|
||||
demo-reset: ## Discard only the isolated demo project when it holds no ordinary account, then seed it again (needs DEMO_MODE=isolated)
|
||||
@$(DEMO_SCRIPT_ENV) bash scripts/demo.sh reset
|
||||
|
||||
demo-down: ## Stop the isolated demo stand and keep its volumes (needs DEMO_MODE=isolated)
|
||||
@$(DEMO_SCRIPT_ENV) bash scripts/demo.sh down
|
||||
Reference in new issue
Block a user