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.
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:
cd ~/w2020 mkdir game cd game git init git remote add origin https://github.com/RuleGame/Rule-Game-server.git git pull origin masterLater, you can update the files in your working directory from the Github repository every now and then as follows:
cd ~/w2020/game git pull origin masterThis is something you may want to do every time when you think that other team members may have checked in their updates. This will ensure that their updates will propagate to your working version, and will reduce the chance of edit conflicts.
Besides git, there are various other command-line and visual client applications that work with Github (e.g. svn). If you use one of those, modify the above commands as appropriate for your client.
Various subdirectories of game containing the following materials:
cd ~/w2020/game git add web/foo.html
cd ~/w2020/game git commit -a git push origin
cd ~/w2020/game ant clean javadoc war cp ../w2020.war /opt/tomcat/webappsThe ant command above compiles the source code, and packs the compiled code, along with the documentation and third-party libraries, into a large file in WAR format. The sudo cp command above copies that WAR file to a directory from which the Apache Tomcat server will automatically pick it and deploy it to the server web application directory, updating all necessary files in /opt/tomcat/webapps/w2020. Your applications will then be visible at the web server, at a URL such as http://localhost:8080/w2020/ or http://sapir.psych.wisc.edu:7150/w2020/ (depending on what host you are deploying it at, and what port the Tomcat server on that host is using).
sudo cp ../w2020.war /opt/tomcat/webapps
cd ~/w2020/game ant clean javadoc war-dev cp ../w2020-dev.war /opt/tomcat/webapps
Staff working with the experiment control files may carry out the following operations:
cd ~/w2020 mkdir game-data cd game-data git init git remote add origin https://github.com/RuleGame/Rule-Game-game-data.git git pull origin masterLater, you can update the files in your working directory from the Github repository every now and then as follows:
cd ~/w2020/game-data git pull origin masterThis is something you may want to do every time when you think that other team members may have checked in their updates. This will ensure that their updates will propagate to your working version, and will reduce the chance of edit conflicts.
Besides git, there are various other command-line and visual client applications that work with Github (e.g. svn). If you use one of those, modify the above commands as appropriate for your client.
Various subdirectories of game-data contain a variety of data files, as per the Data Guide.
cd ~/w2020/game-data git add trial-lists/MyPlan rules/My-Rule-*.txt
cd ~/w2020/game-data git commit -a git push origin
Kevin has set up the repository in such a way when you check your local copy of the data (with git push ...), the data are immediately automatically deployed to the server. If you log in to sapir, go to /opt/tomcat/game-data and check the time stamp and ownership of a file you have recently added and pushed to the repository, you will see that it will have a recent time stamp, and will be owned by user kmui.
If you have modified an existing trial list file or a rule set file that you have previously used in some episodes, you may want to clear the server tables, in order to force the Game Server to re-read and re-compile that file before you play with it again.
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.
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.
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 tomcatand 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.
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
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.