Install Allure TestOps using packages

Install Allure TestOps using packages

We support packaged installation using deb and rpm packages.

Important updates - 2022-04-29

Starting from the 30th of April and release 3.193.1 we moved the packages repo to our own artifactory service — dl.qameta.io.

What does it mean for the packages users?

You need to update your settings for packages download.

If your old credentials aren’t working, please feel free to contact our support and we’ll provide the new ones.

Credentials

By default we send our clients the credentials for docker-compose / Kubernetes installation, i.e. for pulling the images.

To be able to download and install packages from our artifactory you need to have the credentials specific for packages installation.

Credentials are to be requested using our help desk. Please state the company name used to get the licence and include “credentials for packages installation” into the subject of your request.

Types of packages

There are 2 types of the packages available:

  • Minimal package
  • Box package

Minimal package

Minimal package contains only Allure TestOps binaries

  1. Allure TestOps uaa service
  2. Allure TestOps gateway service
  3. Allure TestOps report service

Minimal package is your solution if you already have your own infrastructure in place with all needed additional services, or you are going to install other services needed for Allure TestOps to run separately:

  • Amazon Corretto JDK 17
  • Consul
  • RabbitMQ
  • S3 solution (e.g. min.io)
  • Postgres database server release no lower than 12
  • Redis
  • nginx
  • Min.io

Box package

Box package includes all the additional applications/services required for Allure TestOps to start up and operate.

So, all the tools will be installed, set up and started with Allure TestOps.

Deb packages

mlocate installation

You need to install mlocate tool first.

The tool is used to avoid the need to have elevated privileges during the release upgrade process.

apt install -y mlocate

The following actions need to be performed to add Qameta Software’s artifactory to your packages manager:

  1. Copy all the lines from below:

    cat << EOF >> /etc/apt/sources.list.d/qameta.list
    deb [trusted=yes] https://dl.qameta.io/artifactory/debian stable main
    deb [trusted=yes] https://dl.qameta.io/artifactory/debian focal main
    deb [trusted=yes] https://dl.qameta.io/artifactory/debian focal-pgdg main
    deb [trusted=yes] https://dl.qameta.io/artifactory/deb-local stable main
    EOF
    
  2. Start your terminal application

  3. Type ‘sudo su’ if you are not a root user, then enter you password when prompted.

  4. Paste the text in the terminal application and press Enter.

  5. Check the file has been indeed updated

    cat /etc/apt/sources.list.d/qameta.list
    
  6. Copy all the following lines to a text editor

    cat << EOF >> /etc/apt/auth.conf.d/qameta.conf
    machine dl.qameta.io login <username> password <password>
    EOF
    
  7. Update the strings as follows

    • replace <username> with your user name for dl.qameta.io
    • replace <password> with your password for dl.qameta.io
  8. Copy updated string to the terminal and execute it.

  9. Check the file has been indeed updated

    cat /etc/apt/auth.conf.d/qameta.conf
    
  10. Execute one of the following commands in the terminal

    • Always use Allure TestOps release ID explicitly for the installation. You can check release notes page release notes pages for actual release.
    • for box package
        apt update && apt install allure-testops-box=3.193.0
    
    • for min package
        apt update && apt install allure-testops-min=3.193.0
    
    • Do not use apt upgrade for the release upgrades as it could install a release candidate which stop your production environment and you won’t be able to roll back changes due to database schema incompatibility.

Deb packages’ configuration files

The configuration files and way to configure Allure TestOps’ service has been changed comparing to the way it was done before the 30th of April 2022.

Configuration files paths

For Debian-like OSs the configuration files of Allure TestOps services reside in /opt/allure-testops

For the gateway service

/opt/allure-testops/gateway/conf/allure-gateway.conf

For the uaa service

/opt/allure-testops/uaa/conf/allure-uaa.conf

For the report service

/opt/allure-testops/report/conf/allure-report.conf

Configuration

Configuration is now being done via set of environment variables stored in a allure-<service>.conf file specific for each of Allure TestOps services.

Initial installation of Allure TestOps contains the set of Environment variables sufficient to successfully bring Allure TestOps up.

All additional settings required for the integration is described in further sections of this very article.

RPM packages

The following actions need to be performed to add Qameta Software’s artifactory to your packages manager:

mlocate installation

