Skip to content

Debian package #561

Closed
Closed

Description

@karussell

I would like to see a Debian package of GraphHopper. Someone interested in this too?

There is e.g. ElasticSearch which ships a deb package and builds it via a custom pom.xml

Then a docker image would be easy.

Activity

  1. devemux86 commented on Nov 16, 2015

    @devemux86
    Contributor

    👍
    Interesting idea!

    You mean the core package?

  2. karussell commented on Nov 16, 2015

    @karussell
    MemberAuthor

    The core and web, yes. Including the bash script for import and web to make GraphHopper available for more users and easier. The problem is that then a possible GraphHopper version in Debian will be probably very old compared to master, but even without this I see benefits like just providing the deb package for a very simple installation. E.g. I prefer to install ElasticSearch through deb although it is a simple java service.

  3. boldtrn commented on Dec 8, 2015

    @boldtrn
    Member

    Additionally it would be nice to have a service file for Debian (or systemd in general) to load graphhopper on server startup.

  4. akuckartz commented on Dec 8, 2015

    @akuckartz

    👍

  5. karussell commented on Sep 10, 2018

    @karussell
    MemberAuthor

    Waiting for a contribution here ... for now closing

  6. karussell commented on Mar 16, 2019

    @karussell
    MemberAuthor

    With fpm it is already partly working.

    Here are the steps:

    1. edit the config-example.yml and add
      datareader.file: /opt/graphhopper/berlin-latest.osm.pbf
      graph.location: /opt/graphhopper/graph-cache
    1. create a graphhopper file with:
    #!/bin/sh
    # change dir so that logs go into /var/log/graphhopper/logs
    cd /var/log/graphhopper
    java -jar /opt/graphhopper/graphhopper-web-0.13-SNAPSHOT.jar server /etc/graphhopper/config-example.yml

    Do not forget chmod +x graphhopper!

    1. create an empty log file (workaround to create /var/log/graphhopper/logs in a later step)
    echo '' > gh.log
    1. Install fpm
    # install ruby
    sudo apt-get install ruby ruby-dev rubygems build-essential
    # install fpm
    sudo gem install --no-ri --no-rdoc fpm
    1. create the pleaserun files
    fpm -v 0.13 -n graphhopper-service -s pleaserun -t dir --deb-no-default-config-files /usr/bin/graphhopper
    1. Create a script 'delete.sh'
    #!/bin/sh
    echo "bye bye"
    sh /usr/share/pleaserun/graphhopper/cleanup.sh
    1. create the deb package
    fpm -v 0.13 -n graphhopper -s dir -t deb --deb-no-default-config-files --config-files /etc/graphhopper/config-example.yml --after-install ./graphhopper-service.dir/usr/share/pleaserun/graphhopper/install.sh --before-remove delete.sh web/target/graphhopper-web-0.13-SNAPSHOT.jar=/opt/graphhopper/ config-example.yml=/etc/graphhopper/ graphhopper=/usr/bin/ /tmp/gh.log=/var/log/graphhopper/logs/ ./graphhopper-service.dir/usr/share/pleaserun/=/usr/share/pleaserun
    1. install the package
    sudo dpkg -i graphhopper_0.13_amd64.deb
    1. start the service
    sudo systemctl start graphhopper
    # open localhost:8989 in the browser 
    # see the log
    tail -f /var/log/graphhopper/logs/graphhopper.log
    journalctl -u graphhopper
    journalctl -xe
    1. remove the package
    sudo dpkg -r graphhopper

    TODO: changing the config to point to correct PBF is required after installing the package
    TODO: test proper removal of the package

  7. piiskop commented on Jun 9, 2020

    @piiskop

    peacecop@peacecop-HP-ProBook-4520s:/var/log/graphhopper$ java -jar /home/peacecop/graphhopper/graphhopper-web-0.13.0.jar server /home/peacecop/graphhopper/config-example.yml
    io.dropwizard.configuration.ConfigurationParsingException: /home/peacecop/graphhopper/config-example.yml has an error:

    • Malformed YAML at line: 6, column: 56; while parsing a block mapping
      in 'reader', line 1, column 1:
      graphhopper:
      ^
      expected , but found ''
      in 'reader', line 11, column 3:
      graph.flag_encoders: car
      ^

    at [Source: (FileInputStream); line: 5, column: 55]

    at io.dropwizard.configuration.ConfigurationParsingException$Builder.build(ConfigurationParsingException.java:279)
    at io.dropwizard.configuration.BaseConfigurationFactory.build(BaseConfigurationFactory.java:96)
    at io.dropwizard.cli.ConfiguredCommand.parseConfiguration(ConfiguredCommand.java:126)
    at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:74)
    at io.dropwizard.cli.Cli.run(Cli.java:78)
    at io.dropwizard.Application.run(Application.java:93)
    at com.graphhopper.http.GraphHopperApplication.main(GraphHopperApplication.java:34)
    

    Caused by: com.fasterxml.jackson.dataformat.yaml.snakeyaml.error.MarkedYAMLException: while parsing a block mapping
    in 'reader', line 1, column 1:
    graphhopper:
    ^
    expected , but found ''
    in 'reader', line 11, column 3:
    graph.flag_encoders: car
    ^

    at [Source: (FileInputStream); line: 5, column: 55]
    at com.fasterxml.jackson.dataformat.yaml.snakeyaml.error.MarkedYAMLException.from(MarkedYAMLException.java:27)
    at com.fasterxml.jackson.dataformat.yaml.YAMLParser.nextToken(YAMLParser.java:359)
    at com.fasterxml.jackson.core.JsonParser.nextFieldName(JsonParser.java:825)
    at com.fasterxml.jackson.databind.deser.std.BaseNodeDeserializer.deserializeObject(JsonNodeDeserializer.java:247)
    at com.fasterxml.jackson.databind.deser.std.JsonNodeDeserializer.deserialize(JsonNodeDeserializer.java:68)
    at com.fasterxml.jackson.databind.deser.std.JsonNodeDeserializer.deserialize(JsonNodeDeserializer.java:15)
    at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:3984)
    at com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:2384)
    at io.dropwizard.configuration.BaseConfigurationFactory.build(BaseConfigurationFactory.java:81)
    ... 5 more
    Caused by: while parsing a block mapping
    in 'reader', line 1, column 1:
    graphhopper:
    ^
    expected , but found ''
    in 'reader', line 11, column 3:
    graph.flag_encoders: car
    ^

    at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:572)
    at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
    at org.yaml.snakeyaml.parser.ParserImpl.getEvent(ParserImpl.java:168)
    at com.fasterxml.jackson.dataformat.yaml.YAMLParser.nextToken(YAMLParser.java:355)
    ... 12 more
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions