Difference between revisions of "Getting Started"

From powerwiki
Jump to: navigation, search
Line 1: Line 1:
 
== Release 0.3, mid-June 2011 ==
 
== Release 0.3, mid-June 2011 ==
  
For this version, we have developed a script that downloads all the server components along with the demo broker.
+
For this version, we have developed a [https://github.com/powertac/powertac-tools/raw/master/scripts/installBranch.groovy script] that downloads all the server components along with the demo broker. You do not need to install or use git, but you will need working installations of groovy and grails. See [https://github.com/powertac/powertac-server/wiki/Getting-started the developer's Getting Started page] for setup instructions and links. This script currently depends on tar to expand the tarballs, and it has not been tested on Windows. It should work without problems on Linux and OS X, and it should work on Cygwin. If someone knows how to eliminate the dependence on tar, or wants to contribute a Windows version, let us know.
 +
 
 +
=== Download the release package ===
 +
 
 +
To pull down the release package (15 modules), follow these steps (examples are for a unix or cygwin shell):
 +
 
 +
# Create a new empty directory (we'll assume you call it powertac-0.3) and copy the [https://github.com/powertac/powertac-tools/raw/master/scripts/installBranch.groovy script] to this directory.<br>
 +
:: <code>mkdir powertac-0.3<br>
 +
:: cp installBranch.groovy powertac-0.3</code>
 +
# Move to the directory and run the script, giving the release ID as an argument.<br>
 +
:: <code>cd powertac-0.3<br>
 +
:: groovy installBranch.groovy release-0.3</code>
 +
# The script takes a minute or two and reports its progress; make sure there are no errors. It works to run the script again over the top of an existing installation; that will simply replace the current contents of the module directories with fresh copies from github.
 +
 
 +
=== Run the server ===
 +
 
 +
To start the server, simply enter the powertac-server directory and use the command <code>grails run-app</code>. This will resolve dependencies, compile all the code, and start the server on localhost:8080. Once it is running, you will see the line<br>
 +
: <code>Server running. Browse to http://localhost:8080/powertac-server</code><br>
 +
in the console. If you browse to this address, you will see a web page that allows you to modify some aspects of the server configuration, and to start a new simulation. The default configuration runs a simulation of just 96 hours, to facilitate testing.
 +
 
 +
While the server is running, it writes to a log file in logs/powertac-server.log. If you start a simulation and watch the log, you will see evidence of most server processes as they run.
 +
 
 +
=== Run the demo agent ===
 +
 
 +
The directory <code>powertac-demo-agent-grails</code> is an agent framework, written in grails, that incorporates all the necessary message handling and time-keeping to interact properly with the server. To run the agent on the same machine with the server, it's necessary to force it to use a non-standard port for its web front-end. Do this as<br>
 +
: <code>grails -Dport=9090 run-app</code><br>
 +
and wait for its server running message. To connect the agent to the server, start the server first, but don't start a simulation. Then start the agent and log it in from its web page (by default, the server ignores the agent's password; you can just leave it blank). Finally, configure the server (poke the "default competition" entry and edit/save it) and start it (poke the "dashboard" entry and start the competition). Once the server is running, you can use the broker's web page to submit a tariff, then watch its progress through the server. Note that new tariffs are by default published once every 6 timeslots.
 +
 
 +
=== Release notes ===
 +
 
 +
This package is far more capable than the 0.2 release from May, but there remain a few missing features and odd bugs that we are aware of. In the following, we give the Github issue number for each issue:
 +
 
 +
