Skip to content

Commit fbafd9d

Browse files
fix: Merge branch 'dev' into 'feed-diffs'.
2 parents fde413b + 2989aaa commit fbafd9d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+1147
-429
lines changed

docs/img/feed-profile.png

910 KB
Loading

docs/img/otp-deployment-diagram.png

530 KB
Loading

docs/img/public-portal.png

-622 KB
Binary file not shown.

docs/index.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
The IBI Transit Data Tools suite provides web-based tools for creating, managing, evaluating, and publishing transit data, specifically data stored in the General Transit Feed Specification (GTFS) format.
44

5-
![screenshot](img/public-portal.png)
5+
![screenshot](img/feed-profile.png)
66

7-
The following documentation is available (see full table of contents at left):
8-
9-
- **User Documentation** covering basic use and operation of the tools
10-
- **Developer Documentation** covering installation/deployment of the software and project development
7+
To get started, click a topic from the table of contents on the left pane.

docs/user/add-deployment-server.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Adding an OTP Deployment Server in Data Tools
2+
3+
Assumptions:
4+
5+
* [X] You are an admin for Data Tools.
6+
* [X] You have [set up OTP UI and backend servers on AWS](./setting-up-aws-servers.md).
7+
* [X] You have a private key file (usually ends in `.pem`) to connect to that AWS environment and EC2 servers via ssh.
8+
9+
From `Administration > Deployment servers`, click on `+ Add Server`.
10+
11+
## General Server Properties
12+
13+
| Property | Description |
14+
|----------|-------------|
15+
| Name | A descriptive display name for the server. |
16+
| Public URL | The URL where the public can access the Data Tools UI, e.g. `https://otp-mod-ui.ibi-transit.com`. It is typcially the CNAME of the CloudFront mirror of the AWS S3 bucket you created or picked for this deployment. |
17+
| Internal URLs (Optional) | The URL(s) based on the UI server IP address(es). |
18+
| S3 bucket name | The name of the AWS S3 bucket you created or picked for this deployment, where Data Tools will share files with the OTP servers. |
19+
| Admin access only? | Check this option to only allow logins from Data Tool admins. |
20+
| Project specific? (Optional) | Select a project to only allow the GTFS feeds of that project (e.g. within a region) to be deployed to this server. Leave blank to remove the project restriction. |
21+
| Use elastic load balancer (ELB) | **We recommend using an elastic load balancer (ELB)**. Behind the scenes, a new server is initialized and added to the load balancer, and old servers are removed and destroyed without interruption to the user. <br><br>The load balancer also allows instantiating multiple OTP servers on large deployments. (You can start, add, or remove more than one OTP server to the load balancer.)
22+
23+
## Load Balancer Properties
24+
25+
(Applies to Data Tools versions prior to October 2019.)
26+
27+
| Property | Description |
28+
|----------|-------------|
29+
| Instance type (Optional) | The AWS server type (defines the size, CPU, memory) for all instances on the load balancer. Defaults to `t2.medium`. <br><br> For large deployments (e.g., large metro or statewide), you may need to scale up the instance type beyond the default. Information about instance type sizes and costs can be found at the helpful resource https://ec2instances.info or in the [AWS docs](https://aws.amazon.com/ec2/instance-types/). <br><br>**Note:** Some instance types are not available in certain regions or for VPC setups. If there is a failure during the deployment process (either due to an AWS system error or an out of memory error related to the OTP graph build process), you should be notified and may need to adjust the instance type.
30+
| AMI ID (Optional) | Specify an AWS Machine Image (AMI) if it is not the default one. |
31+
| Instance count | Specifies the number of servers to create under this load balancer. Defaults to 1. |
32+
| Target group ARN | From the AWS Target Groups view (`EC2 > Left Pane > Load Balancing > Target Groups`), find the target group of the desired load balancer, and enter the ARN value under the `Description` tab. |
33+
| Subnet ID (Optional) | The first portion of the first AWS availability zone, e.g. if the zone value is `subnet-0123456789 - us-east-xx`, only enter `subnet-0123456789`. <br><br>The AWS availability zone is found under the load balancer `Description` tab for the desired load balancer in the `AWS Load Balancer` view. |
34+
| Security group ID (Optional) | The security group of the AWS load balancer that supports HTTP, HTTPS, and SSH, e.g. `sg-0123456789abcdef`. <br><br>The security group ID is found under the load balancer `Description` tab for the desired load balancer in the `AWS Load Balancer` view.|
35+
| IAM instance profile ARN | From the `AWS IAM Dashboard > Roles`, pick a role to assign to the deployment servers. Open the role details in AWS to see the IAM instance profile ARN, , e.g. `arn:aws:iam::0123456789:instance-profile/example-role`. |
36+
| Key file name | Enter a valid private key file name, without the `.pem` extension (copy value from another deployment server). |
37+
38+
If there are EC2 instances running for the desired load balancer, you can click `Terminate EC2 Instances` before proceeding.
39+
40+
Proceed to save the new deployment server (The `Save` button is at the top of the dialog). The new server will appear in the list of available servers when deploying feeds.
41+
42+
## For test deployments (from old notes)
43+
44+
A flexible approach for test deployments is to create a stable EC2
45+
instance with a good amount of memory. Identify one or more `internalUrls`
46+
which is the URL where the OTP server is listening for a `buildGraphOverWire`
47+
request. (Note: the `publicUrl` should point to a user interface
48+
for the trip planner.)

