monasca-tempest-plugin/docker
Pierre Riteau 062cb7576a Fix Docker build
The default nodeset was just changed to focal [1], which in the absence
of the python-is-python3 package doesn't provide a python binary.

[1] https://review.opendev.org/c/opendev/base-jobs/+/789098

Change-Id: I55924ec1721181f8301357729df5d2c4abcad892
2021-05-20 18:33:53 +02:00
..
Dockerfile Replace git.openstack.org URLs with opendev.org URLs 2019-06-14 14:09:25 +00:00
README.rst Push Docker image to Docker Hub 2019-04-18 10:06:45 +00:00
build_image.sh Fix Docker build 2021-05-20 18:33:53 +02:00
health_check.py Create Docker image and build in Zuul 2019-03-25 14:58:24 +01:00
start.sh Add waiting for monasca-api before starting in docker 2019-04-16 14:40:10 +02:00
tempest.conf.j2 Create Docker image and build in Zuul 2019-03-25 14:58:24 +01:00

README.rst

Docker image for Monasca Monasca Temptest tests

This image could be used for running Tempest tests on Monasca installed in any way. After providing proper environment variables container could be started and will run tests based on what endpoints it will find in configured Keystone. Supported endpoints are monitoring and logs (Service Type in openstack endpoint list output).

Building monasca-base image

See https://github.com/openstack/monasca-common/tree/master/docker/README.rst

Building Docker image

Example:

$ ./build_image.sh <repository_version> <upper_constrains_branch> <common_version>

Everything after ./build_image.sh is optional and by default configured to get versions from Dockerfile. ./build_image.sh also contain more detailed build description.

How to start

To run, this container needs to connect to a working Keystone and Monasca API.

When using running Monasca in Docker you can connect this image to the network where Monasca is accessible and run all tests. Find network on machine with Monasca with docker network ls. For example you can see similar information to: e20533f6112c monasca-docker_default bridge local

Using this network run all tempest tests with following command:

docker run -it --rm --network=monasca-docker_default monasca/tempest-tests:master

It's important to configure all necessary connection environment variables. They are listed in the next two sections.

Example command to run tempest tests with custom variables:

``docker run -it --rm --network=monasca-docker_default --env-file=tempest_con.env monasca/tempest-tests:master``

In this example you configure all environment variables in tempest_con.env file:

KEYSTONE_IDENTITY_URI=http://172.17.0.1:35357
USE_DYNAMIC_CREDS=True
KEYSTONE_ADMIN_USER=mini-mon
KEYSTONE_ADMIN_PASSWORD=password
KEYSTONE_ADMIN_PROJECT=mini-mon
KEYSTONE_ADMIN_DOMAIN=Default
OS_AUTH_URL=http://172.17.0.1:35357/v3
OS_USERNAME=mini-mon
OS_PASSWORD=password
OS_PROJECT_NAME=mini-mon
OS_DOMAIN_NAME=Default

In order to run in docker-compose add this section to docker-compose.yaml:

tempest-tests:
  image: monasca/tempest-tests:master
  environment:
    KEYSTONE_IDENTITY_URI: "http://keystone:35357"

Environment variables

Variable Default Description
USE_DYNAMIC_CREDS True Create dynamic credentials for tests
KEYSTONE_ADMIN_USER mini-mon OpenStack administrator user name
KEYSTONE_ADMIN_PASSWORD password OpenStack administrator user password
KEYSTONE_ADMIN_PROJECT mini-mon OpenStack administrator tenant name
KEYSTONE_ADMIN_DOMAIN Default OpenStack administrator domain
OS_AUTH_URL http://keystone:35357/v3 Versioned Keystone URL
OS_USERNAME mini-mon Keystone user name
OS_PASSWORD password Keystone user password
OS_PROJECT_NAME mini-mon Keystone user project name
OS_DOMAIN_NAME Default Keystone user domain name
IDENTITY_URI http://keystone:35357/v2.0/ Full URI of the Keystone, v2
IDENTITY_URI_V3 http://keystone:35357/v3/ Full URI of the Keystone, v3
LOG_LEVEL INFO Log level for root logging
STAY_ALIVE_ON_FAILURE false If true, container runs 2 hours after service fail

Wait scripts environment variables

Variable Default Description
KEYSTONE_IDENTITY_URI http://keystone:35357 URI to Keystone admin endpoint
MONASCA_WAIT_FOR_API true If true, ensure Monasca API is available
MONASCA_API_WAIT_RETRIES 24 Retries for Monasca API availability checks
MONASCA_API_WAIT_INTERVAL 5 Sleep time between Monasca API retries

Scripts

start.sh

In this starting script provide all steps that lead to the proper service start. Including usage of wait scripts and templating of configuration files. You also could provide the ability to allow running container after service died for easier debugging.

health_check.py

This file will be used for checking the status of the application.

https://docs.openstack.org/monasca-api/latest/

https://github.com/openstack/monasca-api/blob/master/README.rst