Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 67 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,33 @@ GHCR_PACKAGES_PUBLIC ?= false

.DEFAULT_GOAL := help

.PHONY: help create install dev upgrade upgrade-dev uninstall cleanup delete test test-cleanup check-pre-commit check-helm-docs setup-pre-commit docs docs-check lint floci setup-local-registry cleanup-local-registry flush-local-registry setup-kind load-test-images prepare-test-e2e helm-test cleanup-test-e2e
.PHONY: \
help \
check-pre-commit \
check-helm-docs \
setup-pre-commit \
docs \
docs-check \
lint \
create \
delete \
floci \
install \
dev \
upgrade \
upgrade-dev \
uninstall \
cleanup \
test \
test-cleanup \
prepare-test-e2e \
setup-local-registry \
setup-kind \
load-test-images \
helm-test \
flush-local-registry \
cleanup-test-e2e \
cleanup-local-registry

help: ## Show this help message
@printf '\033[33m%s\n' \
Expand All @@ -37,14 +63,10 @@ help: ## Show this help message
'|_| |___|_| \_\_____|____/ \___/|_____| |_| '
@printf '\033[0m\n'
@awk 'BEGIN {FS = ":.*##"; printf "Usage: make \033[36m<target>\033[0m\n\nTargets:\n"} \
/^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)
/^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } \
/^[a-zA-Z0-9_-]+:.*?##/ { printf " \033[36m%-24s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST)

check-pre-commit: ## Verify that pre-commit is installed
@command -v pre-commit >/dev/null 2>&1 || { \
echo "Error: pre-commit is not installed."; \
echo "Install it from https://github.com/pre-commit/pre-commit"; \
exit 1; \
}
##@ Tooling

check-helm-docs: ## Verify that helm-docs is installed
@command -v helm-docs >/dev/null 2>&1 || { \
Expand All @@ -53,24 +75,42 @@ check-helm-docs: ## Verify that helm-docs is installed
exit 1; \
}

check-pre-commit: ## Verify that pre-commit is installed
@command -v pre-commit >/dev/null 2>&1 || { \
echo "Error: pre-commit is not installed."; \
echo "Install it from https://github.com/pre-commit/pre-commit"; \
exit 1; \
}

setup-pre-commit: check-pre-commit check-helm-docs ## Install pre-commit hooks for this repo
pre-commit install
pre-commit install-hooks

##@ Docs

docs: check-helm-docs ## Regenerate chart documentation with helm-docs
helm-docs --chart-search-root=helm

docs-check: ## Validate Mintlify docs navigation (path depth and lost pages)
$(MAKE) -C docs check

##@ Lint

lint: ## Lint and template-render the helm chart
helm lint --strict $(CHART)
helm template $(RELEASE) $(CHART) > /dev/null
@echo "All helm checks passed."

##@ Local kind cluster (single-node dev)

create: ## Create a local kind cluster
kind create cluster

delete: ## Delete the local kind cluster
kind delete cluster

##@ Release lifecycle (install / upgrade / uninstall)

floci: ## Deploy floci S3 emulator + create the engine's managed_storage bucket in $(NAMESPACE)
kubectl create namespace $(NAMESPACE) --dry-run=client -o yaml | kubectl apply -f -
kubectl apply -n $(NAMESPACE) -f local-floci.yaml
Expand Down Expand Up @@ -99,22 +139,30 @@ cleanup: ## Uninstall the release, delete PVCs, and remove the namespace
kubectl delete pvc --namespace $(NAMESPACE) --all --ignore-not-found
kubectl delete namespace $(NAMESPACE) --ignore-not-found

##@ Helm tests (against the installed release)

test: ## Run helm tests against the installed release
helm test $(RELEASE) --namespace $(NAMESPACE) --logs

test-cleanup: ## Delete leftover helm test pods from previous runs
@pods=$$(kubectl get pods -n $(NAMESPACE) -o name 2>/dev/null | grep "^pod/$(RELEASE)-test-" || true); \
if [ -z "$$pods" ]; then \
echo "No stale test pods found."; \
else \
echo "$$pods" | xargs kubectl delete -n $(NAMESPACE); \
fi

##@ E2E quickstart pipeline

