Package: im-squad
Squonk2 AdminSquAd(Squonk2 Administration) is s Textual-UI (TUI) for the
visualisation and administration of Squonk2 environments.SquAdis
designed to be used by those with Squonk2 administrative privileges,
it’s of little use to users who are not administrators.SquAduses thesquonk2-python-clientto interact with a Squonk2 environment
and uses Will McGugan’stextualframework to provide the user with a simple,
text-based user interface modelled on the populark9sKubernetes monitor.
At the momentSquAdis provides non-destructive,read-onlyaccess to the
chosen Squonk2 environment.SquAdisNOTan alternative to (or replacement for) the existingData Manager UI. The role ofSquAdis to provide a simple and lightweight
Data Manager (and Account Server)monitor, with administrator-only
features not available in the UI.ImportantlySquAdshould be a “rapid development” platform where we
can add features quickly using a lightweight display framework.SquAdfails if we spend too much time battling with the UI.We choseTextualbecause it…has had some favorable reviewsworksis extremely lightweightis under active developmentInstallationSquAdis a Python application, written with Python 3.10 and published
toPyPIand is easily installed usingpip:pip install im-squadExecutionBefore runningSquAdyou must have access to a Squonk2 environment.SquAdobtains details of the environment through a YAML-basedenvironmentsfile. An example file,environments, is located in the root
of this project:---# An example SquAd environments file.## It provides all the connection details for one or more Squonk2 environments.# It is expected to be found in the user's home directory# as '~/.squad/environments' or the user can 'point' to it by setting# 'SQUAD_ENVIRONMENT_FILE', e.g. 'export SQUAD_ENVIRONMENT_FILE=~/my-env'# The 'environments' block defines one or more environments.# Each has a name. Here we define an environment called 'site-a'# but environments can be called anything YAML accepts as a key,# although it would aid consistency if you restrict your names to letters# and hyphens.environments:site-a:# The hostname of the keycloak server, without a 'http' prefix# and without a '/auth' suffix.keycloak-hostname:example.com# The realm name used for the Squonk2 environment.keycloak-realm:squonk2# The Keycloak client IDs of the Account Server and Data Manager.# The Account Server client ID is optional.keycloak-as-client-id:account-server-apikeycloak-dm-client-id:data-manager-api# The hostnames of the Account Server and Data Manager APIs,# without a 'http' prefix and without an 'api' suffix.# If you have not provided an Account Server client ID its# hostname value is not required.as-hostname:as.example.comdm-hostname:dm.example.com# The username and password of an admin user that has access# to the Account Server and Data Manager.# The user *MUST* have admin rights.admin-user:dlisteradmin-password:blob1234# The final part of the file is a 'default' property,# which SquAd uses to select the an environment from the block above# when all else fails. It's simply the name of one of the environment# declarations above.default:site-aWhenSquAdstarts it will look for the environments file in your home
directory, in the file~/.squonk2/environments. If you place your populated
environments file there you need do nothing else prior to runningSquAd.
If you prefer to put yourenvironmentsfile elsewhere, or have multiple
files, set the path to your file using the environment variableSQUONK2_ENVIRONMENTS_FILE:export SQUONK2_ENVIRONMENTS_FILE=~/my-squonk2-environmentsWith an environments file in place you can runSquAd:squadAs an alternative to having separateenvironmentsfiles for each Squonk2
environment, you can populate the file with the details of more than one
Squonk2 environment, giving each a unique name. If you do this
you can select them when you launchSquAdby providing the
the name of the environment on the command-line.For example, if you have anenvironmentsfile with details of two
environments calledsite-aandsite-byou can runSquAdwith
the command:squad site-aor:squad site-bOne environment has be be named in theenvironmentsdeafultproperty
(maybe yourgo toenvironment) but using this technique you can quickly
switch between environments, or have multipleSquAdapplications running,
using a single file.LoggingYou can enable logging fromSquAdand the underlying textual framework by
setting the environment variableSQUONK2_LOGFILEwhen running the
application:SQUONK2_LOGFILE=./squad.log squadDebuggingTextualdoesn’t like anything being written to the console so printing
(even tostderr) will topple the display. That’s whystderris
diverted when the application is running and nothing is printed.
There comes a time, though, when you need to see the error log.
For these times you can runSquAdwithout stderr diverted:squad --enable-stderr