* Adds LightRAG API key support to deployment and secrets Introduces a new environment variable for the LightRAG API key sourced from secrets to enable authenticated access. Updates Helm values and templates to include LightRAG API key management alongside the existing OpenAI key, improving configuration consistency and security. Relates to MLO-339 * Adds optional API key authentication support to LightRAG client Enables passing custom headers, including an API key from environment variables, to all LightRAG HTTP requests for authentication. Improves security by allowing authenticated access without breaking existing unauthenticated usage. Relates to MLO-446 * Adds basic user authentication support to Helm deployment Introduces configurable user accounts and token secret in values and templates to enable authentication. Generates an encoded authentication string from account data stored in secrets and exposes relevant environment variables in the deployment only when authentication is enabled and configured. This enhancement allows secure management of multiple user credentials and token secrets, improving the deployment's security and flexibility. Relates to MLO-446 * Adds support for external secret references in PostgreSQL auth Introduces parameters to allow PostgreSQL credentials to be sourced from existing Kubernetes secrets instead of inline passwords. Improves security and flexibility by enabling integration with external secret management without changing deployment structure. Relates to MLO-446 * Streamline deployment docs and remove preset environment configs Consolidates deployment instructions by removing separate dev and prod values files and related workflows, encouraging users to customize a single values file instead. Simplifies the README to focus on flexible chart deployment without environment-specific templates or variable substitution, improving maintainability and clarity. * Adds Helm packaging and publishing Makefile for LightRAG Introduces a Makefile to automate Helm chart packaging, versioning, and publishing to a container registry. Uses git tags or user-defined versions for chart versioning with sanitization. Ensures streamlined CI/CD by handling dependencies, packaging, registry login, and cleanup, simplifying release workflows. Relates to MLO-446
62 lines
2.2 KiB
Makefile
62 lines
2.2 KiB
Makefile
# Makefile for LightRAG Helm packaging
|
|
|
|
# Configuration
|
|
CHART_NAME := lightrag-minimal
|
|
CHART_DIR := k8s-deploy/$(CHART_NAME)
|
|
CHART_PACKAGE_DIR := dist/charts
|
|
HELM_REGISTRY := ghcr.io/neuro-inc/helm-charts
|
|
|
|
RAW_VERSION := $(if $(VERSION),$(VERSION),$(shell git describe --tags --always --dirty 2>/dev/null))
|
|
SANITIZED_VERSION := $(shell RAW="$(RAW_VERSION)" python - <<'PY'
|
|
import os, re
|
|
raw = os.environ.get("RAW", "").strip()
|
|
if not raw:
|
|
raw = "0.0.0"
|
|
raw = raw.lstrip("v")
|
|
sanitized = re.sub(r"[^0-9A-Za-z\\.\\-]", "-", raw)
|
|
print(sanitized or "0.0.0")
|
|
PY
|
|
)
|
|
CHART_VERSION := $(SANITIZED_VERSION)
|
|
CHART_PACKAGE := $(CHART_PACKAGE_DIR)/$(CHART_NAME)-$(CHART_VERSION).tgz
|
|
|
|
GITHUB_USERNAME := $(shell echo "$$APOLO_GITHUB_TOKEN" | base64 -d 2>/dev/null | cut -d: -f1 2>/dev/null || echo "oauth2")
|
|
|
|
.PHONY: help helm-package helm-push clean
|
|
|
|
help:
|
|
@echo "Available targets:"
|
|
@echo " helm-package - Package the LightRAG Helm chart (version: $(CHART_VERSION))"
|
|
@echo " helm-push - Package and push the chart to $(HELM_REGISTRY)"
|
|
@echo " clean - Remove packaged charts from $(CHART_PACKAGE_DIR)"
|
|
@echo "\nSet VERSION=1.2.3 to override the git-derived chart version."
|
|
|
|
helm-package:
|
|
@if [ -z "$(CHART_VERSION)" ]; then \
|
|
echo "Error: unable to determine chart version."; \
|
|
exit 1; \
|
|
fi
|
|
@echo "Packaging $(CHART_NAME) chart version $(CHART_VERSION)..."
|
|
@mkdir -p $(CHART_PACKAGE_DIR)
|
|
helm dependency update $(CHART_DIR) >/dev/null
|
|
helm package $(CHART_DIR) \
|
|
--version $(CHART_VERSION) \
|
|
--app-version $(CHART_VERSION) \
|
|
-d $(CHART_PACKAGE_DIR)
|
|
@echo "✅ Chart packaged at $(CHART_PACKAGE)"
|
|
|
|
helm-push: helm-package
|
|
@if [ -z "$(APOLO_GITHUB_TOKEN)" ]; then \
|
|
echo "Error: APOLO_GITHUB_TOKEN not set. Please export a token with write:packages."; \
|
|
exit 1; \
|
|
fi
|
|
@echo "Logging into Helm registry ghcr.io as $(GITHUB_USERNAME)..."
|
|
echo "$(APOLO_GITHUB_TOKEN)" | helm registry login ghcr.io -u $(GITHUB_USERNAME) --password-stdin >/dev/null
|
|
@echo "Pushing chart $(CHART_NAME):$(CHART_VERSION) to $(HELM_REGISTRY)..."
|
|
helm push $(CHART_PACKAGE) oci://$(HELM_REGISTRY)
|
|
@echo "✅ Chart pushed to $(HELM_REGISTRY)"
|
|
|
|
clean:
|
|
@echo "Removing packaged charts..."
|
|
rm -rf $(CHART_PACKAGE_DIR)
|
|
@echo "✅ Cleaned"
|