docs/user/deploying-feeds.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Deploying GTFS Feeds to OTP
2+
3+
Assumptions:
4+
5+
* [X] You have [loaded a GTFS feed into a project](./managing-projects-feeds.md).
6+
* [X] You have a deployment server available [(example: AWS)](./add-deployment-server.md).
7+
* [X] [An osm-lib server has been set up](https://github.com/conveyal/osm-lib) for Data Tools to fetch Open Streets Map (OSM) data.
8+
9+
## Executing a deployment
10+
11+
To deploy or update GTFS feeds to OTP:
12+
13+
1. Open a project.
14+
2. Click on the `Deployments` tab.
15+
3. (Optional) To create a new deployment, click `+ New Deployment`, enter a name, then press or click Enter.
16+
4. Click the name of the deployment to execute. A summary of feeds and existing deployments (if available) are shown for your review.
17+
5. Remove the feeds you don't need from the deployment. For the remaining feeds, select the correct feed version.
18+
6. In the `OTP Configuration` pane:
19+
* Select the latest OTP version (the first one in the list).
20+
* Check `Build graph only` to only generate and output a graph file on EC2 to the S3 server (no OTP server will be running after the graph is generated).
21+
* The R5 option is not used.
22+
7. If you select `Custom` under `Build configuration` or `Router configuration`, enter the desired configuration settings.
23+
8. Click the `Deploy` dropdown at the top of the main pane, then pick the server on which to perform the deployment. Existing deployments on that server will be discarded.
24+
25+
## Watching deployments take place
26+
27+
After click Deploy, you can watch the deployment progress from the right-hand panel:
28+
29+
1. The data bundle is uploaded to S3.
30+
2. One EC2 server is commissioned.
31+
3. The EC2 server downloads data and begins building the graph.
32+
4. The EC2 server uploads the graph to S3.
33+
- If you check `Build graph only`, the process stops here and EC2 server is discarded.
34+
5. The OTP process is started on EC2 to load graph.
35+
6. If more EC2 servers are designated, these will be started and told to download and load graph.

docs/user/otp-deployment.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# OTP Deployment Guide
2+
3+
In this guide:
4+
5+
- [OTP Deployment Guide](#otp-deployment-guide)
6+
- [Overview](#overview)
7+
- [OTP Deployment Architecture](#otp-deployment-architecture)
8+
- [Performing an OTP Deployment](#performing-an-otp-deployment)
9+
10+
## Overview
11+
12+
This guide describes how to configure and deploy OTP servers using OTP Data Tools, and is for intermediate to advanced OTP Data Tools administrators.
13+
14+
The deployment architecture diagram below depicts how OTP servers are managed by Data Tools and can be used with elastic load balancers. The user interface is deployed on Amazon S3 servers and optionally mirrored by CloudFront, a high-bandwidth content delivery mechanism. Data Tools prepares and sends a data bundle and configuration properties to initialize OTP servers. The data bundle includes a set of GTFS feeds and OpenStreetMap data. DataTools makes the request to the osm-lib server and then creates a bundle of the resulting OSM and GTFS data. Data Tools does not manage UI deployments at this time.
15+
16+
The steps to perform an OTP deployment describe how to set up and link OTP servers to load balancers, S3 servers to CloudFront, and tie these various AWS resources in Data Tools. Administrators can also find how to configure optional subdomains (i.e. public URLs) for OTP servers.
17+
18+
## OTP Deployment Architecture
19+
20+
The figure below depicts the OTP deployment architecture.
21+
22+
![OTP Deployment Diagram](../img/otp-deployment-diagram.png)
23+
[Source link](https://ibigroup-my.sharepoint.com/:p:/p/binh_dam/EV_e-3qGZzxIgxJy06StsuIB8TW1A50D_DeKF-aV99jIVQ?e=GMjMh7)
24+
25+
## Performing an OTP Deployment
26+
27+
1. [Setting up OTP UI and backend servers on AWS](./setting-up-aws-servers.md)
28+
2. [Adding a deployment server from Data Tools](./add-deployment-server.md)
29+
3. [Deploying GTFS feeds to OTP](./deploying-feeds.md)

docs/user/setting-up-aws-servers.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Setting Up OTP Deployment Servers on Amazon Web Services (AWS)
2+
3+
This document describes how to:
4+
5+
1. [Create an OTP UI server (AWS S3 and CloudFront)](#ui-server-s3-bucket-and-cloudfront)
6+
2. [Create an OTP backend load balancer (AWS EC2)](#backend-server-load-balancer)
7+
8+
Assumptions for IBI-hosted deployments:
9+
10+
1. You are logged into an IBI Group AWS environment.
11+
2. You have selected a region (e.g. [US East (N. Virginia)](https://console.aws.amazon.com/console/home?region=us-east-1)).
12+
3. A Virtual Private Cloud (VPC) with two subnets exists in that AWS environment.
13+
14+
## UI Server: S3 Bucket and CloudFront
15+
16+
The OTP user interface is delivered using a plain HTTP file server that does not perform any computations. The file server consists of one S3 bucket. For fast high-bandwidth file delivery, we mirror the S3 bucket using CloudFront.
17+
18+
### Create an S3 Bucket
19+
20+
1. From [AWS S3](https://console.aws.amazon.com/s3/home), click `Create Bucket`. Each deployment uses its own bucket.
21+
2. Specify a name (write down the name for use in Data Tools later).
22+
3. When specifying options, uncheck `Block All Public Access`.
23+
24+
### Create a CloudFront instance
25+
26+
1. From [AWS CloudFront Home](https://console.aws.amazon.com/cloudfront/home), click `Create Distribution` [(direct link)](https://console.aws.amazon.com/cloudfront/home?#create-distribution:).
27+
2. Select `Web Distribution`, then click `Next`.
28+
3. Under `Origin Settings`, select the `DNS name` of the S3 bucket you created above.
29+
4. Under `Cache Behavior`, select `Redirect HTTP to HTTPS`.
30+
5. Under `Distribution Settings`, select `Custom SSL certificate`, and select the `*.ibi-transit.com` certificate.
31+
6. Under `Distribution Settings`, set the `Default Root Object` value to be `index.html`.
32+
7. (Optional) Enter a comment to make the distribution easy to search. Leave other parameters as is, and click `Create Distribution`.
33+
8. Open the properties of this CloudFront instance, and copy the `Domain Name` value (e.g. `abcdef0123456789.cloudfront.net`).
34+
35+
### Create a CNAME (i.e. subdomain) for CloudFront
36+
37+
1. Go to the [AWS hosted zone for ibi-transit.com](https://console.aws.amazon.com/route53/home#resource-record-sets:Z37ATQUY9Y96RY).
38+
(It should be under [AWS Route 53](https://console.aws.amazon.com/route53/home), [Hosted Zones](https://console.aws.amazon.com/route53/home#hosted-zones:).)
39+
2. Select `Create Record Set`. Fill in the subdmain (e.g. `otp-mod-ui.ibi-transit.com`). The OTP UI will be available at this URL. Set the `Record Type` to `CNAME`.
40+
3. In the value field, paste the `Domain Name` value of the CloudFront instance above.
41+
4. Click `Create`.
42+
5. Return to [AWS CloudFront Home](https://console.aws.amazon.com/cloudfront/home).
43+
6. Edit the properties of the CloudFront instance you created:
44+
* In `Alternate Domain Names (CNAMEs)`, paste the CNAME created above.
45+
46+
### Upload files for OTP UI
47+
48+
Upload the files [referenced here](https://github.com/ibi-group/trimet-mod-otp#to-build-a-production-bundle-for-deployment) to the S3 bucket created above.
49+
50+
If updating the UI files, remember to invalidate the CloudFront instance (this forces an update of the files on CloudFront).
51+
52+
## Backend server: Load balancer
53+
54+
We recommend using an elastic load balancer (ELB) for deploying/upgrading an OTP server instance without interrupting the current one. In doing so, a new server is set up in the background, and when ready (preprocessing done), the new server is added to the load balancer, and the old server removed and destroyed.
55+
56+
The load balancer also allows instantiating multiple OTP servers on large deployments. (You can start, add, or remove more than one OTP server to the load balancer.)
57+
58+
### Create the load balancer in AWS
59+
60+
1. Go to [Create Application Load Balancer](https://console.aws.amazon.com/ec2/home#V2CreateELBWizard:type=application:)
61+
(Under [AWS EC2 Load Balancers view](https://console.aws.amazon.com/ec2/home#LoadBalancers:), click `Create Load Balancer` then `Application Load Balancer`.)
62+
2. Enter a name, add a listener for HTTPS (443), pick a VPC with two subnets/availability zones available, and select two of the subnets. (Leave other params as is, the HTTP(80) listener should be there by default). Click `Next`.
63+
3. Choose a certificate in ACM, pick the IBI Group certificate. (Leave other params as is). Click `Next`.
64+
4. Create a new security group, or use an existing one that supports HTTP, HTTPS, SSH. (Leave other params as is). Click `Next`.
65+
5. Create a new target group (pick a name). Click `Next`.
66+
6. Do not register any targets. Click `Finish`.
67+
7. From the [Load Balancer view](https://console.aws.amazon.com/ec2/home?#LoadBalancers:), select the row corresponding to your new load balancer.
68+
8. Under the `Listeners` tab, there should be two listeners, one for HTTP and one for HTTPS. Add the HTTPS listener if it is not there.
69+
9. Open the load balancer properties, and, under the `Description` tab, copy the load balancer's `DNS name` (e.g. `ibi-dev-otp-1234567890.us-east-1.elb.amazonaws.com`).
70+
71+
### Create a CNAME (i.e. subdomain) for the load balancer
72+
73+
1. Go to the [AWS hosted zone for ibi-transit.com](https://console.aws.amazon.com/route53/home#resource-record-sets:Z37ATQUY9Y96RY).\
74+
(It should be under [AWS Route 53](https://console.aws.amazon.com/route53/home), [Hosted Zones](https://console.aws.amazon.com/route53/home#hosted-zones:).)
75+
2. Select `Create Record Set`. Fill in the subdmain (e.g. `otp-mod-dev.ibi-transit.com`). Set the `Record Type` to `CNAME`.
76+
3. In the value field, paste the `DNS Name` of the load balancer instance above.
77+
4. Click `Create`.

0 commit comments

Comments
 (0)