Standard Operating Procedures: Building and deploying the Game Server

Updated 2021-04-02.

Note: in this document, sections of importance for experiment designers (Aria, Ellise, Gary...) are in yellow. The rest is primarily of importance only to those who work with the server code.

Maintaining and deploying server code and server data

The Game Server source code (including documentation web pages) and the experiment control files (read-only data) (CSV files which control the experiments) are handled as outlined in the chart below:

The chart includes the following locations:

Staff who work with the server code may carry out the following procedures:

Staff working with the experiment control files may carry out the following operations:

Production server vs. development server

As discussed above ((c) vs. (c')), the two are implemented as two web apps within the same Tomcat server. Both presently (ver. 2.001) use the same data files and the same MySQL database. This normally should not cause problems, unless you make the kind of change (in dev vs prod) that requires a change in the database schema.

File ownership and permissions

On a Linux system, every file and directory is owned by a specific user account, and is assigned to a specific UNIX user group. Most of the files under /opt/tomcat/webapps on sapir are owned by user tomcat, group tomcat, and it's a good idea to keep it this way, or as close to it as possible. Therefore, one of the two ways of copying your WAR file to that directory is encouraged.

Being a member of group tomcat

Presently, most team members have been enrolled into the UNIX group tomcat. If you are one of those, then, when you log in to sapir, just type

newgrp tomcat
and all your subsequent interactions with the system will be as a member of that group. So you should be able to copy files to /opt/tomcat/webapps, since that directory is group-writeable.

Using sudo

If you have sudo rights, you of course can copy WAR files to the webapps directory using sudo. But if you do that, do a nice thing and change their ownership to tomcat.tomcat thereafter, so that they won't be in the way of other people:

sudo cp ../w2020.war /opt/tomcat/webapps
sudo chown tomcat.tomcat      /opt/tomcat/webapps/w2020.war
  

Client code

The client (the TypeScript/React/JavaScript application that runs inside the web browser) has its own Github repository, Rule-Game. Kevin can provide more details on the deployment process.