Skip to content

Commit

Permalink
Add Maestro Dry Runs
Browse files Browse the repository at this point in the history
  • Loading branch information
janboll committed Jan 7, 2025
1 parent 3ac0fbd commit d82e958
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 8 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/services-pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,15 @@
PRINCIPAL_ID: ${{ secrets.GHA_PRINCIPAL_ID }}
run: |
make frontend.dry_run
- name: 'Dry Maestro Registration'
env:
PRINCIPAL_ID: ${{ secrets.GHA_PRINCIPAL_ID }}
run: |
make maestro.registration.dry_run
- name: 'Dry Maestro Server'
env:
PRINCIPAL_ID: ${{ secrets.GHA_PRINCIPAL_ID }}
run: |
make maestro.server.dry_run
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ infra.clean:
# separator "/" (used for maestro only).

# Services deployed on "svc" aks cluster
services_svc = istio metrics maestro.server maestro.registration
services_svc = istio metrics
# Services deployed on "mgmt" aks cluster(s)
services_mgmt = acm maestro.agent pko hypershiftoperator
# List of all services
Expand All @@ -124,7 +124,7 @@ services_all = $(join services_svc,services_mgmt)
# Pipelines section
# This sections is used to reference pipeline runs and should replace
# the usage of `svc-deploh.sh` script in the future.
services_svc_pipelines = backend frontend cluster-service
services_svc_pipelines = backend frontend cluster-service maestro.server maestro.registration
%.deploy:
$(eval export dirname=$(subst .,/,$(basename $@)))
./templatize.sh $(DEPLOY_ENV) -p ./$(dirname)/pipeline.yaml -s deploy -P run -c public
Expand Down
4 changes: 3 additions & 1 deletion maestro/registration/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ SHELL = /bin/bash
DEPLOY_ENV ?= personal-dev
$(shell ../../templatize.sh $(DEPLOY_ENV) config.tmpl.mk config.mk)
include config.mk
-include ../helm-cmd.mk
HELM_CMD ?= helm upgrade --install

deploy:
@if ! kubectl get service maestro -n maestro > /dev/null 2>&1; then \
echo "Error: Service 'maestro' not found in namespace 'maestro'"; \
exit 1; \
fi
helm upgrade --install ${CONSUMER_NAME} ./helm \
${HELM_CMD} ${CONSUMER_NAME} ./helm \
--namespace maestro \
--set consumerName=${CONSUMER_NAME}
.PHONY: deploy
4 changes: 3 additions & 1 deletion maestro/server/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
-include ../../setup-env.mk
-include ../helm-cmd.mk
HELM_CMD ?= helm upgrade --install

deploy:
@kubectl create namespace maestro --dry-run=client -o json | kubectl apply -f -
Expand All @@ -8,7 +10,7 @@ deploy:
MAESTRO_MI_CLIENT_ID=$(shell az identity show -g "${SVC_RG}" -n maestro-server --query clientId -o tsv) && \
DATABASE_HOST=$$(if [ "${USE_AZURE_DB}" = "true" ]; then az postgres flexible-server show -g ${SVC_RG} -n ${DATABASE_NAME} --query fullyQualifiedDomainName -o tsv; else echo "maestro-db"; fi) && \
OVERRIDES=$$(if [ "${USE_AZURE_DB}" = "true" ]; then echo "azuredb.values.yaml"; else echo "containerdb.values.yaml"; fi) && \
helm upgrade --install --wait ${HELM_DRY_RUN} maestro-server ./helm \
${HELM_CMD} maestro-server ./helm \
--namespace maestro \
-f helm/$${OVERRIDES} \
--set broker.host=$${EVENTGRID_HOSTNAME} \
Expand Down
6 changes: 2 additions & 4 deletions maestro/server/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ resourceGroups:
command: make deploy
dryRun:
variables:
- name: HELM_DRY_RUN
value: "--dry-run=server --debug"
- name: KUBECTL_DRY_RUN
value: "--dry-run=server"
- name: DRY_RUN
value: "true"
variables:
- name: EVENTGRID_NAME
configRef: maestro.eventGrid.name
Expand Down

0 comments on commit d82e958

Please sign in to comment.