You need to install mlocate tool first.

The tool is used to avoid the need to have elevated privileges during the release upgrade process.

yum install -y mlocate

Pre-installation script

  1. Start terminal application on your server (either locally or using ssh)

  2. execute yum yum check-update && yum upgrade

  3. Copy the content from the snippet below and save it as pre-install.sh on your server.

    #!/bin/bash
    yum install -y curl epel-release yum-utils
    # Amazon Coretto
    rpm --import https://yum.corretto.aws/corretto.key
    curl -L -o /etc/yum.repos.d/corretto.repo https://yum.corretto.aws/corretto.repo
    yum install -y java-17-amazon-corretto-devel
    source /etc/os-release
    # Postgres
    yum install -y "https://download.postgresql.org/pub/repos/yum/reporpms/EL-${VERSION_ID}-$(arch)/pgdg-redhat-repo-latest.noarch.rpm"
    if (( $VERSION_ID > 7 )); then
    dnf -qy module disable postgresql
    fi
    yum install -y postgresql14-server
    /usr/pgsql-14/bin/postgresql-14-setup initdb
    systemctl enable postgresql-14
    systemctl start postgresql-14
    # Consul
    yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
    yum -y install consul
    # RabbitMQ
    curl -1sLf 'https://dl.cloudsmith.io/public/rabbitmq/rabbitmq-erlang/setup.rpm.sh' | sudo bash
    yum install socat logrotate initscripts -y
    yum install -y erlang
    yum install -y https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.9.14/rabbitmq-server-3.9.14-1.el8.noarch.rpm
    chkconfig rabbitmq-server on
    /sbin/service rabbitmq-server start
    
  4. Make pre-install.sh executable and execute the script

    • chmod +x pre-install.sh
    • execute the script as ./pre-install.sh
  5. Type ‘sudo su’ if you are not a root user, then enter you password when prompted.

  6. Copy the following lines to a text editor as you are going to update these:

    cat << EOF >> /etc/yum.repos.d/qameta.repo
    [Qameta]
    name=Qameta
    baseurl=https://<username>:<password>@dl.qameta.io/artifactory/rhel/
    enabled=1
    gpgcheck=0
    EOF
    
    
  7. Update the strings as follows

  • replace <username> with your user name for dl.qameta.io
  • replace <password> with your password for dl.qameta.io
  1. Copy updated string to the terminal and execute it.

  2. Check the file has been indeed updated

    cat /etc/yum.repos.d/qameta.repo
    
  3. Execute one of the following commands in the terminal

    • for box package (Allure TestOps with all needed services)
        yum install allure-testops-box-0:3.193.0-1
    
    • for min package (only Allure TestOps)
        yum install allure-testops-min-0:3.193.0-1
    
    • Always use Allure TestOps release ID explicitly for the installation. You can check release notes page release notes pages for actual release.

RPM packages’ configuration files

The configuration files and way to configure Allure TestOps’ service has been changed comparing to the way it was done before the 30th of April 2022.

Configuration files paths

For Debian-like OSs the configuration files of Allure TestOps services reside in /opt/allure-testops

For the gateway service

/opt/allure-testops/gateway/conf/allure-gateway.conf

For the uaa service

/opt/allure-testops/uaa/conf/allure-uaa.conf

For the report service

/opt/allure-testops/report/conf/allure-report.conf

Configuration

Configuration is now being done via set of environment variables stored in a allure-<service>.conf file specific for each of Allure TestOps services.

Initial installation of Allure TestOps contains the set of Environment variables sufficient to successfully bring Allure TestOps up.

All additional settings required for the integration is described in further sections of this very article.

Configuration of Allure TestOps

admin user log-in information

Allure TestOps requires admin (admin is the default user name for this user) account to be created and kept in the system. This name (admin) and password are defined in the configuration file (allure-uaa.conf) and it will be restored to the state described in the configuration file to ensure you won’t lose the access to your Allure TestOps instance, this means if you disable user admin in the UI, remove admin’s roles and change the password, during the next start of Allure TestOps, it will recreate the user again with all set of available rights, with the password defined in the configuration file.

Do not delete, disable or change the authorities set by the system to this user.

Please consider changing the admin’s password in the configuration before the deployment or remove it to have a new password each time system restarts.

