Skip to content

Commit

Permalink
slo
Browse files Browse the repository at this point in the history
  • Loading branch information
XmasApple committed Sep 1, 2023
1 parent 53f2d6d commit 1aa1b5c
Show file tree
Hide file tree
Showing 28 changed files with 872 additions and 272 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/slo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

name: SLO

jobs:
test-slo:
concurrency:
group: slo-${{ github.ref }}
if: (!contains(github.event.pull_request.labels.*.name, 'no slo'))

runs-on: ubuntu-latest
name: SLO test
permissions:
checks: write
pull-requests: write
contents: read
issues: write

steps:
- name: Checkout repository
uses: actions/checkout@v3
if: env.DOCKER_REPO != null
env:
DOCKER_REPO: ${{ secrets.SLO_DOCKER_REPO }}

- name: Run SLO
uses: ydb-platform/slo-tests@js-version
if: env.DOCKER_REPO != null
env:
DOCKER_REPO: ${{ secrets.SLO_DOCKER_REPO }}
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
KUBECONFIG_B64: ${{ secrets.SLO_KUBE_CONFIG }}
AWS_CREDENTIALS_B64: ${{ secrets.SLO_AWS_CREDENTIALS }}
AWS_CONFIG_B64: ${{ secrets.SLO_AWS_CONFIG }}
DOCKER_USERNAME: ${{ secrets.SLO_DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.SLO_DOCKER_PASSWORD }}
DOCKER_REPO: ${{ secrets.SLO_DOCKER_REPO }}
DOCKER_FOLDER: ${{ secrets.SLO_DOCKER_FOLDER }}
s3_endpoint: ${{ secrets.SLO_S3_ENDPOINT }}
s3_images_folder: ${{ vars.SLO_S3_IMAGES_FOLDER }}
grafana_domain: ${{ vars.SLO_GRAFANA_DOMAIN }}
grafana_dashboard: ${{ vars.SLO_GRAFANA_DASHBOARD }}
ydb_version: 'newest'
timeBetweenPhases: 30
shutdownTime: 30

language_id0: 'dotnet'
workload_path0: 'slo/src'
language0: '.NET SDK'
workload_build_context0: ../..
workload_build_options0: -f Dockerfile

- uses: actions/upload-artifact@v3
if: env.DOCKER_REPO != null
env:
DOCKER_REPO: ${{ secrets.SLO_DOCKER_REPO }}
with:
name: slo-logs
path: logs/
3 changes: 3 additions & 0 deletions slo/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
data/
.idea/
bin/
obj/

8 changes: 0 additions & 8 deletions slo/configs/prometheus/prometheus.yml

This file was deleted.

61 changes: 0 additions & 61 deletions slo/docker-compose.yml

This file was deleted.

36 changes: 0 additions & 36 deletions slo/docker-compose.yml.bak

This file was deleted.

40 changes: 40 additions & 0 deletions slo/playground/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# SLO playground

Playground may be used for testing SLO workloads locally

It has several services:

- `prometheus` - storage for metrics
- `prometheus-pushgateway` - push acceptor for prometheus
- `grafana` - provides chats for metrics
- `ydb` - local instance of ydb-database to run workload with

## Network addresses

- Grafana dashboard: http://localhost:3000
- Prometheus pushgateway: http://localhost:9091
- YDB monitoring: http://localhost:8765
- YDB GRPC: grpc://localhost:2136
- YDB GRPC TLS: grpcs://localhost:2135

## Start

```shell
docker-compose up -d
```

## Stop

```shell
docker-compose down
```

## Configs

Grafana's dashboards stored in `configs/grafana/provisioning/dashboards`

## Data

YDB databases are not persistent

All other data like metrics and certs stored in `data/`
8 changes: 8 additions & 0 deletions slo/playground/configs/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
global:
scrape_interval: 1s
evaluation_interval: 1s

scrape_configs:
- job_name: 'slo'
static_configs:
- targets: ['prometheus-pushgateway:9091']
83 changes: 83 additions & 0 deletions slo/playground/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
version: '2.1'

networks:
monitor-net:
driver: bridge

services:
prometheus:
image: prom/prometheus:v2.44.0
container_name: prometheus
user: "$UID:$GID"
volumes:
- ./configs/prometheus:/etc/prometheus
- ../data/prometheus:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention.time=200h'
- '--web.enable-lifecycle'
restart: unless-stopped
ports:
- "9090:9090"
networks:
- monitor-net

prometheus-pushgateway:
image: prom/pushgateway:v1.6.0
container_name: prometheus-pushgateway
ports:
- "9091:9091"
networks:
- monitor-net

grafana:
image: grafana/grafana:9.5.3
container_name: grafana
user: "$UID:$GID"
volumes:
- ./configs/grafana/provisioning:/etc/grafana/provisioning
- ../data/grafana:/var/lib/grafana
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=passw0rD
restart: unless-stopped
ports:
- "3000:3000"
networks:
- monitor-net

ydb:
image: cr.yandex/yc/yandex-docker-local-ydb:23.1
container_name: ydb
# hostname: localhost
environment:
- GRPC_TLS_PORT=2135
- GRPC_PORT=2136
- MON_PORT=8765
- YDB_USE_IN_MEMORY_PDISKS=true
- YDB_DEFAULT_LOG_LEVEL=NOTICE
ports:
- "2135:2135"
- "2136:2136"
- "8765:8765"
volumes:
- ../data/ydb_certs:/ydb_certs
networks:
- monitor-net

slo-runner:
build:
context: ../..
dockerfile: slo/src/Dockerfile
command:
- 'run'
- 'http://ydb:2136'
- '/local'
- '-prom-pgw=http://prometheus-pushgateway:9091/metrics'
networks:
- monitor-net
depends_on:
ydb:
condition: service_healthy

Loading

0 comments on commit 1aa1b5c

Please sign in to comment.