diff --git a/hetnet/neo4j/docker/Dockerfile b/hetnet/neo4j/docker/Dockerfile index 2221b3c..78713e6 100644 --- a/hetnet/neo4j/docker/Dockerfile +++ b/hetnet/neo4j/docker/Dockerfile @@ -1,21 +1,23 @@ -FROM neo4j:3.5.12 +FROM neo4j:4.0.6 MAINTAINER Daniel Himmelstein, -COPY scripts / -RUN chmod +x /get_data_run_neo4j.sh - -COPY files/neo4j.conf /var/lib/neo4j/conf/ -COPY files/piwik.html / -COPY files/neo4j-guide-extension-3.2.3.jar /var/lib/neo4j/plugins -COPY guides /guides - # Update or install packages RUN apt-get update && apt-get install --yes \ bzip2 \ curl \ tar \ + nano \ zip +COPY scripts / +RUN chmod +x /get_data_run_neo4j.sh + +COPY files/neo4j.conf /var/lib/neo4j/conf/ +COPY files/piwik.html / +# https://github.com/neo4j-contrib/neo4j-guides +# COPY files/neo4j-guide-extension-3.2.3.jar /var/lib/neo4j/plugins +# COPY guides /guides + # Install Neo4j APOC plugin # RUN wget --quiet --directory-prefix=/var/lib/neo4j/plugins \ # https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/3.0.4.1/apoc-3.0.4.1-all.jar diff --git a/hetnet/neo4j/docker/README.md b/hetnet/neo4j/docker/README.md index 4f17dda..6d53a52 100644 --- a/hetnet/neo4j/docker/README.md +++ b/hetnet/neo4j/docker/README.md @@ -11,7 +11,7 @@ The contents of this repository are mostly included in the Docker image. However Build the image using the following command: ```sh -TAG="dhimmel/hetionet:hetionet-v1.0_neo4j-3.5.12" +TAG="dhimmel/hetionet:hetionet-v1.0_neo4j-4.0.6" docker build --tag dhimmel/hetionet:latest --tag $TAG --file Dockerfile . ``` @@ -37,6 +37,32 @@ docker run \ dhimmel/hetionet ``` +## DELETE + +``` +TAG="dhimmel/hetionet:hetionet-v1.0_neo4j-4.0.6" +docker build --tag $TAG --file Dockerfile . +``` + +```sh +docker run \ + --name=hetionet-container \ + --rm \ + --publish=7474:7474 \ + --publish=7687:7687 \ + --volume=$HOME/neo4j/hetionet-data:/data \ + --volume=$HOME/neo4j/hetionet-logs:/logs \ + --interactive --tty \ + dhimmel/hetionet:hetionet-v1.0_neo4j-4.0.6 bash +``` + +``` +DB_URL="https://github.com/hetio/hetionet/raw/030e44430f168d934c44860ad5a9512deb7c7175/hetnet/neo4j/hetionet-v1.0-neo4j.dump" +neo4j-admin load --from=data/hetionet-v1.0-neo4j.dump --database=hetionet + +Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.dbms.database.DefaultSystemGraphInitializer@6b760460' was successfully initialized, but failed to start. Please see the attached cause exception "Unknown store version 'AF4.3.0'". +``` + ## Deploying the docker From the cloud host, first pull the docker `docker pull dhimmel/hetionet` and then start the docker `sh ~/run-docker.sh`. `run-docker.sh` should be copied from [`host/run-docker.sh`](host/run-docker.sh) in this repository into $HOME on the cloud host. diff --git a/hetnet/neo4j/docker/files/neo4j.conf b/hetnet/neo4j/docker/files/neo4j.conf index d05bf34..73bc915 100644 --- a/hetnet/neo4j/docker/files/neo4j.conf +++ b/hetnet/neo4j/docker/files/neo4j.conf @@ -5,8 +5,8 @@ # https://neo4j.com/docs/operations-manual/current/reference/configuration-settings/ #***************************************************************** -# The name of the database to mount (deprecated argument) -dbms.active_database=graph.db +# The name of the database to mount +dbms.default_database=hetionet # This setting constrains all `LOAD CSV` import files to be under the `import` directory. Remove or comment it out to # allow files to be loaded from anywhere in the filesystem; this introduces possible security problems. See the @@ -20,13 +20,15 @@ dbms.security.auth_enabled=false # Enable this to be able to upgrade a store from an older version. dbms.allow_upgrade=true +# unsupported.dbms.tx_log.fail_on_corrupted_log_files=false + #***************************************************************** # Network connector configuration #***************************************************************** # With default configuration Neo4j only accepts local connections. # To accept non-local connections, uncomment this line: -dbms.connectors.default_listen_address=0.0.0.0 +dbms.default_listen_address=0.0.0.0 # You can also choose a specific network interface, and configure a non-default # port for each connector, by setting their individual listen_address. @@ -50,7 +52,8 @@ dbms.connector.http.enabled=true #dbms.connector.http.listen_address=:7474 # HTTPS Connector. There can be zero or one HTTPS connectors. -dbms.connector.https.enabled=true +# https://community.neo4j.com/t5/neo4j-graph-platform/after-neo4j-v4-0-0-upgrade-https-set-to-enabled-but-no-ssl/m-p/32648/highlight/true#M17238 +# dbms.connector.https.enabled=false #dbms.connector.https.listen_address=:7473 # Number of Neo4j worker threads. @@ -90,7 +93,7 @@ dbms.logs.http.enabled=true #dbms.logs.debug.rotation.keep_number=7 # Log executed queries that takes longer than the configured threshold. Enable by uncommenting this line. -dbms.logs.query.enabled=true +dbms.logs.query.enabled=INFO # If the execution of query takes more time than this threshold, the query is logged. If set to zero then all queries # are logged. @@ -142,8 +145,8 @@ dbms.transaction.timeout=120s # Configure the guide-extension # https://github.com/jexp/neo4j-guides/tree/master/guide-extension -dbms.unmanaged_extension_classes=extension.web=/guides -org.neo4j.server.guide.directory=data/guides +# dbms.unmanaged_extension_classes=extension.web=/guides +# org.neo4j.server.guide.directory=data/guides # Enable remote content (guides) from anywhere # In Neo4j 3.2.1, only available in enterprise (https://github.com/neo4j/neo4j/issues/9534) diff --git a/hetnet/neo4j/docker/scripts/get_data.sh b/hetnet/neo4j/docker/scripts/get_data.sh index bc14535..b3c0e1b 100644 --- a/hetnet/neo4j/docker/scripts/get_data.sh +++ b/hetnet/neo4j/docker/scripts/get_data.sh @@ -6,14 +6,19 @@ set -o errexit cd /data mkdir -p databases -if [ ! -d "databases/graph.db" ]; then - echo "Downloading and extracting database" - DB_URL="https://github.com/hetio/hetionet/raw/e319b1b50639b845a35e31fbc16afcbe9b8c2dfd/hetnet/neo4j/hetionet-v1.0.db.tar.bz2" - curl --silent --location $DB_URL | tar --extract --bzip2 --directory=databases +HETIONET_DUMP=hetionet-v1.0-neo4j.dump +if [ ! -f "$HETIONET_DUMP" ]; then + echo "Downloading database dump" + DB_URL="https://github.com/hetio/hetionet/raw/030e44430f168d934c44860ad5a9512deb7c7175/hetnet/neo4j/$HETIONET_DUMP" + wget "$DB_URL" + # curl --silent --location $DB_URL | neo4j-admin load --from=- --database=hetionet --force else echo "Not retrieving database as it already exists" fi +# Loading takes seconds, so +neo4j-admin load --from="$HETIONET_DUMP" --database=hetionet --force + if [ ! -d "guides" ]; then echo "Downloading and extracting guides" cp --recursive /guides ./ diff --git a/hetnet/neo4j/docker/scripts/get_data_run_neo4j.sh b/hetnet/neo4j/docker/scripts/get_data_run_neo4j.sh index efe1b01..45024f8 100644 --- a/hetnet/neo4j/docker/scripts/get_data_run_neo4j.sh +++ b/hetnet/neo4j/docker/scripts/get_data_run_neo4j.sh @@ -1,3 +1,4 @@ #!/bin/sh sh /get_data.sh +export NEO4J_EDITION=community /docker-entrypoint.sh neo4j