prepare-test-e2e: setup-kind load-test-images ## Full e2e setup: start the registry, create the kind cluster, publish images

setup-local-registry: ## Start the local Docker registry the kind node mirrors through (idempotent)
@if [ "$(GHCR_PACKAGES_PUBLIC)" = "true" ]; then \
echo "GHCR_PACKAGES_PUBLIC=true: skipping local registry (kind nodes pull images directly)."; \
else \
REGISTRY_NAME=$(REGISTRY_NAME) REGISTRY_PORT=$(REGISTRY_PORT) ./scripts/ci/setup-local-registry.sh; \
fi

cleanup-local-registry: ## Stop and remove the local Docker registry container (cached images are lost)
@docker rm -f $(REGISTRY_NAME) >/dev/null 2>&1 || true
@echo "Removed local registry '$(REGISTRY_NAME)' (if it existed). Re-run 'make setup-local-registry' to recreate."

flush-local-registry: cleanup-local-registry setup-local-registry ## Recreate the local registry from scratch (drops cached images)

setup-kind: setup-local-registry ## Create (or reuse) the e2e kind cluster and wire it to the local registry
@NODE_IMAGE='$(NODE_IMAGE)' REGISTRY_NAME=$(REGISTRY_NAME) REGISTRY_PORT=$(REGISTRY_PORT) GHCR_PACKAGES_PUBLIC=$(GHCR_PACKAGES_PUBLIC) ./scripts/ci/setup-kind-cluster.sh $(KIND_CLUSTER)

Expand All @@ -125,21 +173,14 @@ load-test-images: ## Pull the chart + floci images and push them into the local
REGISTRY_NAME=$(REGISTRY_NAME) REGISTRY_PORT=$(REGISTRY_PORT) ./scripts/ci/load-e2e-images.sh $(KIND_CLUSTER); \
fi

prepare-test-e2e: setup-kind load-test-images ## Full e2e setup: start the registry, create the kind cluster, publish images

helm-test: ## Run the quickstart end-to-end check against the current cluster (run prepare-test-e2e first)
NAMESPACE=$(NAMESPACE) RELEASE=$(RELEASE) CHART_DIR=$(CHART) ./scripts/ci/helm-test.sh

flush-local-registry: cleanup-local-registry setup-local-registry ## Recreate the local registry from scratch (drops cached images)

cleanup-test-e2e: ## Tear down the e2e kind cluster (the local registry is left running; use flush-local-registry to drop it)
kind delete cluster --name $(KIND_CLUSTER)

test-cleanup: ## Delete leftover helm test pods from previous runs
@pods=$$(kubectl get pods -n $(NAMESPACE) -o name 2>/dev/null | grep "^pod/$(RELEASE)-test-" || true); \
if [ -z "$$pods" ]; then \
echo "No stale test pods found."; \
else \
echo "$$pods" | xargs kubectl delete -n $(NAMESPACE); \
fi

delete: ## Delete the local kind cluster
kind delete cluster
cleanup-local-registry: ## Stop and remove the local Docker registry container (cached images are lost)
@docker rm -f $(REGISTRY_NAME) >/dev/null 2>&1 || true
@echo "Removed local registry '$(REGISTRY_NAME)' (if it existed). Re-run 'make setup-local-registry' to recreate."
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ For more detailed information checkout our [official documentation](https://docs

## Scope

The chart deploys a complete Firebolt Instance consistingo of a Gateway (Envoy), Metadata Service, PostgreSQL and Firebolt Engines into any Kubernetes cluster. For day-2 operational capabilities (zero-downtime engine rollouts, autoscaling, drift correction, reusable per-engine templates), take a look at the [Firebolt Kubernetes Operator](https://github.com/firebolt-db/firebolt-kubernetes-operator).
The chart deploys a complete Firebolt Instance consisting of a Gateway (Envoy), Metadata Service, PostgreSQL and Firebolt Engines into any Kubernetes cluster. For day-2 operational capabilities (zero-downtime engine rollouts, autoscaling, drift correction, reusable per-engine templates), take a look at the [Firebolt Kubernetes Operator](https://github.com/firebolt-db/firebolt-kubernetes-operator).

## Architecture

Expand Down