Skip to content

Build Instructions

LHeffner edited this page Apr 3, 2014 · 12 revisions

Purpose

The following build instructions are designed to help you build the Neon application WAR file from the source code. If you built Neon or have a copy of the neon.war file, proceed to the Deploying Neon for instructions on running Neon on a web server (e.g., Jetty or Tomcat).
Note: The following build instructions assume the developer is running on a Linux operating system.

External Dependencies

You need to download and install the following dependencies to build and/or run Neon.

Java JDK
Neon is a Java application and therefore requires Java JDK. Java version 7 or later is required.
Download Java JDK 7

Git
The Neon source code is hosted on GitHub. To build Neon, clone the Neon repository by first downloading Git and following the instruction for cloning an existing repository.
Download Git

Gradle
Neon uses Gradle as its build system. We recommend that you used the Gradle wrapper to build Neon. You do not have to download Gradle to build Neon using the Gradle wrapper. Instructions for building Neon using the Gradle wrapper are found in section Build Instructions.

Node.js/npm
Node.js and npm are used to build the Neon JavaScript code. The simplest way to install Node.js and npm is to download the latest version (http://nodejs.org/download/) and then run the following commands:

     cd /usr/local
     tar --strip-components 1 -xzf /path/to/node-download.tar.gz

You may need to run as sudo if you do not have permission to write to directories in /usr/local.

Alternatively, you can install Node.js from the package manager as described here and install npm by running

    curl https://www.npmjs.org/install.sh | sudo sh

Mongo Database
Neon supports Mongo and Shark database systems. We recommend first time users download Mongo and configure Neon to use this database. Mongo provides excellent documentation for its product including installation instructions (Mongo DB manual).
Download Mongo (version 2.4 or later)

Shark Database (optional)
Neon also supports Shark database systems. Installation instructions for the Shark database are found here.
Download Shark

Tomcat
For production environments, we recommend running Neon inside a Tomcat web server. Tomcat is not required to build Neon, but you should download it to run the application. Instructions for running Neon inside of Tomcat are found on the Deploying Neon page.
Download Tomcat (version 7.0 or later)

Supported Browsers
Neon has been tested in Firefox and Chrome browsers.

##Initial Setup## Prior to building Neon from source, create a gradle.properties file and configure it to your Mongo and/or Shark databases. Place this file in the top level NEON directory or in your user home directory. See the gradle.properties.sample for example file configurations. For more information on gradle.properies, see the Gradle docs.

Use the following steps to create and configure the gradle.properties file:

  1. Open a terminal and cd into the Neon project directory.
  2. Copy gradle.properties.sample to gradle.properties using the following command:

     cp gradle.properties.sample gradle.properties


*Alternatively*: Instead of creating the **gradle.properties** file, configure the **GRADLE_OPTS** environment variable

     GRADLE_OPTS=-Xmx1024M -XX:MaxPermSize=512M -Dorg.gradle.daemon=true 

and pass the additional Neon properties in using the `-P` flag (when running Gradle). For example:

     gradlew jettyRun -Pmongo.hosts=localhost
  1. Customize the gradle.properties file with your system details. You may delete any properties you are not using. For example, delete the Tomcat deploy properties if you are not deploying to Tomcat. Configurable properties in the gradle.properties include:

    • NEON_SERVER - Set this property to your Tomcat server location.

    • mongo.host - Set this property to your Mongo database instance(s). Use comma separation to add more than one Mongo database.

    • hdfs.url - Set this property to the port of the Hadoop Distributed File System (HDFS) namenode.

    • shark.host - Set this property to your Shark database instance.

Building Neon

After the external dependencies are installed and you've configured the gradle.properties file, use the following steps to build the Neon application.

  1. Open a terminal and cd into the Neon project directory.

  2. Execute the following command to build Neon:

     gradlew build
    

This command compiles the source code, runs the unit tests, executes static code quality checks and builds the neon.war file. The WAR file is added to the neon-server/build/libs directory.

###Now you're ready to run Neon!###

Proceed to the Deploying Neon page for deployment instructions for running Neon in a Jetty container (best for development environments) or in a Tomcat container (best for production environments).

Alternative Build and Test Commands

Additional Gradle commands are available to test the Neon source code. The following commands will execute acceptance, integration and performance tests, respectively. Neon developers have extensively tested the application, therefore executing these commands is necessary only when you are making changes to the source code.

  1. Open a terminal and cd into the Neon project directory.

  2. Run the Gradle command to build Neon from source code and execute the following test:

    • gradlew acceptanceTest - Runs end-to-end acceptance tests. (Requires Mongo)

    • gradlew integrationTest - Runs integration tests against the existing data sources. (Requires Mongo and Shark)

    • gradlew gatling - Runs multi-user concurrency tests. (Requires Mongo and Shark)

Clone this wiki locally