Skip to content

523. Test suite launch

You can launch and monitor OSC2 test suites from Foretify Manager using the Dispatcher.

In order to enable the Dispatcher to work with Foretify Manager, you need to install the Dispatcher as described in Dispatcher Installation, add some configuration options, and rebuild the Docker images.

523.1 Configure the Dispatcher

The Dispatcher’s configuration file dispatcher.env must be extended to work with Foretify Manager.

The following options should be configured:

  • FMANAGER_URL: Enables the Dispatcher to make API calls to Foretify Manager.
  • FMANAGER_USER, FMANAGER_PASSWORD: The credentials used by Dispatcher to communicate with Foretify Manager. By default set to dispatcher:dispatcher, which is a built-in user in Foretify Manager created for this purpose.
  • UPLOAD_JOBS_TIME_INTERVAL_IN_MILLIS, UPLOAD_JOBS_PAGE_SIZE: Specifies the configuration for auto-upload of Foretify jobs to Foretify Manager. If not set, auto-upload is disabled. As the name suggests, these settings determine the latency between API calls to Foretify Manager for uploading completed runs and the batch size for each upload, respectively.
  • UPLOADED_STORAGE_PATH: Specifies a path to a directory located under the shared directory where files uploaded from the client will be stored (e.g. user-defined FRun CSVs).

The following file configures the Dispatcher to upload up to 20 runs every 7 seconds.

dispatcher.env example
# Foretify Manager credentials for Dispatcher data uploader user
FMANAGER_USER=dispatcher
FMANAGER_PASSWORD=dispatcher

# Auto upload related configuration
UPLOAD_JOBS_TIME_INTERVAL_IN_MILLIS=7000
UPLOAD_JOBS_PAGE_SIZE=20

UPLOADED_STORAGE_PATH=</PATH/TO/SHARED_DIR>

523.2 Configure Foretify Manager

Foretify Manager's configuration file application.properties must be extended in order to be enable use of the Dispatcher.

The following options should be configured:

  • dispatcher.fmanagerUser, dispatcher.fmanagerPassword: Same as in dispatcher.env. These are the credentials the Dispatcher will use when communicating with Foretify Manager (defaults are dispatcher:dispatcher)
  • dispatcher.ftxLicense: The Foretify license server to use when running Foretify via the Dispatcher. This is the same value FTX_LIC_FILE is set to when running Foretify.
  • dispatcher.fmanagerHost: The Foretify Manager host address used for callbacks from the Dispatcher to Foretify Manager.
  • dispatcher.pythonInImage: The Python binary to be used in the container while executing Python scripts (default is python3).
  • dispatcher.sharedFolder: The shared directory that is mounted int the Dispatcher’s Docker containers. This is the same one as defined in the Kubernetes Orchestrator configuration.
  • dispatcher.frunPath: Path to the FRun script. Can be either in the shared folder or the Docker image.
  • dispatcher.launchRegressionScriptPath, dispatcher.defaultWorkdirForGenerateRegressions: Dependencies for generating regressions (see below).
  • tasks.test-run-groups-monitoring.enabled: A Boolean value that turns on the job monitoring process in Foretify Manager. Should be always set to true when working with the Dispatcher.
  • dispatcher.defaultDispatcherHost, dispatcher.defaultDispatcherPort: The host and port where the Dispatcher is running (defaults are localhost:8081).
  • dispatcher.enableOptimizeCrunLimit (optional): A Boolean value that when set to true enables Foretify Manager to automatically optimize the dispatching of jobs per regression (default is true). See Crun optimization for more details.
  • dispatcher.defaultInitialCrunLimit (optional): An initial “guess” for the crun optimization algorithm, which is history adaptive (default is 2).

For example:

application.properties example
dispatcher.defaultDispatcherHost=localhost
dispatcher.defaultDispatcherPort=8081
dispatcher.fmanagerUser=dispatcher
dispatcher.fmanagerPassword=dispatcher
dispatcher.ftxLicense=27000@10.1.185.192

# Configuration required for launching:
dispatcher.fmanagerHost=10.1.185.192
dispatcher.pythonInImage=python3
dispatcher.sharedFolder=/clusters/microk8s/shared

# Paths here are inside the docker image:
dispatcher.frunPath=/ftx/bin/frun_pkg/frun
dispatcher.launchRegressionScriptPath=/dispatcher_runs_generator/dispatcher_regression_generator/src/generate_regression_using_frun.py
dispatcher.defaultWorkdirForGenerateRegressions=/dispatcher_runs_generator/run_groups_generation

523.3 Build the Foretify Docker image

Foretify Manager requires that the Foretify Docker image include an additional package and associated dependencies.

To build the Foretify Docker image, follow the instructions from the Dispatcher installation except with the following additional steps:

  1. Obtain the tarball containing the Frun-proxy script used for launching regressions (dispacher_runs_generator_VERSION.tar.gz).
  2. Untar the Frun-proxy script tarball in the same directory as the Dockerfile and Foretify installation.
  3. Add the following lines to the Dockerfile:
RUN apt-get update && apt-get install -y python3.8 python3.8-dev python3.8-distutils python3-pip ksh tcsh sudo acl
COPY dispacher_runs_generator /dispacher_runs_generator
RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install $(readlink -f /dispacher_runs_generator/fmanager_python_sdk-ver-py3-none-any.whl)[s3,okta,azure]
  1. Continue the instructions on the Dispatcher installation page to build the Foretify image.

523.4 Launch a test suite via Foretify Manager

For information on how to launch a test suite, monitor the progress and analyze failed launches, see Launch and manage test suites for more information.