13 الالتزامات

المؤلف SHA1 الرسالة التاريخ
ba873648e5 Update Dockerfile
فشلت بعض الفحوصات
Build and publish graphhopper image / build-and-publish (push) Has been cancelled
2025-11-17 08:48:25 +00:00
b139bd9605 Update Dockerfile 2025-11-17 08:47:18 +00:00
9dc84fce5d Update Dockerfile 2025-11-17 08:45:48 +00:00
e43fa37b15 Update graphhopper.sh 2025-11-17 08:45:16 +00:00
Jason Baker
ed0f3aea11 don't remove graphhopper git repo directory (#44) 2025-03-08 15:59:36 +01:00
Harel M
735390c9c2 Update README.md 2024-12-22 16:20:58 +02:00
Harel M
7be2d9d406 Fixes #34 - Remove profiles from shell script 2024-12-22 16:18:55 +02:00
Jason Baker
74f23a3dd4 Multiplatform build (ARM64/AMD64) (#41)
* provide -DskipTests argument

* add multiplatform build for testing

* Revert "Revert "Add support for cross-platform builds including linux/amd64 and linux/arm64/v8 (#38)" (#39)"

This reverts commit 92d4cba7a9.

* remove test multiplatform build for PR

---------

Co-authored-by: Jason Baker <jbaker@gosonar.com>
2024-11-28 11:11:45 +02:00
Jason Baker
92d4cba7a9 Revert "Add support for cross-platform builds including linux/amd64 and linux/arm64/v8 (#38)" (#39)
This reverts commit 74f8f822bd.

Co-authored-by: Jason Baker <jbaker@gosonar.com>
2024-11-27 18:08:28 +02:00
Jason Baker
74f8f822bd Add support for cross-platform builds including linux/amd64 and linux/arm64/v8 (#38)
* use docker buildx for multiplatform build

* more verbose echos about behavior in build/push step

* echo instead of comment

---------

Co-authored-by: Jason Baker <jbaker@gosonar.com>
2024-11-26 23:01:08 +02:00
Harel M
2d0bed8a91 Update LICENSE 2024 2024-06-12 15:47:40 +03:00
HarelM
5897045b9e Upgrade mvn to 3.9.5, update java to 21 2023-11-25 14:38:42 +02:00
zstadler
f06f2beb48 Build scripts refactoring (#33)
* Build scripts refactoring

`.github/build-and-upload.sh` to use `build.sh`
Related to  #32

* Update build.sh

Following review comments
2023-01-12 11:24:39 +02:00
6 ملفات معدلة مع 66 إضافات و40 حذوفات

22
.github/build-and-upload.sh مباع Normal file → Executable file
عرض الملف

@@ -1,20 +1,12 @@
#!/bin/bash
echo "Cloning graphhopper"
git clone https://github.com/graphhopper/graphhopper.git
echo "Building docker image"
docker build . -t israelhikingmap/graphhopper:latest
docker login --username $DOCKERHUB_USER --password $DOCKERHUB_TOKEN
echo "Publishing docker image"
docker push israelhikingmap/graphhopper:latest
echo "Buidling and pushing israelhikingmap/graphhopper:latest"
./build.sh --push
TAG=`cd graphhopper; git for-each-ref --sort=committerdate refs/tags | tail -n 1 | cut -d "/" -f3`
if docker manifest inspect israelhikingmap/graphhopper:$TAG >/dev/null; then
echo "No need to publish existing version: $TAG";
TAG=`cd graphhopper; git for-each-ref --sort=committerdate refs/tags | sed -n '$s/.*\///p'`
if docker manifest inspect "israelhikingmap/graphhopper:${TAG}" >/dev/null; then
echo "No need to push existing version: ${TAG}";
else
(cd graphhopper ; git checkout tags/$TAG)
echo "Building docker image for tag: $TAG"
docker build . -t israelhikingmap/graphhopper:$TAG
echo "Publishing docker image for tag: $TAG"
docker push israelhikingmap/graphhopper:$TAG
echo "Buidling and pushing israelhikingmap/graphhopper:${TAG}"
./build.sh --push "${TAG}"
fi

عرض الملف

@@ -1,14 +1,14 @@
FROM maven:3.6.3-jdk-8 as build
FROM maven:3.9.5-eclipse-temurin-21 as build
WORKDIR /graphhopper
COPY graphhopper .
RUN mvn clean install
RUN mvn clean install -DskipTests
FROM openjdk:11.0-jre
FROM eclipse-temurin:21.0.1_12-jre
ENV JAVA_OPTS "-Xmx1g -Xms1g"
ENV GH_URL ""
RUN mkdir -p /data
@@ -16,10 +16,11 @@ WORKDIR /graphhopper
COPY --from=build /graphhopper/web/target/graphhopper*.jar ./
COPY graphhopper.sh graphhopper/config-example.yml ./
COPY graphhopper.sh ./
# Enable connections from outside of the container
RUN sed -i '/^ *bind_host/s/^ */&# /p' config-example.yml
# Remove the previous sed command since we're hardcoding in the script
# Enable connections from outside of the container by hardcoding 0.0.0.0 in config
RUN sed -i 's/^\( *bind_host:\).*/\1 0.0.0.0/' config-example.yml
VOLUME [ "/data" ]
@@ -27,4 +28,4 @@ EXPOSE 8989 8990
HEALTHCHECK --interval=5s --timeout=3s CMD curl --fail http://localhost:8989/health || exit 1
ENTRYPOINT [ "./graphhopper.sh", "-c", "config-example.yml" ]
ENTRYPOINT [ "./graphhopper.sh" ]

عرض الملف

@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2021 Israel Hiking Map
Copyright (c) 2024 Israel Hiking Map
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

عرض الملف

@@ -33,4 +33,4 @@ docker run --entrypoint /bin/bash israelhikingmap/graphhopper -c "wget https://d
Checkout `graphhopper.sh` for more usage options such as import.
In order to build the docker image locally, please run [`.github/build.sh`](.github/build.sh).
In order to build the docker image locally, please run [`./build.sh`](./build.sh).

عرض الملف

@@ -2,19 +2,32 @@
usage() (
cat <<USAGE
Build a docker image
Build a docker image for GraphHopper and optionally push it to Docker Hub
Usage:
./build.sh [<tag> | --help]
./build.sh [[--push] <tag>]
./build.sh --help
Argument:
<tag> Build an image for the given graphhopper repository tag [default: master]
<tag> Build an image for the given graphhopper repository tag [default: master]
Option:
--help Print this message
--push Push the image to Docker Hub
--help Print this message
Docker Hub credentials are needed for pushing the image. If they are not provided using the
DOCKERHUB_USER and DOCKERHUB_TOKEN environment variables, then they will be asked interactively.
USAGE
)
if [ "$1" == "--push" ]; then
push="true"
docker login --username "${DOCKERHUB_USER}" --password "${DOCKERHUB_TOKEN}" || exit $?
shift
else
push="false"
fi
if [ $# -gt 1 ] || [ "$1" == "--help" ]; then
usage
exit
@@ -23,6 +36,9 @@ fi
if [ ! -d graphhopper ]; then
echo "Cloning graphhopper"
git clone https://github.com/graphhopper/graphhopper.git
else
echo "Pulling graphhopper"
(cd graphhopper; git checkout master; git pull)
fi
imagename="israelhikingmap/graphhopper:${1:-latest}"
@@ -31,9 +47,18 @@ if [ "$1" ]; then
(cd graphhopper; git checkout --detach "$1")
fi
echo "Building docker image ${imagename}"
docker build . -t ${imagename}
echo "Creating new builder instance for multi-platform (linux/amd64, linux/arm64/v8) builds to use for building Graphhopper"
docker buildx create --use --name graphhopperbuilder
if [ $# -eq 1 ]; then
if [ "${push}" == "true" ]; then
echo "Building docker image ${imagename} for linux/amd64 and linux/arm64/v8 and pushing to Docker Hub\n"
docker buildx build --platform linux/amd64,linux/arm64/v8 -t "${imagename}" --push .
else
echo "Building docker image ${imagename} for linux/amd64 and linux/arm64/v8\n"
docker buildx build --platform linux/amd64,linux/arm64/v8 -t "${imagename}" .
echo "Use \"docker push ${imagename}\" to publish the image on Docker Hub"
fi
# Remove the builder instance after use
docker buildx rm graphhopperbuilder

عرض الملف

@@ -1,6 +1,6 @@
#!/bin/bash
(set -o igncr) 2>/dev/null && set -o igncr; # this comment is required for handling Windows cr/lf
# See StackOverflow answer http://stackoverflow.com/a/14607651
# See StackOverfix answer http://stackoverflow.com/a/14607651
GH_HOME=$(dirname "$0")
JAVA=$JAVA_HOME/bin/java
@@ -16,7 +16,7 @@ fi
echo "## using java $vers from $JAVA_HOME"
function printBashUsage {
echo "$(basename $0): Start a Gpahhopper server."
echo "$(basename $0): Start a Graphhopper server."
echo "Default user access at 0.0.0.0:8989 and API access at 0.0.0.0:8989/route"
echo ""
echo "Usage"
@@ -28,12 +28,18 @@ function printBashUsage {
echo "--import only create the graph cache, to be used later for faster starts"
echo "-c | --config <config> application configuration file location"
echo "-o | --graph-cache <dir> directory for graph cache output"
echo "-p | --profiles <string> comma separated list of vehicle profiles"
echo "--port <port> port for web server [default: 8989]"
echo "--host <host> host address of the web server [default: 0.0.0.0]"
echo "-h | --help display this message"
echo "-h | --help display this help message"
echo ""
echo "environment variables:"
echo "GH_URL download input file from this URL and save as data.pbf"
}
# Check for environment variable first
if [ -z "$URL" ] && [ ! -z "$GH_URL" ]; then
URL="$GH_URL"
fi
# one character parameters have one minus character'-'. longer parameters have two minus characters '--'
while [ ! -z $1 ]; do
case $1 in
@@ -42,9 +48,7 @@ while [ ! -z $1 ]; do
-i|--input) FILE="$2"; shift 2;;
--url) URL="$2"; shift 2;;
-o|--graph-cache) GRAPH="$2"; shift 2;;
-p|--profiles) GH_WEB_OPTS="$GH_WEB_OPTS -Ddw.graphhopper.graph.flag_encoders=$2"; shift 2;;
--port) GH_WEB_OPTS="$GH_WEB_OPTS -Ddw.server.application_connectors[0].port=$2"; shift 2;;
--host) GH_WEB_OPTS="$GH_WEB_OPTS -Ddw.server.application_connectors[0].bind_host=$2"; shift 2;;
-h|--help) printBashUsage
exit 0;;
-*) echo "Option unknown: $1"
@@ -61,7 +65,11 @@ done
: "${JAVA_OPTS:=-Xmx1g -Xms1g}"
: "${JAR:=$(find . -type f -name "*.jar")}"
# Hardcoded host to 0.0.0.0
GH_WEB_OPTS="$GH_WEB_OPTS -Ddw.server.application_connectors[0].bind_host=0.0.0.0"
if [ "$URL" != "" ]; then
echo "## Downloading OSM data from: $URL"
wget -S -nv -O "${FILE:=data.pbf}" "$URL"
fi
@@ -71,4 +79,4 @@ mkdir -p $(dirname "${GRAPH}")
echo "## Executing $ACTION. JAVA_OPTS=$JAVA_OPTS"
exec "$JAVA" $JAVA_OPTS ${FILE:+-Ddw.graphhopper.datareader.file="$FILE"} -Ddw.graphhopper.graph.location="$GRAPH" \
$GH_WEB_OPTS -jar "$JAR" $ACTION $CONFIG
$GH_WEB_OPTS -jar "$JAR" $ACTION $CONFIG