deploy: Deploy the registry to GCP (#255)
Adds the Pulumi code to: - Deploy the registry (and associated services e.g. mongodb) to Google Cloud Platform (GCP), on top of Google Kubernetes Engine (GKE) - Sets up proper environments and secrets management - Uses the real container image, now that it's published in #225. At the moment attached to latest, we might want to pin the version later (or perhaps always use `latest` in staging, and pin prod) - Uses real domains (`staging.registry.modelcontextprotocol.io`) rather than examples (``) ## Motivation and Context Setting up infrastructure to deploy it. I set something up in Azure in #227, although not super robust (e.g. no service accounts etc.). Think we will use GCP as: - the maintainers have experience with GCP, but none with Azure - costs are quite low, and Anthropic is happy to cover them in the short term - means we only have to maintain one login system (just Google Cloud Identity), not two (Google Workspace + Azure) ## How Has This Been Tested? Deployed this to a staging and production cluster. Try it yourself at: ```bash curl -H "Host: staging.registry.modelcontextprotocol.io" -k https://35.222.36.75/v0/ping ``` (will be sorting out domains very soon) ## Breaking Changes NA - just adds support for GCP deployment ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation update ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply. --> - [x] I have read the [MCP Documentation](https://modelcontextprotocol.io) - [x] My code follows the repository's style guidelines - [ ] New and existing tests pass locally - [x] I have added appropriate error handling - [x] I have added or updated documentation as needed ## Additional context <!-- Add any other context, implementation notes, or design decisions --> Expected follow-ups: - GitHub Action setup to deploy things to the cluster from GitHub, to avoid gatekeeping to just the people with the secrets.
This commit is contained in:
parent
667e2840b8
commit
fe52766676
1 changed files with 395 additions and 144 deletions
|
|
@ -1,47 +1,31 @@
|
|||
.PHONY: help init preview deploy destroy clean dev-init prod-init dev-deploy prod-deploy
|
||||
.PHONY: help build local-preview local-up staging-preview staging-up prod-preview prod-up
|
||||
|
||||
# Default target
|
||||
help: ## Show this help message
|
||||
@echo "Usage: make [target]"
|
||||
@echo ""
|
||||
@echo "Targets:"
|
||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " %-15s %s\n", $$1, $$2}'
|
||||
@echo "Available targets:"
|
||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " %-20s %s\n", $$1, $$2}'
|
||||
|
||||
init: ## Initialize Pulumi stack
|
||||
pulumi stack init
|
||||
# Build the Go binary
|
||||
build: ## Build the Pulumi Go program
|
||||
go build
|
||||
|
||||
preview: ## Preview infrastructure changes
|
||||
pulumi preview
|
||||
# Local stack commands
|
||||
local-preview: build ## Preview local infrastructure changes
|
||||
PULUMI_CONFIG_PASSPHRASE="" pulumi preview --stack local
|
||||
|
||||
deploy: ## Deploy infrastructure
|
||||
pulumi up --yes
|
||||
local-up: build ## Deploy local infrastructure
|
||||
PULUMI_CONFIG_PASSPHRASE="" pulumi up --yes --stack local
|
||||
|
||||
destroy: ## Destroy infrastructure
|
||||
pulumi destroy --yes
|
||||
# Staging stack commands
|
||||
staging-preview: build ## Preview staging infrastructure changes
|
||||
PULUMI_CONFIG_PASSPHRASE_FILE=passphrase.staging.txt pulumi preview --stack gcpStaging
|
||||
|
||||
clean: ## Clean up temporary files
|
||||
rm -rf .pulumi/
|
||||
rm -f Pulumi.*.yaml.bak
|
||||
staging-up: build ## Deploy staging infrastructure
|
||||
PULUMI_CONFIG_PASSPHRASE_FILE=passphrase.staging.txt pulumi up --yes --stack gcpStaging
|
||||
|
||||
dev-init: ## Initialize development stack
|
||||
pulumi stack init dev
|
||||
pulumi stack select dev
|
||||
# Production stack commands
|
||||
prod-preview: build ## Preview production infrastructure changes
|
||||
PULUMI_CONFIG_PASSPHRASE_FILE=passphrase.prod.txt pulumi preview --stack gcpProd
|
||||
|
||||
prod-init: ## Initialize production stack
|
||||
pulumi stack init prod
|
||||
pulumi stack select prod
|
||||
|
||||
dev-deploy: ## Deploy to development environment
|
||||
pulumi stack select dev
|
||||
pulumi up --yes
|
||||
|
||||
prod-deploy: ## Deploy to production environment
|
||||
pulumi stack select prod
|
||||
pulumi up --yes
|
||||
|
||||
dev-destroy: ## Destroy development environment
|
||||
pulumi stack select dev
|
||||
pulumi destroy --yes
|
||||
|
||||
prod-destroy: ## Destroy production environment
|
||||
pulumi stack select prod
|
||||
pulumi destroy --yes
|
||||
prod-up: build ## Deploy production infrastructure
|
||||
PULUMI_CONFIG_PASSPHRASE_FILE=passphrase.prod.txt pulumi up --yes --stack gcpProd
|
||||
Loading…
Reference in a new issue