-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
765 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: Benchmark | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
benchmark: | ||
runs-on: ubuntu-latest | ||
env: | ||
DOCKER_BUILDKIT: 1 | ||
COMPOSE_DOCKER_CLI_BUILD: 1 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Create env | ||
run: cp .env.example .env | ||
|
||
- name: Load .env file | ||
uses: xom9ikk/dotenv@v2 | ||
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
cache: 'pip' | ||
|
||
- name: Install deps | ||
run: | | ||
sudo apt-get install -y jq | ||
pip install plotly kaleido | ||
# hyperfine for timing | ||
HF_VERSION=1.18.0 | ||
wget https://github.com/sharkdp/hyperfine/releases/download/v${HF_VERSION}/hyperfine_${HF_VERSION}_amd64.deb | ||
sudo dpkg -i hyperfine_${HF_VERSION}_amd64.deb | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build Django image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
provenance: false | ||
file: docker/django/Dockerfile | ||
pull: true | ||
cache-from: type=registry,ref=opengisch/django-oapif:latest | ||
tags: opengisch/django-oapif:latest | ||
|
||
- name: Download fixtures | ||
run: ./scripts/download-fixtures.sh | ||
|
||
- name: Start Django | ||
run: ./scripts/restart.sh | ||
|
||
- name: Run Benchmark | ||
run: ./tests/benchmark/time.sh | ||
|
||
- name: Create plots | ||
run: ./tests/benchmark/plot.py | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: | | ||
tests/benchmark/results/benchmark.dat | ||
tests/benchmark/results/*.png | ||
if-no-files-found: error | ||
|
||
- name: Failure logs | ||
if: failure() | ||
run: docker-compose logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
# see https://github.com/postgis/docker-postgis/issues/216#issuecomment-1763399631 | ||
# https://github.com/postgis/docker-postgis/pull/356 | ||
|
||
services: | ||
postgres: | ||
image: imresamu/postgis-arm64:15-3.4-alpine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
mkdir -p src/tests/fixtures | ||
|
||
# download fixtures | ||
curl -L -o ./src/tests/fixtures/polygon_2056.json.gz 'https://drive.google.com/uc?export=download&id=1UuGoK_9Y99jiTvQd4juxu85eVZhvlAvy' | ||
curl -L -o ./src/tests/fixtures/polygon_2056_local_geom.json.gz 'https://drive.google.com/uc?export=download&id=18PGtiptcJiRtLnVq7N64EVQLagse0bu0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
set -x | ||
|
||
SIZE=${1:-100} | ||
|
||
|
||
docker compose exec django python manage.py flush --no-input | ||
|
||
docker compose exec django python manage.py populate_users | ||
docker compose exec django python manage.py populate_data -s ${SIZE} | ||
|
||
docker compose exec django python manage.py loaddata polygon_2056 polygon_2056_local_geom |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.