Skip to content

Commit beff1b4

Browse files
add graph build docker compose
1 parent 22f1c5d commit beff1b4

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed
+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
version: '3.8'
2+
services:
3+
download-bundle:
4+
image: amazon/aws-cli
5+
command: "s3 cp ${S3_URI} /var/opentripplanner/ --recursive"
6+
volumes:
7+
- type: bind
8+
source: ./otp
9+
target: /var/opentripplanner
10+
# - type: bind
11+
# source: ~/.aws
12+
# target: /root/.aws
13+
otp-graph-build:
14+
depends_on:
15+
download-bundle:
16+
condition: service_completed_successfully
17+
image: alpine:latest
18+
command: "apk add --no-cache nodejs yarn && yarn global add https://github.com/ibi-group/otp-runner.git && otp-runner /var/opentripplanner/"
19+
volumes:
20+
- type: bind
21+
source: ./otp
22+
target: /var/opentripplanner
23+
- type: bind
24+
source: ./caddy/static
25+
target: /usr/share/nginx/client/
26+
caddy:
27+
image: caddy:latest
28+
restart: unless-stopped
29+
volumes:
30+
- type: bind
31+
source: ./caddy
32+
target: /etc/caddy/
33+
ports:
34+
- "80:80"
35+
- "443:443"

src/main/java/com/conveyal/datatools/manager/jobs/DeployJob.java

+7-2
Original file line numberDiff line numberDiff line change
@@ -1387,7 +1387,7 @@ public String constructUserData(boolean graphAlreadyBuilt, boolean docker) {
13871387
);
13881388

13891389
List<String> lines = new ArrayList<>();
1390-
if (graphAlreadyBuilt && docker) {
1390+
if (docker) {
13911391
lines.add("#!/bin/sh");
13921392
lines.add("yum update -y");
13931393
lines.add("yum install git -y");
@@ -1407,7 +1407,12 @@ public String constructUserData(boolean graphAlreadyBuilt, boolean docker) {
14071407
lines.add("mkdir /root/.aws");
14081408

14091409
lines.add(String.format("echo S3_URI=%s >> /root/datatools-server/otp-docker/.env", joinToS3FolderUri()));
1410-
lines.add("docker-compose -f ./otp-compose.yml up");
1410+
if (graphAlreadyBuilt) {
1411+
lines.add("docker-compose -f ./otp-compose.yml up");
1412+
} else {
1413+
lines.add("docker-compose -f ./otp-graph-build-compose.yml up");
1414+
}
1415+
14111416
} else {
14121417
lines.add("#!/bin/bash");
14131418

0 commit comments

Comments
 (0)