Page tree
Skip to end of metadata
Go to start of metadata

The SSDT Utils project contains a script to assist ITC's in creating training instances for the Pilot release versions of the software.   The script will create a single training instance of both USAS and USPS containing anonymized sample data provided by the SSDT.

Previously the SSDT provided a training.sh script which attempted to create and manage multiple training instances. That script has been removed. The new script creates a single instance. The exec-all-projects.sh can be used to manage multiple instances.

The training instances provided by the SSDT will do the following:

  • Install/deploy the latest Pilot release of the USxS software
  • Special Database containers which contain a backup of the sample data, which is restored each time the database container is created
  • Reset the "admin" password to "training" on each application startup
  • Configure USAS to USPS integration 

Step-by-step guide


  1. Create a directory to contain all training instances: 

    mkdir -p /data/training
  2. Create a directory to contain a single training instance: 

    mkdir -p /data/training/training-00
  3. Execute the Pilot training script to create an instance: 

    cd /data/training/training-00
    /ssdt/pilot/training.sh

    This will create docker-compose.yml and .env files very similar to the setup.sh used for production instances.  You should not copy these files from another training instance.  Each training instance contains unique API keys specific to that instance.

  4. If needed, create a docker-compose.override.yml file to handle reverse proxy per your ITC's conventions.  For example, if you are using nginx-proxy with letsencrypt you would create this override file: 

    version: "3.3"
    services:
      usasapp:
        networks:
          - proxy
        environment:
          - VIRTUAL_HOST=${COMPOSE_PROJECT_NAME}-usas.yourITCdomain.org
          - VIRTUAL_PORT=8080
          - LETSENCRYPT_HOST=${COMPOSE_PROJECT_NAME}-usas.yourITCdomain.org
          - LETSENCRYPT_EMAIL=smith@nwoca.org
      uspsapp:
        networks:
          - proxy
        environment:
          - VIRTUAL_HOST=${COMPOSE_PROJECT_NAME}-usps.yourITCdomain.org
          - VIRTUAL_PORT=8080
          - LETSENCRYPT_HOST=${COMPOSE_PROJECT_NAME}-usps.yourITCdomain.org
          - LETSENCRYPT_EMAIL=smith@nwoca.org
    networks:
       proxy:
         external:
            name: proxy_default
    
    

    Note that this file contains your custom domain name.  Be aware that LetsEncrypt throttles the number of domains you can sign (see https://letsencrypt.org/ for details).  
    If you use the ${COMPOSE_PROJECT} environment variable name in your then you may copy this file from one training instance to another.  You may wish to make other changes, for example, you may wish to override the "restart" policty to "no" to prevent automatic restarts on boot.

  5. Start the instance with docker-compose: 

    training-00> docker-compose up -d


Managing instances:

A training instance may be managed in the same manner as a production instance.  The primary diffrence is that you can "reset" the training data by simple deleting the database containers and restarting them: 

docker-compose down
docker-compose up -d


If you have multiple training instances in you can use the exec-all-projects to execute the command(s) against all training project.

For example, to start all training instances with a single command:

/ssdt/scripts/exec-all-projects.sh /data/training docker-compose up -d

To stop, delete and restart all instances:

/ssdt/scripts/exec-all-projects.sh /data/training "docker-compose down ; docker-compose up -d"

Note: The quotes are necessary in this case to cause both commands to be passed to the script (instead of being executed in the current shell).