Package: argus-alm
ArgusDescriptionArgus is a test tracking system intended to provide observability into automated test pipelines which use long-running resources. It allows observation of a test status, its events and its allocated resources. It also allows easy comparison between particular runs of a specific test.Installation notesPrerequisitesPython >=3.10.0 (system-wide or pyenv)NodeJS >=16 (with npm)Yarn (can be installed globally withnpm -g install yarn)nginxpoetry >=1.2.0b1From sourceProductionPerform the following steps:Create a user that will be used by uwsgi:useradd-m-s/bin/bashargus
sudo-iuargus(Optional) Install pyenv and create a virtualenv for this user:pyenvinstall3.10.0
pyenvvirtualenvargus
pyenvactivateargusClone the project into a directory somewhere where user has full write permissionsgitclonehttps://github.com/scylladb/argus~/appcd~/appInstall project dependencies:poetryinstall--withdefault,dev,web-backend,docker-image
yarninstallCompile frontend files from/frontendinto/public/distyarnwebpackCreate aargus.local.yamlconfiguration file (used to configure database connection) and aargus_web.yaml(used for webapp secrets) in your application install directory.cpargus_web.example.yamlargus_web.yaml
cpargus.yamlargus.local.yamlOpenargus.local.yamland add the database connection information (contact_points, user, password and keyspace name).Openargus_web.yamland change theSECRET_KEYvalue to something secure, like a sha512 digest of random bytes. Fill out GITHUB_* variables with their respective values.Copy nginx configuration file fromdocs/configs/argus.nginx.confto nginx virtual hosts directory:Ubuntu:sudocpdocs/configs/argus.nginx.conf/etc/nginx/sites-available/argus
sudoln-s/etc/nginx/sites-enabled/argus/etc/nginx/sites-available/argusRHEL/Centos/Alma/Fedora:sudocpdocs/configs/argus.nginx.conf/etc/nginx/conf.d/argus.confAdjust the webhost settings in that file as necessary, particularlylistenandserver_namedirectives.Copy systemd service file fromdocs/config/argus.serviceto/etc/systemd/systemdirectory:sudocpdocs/config/argus.service/etc/systemd/systemOpen it and adjust the path to thestart_argus.shscript in theExecStart=directive and the user/group, then reload systemd daemon configuration and enable (and optionally start) the service.WARNING:start_argus.shassumes pyenv is installed into~/.pyenvsudosystemctldaemon-reload
sudosystemctlenable--nowargus.serviceDevelopmentClone the project into a directory somewheregitclonehttps://github.com/scylladb/arguscdargusInstall project dependencies:poetryinstall--withdefault,dev,web-backend,docker-image
yarninstallCompile frontend files from/frontendinto/public/dist. Add --watch to recompile files on change.yarnwebpack--watchConfigurationCreate aargus.local.yamlconfiguration file (used to configure database connection) and aargus_web.yaml(used for webapp secrets) in your application install directory.SeeProductionsection for more details.
To configure Github authentication follow steps:Authorize OAuth Appgo to your Account Settings (top right corner) -> Developer settings (left pane) -> OAuth AppsClick Create New OAuth App buttonFill the fields (app name:argus-dev, homepage URLhttp://localhost:5000, Auth callback URL:http://localhost:5000/profile/oauth/github)Confirm and get the tokens/ids required for configCreate Jenkins token for your accountGo toConfigurein top right cornerClickAdd new TokenGet it and paste to config toJENKINS_API_TOKENparamDatabase InitializationYou can initialize a scylla cluster in any way you like, either using docker image with docker-compose or using cassandra cluster manager. You will need to create the keyspace manually before you can sync database models.Create keyspace according to your configuration.
e.g. (need to test if it works with RF=1 if not, make it 3)CREATE KEYSPACE argus WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 1}Initial sync can be done as follows:fromargus.backend.dbimportScyllaClusterfromargus.db.testrunimportTestRundb=ScyllaCluster.get()db.sync_models()# Syncronizes Object Mapper modelsTestRun.init_own_table()# Syncronizes TestRun table (separate from python-driver Object Mapper)You can also useflask sync-modelsafterwards during development when making small changes to models.It is recommended to set up jenkins api key and runflask scan-jenkinsafterwards to get basic release/group/test structure.There are scripts in./scriptsdirectory that can be used to download data from production, upload them into your dev db and fix their relations to other models in your instance of the application. Specifically,download_runs_from_prod.pyrequires additional config,argus.local.prod.yamlwhich is the config used to connect to the production cluster. The scripts are split to prevent mistakes and accidentally affecting production cluster.ConfigurationCreate aargus.local.yamlconfiguration file (used to configure database connection) and aargus_web.yaml(used for webapp secrets) in your application install directory.cpargus_web.example.yamlargus_web.yaml
cpargus.yamlargus.local.yamlOpenargus.local.yamland add the database connection information (contact_points, user, password and keyspace name).Openargus_web.yamland change theSECRET_KEYvalue to something secure, like a sha512 digest of random bytes. Fill out GITHUB_* and JENKINS_* variables with their respective values.Run the application from CLI using:FLASK_ENV="development"FLASK_APP="argus_backend:start_server"FLASK_DEBUG=1CQLENG_ALLOW_SCHEMA_MANAGEMENT=1flaskrunOmitFLASK_DEBUGif running your own debugger (pdb, pycharm, vscode)