Skip to content
This repository has been archived by the owner on Jan 28, 2022. It is now read-only.

Commit

Permalink
Reduce space used by load tests
Browse files Browse the repository at this point in the history
  • Loading branch information
EliiseS committed Mar 13, 2020
1 parent bf62bd9 commit 069cb9e
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 50 deletions.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Build the manager binary
FROM golang:1.12.5 as builder
FROM golang:1.12.5-alpine3.9 as builder

# Install certs, git, and mercurial
RUN apk add --no-cache ca-certificates git mercurial

WORKDIR /workspace
# Copy the Go Modules manifests
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ delete-kindcluster:
create-kindcluster: delete-kindcluster

@echo "$(shell tput setaf 10)$(shell tput bold)Creating kind cluster $(shell tput sgr0)"
kind create cluster --name ${KIND_CLUSTER_NAME} --config ./kind-cluster.yaml
kind create cluster --name ${KIND_CLUSTER_NAME}

set-kindcluster: install-kind
make create-kindcluster
Expand Down Expand Up @@ -290,7 +290,7 @@ create-db-mock-secret: create-namespace
--from-literal=DatabricksHost="http://databricks-mock-api.databricks-mock-api:8080" \
--from-literal=DatabricksToken="dummy"

deploy-cluster-for-load-testing: create-kindcluster install-prometheus create-db-mock-secret deploy-kindcluster deploy-mock-api
deploy-cluster-for-load-testing: create-kindcluster install-prometheus create-db-mock-secret deploy-kindcluster deploy-mock-api deploy-locust
@echo "$(shell tput setaf 10)$(shell tput bold)Deploying grafana dashboards $(shell tput sgr0)"

# deploy service monitor
Expand All @@ -301,11 +301,11 @@ deploy-cluster-for-load-testing: create-kindcluster install-prometheus create-db
kubectl apply -f ./config/prometheus/grafana-dashboard-load-test-configmap.yaml
kubectl apply -f ./config/prometheus/grafana-dashboard-mockapi-configmap.yaml

run-load-testing: deploy-cluster-for-load-testing deploy-locust port-forward
@echo "$(shell tput setaf 10)$(shell tput bold)Verify load tests $(shell tput sgr0)"
go run hack/verify_load_tests/main.go
run-load-testing: deploy-cluster-for-load-testing port-forward

run-load-testing-auto-start: set-auto-start run-load-testing
@echo "$(shell tput setaf 10)$(shell tput bold)Verify load tests $(shell tput sgr0)"
go run hack/verify_load_tests/main.go

set-auto-start:
# Args passed to locust must be in CSV format as passed in "command" section of yaml doc
Expand Down
6 changes: 0 additions & 6 deletions kind-cluster.yaml

This file was deleted.

46 changes: 25 additions & 21 deletions locust/manifests/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,31 @@ spec:
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: control-plane
operator: In
values:
- controller-manager
topologyKey: kubernetes.io/hostname
namespaces:
- azure-databricks-operator-system
- default
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- databricks-mock-api
topologyKey: kubernetes.io/hostname
namespaces:
- azure-databricks-operator-system
- default
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: control-plane
operator: In
values:
- controller-manager
topologyKey: kubernetes.io/hostname
namespaces:
- azure-databricks-operator-system
- default
- weight: 99
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- databricks-mock-api
topologyKey: kubernetes.io/hostname
namespaces:
- azure-databricks-operator-system
- default
containers:
- name: loadtestrunner
image: locust:latest
Expand Down
5 changes: 4 additions & 1 deletion mockapi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
#-------------------------------------------------------------------------------------------------------------

FROM golang:1.12-stretch as builder
FROM golang:1.12-alpine3.9 as builder

# Install certs, git, and mercurial
RUN apk add --no-cache ca-certificates git mercurial

WORKDIR /workspace

Expand Down
36 changes: 20 additions & 16 deletions mockapi/manifests/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,27 @@ spec:
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: control-plane
operator: In
values:
- controller-manager
topologyKey: kubernetes.io/hostname
namespaces:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: control-plane
operator: In
values:
- controller-manager
topologyKey: kubernetes.io/hostname
namespaces:
- azure-databricks-operator-system
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- locust-loadtest
topologyKey: kubernetes.io/hostname
- weight: 99
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- locust-loadtest
topologyKey: kubernetes.io/hostname
containers:
- name: databricks-mock-api
image: mockapi:latest
Expand Down

0 comments on commit 069cb9e

Please sign in to comment.