If you omit provisioning of initial admin’s password, then default user admin will be created and admin’s strong password will be generated by the system, and then the generated password will be sent to the logs of uaa service.

Each time Allure TestOps is restarted, the admin‘s account is restored to its initial state as per the configuration file (allure-uaa.conf).

UAA service

UAA service’s configuration file resides as follows:

/opt/allure-testops/uaa/conf/allure-uaa.conf

General settings

Here are the recommended settings for the users registration

ALLURE_SECURITY_USER_NAME=admin
ALLURE_SECURITY_USER_PASSWORD=admin
ALLURE_REGISTRATION_ENABLED=false # it's a good idea to have this disabled in a production system
ALLURE_REGISTRATION_AUTOAPPROVE=false # it's a good idea to have this disabled in a production system
ALLURE_REGISTRATION_DEFAULT_ROLE=ROLE_AUDITOR # it's a good idea to have this like this in production

Consul settings

Consul’s settings used by default:

SPRING_CLOUD_CONSUL_HOST=localhost
SPRING_CLOUD_CONSUL_PORT=8500

If you have dedicated Consul server in your environment, you need to update these setting accordingly.

PostgreSQL settings

Default recommended settings for the database connection

SPRING_DATASOURCE_URL="jdbc:postgresql://localhost:5432/uaa?assumeMinServerVersion=11&ApplicationName=uaa-service"
SPRING_DATASOURCE_USERNAME=uaa
SPRING_DATASOURCE_PASSWORD=CjAXjUav3eh3cmWk

If you have dedicated database server (highly recommended for the production system) then you need to update the setting accordingly.

Allure Report

Report service’s configuration file resides as follows:

/opt/allure-testops/report/conf/allure-report.conf

Consul settings

Consul’s settings used by default:

SPRING_CLOUD_CONSUL_HOST=localhost
SPRING_CLOUD_CONSUL_PORT=8500

If you have dedicated Consul server in your environment, you need to update these setting accordingly.

PostgreSQL settings

Default recommended settings for the database connection

SPRING_DATASOURCE_URL="jdbc:postgresql://localhost:5432/report?assumeMinServerVersion=11&ApplicationName=report-service"
SPRING_DATASOURCE_USERNAME=report
SPRING_DATASOURCE_PASSWORD=GnNc9QQcLzZfhVNn

If you have dedicated database server (highly recommended for the production system) then you need to update the setting accordingly.

RabbitMQ settings

SPRING_RABBITMQ_HOST=localhost
SPRING_RABBITMQ_PORT=5672
SPRING_RABBITMQ_USERNAME=guest
SPRING_RABBITMQ_PASSWORD=guest

Storage setup (S3)

The storage type used by the installation by default is the S3 storage with min.io service under hood, this type of setup is recommended comparing to the file system storage as it is allowing more stable files processing.

The settings below are used by the installation by default.

ALLURE_BLOBSTORAGE_TYPE=S3
ALLURE_BLOBSTORAGE_S3_PATHSTYLEACCESS=true
ALLURE_BLOBSTORAGE_S3_ENDPOINT="http://localhost:9000"
ALLURE_BLOBSTORAGE_S3_BUCKET=allure-testops
ALLURE_BLOBSTORAGE_S3_REGION=qameta-0
ALLURE_BLOBSTORAGE_S3_ACCESSKEY=M8P2RAAa73KCBNmXKcp9csX5u5SXUg7L
ALLURE_BLOBSTORAGE_S3_SECRETKEY=YPZNUd5eULXGTZN9c9dNj8M4vffCpYPE

For a production system it is recommended to use Amazon AWS or a local S3 solution with SSD disks storage.

Allure Gateway

Gateway service’s configuration file resides as follows:

/opt/allure-testops/gateway/conf/allure-gateway.conf

ALLURE_JWT_SECRET=N7zaHAQYQ4XtQTz4vGvqt7Tkyjuesxcp
SPRING_SESSION_STORE_TYPE=REDIS
SPRING_REDIS_HOST=localhost
SPRING_REDIS_PORT=6379
SPRING_REDIS_PASSWORD=""
SPRING_CLOUD_CONSUL_ENABLED=true
SPRING_CLOUD_CONSUL_HOST=localhost
SPRING_CLOUD_CONSUL_PORT=8500

Managing Allure TestOps execution state

