baangtDB - the big brother of baangt UI and CLI

bernhardbuhl 99b2d91083 Updates KFZ, RS, Wohnen 6 months ago
api 922a9ad190 Bump 1.2.6 to 1.2.7 11 months ago
files 6ff770a214 Run TestRun on Local system functionality. 11 months ago
mysql 2ce252e2b4 run baangtDB with mysql 1 year ago
postgres 056491eac7 permanent db in docker 1 year ago
ui 99b2d91083 Updates KFZ, RS, Wohnen 6 months ago
.gitignore ef19aa95ab clean-up 1 year ago
Readme.md 056491eac7 permanent db in docker 1 year ago
baangt_services.png 334eb052b2 initial v0.1 1 year ago
docker-compose.dev.yml 579c3a2063 docker env for tests and services 1 year ago
docker-compose.mysql.yml 579c3a2063 docker env for tests and services 1 year ago
docker-compose.test.yml 579c3a2063 docker env for tests and services 1 year ago
docker-compose.yml 579c3a2063 docker env for tests and services 1 year ago
requirements.test.txt 579c3a2063 docker env for tests and services 1 year ago
run_services_db_permanent.sh f974eecc45 run baangt Testruns with noCloneXls=False 1 year ago
run_services_in_docker.sh 579c3a2063 docker env for tests and services 1 year ago
run_services_with_mysql.sh 9627fd9485 mysql support in docker 1 year ago
run_tests.sh 579c3a2063 docker env for tests and services 1 year ago
start_mysql_container.sh 3764499dcd documentations 1 year ago
stop_docker.sh 9f6350ec62 added header 11 months ago

Readme.md

baangt Web-Services

baangt Web-Services provide a simple way to define and run tests within baangt test suite.

Components

baangt UI Web-Service — Web UI providing functionality for definition of the baangt tests including import and export features

baangt Execution API — Service endpoints for running and retrieving results of the baangt tests

baangt Data Files — File storage service to handles baangt Data Files

Design

baangt Services

Run on Docker Containers

baangt Services are available in docker containers. Just execute

./run_services_in_docker.sh

Script run_services_in_docker.sh builds 3 baangt images:

  • baangt-file:latest (baangt Data Files)
  • baangt-api:latest (baangt Execution API)
  • baangt-ui:latest (baangt UI Web-Service)

and runs 6 docker containers on the default ports:

  • postgres (baangt database on port 5430)
  • redis (Redis server on port 6380)
  • rq-worker (Redis Queue worker)
  • baangt-file (baangt Data Files on port 5050)
  • baangt-api (baangt Execution API on port 5000)
  • baangt-ui (baangt UI Web-Service on port 80)

The script accepts the following optional arguments:

Argument Description
-ui {PORT} customize running port for baangt-ui container
-api {PORT} customize running port for baangt-api container
-df {PORT} customize running port for baangt-file container
-rd {PORT} customize running port for redis container
-ps {PORT} customize running port for postgres container
-b skip building docker images
stop stop all six baangt containers

For example, to use existing baangt images and run baangt UI Web-Service on port 8080 use:

./run_services_in_docker.sh -b -ui 8080

To stop all baangt containers use:

./run_services_in_docker.sh stop

NOTE:
The described above method launches baangt Services with the following databases:

  • baangt Testrun definitions in the default location sqlite:///testrun.db (within docker container baangt-ui)
  • baangt Testrun results in the docker container postgres

Other options

Run baangt Services with MySQL

Alternatively, you may start docker container with two MySQL databases (definition for baangt Testrun definitions and execution for baangt Testrun results) by executing

./start_mysql_container.sh

with optional parameter that specifies the MySQL running port.
Wait until the status of the mysql container will be healthly: see STATUS under docker ps

$ docker ps
CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS                    PORTS                               NAMES
8bb944f3de6b        mysql-baangt:latest   "/entrypoint.sh mysq…"   25 minutes ago      Up 24 minutes (healthy)   33060/tcp, 0.0.0.0:3305->3306/tcp   mysql

Then execute

./run_services_with_mysql.sh

to launch the other needed containers.

Run baangt Services with Permanent Databases

For the long-term testing you may want to use permanent databases (local or permanent docker containers -- without attribute --rm). To achieve that just adjust the values of the environmental variables DATABASE_URL in a run_services...sh script

docker run -d --name rq-worker... -e DATABASE_URL=<url_of_baangt_testrun_RESULTS_database>...
docker run -d --name baangt-api... -e DATABASE_URL=<url_of_baangt_testrun_RESULTS_database>...
docker run -d --name baangt-ui... -e DATABASE_URL=<url_of_baangt_testrun_DEFINITIONS_database>...

As an example you may try the run_services_db_permanent.sh script. It builds baangt-postgres:latest image and runs baangt-postgres container with two databases:

  • definition holds baangt Testrun definitions
  • execution holds baangt Testrun results

The container is run without --rm flag and could be reused again on the next execution of the run_services_db_permanent.sh script.

IMPORTANT!!!
Using the command

docker container prune

will delete the baangt-postgres when it is stopped.