Share

Configure secondary application containers

Warning:

Local installations of Flow Production Tracking are no longer offered. This documentation is intended only for those with existing instances of Shotgun Enterprise Docker. Click here for a list of our current offerings.

asterisk Contents

Purpose

Note:

This article explains how to add additional application servers to a Flow Production Tracking Cluster.

It is intended for Flow Production Tracking System Administrators.

Flow Production Tracking application module

The Flow Production Tracking application module, or shotgun-app, is the component responsible of handling Web and API requests and responses. This layer can be scaled easily, allowing your Flow Production Tracking instance to handle more throughput.

schema2.png

Step by Step Procedure

  1. Prepare a host
  2. Configure your database server to accept external connections
  3. Configure your memcached container to accept external connections
  4. Configure container
  5. Load balance

Prepare a host

The first step is to set up a host that will be running your new application container.

See Getting started with Flow Production Tracking for a refresher about how to configure a host for Flow Production Tracking.

Important things to validate are that the external resources needed by the shotgun-app container can be reached from the new host. Validate that:

  • The media folder is correctly mounted on the host, under the same mount path than on the other hosts
  • The database server can be reached from the new host
  • Memcached can be reached from the new host

Database server configuration

In this configuration, your shotgun-app container will probably connect to an external database server. For this to be possible, you will need to first configure your database server. See Configure a standalone database server for more details.

Memcached container configuration

In this configuration, your memcached container need to be configured to accept connections for the secondary server. Here is an example of your memcached service in your Compose file

 memcached:  
  image: memcached:1.4  
  ports:  
    - "11211:11211"  
  restart: always  

Configure container

Spinning up a secondary shotgun-app container is really similar to spinning up your initial shotgun-app container. The main difference is that you will configure the container to connect to existing external resources.

Make sure that the PostgreSQL and memcached environment variables are properly configured before starting your container. Here is an example of what your Compose file should look like:

 version: '2'  
services:  
  ##################################################################  
  app2:  
    image: shotgun-app:7.3.2  
    ports:  
      - "80:80"  
    environment:  
      Flow Production Tracking_SITE_URL: flow production tracking.mystudio.com  
      POSTGRES_HOST: pgsql.mystudio.com  
      POSTGRES_DB: flow production tracking  
      POSTGRES_PORT: 5432  
      POSTGRES_USER: flow production tracking  
      MEMCACHED_HOST: memcached.mystudio.com  
      MEMCACHED_PORT: 11211  
    labels:  
      com.shotgunsoftware.component: app  
    volumes:  
      - ./media:/media  
    restart: always 

See the Reference Docker Compose file and Application container customization for more details.

Flow Production Tracking-app Specialization

A good optimization to consider when your cluster is composed of multiple shotgun-app containers is to decouple API requests processing from web requests processing. Scripts and automation can generate a lot of requests. By decoupling the two, you can assure the web application remains responsive while API requests are being crunched.

Specializing a shotgun-app container to process only API requests

An API-only server will remove the web UI functionality and the server will only respond to API calls.

Add the following lines in docker-compose.yml in the services section. The container will need to be restarted after the change. Note that the main URL is now flow production tracking-api.mystudio.com and the alternate URL is the actual website.

   apiserver:  
    image: shotgun-app:7.2.3  
    ports:  
      - "80:80"  
    environment:  
      Flow Production Tracking_SITE_URL: flow production tracking-api.mystudio.com  
      Flow Production Tracking_ALT_URL: flow production tracking.mystudio.com  
      Flow Production Tracking_ROLE: api_server  
      POSTGRES_HOST: pgsql.mystudio.com  
      POSTGRES_DB: flow production tracking  
      POSTGRES_PORT: 5432  
      POSTGRES_USER: flow production tracking  
      MEMCACHED_HOST: memcached.mystudio.com  
      MEMCACHED_PORT: 11211      
    labels:  
      com.flow production trackingsoftware.component: app 

Specializing a shotgun-app container to process only web requests

A container specialized to handle only web requests will remove calls to API endpoints, preventing scripts and integrations using the API from being processed by that container.

Add the following lines in docker-compose.yml in the services section. The container will need to be restarted after the change.

   webserver:  
    image: shotgun-app:7.2.3  
    ports:  
      - "80:80"  
    environment:  
      Flow Production Tracking_SITE_URL: flow production tracking.mystudio.com  
      Flow Production Tracking_ALT_URL: flow production tracking-api.mystudio.com  
      Flow Production Tracking_ROLE: ui_server  
      POSTGRES_HOST: pgsql.mystudio.com  
      POSTGRES_DB: flow production tracking  
      POSTGRES_PORT: 5432  
      POSTGRES_USER: flow production tracking  
      MEMCACHED_HOST: memcached.mystudio.com  
      MEMCACHED_PORT: 11211   
    labels:  
      com.flow production trackingsoftware.component: app 

A note on load balancing

Flow Production Tracking doesn't provide or recommend a product to load balance requests between your application containers. See Scaling Flow Production Tracking for more details how that can be achieved.

Was this information helpful?