Skip to content

Commit

Permalink
feat: + scalability perf test
Browse files Browse the repository at this point in the history
  • Loading branch information
akurilov committed Aug 19, 2023
1 parent 783afa9 commit 36b3733
Show file tree
Hide file tree
Showing 13 changed files with 483 additions and 688 deletions.
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
FROM golang:1.20.6-alpine3.18 AS builder
FROM golang:1.20.7-alpine3.18
WORKDIR /go/src/core
COPY . .
RUN apk add protoc protobuf-dev make git gcc musl-dev
RUN apk add --update --no-cache protoc protobuf-dev make git gcc musl-dev
RUN go get github.com/fullstorydev/grpcurl/...
RUN go install github.com/fullstorydev/grpcurl/cmd/grpcurl
RUN go get -t github.com/awakari/core/test
ENTRYPOINT ["/usr/bin/make", "test"]
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@ default: test
test:
CGO_ENABLED=1 go test -race ./...

testperfe2e:
go test -v -run Test_Perf_EndToEnd -timeout 168h ./...

docker:
docker build -t awakari/core-tests .

run: docker
docker run \
--name awakari-core-tests \
--network host \
awakari/core-tests

staging: docker
./scripts/staging.sh

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ helm test core -n awakari --filter name=core-test

![perf-e2e-test-report-2023-07-11](doc/perf-e2e-test-report-2023-07-11.png)

![perf-e2e-test-report-2023-08-18](doc/perf-e2e-test-report-2023-08-18.png)

## 6.5. Releasing

To release a new version (e.g. `1.2.3`) it's enough to put a git tag:
Expand Down
Binary file added doc/perf-e2e-test-report-2023-08-18.ods
Binary file not shown.
Binary file added doc/perf-e2e-test-report-2023-08-18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions helm/core-tests-perf/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: core-tests-perf
description: Helm chart for the Awakari Core performance test

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "latest"
47 changes: 47 additions & 0 deletions helm/core-tests-perf/templates/job-e2e.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
apiVersion: batch/v1
kind: Job
metadata:
labels:
app: "core-tests-perf-e2e"
name: "core-tests-perf-e2e"
spec:
template:
spec:
nodeSelector:
purpose: svc
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 12 }}
{{- end }}
initContainers:
- name: "core-tests-perf-e2e-subs10-rate200"
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
command:
- /usr/bin/make
args:
- testperfe2e
env:
- name: TEST_PERF_E2E_SUB_COUNT
value: "10"
- name: TEST_PERF_E2E_WRITE_RATE
value: "200"
- name: TEST_PERF_E2E_BATCH_SIZE
value: "16"
- name: TEST_PERF_E2E_DURATION
value: "4m"
- name: URI_READER
value: "core-reader:50051"
- name: URI_SUBSCRIPTIONS
value: "core-subscriptionsproxy:50051"
- name: URI_RESOLVER
value: "core-resolver:50051"
- name: URI_MATCHES
value: "core-matches:50051"
- name: URI_MESSAGES
value: "core-messages:50051"
containers:
- name: job-done
image: busybox
command: [ 'sh', '-c', 'echo "core-tests-perf-e2e completed"' ]
restartPolicy: Never
70 changes: 70 additions & 0 deletions helm/core-tests-perf/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1

image:
repository: ghcr.io/awakari/core-tests
pullPolicy: Always
tag: "latest"
imagePullSecrets:
- name: github-registry
nameOverride: ""
fullnameOverride: ""

serviceAccount:
# Specifies whether a service account should be created
create: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""

podAnnotations: {}

podSecurityContext: {}
# fsGroup: 2000

securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000

service:
type: ClusterIP
port: 8080

ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts: []
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

resources:
requests:
cpu: 1m
memory: 16Mi

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 1
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80

nodeSelector:
purpose: svc

tolerations: []

affinity: {}
4 changes: 2 additions & 2 deletions helm/core/templates/tests/test-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ spec:
value: "{{ .Release.Name }}-reader:{{ .Values.messages.service.port }}"
- name: URI_SUBSCRIPTIONS
value: "{{ .Release.Name }}-subscriptionsproxy:{{ .Values.subscriptionsproxy.service.port }}"
- name: URI_WRITER
value: "{{ .Release.Name }}-writer:{{ .Values.writer.service.port }}"
- name: URI_RESOLVER
value: "{{ .Release.Name }}-resolver:{{ .Values.writer.service.port }}"
restartPolicy: Never
156 changes: 156 additions & 0 deletions helm/core/values-perf-test-db.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
mongodb:
internal: true
shards: 3 # test variable, vary: 1, 2, 3
configsvr:
nodeSelector:
purpose: svc
mongos:
replicaCount: 3 # should be equal to mongodb.shards
nodeSelector:
purpose: db
shardsvr:
dataNode:
podAntiAffinityPreset: hard
replicaCount: 1
nodeSelector:
purpose: db

nats:
nodeSelector:
purpose: svc
replicaCount: 3

redis:
redis:
nodeSelector:
purpose: svc

semaphore:
autoscaling:
enabled: false
log:
level: 0
nodeSelector:
purpose: svc
replicaCount: 3
resources:
limits: {}

queue:
autoscaling:
enabled: false
log:
level: 0
nodeSelector:
purpose: svc
replicaCount: 3
resources:
limits: {}

conditionsnumber:
autoscaling:
enabled: false
log:
level: 0
nodeSelector:
purpose: svc
resources:
limits: {}

conditionstext:
autoscaling:
enabled: false
log:
level: 0
nodeSelector:
purpose: svc
resources:
limits: {}
replicaCount: 3

matches:
autoscaling:
enabled: false
db:
retentionPeriod: 1s
log:
level: 0
nodeSelector:
purpose: svc
resources:
limits: {}
replicaCount: 3

messages:
autoscaling:
enabled: false
db:
retentionPeriod: 1s
log:
level: 0
nodeSelector:
purpose: svc
resources:
limits: {}
replicaCount: 3

subscriptionsproxy:
api:
# use "local" subscriptions
subscriptions:
tls:
enabled: false
uri: "subscriptions:50051"
autoscaling:
enabled: false
log:
level: 0
nodeSelector:
purpose: svc
resources:
limits: {}
replicaCount: 3

reader:
autoscaling:
enabled: false
log:
level: 0
nodeSelector:
purpose: svc
resources:
limits: {}
replicaCount: 3

evaluator:
autoscaling:
enabled: false
log:
level: 0
nodeSelector:
purpose: svc
resources:
limits: {}
replicaCount: 3

writer:
autoscaling:
enabled: false
log:
level: 0
nodeSelector:
purpose: svc
resources:
limits: {}
replicaCount: 3

resolver:
autoscaling:
enabled: false
log:
level: 0
nodeSelector:
purpose: svc
replicaCount: 3
resources:
limits: {}
Loading

0 comments on commit 36b3733

Please sign in to comment.