Skip to content
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

upgrade neo4j to 4.0.6 #33

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions hetnet/neo4j/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
FROM neo4j:3.5.12
FROM neo4j:4.0.6
MAINTAINER Daniel Himmelstein, <[email protected]>

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
Expand Down
28 changes: 27 additions & 1 deletion hetnet/neo4j/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
```

Expand All @@ -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.
17 changes: 10 additions & 7 deletions hetnet/neo4j/docker/files/neo4j.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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)
Expand Down
13 changes: 9 additions & 4 deletions hetnet/neo4j/docker/scripts/get_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ./
Expand Down
1 change: 1 addition & 0 deletions hetnet/neo4j/docker/scripts/get_data_run_neo4j.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
sh /get_data.sh
export NEO4J_EDITION=community
/docker-entrypoint.sh neo4j