Operational Guide

User Management

For PWA user management details, read User Management

Service Status

PWA runs in a Docker container; to list the containers running on the host, user the docker ps command.

$ sudo docker ps
[root@mca-nightly mj82]# docker ps
CONTAINER ID        IMAGE                 COMMAND                  CREATED             STATUS              PORTS                                                              NAMES
cc9137f3c1ec        perfsonar/pwa-admin   "/start.sh"              2 hours ago         Up 2 hours          80/tcp, 8080/tcp                                                   pwa-admin1
d23ed1cddbff        perfsonar/pwa-pub     "node /app/api/pwapu…"   2 hours ago         Up 2 hours          8080/tcp                                                           pwa-pub1
457a9ba151bf        nginx                 "nginx -g 'daemon of…"   11 days ago         Up 10 days          0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:9443->9443/tcp   nginx
301be8a679c7        perfsonar/sca-auth    "/app/docker/start.sh"   11 days ago         Up 11 days          80/tcp, 8080/tcp                                                   sca-auth
ccde4bfc7a2d        mongo                 "docker-entrypoint.s…"   11 days ago         Up 11 days          27017/tcp                                                          mongo

To see logs for a container, use the docker logs command.

$ sudo docker logs --tail 20 pwa-admin1

If you leave out the –tail parameter, it will show ALL the logs for that container, which may be quite long.

If you want to monitor a specific component within a container, PWA uses PM2 to manage its related services and load-balance incoming requests.

There are two ways to run commands within a docker container.

  1. docker exec -it <container> <command> - this allows you to execute something inside the container without actually interactively entering the container. This is useful for one-off or scripted commands.

    $ sudo docker exec -it pwa-admin1 pm2 logs
    
  2. docker exec -it <container> bash - this starts an interactive bash shell within the container.

You can see a list of services like this:

$ sudo docker exec -it pwa-admin1 pm2 logs
$ sudo docker exec -it pwa-admin1 bash
root@cc9137f3c1ec:/# pm2 status
┌──────────┬────┬──────┬─────┬────────┬─────────┬────────┬─────┬───────────┬──────┬──────────┐
│ App name │ id │ mode │ pid │ status │ restart │ uptime │ cpu │ mem       │ user │ watching │
├──────────┼────┼──────┼─────┼────────┼─────────┼────────┼─────┼───────────┼──────┼──────────┤
│ pwaadmin │ 1  │ fork │ 31  │ online │ 0       │ 2h     │ 0%  │ 44.2 MB   │ root │ disabled │
│ pwacache │ 2  │ fork │ 51  │ online │ 0       │ 2h     │ 0%  │ 49.6 MB   │ root │ disabled │
│ ui       │ 3  │ fork │ 67  │ online │ 0       │ 2h     │ 0%  │ 28.0 MB   │ root │ disabled │
└──────────┴────┴──────┴─────┴────────┴─────────┴────────┴─────┴───────────┴──────┴──────────┘
 Module activated
┌───────────────┬─────────┬────────────┬────────┬─────────┬─────┬─────────────┬──────┐
│ Module        │ version │ target PID │ status │ restart │ cpu │ memory      │ user │
├───────────────┼─────────┼────────────┼────────┼─────────┼─────┼─────────────┼──────┤
│ pm2-logrotate │ 2.6.0   │ N/A        │ online │ 0       │ 0%  │ 31.465 MB   │ root │
└───────────────┴─────────┴────────────┴────────┴─────────┴─────┴─────────────┴──────┘
 Use `pm2 show <id|name>` to get more details about an app

The auth service provides PWA authentication. pwaadmin is the main PWA UI (server side component), and pwapub generates MeshConfig/pSConfig output to be downloaded by external services. You can safely shutdown / restart pwaadmin without impacting mcapub service. pwacache periodically loads host information from configured sLS and global LS instances.

You should see all service to show “online” with small number of restart (if you update configuration for any service, the service will be automatically restarted, so you will see non-0 restart in such case). You can reset restart count by doing this:

pm2 reset pwaadmin

or

pm2 reset all

You can monitor realtime stats of each services via

pm2 monit

For more information on PM2, please see the PM2 main page

PWA Conatiners

Here is a complete list of PWA Docker containers, and what services run under them.

pwa-admin1

  1. pwaadmin This includes the PWA web-based UI, and the API

  2. pwacache The PWA cache, which pulls down host details from the global LS and any private LSes you may have configured, on a regular basis.

pwa-pub1

  1. pwapub The PWA Publisher, which publishes MeshConfig/pSConfig outputs; this is what you point your MadDash instance and tests hosts at.

sca-auth

  1. ui (sca-auth)

  2. auth (sca-auth) The Authentication service provides the API for the authentication module

Other Containers

These Docker containers are required by PWA, but not part of PWA itself.

mongo

This is the MongoDB database, and is used to store the Host Group/Testspec/Config options, as well as the LS cache.

nginx

A web server which is used as a reverse proxy to access the other components.

Backup (Volatile Data)

All the PWA-related data is stored under this directory; if you want to back up your data, simply copy this folder.

/usr/local/data

PWA stores Config-related information in the mongo/ subdirectory, and auth data in auth/.

Additionally, PWA config data is under

/etc/pwa

So this folder should also be backed up, as well.