Skip to content

Run STAC API performance tests #1522

Run STAC API performance tests

Run STAC API performance tests #1522

---
name: Run STAC API performance tests
on:
workflow_dispatch:
schedule:
- cron: "0 */2 * * *"
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
perform-load-test:
runs-on: ubuntu-latest
steps:
# Check out the code from the repository
- name: Checkout code
uses: actions/checkout@v4
# Get environment ready
- name: Create pixi environment
uses: prefix-dev/setup-pixi@v0.8.3
env:
RUNNER_DEBUG: true
with:
pixi-version: v0.42.1
cache: true
locked: false
- name: Run STAC query performance test
run: |
pixi run locust -f ./src/performance_testing/stac_query.py \
--headless --run-time 30s \
--csv stac_query \
--users 10 --spawn-rate 1 -H https://stac.core.eopf.eodc.eu/
# Push metrics to Prometheus pushgateway
- name: Push metrics
env:
PUSHGATEWAY_ENDPOINT: ${{ secrets.PUSHGATEWAY_ENDPOINT }}
PUSHGATEWAY_USERNAME: ${{ secrets.PUSHGATEWAY_USERNAME }}
PUSHGATEWAY_PASSWORD: ${{ secrets.PUSHGATEWAY_PASSWORD }}
run: |
pixi run python ./src/performance_testing/locust2prometheus.py \
./stac_query_stats.csv \
--pushgateway $PUSHGATEWAY_ENDPOINT \
--user $PUSHGATEWAY_USERNAME \
--password $PUSHGATEWAY_PASSWORD