feat(deploy): add release manifest with pinned base image digests
This commit is contained in:
1 parent
ea0982a762
commit
a0551a34b8
18 files changed
+2316
-21
No files matched your search
+51
-3
@@ -12,12 +12,25 @@ CORE_FILE := $(ROOT)/deploy/docker/docker-compose.yml
|
||||
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
|
||||
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
|
||||
RELEASE := PYTHONDONTWRITEBYTECODE=1 python3 "$(RELEASE_SCRIPT)"
|
||||
# Pull policy of release-build for base and service images: missing or always.
|
||||
RELEASE_PULL ?= missing
|
||||
# Compose project whose running containers release-manifest-verify compares.
|
||||
RELEASE_VERIFY_PROJECT ?= $(APP_PROJECT)
|
||||
# Optional manifest path for release-manifest-verify; empty means the current tag.
|
||||
RELEASE_MANIFEST ?=
|
||||
# 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)
|
||||
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 smoke test-e2e
|
||||
.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 smoke test-e2e release-build release-smoke release-e2e release-manifest release-manifest-verify release-manifest-check release-up release-down release-clean
|
||||
|
||||
help: ## Show deployment commands
|
||||
@awk 'BEGIN {FS = ":.*## "} /^[a-zA-Z0-9_-]+:.*## / {printf "%-18s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
||||
@awk 'BEGIN {FS = ":.*## "} /^[a-zA-Z0-9_-]+:.*## / {printf "%-24s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
||||
|
||||
config: ## Render all Compose files with safe example values
|
||||
@test -f "$(ROOT)/backend/Dockerfile" || { printf 'Missing backend/Dockerfile.\n' >&2; exit 2; }
|
||||
@@ -26,6 +39,8 @@ config: ## Render all Compose files with safe example values
|
||||
APP_PROJECT="$(APP_PROJECT)" APP_NETWORK="$(APP_NETWORK)" $(DOCKER) compose --env-file "$(CHECK_ENV_FILE)" -p "$(APP_PROJECT)" -f "$(CORE_FILE)" config --quiet
|
||||
APP_PROJECT="$(APP_PROJECT)" APP_NETWORK="$(APP_NETWORK)" $(DOCKER) compose --env-file "$(CHECK_ENV_FILE)" -p "$(ML_PROJECT)" -f "$(ML_FILE)" config --quiet
|
||||
APP_PROJECT="$(APP_PROJECT)" APP_NETWORK="$(APP_NETWORK)" $(DOCKER) compose --env-file "$(CHECK_ENV_FILE)" -p "$(MONITORING_PROJECT)" -f "$(MONITORING_FILE)" config --quiet
|
||||
APP_PROJECT="$(APP_PROJECT)" APP_NETWORK="$(APP_NETWORK)" LINCODEX_RELEASE_TAG=000000000000 $(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 $(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" $(DOCKER) compose --env-file "$(CHECK_ENV_FILE)" -p lincodex-e2e-config -f "$(CORE_FILE)" -f "$(E2E_FILE)" --profile e2e config --quiet
|
||||
|
||||
build: ## Build local frontend and backend images
|
||||
@@ -76,13 +91,46 @@ ml-logs: ## Follow ML 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 "$(ML_PROJECT)" -f "$(ML_FILE)" logs -f
|
||||
|
||||
check: config check-workflows ## Validate Compose files and CI workflow aggregates without starting services
|
||||
check: config check-workflows check-release ## Validate Compose files, CI workflow aggregates, and release tooling 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'
|
||||
|
||||
check-release: ## Test the release manifest tooling, its secret scan, and the Go and base image pins
|
||||
PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s "$(ROOT)/deploy/scripts" -p 'test_release_manifest.py'
|
||||
|
||||
smoke: ## Start an isolated stack and check infrastructure health routes
|
||||
@bash scripts/smoke.sh
|
||||
|
||||
test-e2e: ## Run the Playwright suite against an isolated throwaway stack
|
||||
@bash scripts/e2e.sh
|
||||
|
||||
release-build: ## Build release images with every base image pinned to its resolved digest
|
||||
@$(RELEASE) build --pull "$(RELEASE_PULL)"
|
||||
|
||||
release-smoke: ## Run the smoke against the release images and record passing evidence
|
||||
@LINCODEX_RELEASE_TAG="$(LINCODEX_RELEASE_TAG)" bash scripts/smoke.sh
|
||||
|
||||
release-e2e: ## Run the Playwright suite against the release images and record passing evidence
|
||||
@LINCODEX_RELEASE_TAG="$(LINCODEX_RELEASE_TAG)" bash scripts/e2e.sh
|
||||
|
||||
release-manifest: ## Write deploy/release/<tag>/manifest.json from local images and recorded evidence
|
||||
@$(RELEASE) manifest
|
||||
|
||||
release-manifest-verify: ## Compare running containers of RELEASE_VERIFY_PROJECT with the manifest (or RELEASE_MANIFEST)
|
||||
@$(RELEASE) verify --project "$(RELEASE_VERIFY_PROJECT)" $(if $(RELEASE_MANIFEST),--manifest "$(RELEASE_MANIFEST)")
|
||||
|
||||
release-manifest-check: ## Check the manifest structure and scan it for secrets and machine data
|
||||
@$(RELEASE) check
|
||||
|
||||
release-up: ## Start the core stack from the release images without building or pulling
|
||||
@test -f "$(ENV_FILE)" || { printf 'Missing %s. Copy .env.example to .env and replace the placeholder passwords.\n' "$(ENV_FILE)" >&2; exit 2; }
|
||||
@$(RELEASE) require-images --tag "$(LINCODEX_RELEASE_TAG)"
|
||||
APP_PROJECT="$(APP_PROJECT)" APP_NETWORK="$(APP_NETWORK)" LINCODEX_RELEASE_TAG="$(LINCODEX_RELEASE_TAG)" $(DOCKER) compose --env-file "$(ENV_FILE)" -p "$(APP_PROJECT)" -f "$(CORE_FILE)" -f "$(RELEASE_FILE)" up -d --no-build --pull never --wait --wait-timeout 180
|
||||
|
||||
release-down: ## Stop the core stack started by release-up 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)" LINCODEX_RELEASE_TAG="$(LINCODEX_RELEASE_TAG)" $(DOCKER) compose --env-file "$(ENV_FILE)" -p "$(APP_PROJECT)" -f "$(CORE_FILE)" -f "$(RELEASE_FILE)" down
|
||||
|
||||
release-clean: ## Remove the local lincodex.invalid/* release images; keep deploy/release files
|
||||
@$(RELEASE) clean-images
|
||||
Reference in new issue
Block a user