After Allure TestOps is installed it’ll be brought up automatically and enabled as service.

To manage the state of the applications you need to use the following commands:

Start Allure TestOps services

systemctl start allure-uaa
systemctl start allure-report
systemctl start allure-gateway

Restart Allure TestOps services

systemctl restart allure-uaa
systemctl restart allure-report
systemctl restart allure-gateway

Getting execution status of Allure TestOps services

systemctl status allure-uaa
systemctl status allure-report
systemctl status allure-gateway

Stopping Allure TestOps services

systemctl stop allure-uaa
systemctl stop allure-report
systemctl stop allure-gateway

Connecting to Allure TestOps UI

Allure Test UI by default is available on the port #8080.

So, you need to access it via URL

http://your_domain_or_ip:8080/

Initial login

Log in to Allure TestOps using username and password from /opt/allure-testops/uaa/conf/allure-uaa.conf configuration.

The username is admin and the password is either the default one or the password you’ve defined in the said file.

Provide the license for your Allure TestOps instance

Next thing you see will be the modal window to which you will need to provide the license you acquired.

if you see this write to support.qameta.io

After the correct license is provided, you’ll be able to start your work.

Upgrading the release of Allure TestOps

Please never use apt upgrade to upgrade the release of Allure TestOps. This command will install the latest binaries which could be a release candidate or an unstable version and this action could potentially lead your working processes to stop.

If you upgrade to an unstable release database changes will be applied and it won’t be possible to roll back the changes.

Deb packages

Always explicitly use the release you want to upgrade to. You can check release notes page release notes pages for actual release.

If you have installed Allure TestOps Box package with the release 3.193.0, and you want to upgrade the release to the hot-fix 3.193.1 you need to do the upgrade as follows:

Before upgrading

This behaviour will be changed in future but now you need to save the configuration files for each service and restore the configuration files after the upgrade.

cp /opt/allure-testops/gateway/conf/allure-gateway.conf ~/
cp /opt/allure-testops/report/conf/allure-report.conf ~/
cp /opt/allure-testops/uaa/conf/allure-uaa.conf ~/

Upgrading

sudo apt update
sudo apt-get install allure-testops-box=3.193.1

Wait at least one minute, so the initialization of the services has been completed.

After upgrading

We need to restore the previously saved configuration files and restart Allure TestOps services to apply saved configuartion.

cp ~/allure-gateway.conf /opt/allure-testops/gateway/conf/allure-gateway.conf
cp ~/allure-report.conf /opt/allure-testops/report/conf/allure-report.conf 
cp ~/allure-uaa.conf /opt/allure-testops/uaa/conf/allure-uaa.conf

systemctl restart allure-uaa && systemctl restart allure-report && systemctl restart allure-gateway

RPM packages

Always explicitly use the release you want to upgrade to. You can check release notes page release notes pages for actual release.

Before upgrading

This behaviour will be changed in future but now you need to save the configuration files for each service and restore the configuration files after the upgrade.

cp /opt/allure-testops/gateway/conf/allure-gateway.conf ~/
cp /opt/allure-testops/report/conf/allure-report.conf ~/
cp /opt/allure-testops/uaa/conf/allure-uaa.conf ~/

Upgrading

If you have installed Allure TestOps Box package with the release 3.193.0-1, and you want to upgrade the release to the hot-fix 3.193.1-1 you need to do the upgrade as follows:

yum install allure-testops-box-0:3.193.1-1

After upgrading

We need to restore the previously saved configuration files and restart Allure TestOps services to apply saved configuration.

cp ~/allure-gateway.conf /opt/allure-testops/gateway/conf/allure-gateway.conf
cp ~/allure-report.conf /opt/allure-testops/report/conf/allure-report.conf 
cp ~/allure-uaa.conf /opt/allure-testops/uaa/conf/allure-uaa.conf

systemctl restart allure-uaa && systemctl restart allure-report && systemctl restart allure-gateway

Troubleshooting Allure TestOps

By default all components write logs to stdout, you can get logs by journalctl:

journalctl -f -n 100 -u allure-uaa
journalctl -f -n 100 -u allure-report
journalctl -f -n 100 -u allure-gateway

where:

  • f - to follow the journal, i.e. all the new lines will be shown on the screen
  • n 100 - the number of journal entries to show
  • u name - name of a unit

