OpenTripPlanner Docker

541 views
Skip to first unread message

Ulrich Strötz

unread,
Nov 12, 2015, 4:31:07 AM11/12/15
to OpenTripPlanner Developers
Dear OTP developer community,

I would like to inform you that we created a Docker for OpenTripPlanner. 

You can find the Dockerfile along with deployment instructions for AWS Elastic Beanstalk here: thttps://github.com/allyapp/otp-docker

Feel free to create an issue or send a PR if you notice any problems.

Best,

Uli

Yael Herrera

unread,
Jun 1, 2016, 3:29:45 AM6/1/16
to OpenTripPlanner Developers
Hello Ulrich,

I tried this and pretty quickly got OTP running on AWS. However afterwards I'm not sure of how to proceed with the actually adding data to it. I have a small graph that I built locally, but I'm not sure of how to get it on AWS and make OTP use it. Right now, OTP is running but no graph is present, so any routes I try to create give me errors.

Further, is there a way to modify the Docker to create new graphs using AWS?

Any help, even if it's just a link to to the right direction would be greatly appreciated.

Thanks,

Yael

Uli Strötz

unread,
Jun 1, 2016, 3:46:54 AM6/1/16
to Yael Herrera, OpenTripPlanner Developers
Hi Yael, 

There are different ways to get data (the graph) into OTP. The way we do with the described docker is the following:

1. We build the graph on a separate instance or locally:
 java -Xmx4G -jar otp.jar --build ~/path/to/osm+gtfs

2. We post the graph to the OTP instance
curl -T Graph.obj -H "Content-Type: application/octet-stream" -X POST 'http://localhost:8080/otp/routers/router-name'

I hope this helps you. Let me know if you run if I can help somehow.

Best,

Uli




--
You received this message because you are subscribed to the Google Groups "OpenTripPlanner Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentripplanner...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Uli Strötz
GIS Developer

ally | local transport app

Making Cities Smarter.

    

Yael Herrera

unread,
Jun 3, 2016, 9:09:15 PM6/3/16
to OpenTripPlanner Developers, yohh...@gmail.com
Hi Uli,

Thanks for the reply. I created a new graph with the Basic Usage data from Portland, from the opentripplanner website. I tried to run the command, however got the following response:

curl -T Graph.obj -H "Content-Type: application/octet-stream" -X POST 'http://my_otp_environment.us-west-2.elasticbeanstalk.com/otp/routers/portland'

(I removed the port 8080 part as my instance is running in the 80 port. When I try with 8080 I get a timeout error)

response:

<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.8.1</center>
</body>
</html>

From reading the opentripplanner docs, I decided to also try the following:

1. SSH into my instance.
2. Create a /var/otp/graphs/portland folder and copy my Graph.obj file in there.
3. Modify the OTP Docker run.sh file to the following:

java -Dlogback.configurationFile=/otp/logback.xml -Xmx7G -jar otp-0.20.1-ROUTERCONFIG.jar --server --router portland --insecure --autoScan

Which should be telling OTP to start the server, look for my portland router, and add it.

When I start OTP locally and I go to: localhost:8080/otp/routers/portland, with those parameters, I see that the router has been loaded successfully.

However when I do:

eb deploy --staged --verbose

To update the version of my app with the updated run.sh file, I get an error:

INFO: Successfully built aws_beanstalk/staging-app                  
ERROR: Docker container quit unexpectedly after launch: entripplanner.routing.impl.GraphScanner.startup(GraphScanner.java:93)
        at org.opentripplanner.standalone.OTPMain.run(OTPMain.java:137)
        at org.opentripplanner.standalone.OTPMain.main(OTPMain.java:88). Check snapshot logs for details.
ERROR: [Instance: i-088a6830497fe8982] Command failed on instance. Return code: 1 Output: (TRUNCATED)...pectedly after launch: entripplanner.routing.impl.GraphScanner.startup(GraphScanner.java:93)
        at org.opentripplanner.standalone.OTPMain.run(OTPMain.java:137)
        at org.opentripplanner.standalone.OTPMain.main(OTPMain.java:88). Check snapshot logs for details. 
Hook /opt/elasticbeanstalk/hooks/appdeploy/enact/00run.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.

I tried also without the --autoScan flag, and the update is successful, however when I try to verify if my router was added by going to:


all I get is:

<RouterList>
<routerInfo/>
</RouterList>

So still no luck with the router. I'm not sure if even trying that makes sense when using OTP Docker? (I'm not familiar with Docker at all).

Do you have any clues of what I could be doing wrong?

Regards,

Yael
To unsubscribe from this group and stop receiving emails from it, send an email to opentripplanner-dev+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Uli Strötz

unread,
Jun 7, 2016, 7:21:30 AM6/7/16
to Yael Herrera, OpenTripPlanner Developers
Hi Yael,

There is something wrong setup with nginx. Is the nginx.config file present in your folder? Also could you have a look at the logs and send me them? You get them with command line tool or through the Elastic Beanstalk web interface. 

Regarding the ssh approach: I think you cannot ssh that easily inside the docker. If you want to set it up with ssh I recommend you to simply use an EC2 instance and not Elastic Beanstalk.

Best,
Uli

To unsubscribe from this group and stop receiving emails from it, send an email to opentripplanner...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Uli Strötz
GIS Developer

ally | local transport app

Making Cities Smarter.

    

--
You received this message because you are subscribed to the Google Groups "OpenTripPlanner Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentripplanner...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages