Tournament Installation - Pyosch/powertac-server GitHub Wiki
- Tournament Scheduler JSF Web Application
- Apache Tomcat 7
- Apache Maven 3.X.X
- MySQL or equivalent dbms
-
First clone the repo with this command:
$ git clone git://github.com/powertac/powertac-tournament-scheduler.git
-
Create a directory where all TS-related files will stored (each type in their own sub-dir).
The TS needs directories for storing logs, boots, and poms. It's convenient to put those in the same parent dir. In this parent, create 'boot', 'log' and 'pom'. It might be helpful to create another dir for the TS-log files (see 3, log4j.properties). -
Duplicate all 3 files in src/main/resources/ without the .template extension.
- In hibernate.cfg.xml change the hibernate.connection.username and -password, and change the hibernate.connection.url if needed. Currently the only dbms officially supported is MySQL. Don't change the db name, as the install script depends on it.
- In log4j.properties, change the locations for log4j.appender.File.File and log4j.appender.Hibernate.File.
- In tournament.properties, set the parameters for your Jenkins install, leave user/token empty if your install doesn't require authentication.
If you want notifications when boots or sims are stuck, you have to enter the recipients email address in 'scheduler.mailRecipient'. In order for the TS to be able to send mail, fill in the user/pass of Gmail account (best to create a new account).
Change the boot/log/pom locations to the locations defined under 2.
The rest of the settings probably don't need editing.
- In hibernate.cfg.xml change the hibernate.connection.username and -password, and change the hibernate.connection.url if needed. Currently the only dbms officially supported is MySQL. Don't change the db name, as the install script depends on it.
-
Open your pom.xml and navigate to this portion:
<artifactId>tomcat7-maven-plugin</artifactId> <version>2.0</version> <configuration> <url>http://localhost:8080/manager/text</url> <username>admin</username> <password>admin</password> <path>/TournamentScheduler</path> <update>true</update> </configuration>
Note that this is your tomcat script username and password, change these to something more secure. Leave the path element alone.
Don't forget to give the required privileges to the user as defined in hibernate.cfg.xml.
In the install directory of the Tournament Scheduler there is file called make-tournament-db.sql, this file contains all of the table definitions used by the Tournament Scheduler. You can import the database and table definitions with the following command:
$ mysql -u _yourdbusername_ -p < make-tournament-db.sql
-
Download Apache Tomcat 7 here
-
Replace the {Tomcat}/bin/startup.sh with {Tournament-Scheduler}/install/startup.sh. The default Tomcat startup script does not start with enough heap space to function properly, so we must replace it.
-
Once you have replaced the script run the following command:
$ chmod 770 startup.sh
-
Navigate to {Tomcat}/conf/tomcat-users.xml and replace it with {Tournament-Scheduler}/install/tomcat-users.xml.
-
Once you have replaced the xml file run the following command:
$ chmod 670 tomcat-users.xml
-
Open up tomcat-users.xml, set your username and password the same as the username and password values located in your pom.xml file.
<user username="admin" password="admin" roles="admin-gui,manager-gui,manager-script"/>
-
Now you may start tomcat, navigate to {Tomcat}/bin/startup.sh and run it. To test if you have succeed navigate to http://localhost:8080/ to see the tomcat splash page.
-
If you have set everything up correctly the command to deploy the Tournament Scheduler is very easy. The following command will deploy the Tournament Scheduler to http://localhost:8080/TournamentScheduler/ :
$ mvn tomcat7:deploy
-
Register your admin user on the register page. Set the permissions of this user to 'admin' in the database.
More detailed directions can be found here.
-
Run the script called "install-jenkins.sh" located in the {Tournament-Scheduler}/install directory. Note you must have an instance of Apache Tomcat 7 running for this script to succeed. This script optionally takes three command line arguments. Without arguments localhost:8080 without authentication will be used.
$ ./install-jenkins.sh {apache-tomcat-url:8080} {apache-username} {apache-password}.
-
Once Jenkins is up and running navigate to the following url:
-
Click on the "Manage Jenkins" link
-
Click on "Manage Plugins"
-
Search Available Plugins for the "NodeLabel Parameter Plugin" and the "Throttle Concurrent Builds Plugin". Install it without restart.
-
Click on "Manage Jenkins", "Configure System". Then under "Throttle Concurrent Builds", add :
- Category Name = game-server
- Maximum Total Concurrent Builds = 0
- Maximum Concurrent Builds Per Node = 1
-
Click on "Manage Jenkins" again, click on "Manage Nodes", and click "New Node"
-
We want to create "dumb nodes" which are remote machines to run sims and bootstraps on, we suggest that you don't use password authentication but ssh keys.
-
We recommend that you use /export/scratch/jenkins-node as your "Remote FS Root" especially if you are running on a network filesystem as this is very slow.
-
Create a node for every machine you want to run a sim or a bootstrap.
-
Located the {Tournament-Scheduler}/install/configure-jenkins.sh script and run it. This script takes one command line argument ./configure-jenkins.sh {apache-url:8080} (Usually localhost:8080)
-
Navigate to http://localhost:8080/jenkins/ and ensure that 4 new jobs were created, called "start-sim-server", "start-boot-server", "abort-server-instance" and "kill-server-instance".