-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create docker container to build graph file #1319
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM openjdk:8u322-jre-bullseye | ||
|
||
ENV VERSION=1.4.0 \ | ||
JAVA_MX=15G | ||
|
||
ADD https://repo1.maven.org/maven2/org/opentripplanner/otp/$VERSION/otp-$VERSION-shaded.jar /usr/local/share/java/ | ||
RUN echo "0367b1a15bac5f587807a5b897a9734209f8135c /usr/local/share/java/otp-$VERSION-shaded.jar" | sha1sum --check | ||
RUN ln -s otp-$VERSION-shaded.jar /usr/local/share/java/otp.jar | ||
|
||
COPY otp /usr/local/bin/ | ||
RUN chmod 755 /usr/local/bin/* | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you add an ENTRYPOINT here then you'll be able to avoid specifying There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ENTRYPOINT didn't do what i had hoped in the Dockerfile. I tried adding it to docker-compose which did appear to work, but just let me get ride of otp - not the need for a separate file. Might be a docker-compose version thing - will investigate further if I pick up #1275 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
version: '3' | ||
services: | ||
otp: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
volumes: | ||
- ../ansible/roles/cac-tripplanner.otp-data/files/otp_data/:/var/otp/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
exec java -Xmx"$JAVA_MX" -jar /usr/local/share/java/otp.jar "$@" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I noticed when building the graph that I received a warning that So I don't think we need to work to include the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this will cause Docker to re-download the OTP jar on each rebuild so that it can calculate a checksum and decide whether to use its cached filesystem layer or not. We've historically had struggles with reliability when downloading from Maven in places that get run a lot (CI), so in the past we've sometimes manually copied dependencies to our own S3 buckets.
But I think that would be overkill for something that most people will run once and never again. Without significant development activity on the horizon for this project I think this is fine as-is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that the Docker docs discourage the use of
ADD
for remote fetch in favor of something likeRUN curl ...
so that Docker caches based on the command string rather than the file contents, although I don't think their reasoning directly applies to this particular case because we're just copying a single file directly to a directory and not doing anything with it afterward.