Skip to content

Commit

Permalink
Moving to service containers
Browse files Browse the repository at this point in the history
  • Loading branch information
madflojo committed Jun 2, 2024
1 parent 1b5109c commit 394ba1f
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 7 deletions.
52 changes: 47 additions & 5 deletions .github/workflows/load.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,54 @@ on:
jobs:
load-tests:
runs-on: ubuntu-latest

services:
mysql:
image: bitnami/mysql:latest
env:
MYSQL_ROOT_PASSWORD: example
MYSQL_DATABASE: example
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
data-manager:
image: madflojo/tarmac:unstable
env:
APP_ENABLE_TLS: false
APP_LISTEN_ADDR: 0.0.0.0:8080
APP_DEBUG: false
APP_TRACE: false
APP_WASM_FUNCTION_CONFIG: /config/tarmac.json
APP_ENABLE_SQL: true
APP_SQL_TYPE: mysql
APP_SQL_DSN: root:example@tcp(mysql:3306)/example
APP_ENABLE_KVSTORE: false
ports:
- 9080:8080
volumes:
- .:/config
- ./functions/build:/functions
lookup:
image: madflojo/tarmac:unstable
env:
APP_ENABLE_TLS: false
APP_LISTEN_ADDR: 0.0.0.0:8080
APP_DEBUG: false
APP_TRACE: false
APP_WASM_FUNCTION_CONFIG: /config/tarmac-basic.json
APP_ENABLE_SQL: true
APP_SQL_TYPE: mysql
APP_SQL_DSN: root:example@tcp(mysql:3306)/example
APP_ENABLE_KVSTORE: true
APP_KVSTORE_TYPE: in-memory
ports:
- 8080:8080
volumes:
- .:/config
- ./functions/build:/functions

steps:
- uses: actions/checkout@v3
- name: Run the Service
run: make run-background
- name: Wait for the Service to be ready
run: |
while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:8080/ready)" != "200" ]]; do sleep 5; done
- name: Run the load tests
run: make run-stress
while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://data-manager:9080/ready)" != "200" ]]; do sleep 5; done
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
- "APP_SQL_TYPE=mysql"
- "APP_SQL_DSN=root:example@tcp(mysql:3306)/example"
- "APP_ENABLE_KVSTORE=true"
- "APP_KVSTORE_TYPE=in-memory"
- "APP_KVSTORE_TYPE=redis"
- "APP_REDIS_SERVER=redis:6379"
volumes:
- "./config:/config"
Expand Down Expand Up @@ -50,7 +50,7 @@ services:
- "APP_SQL_TYPE=mysql"
- "APP_SQL_DSN=root:example@tcp(mysql:3306)/example"
- "APP_ENABLE_KVSTORE=true"
- "APP_KVSTORE_TYPE=in-memory"
- "APP_KVSTORE_TYPE=redis"
- "APP_REDIS_SERVER=redis:6379"
volumes:
- "./config:/config"
Expand Down

0 comments on commit 394ba1f

Please sign in to comment.