Code Monkey home page Code Monkey logo

cac-tripplanner's Introduction

Clean Air Council Circuit Trip Planner and Travelshed

Development Dependencies

Development Installation

  1. Make sure you have the development dependencies installed
  2. Place GTFS .zip files, OSM files, and elevation .tif files (optional) in the otp_data folder
  3. Copy deployment/ansible/group_vars/development_template to deployment/ansible/group_vars/development and edit variables
  4. Run vagrant up
  5. See the app at http://localhost:8024! See OpenTripPlanner at http://localhost:9090.
  6. Running npm run gulp-watch from /opt/app/src will automatically collect static files together when changes are detected for Django template consumption.

Building AMIs

  1. Make a production group_vars file (similarly to how is described above with development). Make sure production is set to true, and also specify an app_username, which should be set to: ubuntu
  2. If building the otp machine, make sure the latest GTFS are in otp_data, then build a graph when them in the development environment provisioning. This will result in a new Graph.obj file being written to otp_data.
  3. In the project directory within the app VM, run: deployment/cac-stack.py create-ami --aws-access-key-id YOUR_ACCESS_KEY --aws-secret-access-key YOUR_SECRET_KEY --aws-role-arn YOUR_ASSUMED_ROLE_ARN
  4. The previous command builds all AMIs. To only build a single AMI, run the same command, but also specify the --machine-type parameter, which may be set to one of: bastion, otp, or app.

Launching AWS Stacks

  1. Copy deployment/default_template.yaml to deployment/default.yaml and edit variables
  2. In the project directory, for a set of Blue stacks in the Production environment, run: deployment/cac-stack.py launch-stacks --stack-type prod --stack-color blue --aws-access-key-id YOUR_ACCESS_KEY --aws-secret-access-key YOUR_SECRET_KEY --aws-role-arn YOUR_ASSUMED_ROLE_ARN
  3. The previous command will do the following:
  • Ensure the VPC stack is up in Production -- it will be launched if it isn't already running
  • Ensure the DataPlane stack is up in Production -- it will be launched if it isn't already running
  • Ensure the OtpServer Blue stack is up in Production -- it will be launched if it isn't already running
  • Ensure the WebServer Blue stack is up in Production -- it will be launched if it isn't already running
  1. Note that database migrations are not automatically run. When the DataPlane is first brought up, it is necessary to manually create the app user/db and run migrations.
  2. Launching a set of Production stacks with the other color (Green), will use the same VPC and DataPlane stacks, but will create different OtpServer and WebServer stacks (if they don't already exist).

Production Blue/Green deployment

  1. Note which color is currently running in production. Use the opposite color in the following steps.
  2. Set otp_host in production group_vars to the CloudFront distribution with the desired color.
  3. Run create_ami command to build new AMIs.
  4. Update default.yaml with new AMI ids.
  5. Run launch_stacks command to launch stacks with the desired color.
  6. Test new stacks thoroughly.
  7. Switch the public DNS record of the site to point to the new WebServer ELB DNS.
  8. The stacks of the previous color may be deleted when ready.

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.