Skip to content

Complete Installation Guide

Anna Thomas edited this page Dec 1, 2016 · 9 revisions
  1. Install CE-Store
  2. Populate CE-Store with Science Library data
  3. Install Science Library

These instructions assume you're starting with a new server. If you already have completed some of the steps, eg. already installed Java, feel free to skip those steps.

Installing CE-Store

Example code provided for an Ubuntu server

Install Requirements

  • Install Git

    sudo apt-get install git

  • Install Java (JDK)

    sudo apt-get install default-jdk

  • Set JAVA_HOME environment variable

    To find out which Java options you have installed:

    sudo update-alternatives --config java

    Then set the JDK you want to the JAVA_HOME variable in /etc/environment

    sudo vi /etc/environment

    Add the line JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"

    Check JAVA_HOME has been set using echo $JAVA_HOME

  • Install Maven

    sudo apt-get install maven

Clone, Install and Run

  • Clone CE-Store

    git clone https://github.com/ce-store/ce-store

  • CD into CE-Store directory

    cd ce-store

  • Install CE-Store

    mvn install

  • Run CE-Store

    mvn tomcat:run

    You can run CE-Store in the background on an Ubuntu server using paranthesis:

    (mvn tomcat:run &)

    CE-Store should be available on <YOUR-SERVER>:8080/ce-store

Populate CE-Store with Science Library data

Example code provided for an Ubuntu server

If you already have data hosted elsewhere you can skip to the last step and load it straight into the Engineering Panel using its URL.

  • Clone sample data from Science Library Data

    git clone https://github.com/ce-store/sl-data.git

  • Move the SL-Data CE folder into the CE-Store CE directory.

    SL-Data CE is stored in sl-data/WebContent/ce

    CE in the CE-Store is stored in ce-store/src/main/webapp

    You will need to create a directory in the CE-Store webapp directory for the SL-Data to live

    mkdir ce-store/src/main/webapp/sl-data

    Then move the CE into the newly created folder

    mv sl-data/WebContent/ce ce-store/src/main/webapp/sl-data

    Finally we need to set the CE root so the store knows where to base the relative URLs off

    vi ce-store/src/main/webapp/sl-data/ce/cmd/load_cached.cecmd

    Add this line to the load_cached command file after the store reset command:

    perform set 'ce root' to '<YOUR_SERVER>:8080/ce-store/'.

    load_cached.cecmd should look like this:

    perform reset store with starting uid '1'.
    
    perform set 'ce root' to '<YOUR_SERVER>:8080/ce-store/'.
    
    -- Load the models
    perform load sentences from url '/sl-data/ce/cmd/all_models.cecmd'.
    
    -- Load the generated facts
    perform load sentences from url '/sl-data/ce/cmd/all_facts_generated.cecmd'.
    
    -- (Run the rules) - Load the cached data
    perform load sentences from url '/sl-data/ce/cmd/all_cached_rules.cecmd'.
    
  • Load the data into the to CE-Store

    Go to the Engineering panel at (YOUR_SERVER:8080/ce-store/ui)

    Click 'Add CE' in the left panel, under 'Add CE from URL' select 'Specify URL...'

    A popup window should appear to specify the command file you want to load

    Enter ./sl-data/ce/cmd/load_cached.cecmd and click 'Okay'

    It may take a while to load the data, but you should get a pop up saying:

    Result of CE sentence loading:
     66 commands executed
     127503 valid sentences
    

    If you get a file not found error, try restarting the CE-Store

Install Science Library

Example code provided for an Ubuntu server

Install Requirements

  • Install Node curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash - sudo apt-get install -y nodejs

Clone, Install and Run

  • Clone Science Library

    git clone https://github.com/ce-store/science-library

  • Install dependencies using npm and bower

    npm install
    sudo npm install -g bower
    sudo npm install -g grunt-cli
    sudo npm install -g forever
    bower install
    
  • Update URL home and server endpoints in app/services/urls.js to your server's URL

    vi app/scripts/services/urls.js

    It should look like this:

    angular.module('itapapersApp')
    
    .constant('urls', {
      home: '<YOUR_SERVER>:8080',
      server: '<YOUR_SERVER>:8080',
      ...
    
  • Set environment to production

    export NODE_ENV=production

  • Build the production version of the Science Library

    grunt

  • Run the Science Library with Forever

    forever start server.js

    The Science Library should be available on <YOUR-SERVER>:3000

    To view running processes:

    forever list

    To stop running process:

    forever stop <ID|UID|PID>