Skip to content
sheldonabrown edited this page Mar 6, 2013 · 17 revisions

(This page still in progress)

Prerequisites:

  • git
  • a username on github
  • java JDK
  • maven 3 (maven 2 won't work!)
  • tomcat6
  • postgresql or mysql
  • zeromq libraries

Here are some detailed instructions on Installing Project Dependencies.

Profiles

There are several different deployment styles, as represented in Maven profiles. What you choose is largely based on on the component you are working on. "local-multi-port" works for all components so is the default recommended. If you only plan to work on the Front-end however, stick with the "local-front-end" profile. These have been tested on Ubuntu, but work on OSX as well.

  • local-front-end: run the front-end locally off of the TDF in the dev environment. This profile isn't applicable to other modules. Use this when you are only concerned with the HTML front end. (Essentially you plug your local HTML front end into a live OBA in the development environment)
  • local-single-port: run either the front-end/API/TDF or the inference engine on 8080, and optionally hook up the archiver as well. In either case, the modules listen to the dev queue. Use this when you only want to run the Front-end or the Inference engine, but not both. (You run OBA yourself, and subscribe to data from the development environment)
  • local-ie: run the front-end off of a local VTW, all on port 8080. (This is for IE development)
  • local-multi-port: run each module on a separate port and hence separate process. (Preferred method cause it just works)

You can run this directly on the command line using Maven, or use the Maven Build run configurations in Eclipse to run it there, for example if you need to debug.

Run Via Eclipse

Assuming you have Tomcat support in Eclipse, this is the easiest option for new users.

Run the front-end only

Right click on onebusaway-nyc-acta-webapp and go Properties->Maven and add local-front-end,eclipse-only in Active Maven Profile text and click OK.

Update your configuration via Servers/Tomcat v6.0 Server at localhost-config/context.xml

  <WatchedResource>WEB-INF/web.xml</WatchedResource>
       <Resource name="jdbc/appDB"
    auth="Container"
    type="javax.sql.DataSource"
    maxActive="100"
    maxIdle="30"
    maxWait="10000"
    username="root"
    password="changeme"
    driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/onebusaway_nyc" />

Next Right click on onebusaway-nyc-acta-webapp and go Run As->Run on Server

Go http://localhost:8080/onebusaway-nyc-acta-webapp

Run the front-end and IE

Right-click on onebusaway-nyc-vehicle-tracking-webapp, Go Properties->Maven and specify "local-single-port,depots-one" as the profile Right-click on onebusaway-nyc-vehicle-track-webapp, and go Run As->Run on Server Right-click on onebusaway-nyc-webapp, Go Properties->Maven and specify "local-single-port" as the profile. Note, do not deploy this webapp, deploy the overlay below Right-click on onebusaway-nyc-acta-webapp, Go Properties->Maven and specify "local-single-port" as the profile. Right-click on onebusaway-nyc-acta-webapp, and go Run As->Run on Server

The depots-one profile has selected a single small depot so as to not overwhelm the CPU. As such, only a fraction of routes and buses will be available.

Go http://localhost:8080/onebusaway-nyc-acta-webapp

Run via the Command Line

This example uses the profile local-front-end (For front end only, uses TDF in dev environment).

Novice users will want to skip this step as using Eclipse is much simpler! This step describes running the application using Tomcat.

Run the front-end only

Build the entire onebusaway-nyc project with the profile "local-front-end"

$ cd ~/src/onebusaway-nyc
$ mvn clean && mvn install -Plocal-front-end,skip-integration-tests

Configure the appDB resource reference in tomcat; edit /var/lib/tomcat6/conf/context.xml

            <!-- Default set of monitored resources -->
            <WatchedResource>WEB-INF/web.xml</WatchedResource>

            <Resource name="jdbc/appDB"
                auth="Container"
                type="javax.sql.DataSource"
                maxActive="100"
                maxIdle="30"
                maxWait="10000"
                username="root"
                password=""
                driverClassName="com.mysql.jdbc.Driver"
                url="jdbc:mysql://localhost:3306/onebusaway_nyc" />

Deploy to Tomcat and start

        // note we change the war file name to have it deploy at the root context
        $ sudo /etc/init.d/tomcat6 stop
        $ sudo cp ~/src/onebusaway-nyc/onebusaway-nyc-webapp/target/onebusaway-nyc-webapp.war /var/lib/tomcat6/webapps/ROOT.war
        $ sudo /etc/init.d/tomcat6 start

Point your browser to http://localhost:8080/

Run the Front-end and IE

Edit /var/lib/tomcat6/conf/context.xml and add:

   <Resource name="jdbc/appDB"
    auth="Container"
    type="javax.sql.DataSource"
    maxActive="100"
    maxIdle="30"
    maxWait="10000"
    username="root"
    password="changeme"
    driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/onebusaway_nyc" />

Execute the following commands:

user@localhost:src/onebusaway-nyc$ mvn clean install -Plocal-single-port,depots-one,skip-integration-tests
user@localhost:src/onebusaway-nyc$ mkdir /tmp/bundle /tmp/oba-bundle
user@localhost:src/onebusaway-nyc$ sudo chown -R tomcat6:tomcat6 /tmp/bundle
user@localhost:src/onebusaway-nyc$ sudo chown -R tomcat6:tomcat6 /tmp/oba-bundle
user@localhost:src/onebusaway-nyc$ sudo cp onebusaway-nyc-vehicle-tracking-webapp/target/onebusaway-nyc-vehicle-tracking-webapp.war /var/lib/tomcat6/webapps/
user@localhost:src/onebusaway-nyc$ sudo cp onebusaway-nyc-acta-webapp/target/onebusaway-nyc-acta-webapp.war /var/lib/tomcat6/webapps/
user@localhost:src/onebusaway-nyc$ sudo /etc/init.d/tomcat6 start

Go to http://localhost:8080/onebusaway-nyc-acta-webapp

Run the Admin Server

Edit /var/lib/tomcat6/conf/context.xml and add:

    <Resource name="jdbc/appDB"
    auth="Container"
    type="javax.sql.DataSource"
    maxActive="100"
    maxIdle="30"
    maxWait="10000"
    username="root"
    password="changeme"
    driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/onebusaway_nyc" />
       <Resource name="jdbc/archiveDB"
    auth="Container"
    type="javax.sql.DataSource"
    maxActive="100"
    maxIdle="30"
    maxWait="10000"
    username="root"
    password="changeme"
    driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/onebusaway_nyc_archive" />
  <Parameter name="obanyc.environment" value="dev" override="false" />
  <Parameter name="admin.instanceId" value="localhost" override="false" />

Execute the following commands:

user@localhost:src/onebusaway-nyc$ mvn clean install -Plocal-single-portskip-integration-tests
user@localhost:src/onebusaway-nyc$ sudo cp onebusaway-nyc-admin-webapp/target/onebusaway-nyc-admin-webapp.war /var/lib/tomcat6/webapps/
user@localhost:src/onebusaway-nyc$ sudo /etc/init.d/tomcat6 start

Run the Archiver

Run the TDM

Clone this wiki locally