Package: empaia-app-test-suite
EMPAIA App Test Suite (EATS)RequirementsThe EMPAIA App Test Suite requires Python 3.8.Supported Operating Systems are Linux, Windows and MacOSforWindowsthe EATS requires the usage of WSL 2 (Windows Subsystem for Linux) with Docker for WindowsInstallationThere are different possibilities to install the EMPAIA App Test Suite depending on your intended use:Installation as App DeveloperLatest stable releaseLatest test releaseBuild and installation as EATS DeveloperInstallation as App Developer - Latest stable releaseInstallation viapipfrom Python Package Index (PyPI).# create virtual environment (recommended)python3-mvenv.venvsource.venv/bin/activate# install with pippipinstallempaia-app-test-suiteInstallation as App Developer - Latest test releaseInstallation viapipfrom Python Package Index Test Repository (Test.PyPI).# create virtual environment (recommended)python3-mvenv.venvsource.venv/bin/activate# install with pip from test.pypi.orgpipinstall-ihttps://test.pypi.org/simple/--extra-index-urlhttps://pypi.org/simple/empaia-app-test-suiteBuild and installation as EATS DeveloperClone the EATS source code repository.This module uses submodules, i.e. references to other git repositories. Add--recurse-submoduleto your clone command to also get all submodules, e.g.gitclone--recurse-submodulehttps://gitlab.com/empaia/integration/empaia-app-test-suite.gitcdempaia-app-test-suite### also after changing branchgitsubmoduleupdate--init--recursiveBuild the EATS CLI app and install all needed dependencies:# create virtual environment (recommended)python3-mvenv.venvsource.venv/bin/activate# build / install EATS and dependenciespoetryinstallRun EATSRun the EATS CLI app witheatsTo force pull and build services and submodules:eatsservicesup./wsi-mount-points.json--build--pullUsageFor detailed instructions take a look at theApp Developer DocumentationDefine absolute paths to directories containing WSIs in a./wsi-mount-points.jsonfile as follows:{"/absolute/local/path/to/wsis/dir1":"/data/","/absolute/local/path/to/wsis/dir2":"/data2/"}Start all backend services in Docker containers using theeats services upcommand. WSI directories are mounted into the WSI Service container. Only WSIs contained in one of the specified directories can be used as a job input.eatsservicesup./wsi-mount-points.jsonYou can perform health checks of running backend services.eatsserviceshealthRegister your app with its<docker-image-name>(can be fully qualified docker registry url, e.g.registry.gitlab.com/empaia/integration/sample-apps/v3/org-empaia-vendor_name-tutorial_app_01:v3.0). Also provide the path to youread.json. If your app required configuration parameters, use the--global-config-fileand / or--customer-config-fileflag to specify the path to you configuration.eatsappsregister<path-to-ead.json><docker-image-name>>app.env# or with configurationeatsappsregister<path-to-ead.json><docker-image-name>--global-config-file<path-to-configuration.json>--customer-config-file<path-to-configuration.json>>app.env# export the app id for later useexport$(xargs<app.env)echo$APP_IDUse the APP_ID together with your JSON files for your data inputs in ajob-inputsdirectory to register ar new job.eatsjobsregister$APP_ID<path-to-job-inputs>>job.envThe generatedjob.envfile contains theEMPAIA_JOB_ID,EMPAIA_TOKEN, andEMPAIA_APP_APIenvironment variables, that are handed to your app during theeats jobs runstep.eatsjobsrun./job.envThe job ID can be retrieved from thejob.envfile to be used in other commands.export$(xargs<job.env)echo$EMPAIA_JOB_IDRegularly check the jobs status until it isCOMPLETED.eatsjobsstatus${EMPAIA_JOB_ID}The job ID is used as the container name. It can be used to retrieved docker logs.dockerlogs${EMPAIA_JOB_ID}Openlocalhost:8888/wbc3in a Browser to review job results using the Workbench Client 3.0.In addition, the job results can be exported to JSON files in ajob-outputsdirectory.eatsjobsexport${EMPAIA_JOB_ID}./job-outputsIf a job is taking too long or is stuck, the job can be aborted.eatsjobsabort${EMPAIA_JOB_ID}To inspect backend service logs thedocker logscommand can used directly. The names of all service containers can be retrieved using theeats services listcommand.eatsserviceslist# print list of service namesdockerlogs${SERVICE_NAME}It is possible to register and run multiple jobs without restart backend services. The services can be stopped, if they are not needed anymore. All created data is available when the services are started again.eatsservicesdownTo erase all created data useeats services down -vto remove all created docker volumes ordocker volume rmdirectly.eatsservicesdown-v# ordockervolumerm$(eatsservicesvolumes)For EATS DevelopersCode ChecksCheck your code before committing.always format code withblackandisortcheck code quality usingpycodestyleandpylintblackformatting should resolve most issues forpycodestyleisort.
blackempaia_app_test_suitetestscheck_version.py
pycodestyleempaia_app_test_suitetestscheck_version.py
pylintempaia_app_test_suitetestscheck_version.pyTestsCreate./wsi-mount-points.json:{"/path/to/testdata/Aperio/":"/data","/path/to/testdata/Fluorescence OME-Tif/":"/data2"}# run cli command testspytesttests/commands--maxfail=1-s-v

eatsservicesup./wsi-mount-points.json--build--pull# run sample apps testspytesttests/sample_apps_tests--maxfail=1-s-vIf a test fromtests/sample_appsfails, usedocker logs <servicename>for debugging.Test GPU supporteatsservicesup./wsi-mount-points.json--build--pull--gpu-drivernvidia# run cli command testpytesttests/gpu_support_testIf docker is locally installed with support for CUDA and a supported GPU is available on the host system the test must succeed. If the test fails please check if docker is correctly installed.