* [https://github.com/powertac/powertac-server/issues/250 Server performance is inadequate] - we have the timeslot interval set to 12 seconds, which means a full game would take over 4 hours. Our goal is to get it down to 5 seconds.
 +
* [https://github.com/powertac/powertac-server/issues/184 Load and price profiles are not available at the start of a simulation] - this is fairly essential bootstrap information for a broker, and it's not yet working.
 +
* [https://github.com/powertac/powertac-server/issues/185 Balancing is very primitive] - the Distribution Utility does not yet implement even the "static" balancing scheme outlined in the game specification. We hope to have this working in an interim release very shortly.
 +
* [https://github.com/powertac/powertac-server/issues/246 Customer model does not effectively model price elasticity] - this feature is coming along nicely, but it's not yet ready.
 +
* [https://github.com/powertac/powertac-server/issues/270 Orderbook does not correctly separate bids and asks] - the Orderbook abstraction produced by the wholesale market is supposed to contain a list of un-cleared bids and a separate list of un-cleared asks, but instead it includes all uncleared bids and asks in both lists.
 +
* [https://github.com/powertac/powertac-server/issues/133 Server does not completely recycle after the end of a simulation] - it does dump its database, but you cannot start another simulation without restarting it.
 +
* [https://github.com/powertac/powertac-server/issues/135 Visualizer is not displayed] - the server's game visualizer is incomplete and does not currently display.
 +
* [https://github.com/powertac/powertac-server/issues/155 Pause mode not implemented] - the server's clock moves ahead relentlessly. A goal is to allow it to pause, either because a GUI-driven broker needs more time, or because some server process cannot meet the timeslot time-limit. This should mostly address the performance problem.
  
 
== Release 0.2, mid-May 2011 ==
 
== Release 0.2, mid-May 2011 ==

Revision as of 15:50, 15 June 2011

Release 0.3, mid-June 2011

For this version, we have developed a script that downloads all the server components along with the demo broker. You do not need to install or use git, but you will need working installations of groovy and grails. See the developer's Getting Started page for setup instructions and links. This script currently depends on tar to expand the tarballs, and it has not been tested on Windows. It should work without problems on Linux and OS X, and it should work on Cygwin. If someone knows how to eliminate the dependence on tar, or wants to contribute a Windows version, let us know.

Download the release package

To pull down the release package (15 modules), follow these steps (examples are for a unix or cygwin shell):

  1. Create a new empty directory (we'll assume you call it powertac-0.3) and copy the script to this directory.
mkdir powertac-0.3
cp installBranch.groovy powertac-0.3
  1. Move to the directory and run the script, giving the release ID as an argument.
cd powertac-0.3
groovy installBranch.groovy release-0.3
  1. The script takes a minute or two and reports its progress; make sure there are no errors. It works to run the script again over the top of an existing installation; that will simply replace the current contents of the module directories with fresh copies from github.

Run the server

To start the server, simply enter the powertac-server directory and use the command grails run-app. This will resolve dependencies, compile all the code, and start the server on localhost:8080. Once it is running, you will see the line

Server running. Browse to http://localhost:8080/powertac-server

in the console. If you browse to this address, you will see a web page that allows you to modify some aspects of the server configuration, and to start a new simulation. The default configuration runs a simulation of just 96 hours, to facilitate testing.

While the server is running, it writes to a log file in logs/powertac-server.log. If you start a simulation and watch the log, you will see evidence of most server processes as they run.

Run the demo agent

The directory powertac-demo-agent-grails is an agent framework, written in grails, that incorporates all the necessary message handling and time-keeping to interact properly with the server. To run the agent on the same machine with the server, it's necessary to force it to use a non-standard port for its web front-end. Do this as

grails -Dport=9090 run-app

and wait for its server running message. To connect the agent to the server, start the server first, but don't start a simulation. Then start the agent and log it in from its web page (by default, the server ignores the agent's password; you can just leave it blank). Finally, configure the server (poke the "default competition" entry and edit/save it) and start it (poke the "dashboard" entry and start the competition). Once the server is running, you can use the broker's web page to submit a tariff, then watch its progress through the server. Note that new tariffs are by default published once every 6 timeslots.

Release notes

This package is far more capable than the 0.2 release from May, but there remain a few missing features and odd bugs that we are aware of. In the following, we give the Github issue number for each issue:

Release 0.2, mid-May 2011

Because the development team is still actively developing, we have not yet packaged the Power TAC server plugins to be automatically resolved by maven. Therefore, you will have to use the release branch in development mode, which means you need to install git and download each component from its github repository and checkout the correct branch. With a git command-line tool, you do this as

git clone https://github.com/powertac/powertac-server.git
git clone https://github.com/powertac-plugins/powertac-common.git
... etc. ...

There are a number of git clients, either embedded in tools like Springsource STS (a custom-packaged version of Eclipse) and IntelliJ, or command-line or GUI clients.

You will need to install Grails 1.3.7 before you can run the server or the demo agent.

To retrieve the server, you will need the server and 12 plugins, each cloned into parallel directories. Instructions for downloading and setting up the server as a developer are given in the developer's wiki on github. If you follow these instructions, you will have the development branch, not the release branch. We attempt to keep the development branch reasonably stable, but we cannot support it for non-developers. To get to the release branch, you will need to check out the branch release-0.2 in each of the component directories. Using the command-line version of git, this is accomplished by

git checkout release-0.2

Once you have done this, you should be ready to start the server.

In addition to the server, there is a simple Grails-based demo agent that runs the communication protocol and provides a simple web interface to the underlying data model.