To check the service status in consul

To show service status in consul use the URLs below, replace 127.0.0.1 by your actual consul IP address:

curl  http://127.0.0.1:8500/v1/health/service/allure-ee-gateway
curl  http://127.0.0.1:8500/v1/health/service/allure-ee-uaa
curl  http://127.0.0.1:8500/v1/health/service/allure-ee-report

Removing Allure TestOps

It is not clear at all, why are you going to do such a thing, but to remove Allure TestOps you need to do the following:

  1. Remove packages
  2. Remove configurations and assets

Deb packages

sudo apt autoremove allure-testops-box

This command will remove Allure TestOps and all the dependencies installed by apt install

RPM packages

yum remove allure-testops-box

Removing configurations and assets

rm -rf /opt/allure-testops

Using Allure TestOps with reverse proxy

If you want to use Allure TestOps with http/https, you should install nginx and certbot

Install nginx

sudo apt install nginx certbot

obtain a SSL certificate, where %%DOMAIN%% is your domain name.

certbot certonly -d %%DOMAIN%%

Nginx configuration

Put nginx config into file /etc/nginx/sites-available/allure.conf

cat << EOF > /etc/nginx/sites-available/allure.conf
upstream allure {
     server 127.0.0.1:8083 weight=1;
}

server {
   listen 80;
   server_name %%DOMAIN%%;
   return 301 https://$host$request_uri;
}

server {
   listen 0.0.0.0:443 ssl;
   server_name %%DOMAIN%%;
   ssl_certificate /etc/letsencrypt/live/%%DOMAIN%%/fullchain.pem;
   ssl_certificate_key /etc/letsencrypt/live/%%DOMAN%%/privkey.pem;
   ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
   ssl_protocols TLSv1.1 TLSv1.2;
   ssl_prefer_server_ciphers on;
   location / {
       proxy_pass http://allure;
       proxy_set_header Host $host;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_redirect off;
   }
}
EOF

Enable site

ln -s /etc/nginx/sites-available/allure.conf /etc/nginx/sites-enabled/allure.conf

Start nginx

systemctl start nginx
systemctl enable nginx

Connecting S3 storage

It is strongly advised using external storage for production system. By default for a Box package Allure TestOps uses min.io object storage.

To use other object storage like AWS, you need to update the following environment variables:

ALLURE_BLOBSTORAGE_TYPE=S3
ALLURE_BLOBSTORAGE_S3_PATHSTYLEACCESS=true
ALLURE_BLOBSTORAGE_S3_ENDPOINT="http://localhost:9000"
ALLURE_BLOBSTORAGE_S3_BUCKET=allure-testops
ALLURE_BLOBSTORAGE_S3_REGION=qameta-0
ALLURE_BLOBSTORAGE_S3_ACCESSKEY=M8P2RAAa73KCBNmXKcp9csX5u5SXUg7L
ALLURE_BLOBSTORAGE_S3_SECRETKEY=YPZNUd5eULXGTZN9c9dNj8M4vffCpYPE

ACL for S3

The following access policies are needed on S3 side for Allure TestOps to work correctly with the files in case of AWS usage.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "S3assets",
            "Effect": "Allow",
            "Action": [
                "s3:PutObjectAcl",
                "s3:PutObject",
                "s3:ListMultipartUploadParts",
                "s3:ListBucketMultipartUploads",
                "s3:ListBucket",
                "s3:GetObjectAcl",
                "s3:GetObject",
                "s3:GetBucketLocation",
                "s3:GetBucketAcl",
                "s3:DeleteObject"
            ],
            "Resource": [
                "arn:aws:s3:::<ALLURE_S3_BUCKET_NAME>/*",
                "arn:aws:s3:::<ALLURE_S3_BUCKET_NAME>"]
        }
    ]
}

Google S3

For Google S3 you need to use fine-granted access control and settings for public access Subject to object ACLs, this is needed for interoperability with AWS SDK, otherwise files in S3 bucket won’t be fully accessible by Allure TestOps and report service will fail to start.

The value Parameter allure.blob-storage.s3.endpoint for Google S3 should be https://storage.googleapis.com.

Preparation for the production deployment

Before putting your system to the production, please refer to the recommendations here.

If you have any doubts, please consult our tech support fellows.

Back to installation