Code Monkey home page Code Monkey logo

analysis-backend's Introduction

Analyst

This is the server component of Conveyal's analysis platform.

Please note: At this time Conveyal does not provide support for third-party deployments of Analysis. We provide paid subscriptions to a hosted deployment of this system, as well as transportation planning consulting for subscribers.

For now, the project is open source primarily to prevent vendor lock-in for our clients and to ensure transparency in planning and decision making processes. It is likely that over time the system will become easier to deploy by third parties, but we do not plan to provide technical support for such deployments.

Setup

In production we use Auth0 for authentication and S3 for storage; set the following variables, either in application.conf in the working directory, or as environment variables.

  • AUTH0_CLIENT_ID: your Auth0 client ID
  • AUTH0_CLIENT_SECRET: your Auth0 client secret
  • MONGOLAB_URI: URI to your Mongo cluster
  • BUNDLE_BUCKET: S3 bucket to store bundles in
  • GRID_BUCKET: S3 bucket to store grids in
  • RESULTS_BUCKET: S3 bucket to store results in
  • RESULTS_QUEUE: SQS queue to use to return results

Alternatively, omit all of that and set OFFLINE=true. For now, in offline mode you still need an S3 grid bucket and SQS results queue, those parts do not yet work offline. This means that regional jobs will write and read from the specified queue - be careful not to configure any development or staging instance with the same queue names used in production! For that matter, never configure any two instances to use the same queue.

You will need to have S3 credentials set up in your environment or in ~/.aws for an identity that is allowed to access all the buckets in use, including the seamless census data bucket. If you have multiple profiles, you can use the AWS_PROFILE variable in the environment or in application.conf to choose which AWS credentials profile will be used.

By default it will use the scenario-editor database in your Mongo instance. You can set DATABASE_NAME to change that.

Once you have configured your environment or application.conf, build the application with mvn package and start it with java -Xmx2g -jar target/analyst.jar

You can then start the frontend with yarn start

Creating a development environment

In order to do development on the frontend, backend, or on R5, which we use for performing the analyses, you'll want a local development environment. We use IntelliJ IDEA (free/community version is fine). First, clone the project with git, and add it as a project to IntelliJ. Do the same with R5; add it as another module in the same IntelliJ project. Then, enter the project settings of analysis-backend and remove the existing dependency on R5 (which will pull down a built JAR from Maven Central) and replace it with a module dependency on your local R5. This way, any changes you make to R5 will also be reflected when you run it.

You can then create a run configuration for com.conveyal.taui.AnalysisServer, which is the main class. You will need to configure the options mentioned above; I recommend using environment variables in the run configuration rather than messing with config files for local development. If you set OFFLINE=true, you won't need to run the R5 BrokerMain and AnalystWorker classses separately. You will need to configure an GRID_BUCKET, RESULTS_QUEUE and RESULTS_BUCKET, and AWS credentials to access them, as these do not yet have offline equivalents.

You can then follow the instructions to get the frontend started up.

You'll also need a MongoDB instance running locally.

analysis-backend's People

Contributors

abyrd avatar ansoncfit avatar evansiroky avatar landonreed avatar mattwigway avatar trevorgerhardt avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.