├── .dependency_license ├── .editorconfig ├── .github ├── dependabot.yml └── workflows │ ├── deploy.yml │ ├── docker.yml │ ├── editorconfig.yml │ └── license.yml ├── .gitignore ├── .remarkrc.yml ├── 0.2 ├── Dockerfile ├── conf │ ├── janusgraph-berkeleyje-lucene-server.properties │ └── log4j-server.properties ├── docker-entrypoint.sh ├── load-initdb.sh └── scripts │ └── remote-connect.groovy ├── 0.3 ├── Dockerfile ├── conf │ ├── janusgraph-berkeleyje-lucene-server.properties │ └── log4j-server.properties ├── docker-entrypoint.sh ├── load-initdb.sh └── scripts │ └── remote-connect.groovy ├── 0.4 ├── Dockerfile ├── conf │ ├── janusgraph-berkeleyje-lucene-server.properties │ └── log4j-server.properties ├── docker-entrypoint.sh ├── load-initdb.sh └── scripts │ └── remote-connect.groovy ├── 0.5 ├── Dockerfile ├── conf │ ├── gremlin-server.yaml │ ├── janusgraph-berkeleyje-es-server.properties │ ├── janusgraph-berkeleyje-lucene-server.properties │ ├── janusgraph-berkeleyje-server.properties │ ├── janusgraph-cassandra-es-server.properties │ ├── janusgraph-cql-es-server.properties │ ├── janusgraph-cql-server.properties │ ├── janusgraph-inmemory-server.properties │ └── log4j-server.properties ├── docker-entrypoint.sh ├── load-initdb.sh └── scripts │ └── remote-connect.groovy ├── 0.6 ├── Dockerfile ├── conf │ ├── janusgraph-berkeleyje-es-server.properties │ ├── janusgraph-berkeleyje-lucene-server.properties │ ├── janusgraph-berkeleyje-server.properties │ ├── janusgraph-cql-es-server.properties │ ├── janusgraph-cql-server.properties │ ├── janusgraph-inmemory-server.properties │ └── log4j-server.properties ├── docker-entrypoint.sh ├── load-initdb.sh └── scripts │ └── remote-connect.groovy ├── 1.0 ├── Dockerfile ├── conf │ ├── janusgraph-berkeleyje-es-server.properties │ ├── janusgraph-berkeleyje-lucene-server.properties │ ├── janusgraph-berkeleyje-server.properties │ ├── janusgraph-cql-es-server.properties │ ├── janusgraph-cql-server.properties │ └── janusgraph-inmemory-server.properties ├── docker-entrypoint.sh ├── load-initdb.sh └── scripts │ └── remote-connect.groovy ├── APACHE-2.0.txt ├── AUTHORS.txt ├── BUILDING.md ├── CC-BY-4.0.txt ├── CHANGELOG.md ├── CONTRIBUTORS.txt ├── DCO.txt ├── LICENSE ├── README.md ├── build-images.sh ├── build ├── Dockerfile-openjdk11.template ├── Dockerfile-openjdk8.template ├── conf │ ├── janusgraph-berkeleyje-es-server.properties │ ├── janusgraph-berkeleyje-lucene-server.properties │ ├── janusgraph-berkeleyje-server.properties │ ├── janusgraph-cql-es-server.properties │ ├── janusgraph-cql-server.properties │ └── janusgraph-inmemory-server.properties ├── docker-entrypoint.sh ├── load-initdb.sh └── scripts │ └── remote-connect.groovy ├── docker-compose-cql-es.yml ├── docker-compose-mount.yml ├── docker-compose.yml ├── example-config ├── gremlin-server.yaml └── janusgraph.properties ├── push-images.sh ├── test-image.sh └── update.sh /.dependency_license: -------------------------------------------------------------------------------- 1 | # Copyright 2020 JanusGraph Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | \.gitignore, Apache-2.0 16 | README.md, Apache-2.0 17 | BUILDING.md, Apache-2.0 18 | CHANGELOG.md, Apache-2.0 19 | AUTHORS.txt, Apache-2.0 20 | DCO.txt, Apache-2.0 21 | .csproj, Apache-2.0 22 | CC-BY-4.0.txt, Apache-2.0 23 | CONTRIBUTORS.txt, Apache-2.0 24 | appsettings.json, Apache-2.0 25 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Copyright 2020 JanusGraph Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | root = true 16 | 17 | [*] 18 | charset = utf-8 19 | indent_style = space 20 | end_of_line = lf 21 | insert_final_newline = true 22 | trim_trailing_whitespace = true 23 | 24 | [*.md] 25 | trim_trailing_whitespace = false 26 | 27 | [*.xml] 28 | indent_size = 4 29 | insert_final_newline = false 30 | 31 | [*.sh] 32 | indent_size = 2 33 | 34 | [*.{yml,yaml}] 35 | indent_size = 2 36 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 JanusGraph Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: 2 16 | updates: 17 | - package-ecosystem: github-actions 18 | directory: "/" 19 | schedule: 20 | interval: daily 21 | time: "11:00" 22 | open-pull-requests-limit: 10 23 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 JanusGraph Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | name: Deploy Images 16 | 17 | on: 18 | push: 19 | branches: 20 | - "master" 21 | 22 | jobs: 23 | deploy: 24 | runs-on: ubuntu-20.04 25 | strategy: 26 | matrix: 27 | version: ["0.5", "0.6", "1.0"] 28 | steps: 29 | - uses: actions/checkout@v4 30 | - name: Set up QEMU 31 | uses: docker/setup-qemu-action@v2 32 | - name: Set up Docker Buildx 33 | uses: docker/setup-buildx-action@v2 34 | - name: build images 35 | run: ./build-images.sh ${{ matrix.version }} 36 | - name: Login to DockerHub 37 | uses: docker/login-action@v2 38 | with: 39 | username: ${{ secrets.DOCKERHUB_USERNAME }} 40 | password: ${{ secrets.DOCKERHUB_TOKEN }} 41 | - name: push images 42 | run: ./push-images.sh ${{ matrix.version }} 43 | -------------------------------------------------------------------------------- /.github/workflows/docker.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 JanusGraph Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | name: Build Images 16 | 17 | on: 18 | push: 19 | branches-ignore: 20 | - 'dependabot/**' 21 | pull_request: 22 | 23 | jobs: 24 | build: 25 | runs-on: ubuntu-20.04 26 | strategy: 27 | matrix: 28 | version: ["0.5", "0.6", "1.0"] 29 | steps: 30 | - uses: actions/checkout@v4 31 | - name: build images 32 | run: ./build-images.sh ${{ matrix.version }} 33 | - name: Run Trivy vulnerability scanner 34 | uses: aquasecurity/trivy-action@master 35 | with: 36 | image-ref: 'docker.io/janusgraph/janusgraph:${{ matrix.version }}' 37 | format: 'template' 38 | template: '@/contrib/sarif.tpl' 39 | output: 'trivy-results.sarif' 40 | 41 | - name: Upload Trivy scan results to GitHub Security tab 42 | uses: github/codeql-action/upload-sarif@v2 43 | with: 44 | sarif_file: 'trivy-results.sarif' 45 | -------------------------------------------------------------------------------- /.github/workflows/editorconfig.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 JanusGraph Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | name: Editorconfig 16 | 17 | on: 18 | pull_request: {} 19 | 20 | jobs: 21 | check: 22 | runs-on: ubuntu-20.04 23 | steps: 24 | - name: Checkout 25 | uses: actions/checkout@v4 26 | - name: Run editorconfig 27 | uses: docker://mstruebing/editorconfig-checker 28 | -------------------------------------------------------------------------------- /.github/workflows/license.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 JanusGraph Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | name: License Validation 16 | 17 | on: 18 | pull_request: {} 19 | 20 | jobs: 21 | weasel: 22 | runs-on: ubuntu-20.04 23 | steps: 24 | - name: Checkout 25 | uses: actions/checkout@v4 26 | - name: Run weasel 27 | uses: docker://licenseweasel/weasel:v0.4 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | *.iml 3 | -------------------------------------------------------------------------------- /.remarkrc.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2019 JanusGraph-Docker Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Ignore [table-pipe-alignment] lint warning on Codacy 16 | # https://github.com/remarkjs/remark/tree/master/packages/remark-stringify#optionspaddedtable 17 | paddedTable: false 18 | -------------------------------------------------------------------------------- /0.2/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2019 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | FROM debian:buster-slim as builder 20 | 21 | ARG JANUS_VERSION=0.2.3 22 | 23 | ENV JANUS_VERSION=${JANUS_VERSION} \ 24 | JANUS_HOME=/opt/janusgraph 25 | 26 | RUN apt update -y && apt install -y gpg unzip curl && \ 27 | curl -fSL https://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/janusgraph-${JANUS_VERSION}-hadoop2.zip -o janusgraph.zip && \ 28 | curl -fSL https://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/janusgraph-${JANUS_VERSION}-hadoop2.zip.asc -o janusgraph.zip.asc && \ 29 | curl -fSL https://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/KEYS -o KEYS && \ 30 | gpg --import KEYS && \ 31 | gpg --batch --verify janusgraph.zip.asc janusgraph.zip && \ 32 | unzip janusgraph.zip && \ 33 | mv janusgraph-${JANUS_VERSION}-hadoop2 /opt/janusgraph && \ 34 | rm -rf ${JANUS_HOME}/elasticsearch && \ 35 | rm -rf ${JANUS_HOME}/javadocs && \ 36 | rm -rf ${JANUS_HOME}/log && \ 37 | rm -rf ${JANUS_HOME}/examples 38 | 39 | COPY conf/janusgraph-berkeleyje-lucene-server.properties conf/log4j-server.properties ${JANUS_HOME}/conf/gremlin-server/ 40 | COPY scripts/remote-connect.groovy ${JANUS_HOME}/scripts/ 41 | 42 | FROM openjdk:8-jre-slim-buster 43 | 44 | ARG CREATED=test 45 | ARG REVISION=test 46 | ARG JANUS_VERSION=0.2.3 47 | 48 | ENV JANUS_VERSION=${JANUS_VERSION} \ 49 | JANUS_HOME=/opt/janusgraph \ 50 | JANUS_CONFIG_DIR=/etc/opt/janusgraph \ 51 | JANUS_DATA_DIR=/var/lib/janusgraph \ 52 | JANUS_SERVER_TIMEOUT=30 \ 53 | JANUS_STORAGE_TIMEOUT=60 \ 54 | JANUS_PROPS_TEMPLATE=berkeleyje-lucene \ 55 | janusgraph.index.search.directory=/var/lib/janusgraph/index \ 56 | janusgraph.storage.directory=/var/lib/janusgraph/data \ 57 | gremlinserver.graph=/etc/opt/janusgraph/janusgraph.properties \ 58 | gremlinserver.threadPoolWorker=1 \ 59 | gremlinserver.gremlinPool=8 60 | 61 | RUN groupadd -r janusgraph --gid=999 && \ 62 | useradd -r -g janusgraph --uid=999 janusgraph && \ 63 | apt-get update -y && \ 64 | DEBIAN_FRONTEND=noninteractive apt-get install -y krb5-user && \ 65 | rm -rf /var/lib/apt/lists/* && \ 66 | mkdir /docker-entrypoint-initdb.d 67 | 68 | COPY --from=builder /opt/janusgraph/ /opt/janusgraph/ 69 | 70 | COPY docker-entrypoint.sh /usr/local/bin/ 71 | COPY load-initdb.sh /usr/local/bin/ 72 | 73 | RUN chmod 755 /usr/local/bin/docker-entrypoint.sh && \ 74 | chmod 755 /usr/local/bin/load-initdb.sh && \ 75 | chown -R janusgraph:janusgraph ${JANUS_HOME} 76 | 77 | EXPOSE 8182 78 | 79 | WORKDIR ${JANUS_HOME} 80 | 81 | ENTRYPOINT [ "docker-entrypoint.sh" ] 82 | CMD [ "janusgraph" ] 83 | 84 | LABEL org.opencontainers.image.title="JanusGraph Docker Image" \ 85 | org.opencontainers.image.description="Official JanusGraph Docker image" \ 86 | org.opencontainers.image.url="https://janusgraph.org/" \ 87 | org.opencontainers.image.documentation="https://docs.janusgraph.org/v0.2/" \ 88 | org.opencontainers.image.revision="${REVISION}" \ 89 | org.opencontainers.image.source="https://github.com/JanusGraph/janusgraph-docker/" \ 90 | org.opencontainers.image.vendor="JanusGraph" \ 91 | org.opencontainers.image.version="${JANUS_VERSION}" \ 92 | org.opencontainers.image.created="${CREATED}" \ 93 | org.opencontainers.image.license="Apache-2.0" 94 | -------------------------------------------------------------------------------- /0.2/conf/janusgraph-berkeleyje-lucene-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2019 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | gremlin.graph=org.janusgraph.core.JanusGraphFactory 20 | storage.backend=berkeleyje 21 | storage.directory=db/berkeley 22 | index.search.backend=lucene 23 | index.search.directory=db/searchindex 24 | -------------------------------------------------------------------------------- /0.2/conf/log4j-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2019 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | log4j.appender.console=org.apache.log4j.ConsoleAppender 20 | log4j.appender.console.Threshold=INFO 21 | log4j.appender.console.layout=org.apache.log4j.PatternLayout 22 | log4j.appender.console.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n 23 | 24 | log4j.rootLogger=INFO, console 25 | -------------------------------------------------------------------------------- /0.2/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 4 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 5 | # 6 | # 7 | # Copyright 2019 JanusGraph Authors 8 | # 9 | # Licensed under the Apache License, Version 2.0 (the "License"); 10 | # you may not use this file except in compliance with the License. 11 | # You may obtain a copy of the License at 12 | # 13 | # http://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, software 16 | # distributed under the License is distributed on an "AS IS" BASIS, 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | # See the License for the specific language governing permissions and 19 | # limitations under the License. 20 | 21 | JANUS_PROPS="${JANUS_CONFIG_DIR}/janusgraph.properties" 22 | GREMLIN_YAML="${JANUS_CONFIG_DIR}/gremlin-server.yaml" 23 | 24 | # running as root; step down to run as janusgraph user 25 | if [ "$1" == 'janusgraph' ] && [ "$(id -u)" == "0" ]; then 26 | mkdir -p ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 27 | chown -R janusgraph:janusgraph ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 28 | chmod 700 ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 29 | 30 | exec chroot --skip-chdir --userspec janusgraph:janusgraph / "${BASH_SOURCE}" "$@" 31 | fi 32 | 33 | # running as non root user 34 | if [ "$1" == 'janusgraph' ]; then 35 | # setup config directory 36 | mkdir -p ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 37 | cp conf/gremlin-server/janusgraph-${JANUS_PROPS_TEMPLATE}-server.properties ${JANUS_CONFIG_DIR}/janusgraph.properties 38 | cp conf/gremlin-server/gremlin-server.yaml ${JANUS_CONFIG_DIR} 39 | chown -R "$(id -u):$(id -g)" ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 40 | chmod 700 ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 41 | chmod -R 600 ${JANUS_CONFIG_DIR}/* 42 | 43 | # apply configuration from environment 44 | while IFS='=' read -r envvar_key envvar_val; do 45 | if [[ "${envvar_key}" =~ janusgraph\. ]] && [[ ! -z ${envvar_val} ]]; then 46 | # strip namespace and use properties file delimiter for janusgraph properties 47 | config_file=${JANUS_PROPS} delimiter="=" envvar_key=${envvar_key#"janusgraph."} 48 | elif [[ "${envvar_key}" =~ gremlinserver\. ]] && [[ ! -z ${envvar_val} ]]; then 49 | # strip namespace, use yaml delimiter and add space after delimiter for gremlinserver properties 50 | config_file=${GREMLIN_YAML} delimiter=":" envvar_key=${envvar_key#"gremlinserver."} envvar_val=" $envvar_val" 51 | else 52 | continue 53 | fi 54 | 55 | # if the line exists replace it; otherwise append it 56 | if grep -q -E "^\s*${envvar_key}\s*${delimiter}\.*" ${config_file}; then 57 | sed -ri "s#^(\s*${envvar_key}\s*${delimiter}).*#\\1${envvar_val}#" ${config_file} 58 | else 59 | echo "${envvar_key}${delimiter}${envvar_val}" >> ${config_file} 60 | fi 61 | done < <(env) 62 | 63 | if [ "$2" == 'show-config' ]; then 64 | echo "# contents of ${JANUS_PROPS}" 65 | cat "$JANUS_PROPS" 66 | echo "---------------------------------------" 67 | echo "# contents of ${GREMLIN_YAML}" 68 | cat "$GREMLIN_YAML" 69 | exit 0 70 | else 71 | # wait for storage 72 | if ! [ -z "${JANUS_STORAGE_TIMEOUT:-}" ]; then 73 | F="$(mktemp --suffix .groovy)" 74 | echo "graph = JanusGraphFactory.open('${JANUS_CONFIG_DIR}/janusgraph.properties')" > $F 75 | timeout "${JANUS_STORAGE_TIMEOUT}s" bash -c \ 76 | "until bin/gremlin.sh -e $F > /dev/null 2>&1; do echo \"waiting for storage...\"; sleep 5; done" 77 | rm -f "$F" 78 | fi 79 | 80 | /usr/local/bin/load-initdb.sh & 81 | 82 | exec ${JANUS_HOME}/bin/gremlin-server.sh ${JANUS_CONFIG_DIR}/gremlin-server.yaml 83 | fi 84 | fi 85 | 86 | # override hosts for remote connections with Gremlin Console 87 | if ! [ -z "${GREMLIN_REMOTE_HOSTS:-}" ]; then 88 | sed -i "s/hosts\s*:.*/hosts: [$GREMLIN_REMOTE_HOSTS]/" ${JANUS_HOME}/conf/remote.yaml 89 | fi 90 | 91 | exec "$@" 92 | -------------------------------------------------------------------------------- /0.2/load-initdb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 4 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 5 | # 6 | # 7 | # Copyright 2019 JanusGraph Authors 8 | # 9 | # Licensed under the Apache License, Version 2.0 (the "License"); 10 | # you may not use this file except in compliance with the License. 11 | # You may obtain a copy of the License at 12 | # 13 | # http://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, software 16 | # distributed under the License is distributed on an "AS IS" BASIS, 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | # See the License for the specific language governing permissions and 19 | # limitations under the License. 20 | 21 | # exit early if directory is empty 22 | if ! [ "$(ls -A /docker-entrypoint-initdb.d)" ]; then 23 | exit 0 24 | fi 25 | 26 | # wait for JanusGraph Server 27 | if ! [ -z "${JANUS_SERVER_TIMEOUT:-}" ]; then 28 | timeout "${JANUS_SERVER_TIMEOUT}s" bash -c \ 29 | "until true &>/dev/null g 21 | -------------------------------------------------------------------------------- /0.3/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2019 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | FROM debian:buster-slim as builder 20 | 21 | ARG JANUS_VERSION=0.3.3 22 | 23 | ENV JANUS_VERSION=${JANUS_VERSION} \ 24 | JANUS_HOME=/opt/janusgraph 25 | 26 | RUN apt update -y && apt install -y gpg unzip curl && \ 27 | curl -fSL https://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/janusgraph-${JANUS_VERSION}-hadoop2.zip -o janusgraph.zip && \ 28 | curl -fSL https://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/janusgraph-${JANUS_VERSION}-hadoop2.zip.asc -o janusgraph.zip.asc && \ 29 | curl -fSL https://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/KEYS -o KEYS && \ 30 | gpg --import KEYS && \ 31 | gpg --batch --verify janusgraph.zip.asc janusgraph.zip && \ 32 | unzip janusgraph.zip && \ 33 | mv janusgraph-${JANUS_VERSION}-hadoop2 /opt/janusgraph && \ 34 | rm -rf ${JANUS_HOME}/elasticsearch && \ 35 | rm -rf ${JANUS_HOME}/javadocs && \ 36 | rm -rf ${JANUS_HOME}/log && \ 37 | rm -rf ${JANUS_HOME}/examples 38 | 39 | COPY conf/janusgraph-berkeleyje-lucene-server.properties conf/log4j-server.properties ${JANUS_HOME}/conf/gremlin-server/ 40 | COPY scripts/remote-connect.groovy ${JANUS_HOME}/scripts/ 41 | 42 | FROM openjdk:8-jre-slim-buster 43 | 44 | ARG CREATED=test 45 | ARG REVISION=test 46 | ARG JANUS_VERSION=0.3.3 47 | 48 | ENV JANUS_VERSION=${JANUS_VERSION} \ 49 | JANUS_HOME=/opt/janusgraph \ 50 | JANUS_CONFIG_DIR=/etc/opt/janusgraph \ 51 | JANUS_DATA_DIR=/var/lib/janusgraph \ 52 | JANUS_SERVER_TIMEOUT=30 \ 53 | JANUS_STORAGE_TIMEOUT=60 \ 54 | JANUS_PROPS_TEMPLATE=berkeleyje-lucene \ 55 | janusgraph.index.search.directory=/var/lib/janusgraph/index \ 56 | janusgraph.storage.directory=/var/lib/janusgraph/data \ 57 | gremlinserver.graph=/etc/opt/janusgraph/janusgraph.properties \ 58 | gremlinserver.threadPoolWorker=1 \ 59 | gremlinserver.gremlinPool=8 60 | 61 | RUN groupadd -r janusgraph --gid=999 && \ 62 | useradd -r -g janusgraph --uid=999 janusgraph && \ 63 | apt-get update -y && \ 64 | DEBIAN_FRONTEND=noninteractive apt-get install -y krb5-user && \ 65 | rm -rf /var/lib/apt/lists/* && \ 66 | mkdir /docker-entrypoint-initdb.d 67 | 68 | COPY --from=builder /opt/janusgraph/ /opt/janusgraph/ 69 | 70 | COPY docker-entrypoint.sh /usr/local/bin/ 71 | COPY load-initdb.sh /usr/local/bin/ 72 | 73 | RUN chmod 755 /usr/local/bin/docker-entrypoint.sh && \ 74 | chmod 755 /usr/local/bin/load-initdb.sh && \ 75 | chown -R janusgraph:janusgraph ${JANUS_HOME} 76 | 77 | EXPOSE 8182 78 | 79 | WORKDIR ${JANUS_HOME} 80 | 81 | ENTRYPOINT [ "docker-entrypoint.sh" ] 82 | CMD [ "janusgraph" ] 83 | 84 | LABEL org.opencontainers.image.title="JanusGraph Docker Image" \ 85 | org.opencontainers.image.description="Official JanusGraph Docker image" \ 86 | org.opencontainers.image.url="https://janusgraph.org/" \ 87 | org.opencontainers.image.documentation="https://docs.janusgraph.org/v0.3/" \ 88 | org.opencontainers.image.revision="${REVISION}" \ 89 | org.opencontainers.image.source="https://github.com/JanusGraph/janusgraph-docker/" \ 90 | org.opencontainers.image.vendor="JanusGraph" \ 91 | org.opencontainers.image.version="${JANUS_VERSION}" \ 92 | org.opencontainers.image.created="${CREATED}" \ 93 | org.opencontainers.image.license="Apache-2.0" 94 | -------------------------------------------------------------------------------- /0.3/conf/janusgraph-berkeleyje-lucene-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2019 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | gremlin.graph=org.janusgraph.core.JanusGraphFactory 20 | storage.backend=berkeleyje 21 | storage.directory=db/berkeley 22 | index.search.backend=lucene 23 | index.search.directory=db/searchindex 24 | -------------------------------------------------------------------------------- /0.3/conf/log4j-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2019 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | log4j.appender.console=org.apache.log4j.ConsoleAppender 20 | log4j.appender.console.Threshold=INFO 21 | log4j.appender.console.layout=org.apache.log4j.PatternLayout 22 | log4j.appender.console.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n 23 | 24 | log4j.rootLogger=INFO, console 25 | -------------------------------------------------------------------------------- /0.3/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 4 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 5 | # 6 | # 7 | # Copyright 2019 JanusGraph Authors 8 | # 9 | # Licensed under the Apache License, Version 2.0 (the "License"); 10 | # you may not use this file except in compliance with the License. 11 | # You may obtain a copy of the License at 12 | # 13 | # http://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, software 16 | # distributed under the License is distributed on an "AS IS" BASIS, 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | # See the License for the specific language governing permissions and 19 | # limitations under the License. 20 | 21 | JANUS_PROPS="${JANUS_CONFIG_DIR}/janusgraph.properties" 22 | GREMLIN_YAML="${JANUS_CONFIG_DIR}/gremlin-server.yaml" 23 | 24 | # running as root; step down to run as janusgraph user 25 | if [ "$1" == 'janusgraph' ] && [ "$(id -u)" == "0" ]; then 26 | mkdir -p ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 27 | chown -R janusgraph:janusgraph ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 28 | chmod 700 ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 29 | 30 | exec chroot --skip-chdir --userspec janusgraph:janusgraph / "${BASH_SOURCE}" "$@" 31 | fi 32 | 33 | # running as non root user 34 | if [ "$1" == 'janusgraph' ]; then 35 | # setup config directory 36 | mkdir -p ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 37 | cp conf/gremlin-server/janusgraph-${JANUS_PROPS_TEMPLATE}-server.properties ${JANUS_CONFIG_DIR}/janusgraph.properties 38 | cp conf/gremlin-server/gremlin-server.yaml ${JANUS_CONFIG_DIR} 39 | chown -R "$(id -u):$(id -g)" ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 40 | chmod 700 ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 41 | chmod -R 600 ${JANUS_CONFIG_DIR}/* 42 | 43 | # apply configuration from environment 44 | while IFS='=' read -r envvar_key envvar_val; do 45 | if [[ "${envvar_key}" =~ janusgraph\. ]] && [[ ! -z ${envvar_val} ]]; then 46 | # strip namespace and use properties file delimiter for janusgraph properties 47 | config_file=${JANUS_PROPS} delimiter="=" envvar_key=${envvar_key#"janusgraph."} 48 | elif [[ "${envvar_key}" =~ gremlinserver\. ]] && [[ ! -z ${envvar_val} ]]; then 49 | # strip namespace, use yaml delimiter and add space after delimiter for gremlinserver properties 50 | config_file=${GREMLIN_YAML} delimiter=":" envvar_key=${envvar_key#"gremlinserver."} envvar_val=" $envvar_val" 51 | else 52 | continue 53 | fi 54 | 55 | # if the line exists replace it; otherwise append it 56 | if grep -q -E "^\s*${envvar_key}\s*${delimiter}\.*" ${config_file}; then 57 | sed -ri "s#^(\s*${envvar_key}\s*${delimiter}).*#\\1${envvar_val}#" ${config_file} 58 | else 59 | echo "${envvar_key}${delimiter}${envvar_val}" >> ${config_file} 60 | fi 61 | done < <(env) 62 | 63 | if [ "$2" == 'show-config' ]; then 64 | echo "# contents of ${JANUS_PROPS}" 65 | cat "$JANUS_PROPS" 66 | echo "---------------------------------------" 67 | echo "# contents of ${GREMLIN_YAML}" 68 | cat "$GREMLIN_YAML" 69 | exit 0 70 | else 71 | # wait for storage 72 | if ! [ -z "${JANUS_STORAGE_TIMEOUT:-}" ]; then 73 | F="$(mktemp --suffix .groovy)" 74 | echo "graph = JanusGraphFactory.open('${JANUS_CONFIG_DIR}/janusgraph.properties')" > $F 75 | timeout "${JANUS_STORAGE_TIMEOUT}s" bash -c \ 76 | "until bin/gremlin.sh -e $F > /dev/null 2>&1; do echo \"waiting for storage...\"; sleep 5; done" 77 | rm -f "$F" 78 | fi 79 | 80 | /usr/local/bin/load-initdb.sh & 81 | 82 | exec ${JANUS_HOME}/bin/gremlin-server.sh ${JANUS_CONFIG_DIR}/gremlin-server.yaml 83 | fi 84 | fi 85 | 86 | # override hosts for remote connections with Gremlin Console 87 | if ! [ -z "${GREMLIN_REMOTE_HOSTS:-}" ]; then 88 | sed -i "s/hosts\s*:.*/hosts: [$GREMLIN_REMOTE_HOSTS]/" ${JANUS_HOME}/conf/remote.yaml 89 | fi 90 | 91 | exec "$@" 92 | -------------------------------------------------------------------------------- /0.3/load-initdb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 4 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 5 | # 6 | # 7 | # Copyright 2019 JanusGraph Authors 8 | # 9 | # Licensed under the Apache License, Version 2.0 (the "License"); 10 | # you may not use this file except in compliance with the License. 11 | # You may obtain a copy of the License at 12 | # 13 | # http://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, software 16 | # distributed under the License is distributed on an "AS IS" BASIS, 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | # See the License for the specific language governing permissions and 19 | # limitations under the License. 20 | 21 | # exit early if directory is empty 22 | if ! [ "$(ls -A /docker-entrypoint-initdb.d)" ]; then 23 | exit 0 24 | fi 25 | 26 | # wait for JanusGraph Server 27 | if ! [ -z "${JANUS_SERVER_TIMEOUT:-}" ]; then 28 | timeout "${JANUS_SERVER_TIMEOUT}s" bash -c \ 29 | "until true &>/dev/null g 21 | -------------------------------------------------------------------------------- /0.4/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2019 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | FROM debian:buster-slim as builder 20 | 21 | ARG JANUS_VERSION=0.4.1 22 | 23 | ENV JANUS_VERSION=${JANUS_VERSION} \ 24 | JANUS_HOME=/opt/janusgraph 25 | 26 | RUN apt update -y && apt install -y gpg unzip curl && \ 27 | curl -fSL https://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/janusgraph-${JANUS_VERSION}-hadoop2.zip -o janusgraph.zip && \ 28 | curl -fSL https://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/janusgraph-${JANUS_VERSION}-hadoop2.zip.asc -o janusgraph.zip.asc && \ 29 | curl -fSL https://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/KEYS -o KEYS && \ 30 | gpg --import KEYS && \ 31 | gpg --batch --verify janusgraph.zip.asc janusgraph.zip && \ 32 | unzip janusgraph.zip && \ 33 | mv janusgraph-${JANUS_VERSION}-hadoop2 /opt/janusgraph && \ 34 | rm -rf ${JANUS_HOME}/elasticsearch && \ 35 | rm -rf ${JANUS_HOME}/javadocs && \ 36 | rm -rf ${JANUS_HOME}/log && \ 37 | rm -rf ${JANUS_HOME}/examples 38 | 39 | COPY conf/janusgraph-berkeleyje-lucene-server.properties conf/log4j-server.properties ${JANUS_HOME}/conf/gremlin-server/ 40 | COPY scripts/remote-connect.groovy ${JANUS_HOME}/scripts/ 41 | 42 | FROM openjdk:8-jre-slim-buster 43 | 44 | ARG CREATED=test 45 | ARG REVISION=test 46 | ARG JANUS_VERSION=0.4.1 47 | 48 | ENV JANUS_VERSION=${JANUS_VERSION} \ 49 | JANUS_HOME=/opt/janusgraph \ 50 | JANUS_CONFIG_DIR=/etc/opt/janusgraph \ 51 | JANUS_DATA_DIR=/var/lib/janusgraph \ 52 | JANUS_SERVER_TIMEOUT=30 \ 53 | JANUS_STORAGE_TIMEOUT=60 \ 54 | JANUS_PROPS_TEMPLATE=berkeleyje-lucene \ 55 | janusgraph.index.search.directory=/var/lib/janusgraph/index \ 56 | janusgraph.storage.directory=/var/lib/janusgraph/data \ 57 | gremlinserver.graph=/etc/opt/janusgraph/janusgraph.properties \ 58 | gremlinserver.threadPoolWorker=1 \ 59 | gremlinserver.gremlinPool=8 60 | 61 | RUN groupadd -r janusgraph --gid=999 && \ 62 | useradd -r -g janusgraph --uid=999 janusgraph && \ 63 | apt-get update -y && \ 64 | DEBIAN_FRONTEND=noninteractive apt-get install -y krb5-user && \ 65 | rm -rf /var/lib/apt/lists/* && \ 66 | mkdir /docker-entrypoint-initdb.d 67 | 68 | COPY --from=builder /opt/janusgraph/ /opt/janusgraph/ 69 | 70 | COPY docker-entrypoint.sh /usr/local/bin/ 71 | COPY load-initdb.sh /usr/local/bin/ 72 | 73 | RUN chmod 755 /usr/local/bin/docker-entrypoint.sh && \ 74 | chmod 755 /usr/local/bin/load-initdb.sh && \ 75 | chown -R janusgraph:janusgraph ${JANUS_HOME} 76 | 77 | EXPOSE 8182 78 | 79 | WORKDIR ${JANUS_HOME} 80 | 81 | ENTRYPOINT [ "docker-entrypoint.sh" ] 82 | CMD [ "janusgraph" ] 83 | 84 | LABEL org.opencontainers.image.title="JanusGraph Docker Image" \ 85 | org.opencontainers.image.description="Official JanusGraph Docker image" \ 86 | org.opencontainers.image.url="https://janusgraph.org/" \ 87 | org.opencontainers.image.documentation="https://docs.janusgraph.org/v0.4/" \ 88 | org.opencontainers.image.revision="${REVISION}" \ 89 | org.opencontainers.image.source="https://github.com/JanusGraph/janusgraph-docker/" \ 90 | org.opencontainers.image.vendor="JanusGraph" \ 91 | org.opencontainers.image.version="${JANUS_VERSION}" \ 92 | org.opencontainers.image.created="${CREATED}" \ 93 | org.opencontainers.image.license="Apache-2.0" 94 | -------------------------------------------------------------------------------- /0.4/conf/janusgraph-berkeleyje-lucene-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2019 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | gremlin.graph=org.janusgraph.core.JanusGraphFactory 20 | storage.backend=berkeleyje 21 | storage.directory=db/berkeley 22 | index.search.backend=lucene 23 | index.search.directory=db/searchindex 24 | -------------------------------------------------------------------------------- /0.4/conf/log4j-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2019 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | log4j.appender.console=org.apache.log4j.ConsoleAppender 20 | log4j.appender.console.Threshold=INFO 21 | log4j.appender.console.layout=org.apache.log4j.PatternLayout 22 | log4j.appender.console.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n 23 | 24 | log4j.rootLogger=INFO, console 25 | -------------------------------------------------------------------------------- /0.4/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 4 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 5 | # 6 | # 7 | # Copyright 2019 JanusGraph Authors 8 | # 9 | # Licensed under the Apache License, Version 2.0 (the "License"); 10 | # you may not use this file except in compliance with the License. 11 | # You may obtain a copy of the License at 12 | # 13 | # http://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, software 16 | # distributed under the License is distributed on an "AS IS" BASIS, 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | # See the License for the specific language governing permissions and 19 | # limitations under the License. 20 | 21 | JANUS_PROPS="${JANUS_CONFIG_DIR}/janusgraph.properties" 22 | GREMLIN_YAML="${JANUS_CONFIG_DIR}/gremlin-server.yaml" 23 | 24 | # running as root; step down to run as janusgraph user 25 | if [ "$1" == 'janusgraph' ] && [ "$(id -u)" == "0" ]; then 26 | mkdir -p ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 27 | chown -R janusgraph:janusgraph ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 28 | chmod 700 ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 29 | 30 | exec chroot --skip-chdir --userspec janusgraph:janusgraph / "${BASH_SOURCE}" "$@" 31 | fi 32 | 33 | # running as non root user 34 | if [ "$1" == 'janusgraph' ]; then 35 | # setup config directory 36 | mkdir -p ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 37 | cp conf/gremlin-server/janusgraph-${JANUS_PROPS_TEMPLATE}-server.properties ${JANUS_CONFIG_DIR}/janusgraph.properties 38 | cp conf/gremlin-server/gremlin-server.yaml ${JANUS_CONFIG_DIR} 39 | chown -R "$(id -u):$(id -g)" ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 40 | chmod 700 ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 41 | chmod -R 600 ${JANUS_CONFIG_DIR}/* 42 | 43 | # apply configuration from environment 44 | while IFS='=' read -r envvar_key envvar_val; do 45 | if [[ "${envvar_key}" =~ janusgraph\. ]] && [[ ! -z ${envvar_val} ]]; then 46 | # strip namespace and use properties file delimiter for janusgraph properties 47 | config_file=${JANUS_PROPS} delimiter="=" envvar_key=${envvar_key#"janusgraph."} 48 | elif [[ "${envvar_key}" =~ gremlinserver\. ]] && [[ ! -z ${envvar_val} ]]; then 49 | # strip namespace, use yaml delimiter and add space after delimiter for gremlinserver properties 50 | config_file=${GREMLIN_YAML} delimiter=":" envvar_key=${envvar_key#"gremlinserver."} envvar_val=" $envvar_val" 51 | else 52 | continue 53 | fi 54 | 55 | # if the line exists replace it; otherwise append it 56 | if grep -q -E "^\s*${envvar_key}\s*${delimiter}\.*" ${config_file}; then 57 | sed -ri "s#^(\s*${envvar_key}\s*${delimiter}).*#\\1${envvar_val}#" ${config_file} 58 | else 59 | echo "${envvar_key}${delimiter}${envvar_val}" >> ${config_file} 60 | fi 61 | done < <(env) 62 | 63 | if [ "$2" == 'show-config' ]; then 64 | echo "# contents of ${JANUS_PROPS}" 65 | cat "$JANUS_PROPS" 66 | echo "---------------------------------------" 67 | echo "# contents of ${GREMLIN_YAML}" 68 | cat "$GREMLIN_YAML" 69 | exit 0 70 | else 71 | # wait for storage 72 | if ! [ -z "${JANUS_STORAGE_TIMEOUT:-}" ]; then 73 | F="$(mktemp --suffix .groovy)" 74 | echo "graph = JanusGraphFactory.open('${JANUS_CONFIG_DIR}/janusgraph.properties')" > $F 75 | timeout "${JANUS_STORAGE_TIMEOUT}s" bash -c \ 76 | "until bin/gremlin.sh -e $F > /dev/null 2>&1; do echo \"waiting for storage...\"; sleep 5; done" 77 | rm -f "$F" 78 | fi 79 | 80 | /usr/local/bin/load-initdb.sh & 81 | 82 | exec ${JANUS_HOME}/bin/gremlin-server.sh ${JANUS_CONFIG_DIR}/gremlin-server.yaml 83 | fi 84 | fi 85 | 86 | # override hosts for remote connections with Gremlin Console 87 | if ! [ -z "${GREMLIN_REMOTE_HOSTS:-}" ]; then 88 | sed -i "s/hosts\s*:.*/hosts: [$GREMLIN_REMOTE_HOSTS]/" ${JANUS_HOME}/conf/remote.yaml 89 | fi 90 | 91 | exec "$@" 92 | -------------------------------------------------------------------------------- /0.4/load-initdb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 4 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 5 | # 6 | # 7 | # Copyright 2019 JanusGraph Authors 8 | # 9 | # Licensed under the Apache License, Version 2.0 (the "License"); 10 | # you may not use this file except in compliance with the License. 11 | # You may obtain a copy of the License at 12 | # 13 | # http://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, software 16 | # distributed under the License is distributed on an "AS IS" BASIS, 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | # See the License for the specific language governing permissions and 19 | # limitations under the License. 20 | 21 | # exit early if directory is empty 22 | if ! [ "$(ls -A /docker-entrypoint-initdb.d)" ]; then 23 | exit 0 24 | fi 25 | 26 | # wait for JanusGraph Server 27 | if ! [ -z "${JANUS_SERVER_TIMEOUT:-}" ]; then 28 | timeout "${JANUS_SERVER_TIMEOUT}s" bash -c \ 29 | "until true &>/dev/null g 21 | -------------------------------------------------------------------------------- /0.5/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2019 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | FROM debian:buster-slim as builder 20 | 21 | ARG TARGETARCH 22 | ARG JANUS_VERSION=0.5.3 23 | ARG YQ_VERSION=3.4.1 24 | 25 | ENV JANUS_VERSION=${JANUS_VERSION} \ 26 | JANUS_HOME=/opt/janusgraph 27 | 28 | WORKDIR /opt 29 | 30 | RUN apt update -y && apt install -y gpg unzip curl && \ 31 | curl -fSL https://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/janusgraph-${JANUS_VERSION}.zip -o janusgraph.zip && \ 32 | curl -fSL https://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/janusgraph-${JANUS_VERSION}.zip.asc -o janusgraph.zip.asc && \ 33 | curl -fSL https://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/KEYS -o KEYS && \ 34 | curl -fSL https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_${TARGETARCH} -o yq && \ 35 | gpg --import KEYS && \ 36 | gpg --batch --verify janusgraph.zip.asc janusgraph.zip && \ 37 | unzip janusgraph.zip && \ 38 | mv janusgraph-${JANUS_VERSION} /opt/janusgraph && \ 39 | rm -rf ${JANUS_HOME}/elasticsearch && \ 40 | rm -rf ${JANUS_HOME}/javadocs && \ 41 | rm -rf ${JANUS_HOME}/log && \ 42 | rm -rf ${JANUS_HOME}/examples 43 | 44 | COPY conf/ ${JANUS_HOME}/conf/gremlin-server/ 45 | COPY scripts/remote-connect.groovy ${JANUS_HOME}/scripts/ 46 | 47 | FROM eclipse-temurin:8-jdk 48 | 49 | ARG CREATED=test 50 | ARG REVISION=test 51 | ARG JANUS_VERSION=0.5.3 52 | 53 | ENV JANUS_VERSION=${JANUS_VERSION} \ 54 | JANUS_HOME=/opt/janusgraph \ 55 | JANUS_CONFIG_DIR=/etc/opt/janusgraph \ 56 | JANUS_DATA_DIR=/var/lib/janusgraph \ 57 | JANUS_SERVER_TIMEOUT=30 \ 58 | JANUS_STORAGE_TIMEOUT=60 \ 59 | JANUS_PROPS_TEMPLATE=berkeleyje-lucene \ 60 | JANUS_INITDB_DIR=/docker-entrypoint-initdb.d \ 61 | gremlinserver.graphs.graph=/etc/opt/janusgraph/janusgraph.properties \ 62 | gremlinserver.threadPoolWorker=1 \ 63 | gremlinserver.gremlinPool=8 64 | 65 | RUN groupadd -r janusgraph --gid=999 && \ 66 | useradd -r -g janusgraph --uid=999 -d ${JANUS_DATA_DIR} janusgraph && \ 67 | apt-get update -y && \ 68 | DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends krb5-user && \ 69 | rm -rf /var/lib/apt/lists/* 70 | 71 | COPY --from=builder /opt/janusgraph/ /opt/janusgraph/ 72 | COPY --from=builder /opt/yq /usr/bin/yq 73 | COPY docker-entrypoint.sh /usr/local/bin/ 74 | COPY load-initdb.sh /usr/local/bin/ 75 | 76 | RUN chmod 755 /usr/local/bin/docker-entrypoint.sh && \ 77 | chmod 755 /usr/local/bin/load-initdb.sh && \ 78 | chmod 755 /usr/bin/yq && \ 79 | mkdir -p ${JANUS_INITDB_DIR} ${JANUS_CONFIG_DIR} ${JANUS_DATA_DIR} && \ 80 | chown -R janusgraph:janusgraph ${JANUS_HOME} ${JANUS_INITDB_DIR} ${JANUS_CONFIG_DIR} ${JANUS_DATA_DIR} 81 | 82 | EXPOSE 8182 83 | 84 | WORKDIR ${JANUS_HOME} 85 | USER janusgraph 86 | 87 | ENTRYPOINT [ "docker-entrypoint.sh" ] 88 | CMD [ "janusgraph" ] 89 | 90 | LABEL org.opencontainers.image.title="JanusGraph Docker Image" \ 91 | org.opencontainers.image.description="Official JanusGraph Docker image" \ 92 | org.opencontainers.image.url="https://janusgraph.org/" \ 93 | org.opencontainers.image.documentation="https://docs.janusgraph.org/v0.5/" \ 94 | org.opencontainers.image.revision="${REVISION}" \ 95 | org.opencontainers.image.source="https://github.com/JanusGraph/janusgraph-docker/" \ 96 | org.opencontainers.image.vendor="JanusGraph" \ 97 | org.opencontainers.image.version="${JANUS_VERSION}" \ 98 | org.opencontainers.image.created="${CREATED}" \ 99 | org.opencontainers.image.license="Apache-2.0" 100 | -------------------------------------------------------------------------------- /0.5/conf/gremlin-server.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2021 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | host: 0.0.0.0 20 | port: 8182 21 | scriptEvaluationTimeout: 30000 22 | channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer 23 | graphs: 24 | graph: /etc/opt/janusgraph/janusgraph.properties 25 | scriptEngines: 26 | gremlin-groovy: 27 | plugins: 28 | org.janusgraph.graphdb.tinkerpop.plugin.JanusGraphGremlinPlugin: {} 29 | org.apache.tinkerpop.gremlin.server.jsr223.GremlinServerGremlinPlugin: {} 30 | org.apache.tinkerpop.gremlin.tinkergraph.jsr223.TinkerGraphGremlinPlugin: {} 31 | org.apache.tinkerpop.gremlin.jsr223.ImportGremlinPlugin: {classImports: [java.lang.Math], methodImports: [java.lang.Math#*]} 32 | org.apache.tinkerpop.gremlin.jsr223.ScriptFileGremlinPlugin: {files: [scripts/empty-sample.groovy]} 33 | serializers: 34 | - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }} 35 | - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV3d0, config: { serializeResultToString: true }} 36 | - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV3d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }} 37 | # Older serialization versions for backwards compatibility: 38 | - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }} 39 | - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: {ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }} 40 | - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }} 41 | - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] }} 42 | - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistryV1d0] }} 43 | - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistryV1d0] }} 44 | processors: 45 | - { className: org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor, config: { sessionTimeout: 28800000 }} 46 | - { className: org.apache.tinkerpop.gremlin.server.op.traversal.TraversalOpProcessor, config: { cacheExpirationTime: 600000, cacheMaxSize: 1000 }} 47 | metrics: 48 | consoleReporter: {enabled: true, interval: 180000} 49 | csvReporter: {enabled: true, interval: 180000, fileName: /tmp/gremlin-server-metrics.csv} 50 | jmxReporter: {enabled: true} 51 | slf4jReporter: {enabled: true, interval: 180000} 52 | gangliaReporter: {enabled: false, interval: 180000, addressingMode: MULTICAST} 53 | graphiteReporter: {enabled: false, interval: 180000} 54 | maxInitialLineLength: 4096 55 | maxHeaderSize: 8192 56 | maxChunkSize: 8192 57 | maxContentLength: 65536 58 | maxAccumulationBufferComponents: 1024 59 | resultIterationBatchSize: 64 60 | writeBufferLowWaterMark: 32768 61 | writeBufferHighWaterMark: 65536 62 | threadPoolWorker: 1 63 | gremlinPool: 8 64 | -------------------------------------------------------------------------------- /0.5/conf/janusgraph-berkeleyje-es-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2021 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | # JanusGraph configuration sample: BerkeleyDB JE and embedded Elasticsearch 20 | # 21 | # This file opens a BDB JE instance in the directory 22 | # db/berkeley. It also starts a local Elasticsearch 23 | # service inside the same JVM running JanusGraph, persisted at 24 | # db/es. 25 | 26 | gremlin.graph=org.janusgraph.core.JanusGraphFactory 27 | storage.backend=berkeleyje 28 | storage.directory=/var/lib/janusgraph/data 29 | index.search.backend=elasticsearch 30 | index.search.hostname=elasticsearch 31 | -------------------------------------------------------------------------------- /0.5/conf/janusgraph-berkeleyje-lucene-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2021 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | gremlin.graph=org.janusgraph.core.JanusGraphFactory 20 | storage.backend=berkeleyje 21 | storage.directory=/var/lib/janusgraph/data 22 | index.search.backend=lucene 23 | index.search.directory=/var/lib/janusgraph/index 24 | -------------------------------------------------------------------------------- /0.5/conf/janusgraph-berkeleyje-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2021 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | gremlin.graph=org.janusgraph.core.JanusGraphFactory 20 | storage.backend=berkeleyje 21 | storage.directory=/var/lib/janusgraph/data 22 | -------------------------------------------------------------------------------- /0.5/conf/janusgraph-cassandra-es-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2021 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | gremlin.graph=org.janusgraph.core.JanusGraphFactory 20 | 21 | # JanusGraph configuration sample: Cassandra & Elasticsearch over sockets 22 | # 23 | # This file connects to Cassandra and Elasticsearch services running 24 | # on localhost over the Thrift API and the Elasticsearch native 25 | # "Transport" API on their respective default ports. The Cassandra 26 | # and Elasticsearch services must already be running before starting 27 | # JanusGraph with this file. 28 | 29 | # The primary persistence provider used by JanusGraph. This is required. It 30 | # should be set one of JanusGraph's built-in shorthand names for its standard 31 | # storage backends (shorthands: berkeleyje, cassandrathrift, cassandra, 32 | # astyanax, embeddedcassandra, hbase, inmemory) or to the full package and 33 | # classname of a custom/third-party StoreManager implementation. 34 | # 35 | # Default: (no default value) 36 | # Data Type: String 37 | # Mutability: LOCAL 38 | storage.backend=cassandrathrift 39 | 40 | # The hostname or comma-separated list of hostnames of storage backend 41 | # servers. This is only applicable to some storage backends, such as 42 | # cassandra and hbase. 43 | # 44 | # Default: 127.0.0.1 45 | # Data Type: class java.lang.String[] 46 | # Mutability: LOCAL 47 | storage.hostname=127.0.0.1 48 | 49 | # Whether to enable JanusGraph's database-level cache, which is shared across 50 | # all transactions. Enabling this option speeds up traversals by holding 51 | # hot graph elements in memory, but also increases the likelihood of 52 | # reading stale data. Disabling it forces each transaction to 53 | # independently fetch graph elements from storage before reading/writing 54 | # them. 55 | # 56 | # Default: false 57 | # Data Type: Boolean 58 | # Mutability: MASKABLE 59 | cache.db-cache = true 60 | 61 | # How long, in milliseconds, database-level cache will keep entries after 62 | # flushing them. This option is only useful on distributed storage 63 | # backends that are capable of acknowledging writes without necessarily 64 | # making them immediately visible. 65 | # 66 | # Default: 50 67 | # Data Type: Integer 68 | # Mutability: GLOBAL_OFFLINE 69 | # 70 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 71 | # storage backend. After starting the database for the first time, this 72 | # file's copy of this setting is ignored. Use JanusGraph's Management System 73 | # to read or modify this value after bootstrapping. 74 | cache.db-cache-clean-wait = 20 75 | 76 | # Default expiration time, in milliseconds, for entries in the 77 | # database-level cache. Entries are evicted when they reach this age even 78 | # if the cache has room to spare. Set to 0 to disable expiration (cache 79 | # entries live forever or until memory pressure triggers eviction when set 80 | # to 0). 81 | # 82 | # Default: 10000 83 | # Data Type: Long 84 | # Mutability: GLOBAL_OFFLINE 85 | # 86 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 87 | # storage backend. After starting the database for the first time, this 88 | # file's copy of this setting is ignored. Use JanusGraph's Management System 89 | # to read or modify this value after bootstrapping. 90 | cache.db-cache-time = 180000 91 | 92 | # Size of JanusGraph's database level cache. Values between 0 and 1 are 93 | # interpreted as a percentage of VM heap, while larger values are 94 | # interpreted as an absolute size in bytes. 95 | # 96 | # Default: 0.3 97 | # Data Type: Double 98 | # Mutability: MASKABLE 99 | cache.db-cache-size = 0.25 100 | 101 | # Connect to an already-running ES instance on localhost 102 | 103 | # The indexing backend used to extend and optimize JanusGraph's query 104 | # functionality. This setting is optional. JanusGraph can use multiple 105 | # heterogeneous index backends. Hence, this option can appear more than 106 | # once, so long as the user-defined name between "index" and "backend" is 107 | # unique among appearances.Similar to the storage backend, this should be 108 | # set to one of JanusGraph's built-in shorthand names for its standard index 109 | # backends (shorthands: lucene, elasticsearch, es, solr) or to the full 110 | # package and classname of a custom/third-party IndexProvider 111 | # implementation. 112 | # 113 | # Default: elasticsearch 114 | # Data Type: String 115 | # Mutability: GLOBAL_OFFLINE 116 | # 117 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 118 | # storage backend. After starting the database for the first time, this 119 | # file's copy of this setting is ignored. Use JanusGraph's Management System 120 | # to read or modify this value after bootstrapping. 121 | index.search.backend=elasticsearch 122 | 123 | # The hostname or comma-separated list of hostnames of index backend 124 | # servers. This is only applicable to some index backends, such as 125 | # elasticsearch and solr. 126 | # 127 | # Default: 127.0.0.1 128 | # Data Type: class java.lang.String[] 129 | # Mutability: MASKABLE 130 | index.search.hostname=127.0.0.1 131 | 132 | # The Elasticsearch node.client option is set to this boolean value, and 133 | # the Elasticsearch node.data option is set to the negation of this value. 134 | # True creates a thin client which holds no data. False creates a regular 135 | # Elasticsearch cluster node that may store data. 136 | # 137 | # Default: true 138 | # Data Type: Boolean 139 | # Mutability: GLOBAL_OFFLINE 140 | # 141 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 142 | # storage backend. After starting the database for the first time, this 143 | # file's copy of this setting is ignored. Use JanusGraph's Management System 144 | # to read or modify this value after bootstrapping. 145 | index.search.elasticsearch.client-only=true 146 | 147 | # Or start ES inside the JanusGraph JVM 148 | #index.search.backend=elasticsearch 149 | #index.search.directory=db/es 150 | #index.search.elasticsearch.client-only=false 151 | #index.search.elasticsearch.local-mode=true 152 | -------------------------------------------------------------------------------- /0.5/conf/janusgraph-cql-es-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2021 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | gremlin.graph=org.janusgraph.core.JanusGraphFactory 20 | 21 | # JanusGraph configuration sample: Cassandra & Elasticsearch over sockets 22 | # 23 | # This file connects to Cassandra and Elasticsearch services running 24 | # on localhost over the CQL API and the Elasticsearch native 25 | # "Transport" API on their respective default ports. The Cassandra 26 | # and Elasticsearch services must already be running before starting 27 | # JanusGraph with this file. 28 | 29 | # The primary persistence provider used by JanusGraph. This is required. It 30 | # should be set one of JanusGraph's built-in shorthand names for its standard 31 | # storage backends or to the full package and classname of a custom/third-party 32 | # StoreManager implementation. 33 | # 34 | # Default: (no default value) 35 | # Data Type: String 36 | # Mutability: LOCAL 37 | storage.backend=cql 38 | 39 | # The hostname or comma-separated list of hostnames of storage backend 40 | # servers. This is only applicable to some storage backends, such as 41 | # cassandra and hbase. 42 | # 43 | # Default: 127.0.0.1 44 | # Data Type: class java.lang.String[] 45 | # Mutability: LOCAL 46 | storage.hostname=127.0.0.1 47 | 48 | # The name of JanusGraph's keyspace. It will be created if it does not 49 | # exist. 50 | # 51 | # Default: janusgraph 52 | # Data Type: String 53 | # Mutability: LOCAL 54 | storage.cql.keyspace=janusgraph 55 | 56 | # Whether to enable JanusGraph's database-level cache, which is shared across 57 | # all transactions. Enabling this option speeds up traversals by holding 58 | # hot graph elements in memory, but also increases the likelihood of 59 | # reading stale data. Disabling it forces each transaction to 60 | # independently fetch graph elements from storage before reading/writing 61 | # them. 62 | # 63 | # Default: false 64 | # Data Type: Boolean 65 | # Mutability: MASKABLE 66 | cache.db-cache = true 67 | 68 | # How long, in milliseconds, database-level cache will keep entries after 69 | # flushing them. This option is only useful on distributed storage 70 | # backends that are capable of acknowledging writes without necessarily 71 | # making them immediately visible. 72 | # 73 | # Default: 50 74 | # Data Type: Integer 75 | # Mutability: GLOBAL_OFFLINE 76 | # 77 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 78 | # storage backend. After starting the database for the first time, this 79 | # file's copy of this setting is ignored. Use JanusGraph's Management System 80 | # to read or modify this value after bootstrapping. 81 | cache.db-cache-clean-wait = 20 82 | 83 | # Default expiration time, in milliseconds, for entries in the 84 | # database-level cache. Entries are evicted when they reach this age even 85 | # if the cache has room to spare. Set to 0 to disable expiration (cache 86 | # entries live forever or until memory pressure triggers eviction when set 87 | # to 0). 88 | # 89 | # Default: 10000 90 | # Data Type: Long 91 | # Mutability: GLOBAL_OFFLINE 92 | # 93 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 94 | # storage backend. After starting the database for the first time, this 95 | # file's copy of this setting is ignored. Use JanusGraph's Management System 96 | # to read or modify this value after bootstrapping. 97 | cache.db-cache-time = 180000 98 | 99 | # Size of JanusGraph's database level cache. Values between 0 and 1 are 100 | # interpreted as a percentage of VM heap, while larger values are 101 | # interpreted as an absolute size in bytes. 102 | # 103 | # Default: 0.3 104 | # Data Type: Double 105 | # Mutability: MASKABLE 106 | cache.db-cache-size = 0.25 107 | 108 | # Connect to an already-running ES instance on localhost 109 | 110 | # The indexing backend used to extend and optimize JanusGraph's query 111 | # functionality. This setting is optional. JanusGraph can use multiple 112 | # heterogeneous index backends. Hence, this option can appear more than 113 | # once, so long as the user-defined name between "index" and "backend" is 114 | # unique among appearances.Similar to the storage backend, this should be 115 | # set to one of JanusGraph's built-in shorthand names for its standard index 116 | # backends (shorthands: lucene, elasticsearch, es, solr) or to the full 117 | # package and classname of a custom/third-party IndexProvider 118 | # implementation. 119 | # 120 | # Default: elasticsearch 121 | # Data Type: String 122 | # Mutability: GLOBAL_OFFLINE 123 | # 124 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 125 | # storage backend. After starting the database for the first time, this 126 | # file's copy of this setting is ignored. Use JanusGraph's Management System 127 | # to read or modify this value after bootstrapping. 128 | index.search.backend=elasticsearch 129 | 130 | # The hostname or comma-separated list of hostnames of index backend 131 | # servers. This is only applicable to some index backends, such as 132 | # elasticsearch and solr. 133 | # 134 | # Default: 127.0.0.1 135 | # Data Type: class java.lang.String[] 136 | # Mutability: MASKABLE 137 | index.search.hostname=127.0.0.1 138 | 139 | # The Elasticsearch node.client option is set to this boolean value, and 140 | # the Elasticsearch node.data option is set to the negation of this value. 141 | # True creates a thin client which holds no data. False creates a regular 142 | # Elasticsearch cluster node that may store data. 143 | # 144 | # Default: true 145 | # Data Type: Boolean 146 | # Mutability: GLOBAL_OFFLINE 147 | # 148 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 149 | # storage backend. After starting the database for the first time, this 150 | # file's copy of this setting is ignored. Use JanusGraph's Management System 151 | # to read or modify this value after bootstrapping. 152 | index.search.elasticsearch.client-only=true 153 | 154 | # Or start ES inside the JanusGraph JVM 155 | #index.search.backend=elasticsearch 156 | #index.search.directory=db/es 157 | #index.search.elasticsearch.client-only=false 158 | #index.search.elasticsearch.local-mode=true 159 | -------------------------------------------------------------------------------- /0.5/conf/janusgraph-cql-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2021 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | gremlin.graph=org.janusgraph.core.JanusGraphFactory 20 | 21 | # JanusGraph configuration sample: Cassandra & Elasticsearch over sockets 22 | # 23 | # This file connects to Cassandra and Elasticsearch services running 24 | # on localhost over the CQL API and the Elasticsearch native 25 | # "Transport" API on their respective default ports. The Cassandra 26 | # and Elasticsearch services must already be running before starting 27 | # JanusGraph with this file. 28 | 29 | # The primary persistence provider used by JanusGraph. This is required. It 30 | # should be set one of JanusGraph's built-in shorthand names for its standard 31 | # storage backends or to the full package and classname of a custom/third-party 32 | # StoreManager implementation. 33 | # 34 | # Default: (no default value) 35 | # Data Type: String 36 | # Mutability: LOCAL 37 | storage.backend=cql 38 | 39 | # The hostname or comma-separated list of hostnames of storage backend 40 | # servers. This is only applicable to some storage backends, such as 41 | # cassandra and hbase. 42 | # 43 | # Default: 127.0.0.1 44 | # Data Type: class java.lang.String[] 45 | # Mutability: LOCAL 46 | storage.hostname=127.0.0.1 47 | 48 | # The name of JanusGraph's keyspace. It will be created if it does not 49 | # exist. 50 | # 51 | # Default: janusgraph 52 | # Data Type: String 53 | # Mutability: LOCAL 54 | storage.cql.keyspace=janusgraph 55 | 56 | # Whether to enable JanusGraph's database-level cache, which is shared across 57 | # all transactions. Enabling this option speeds up traversals by holding 58 | # hot graph elements in memory, but also increases the likelihood of 59 | # reading stale data. Disabling it forces each transaction to 60 | # independently fetch graph elements from storage before reading/writing 61 | # them. 62 | # 63 | # Default: false 64 | # Data Type: Boolean 65 | # Mutability: MASKABLE 66 | cache.db-cache = true 67 | 68 | # How long, in milliseconds, database-level cache will keep entries after 69 | # flushing them. This option is only useful on distributed storage 70 | # backends that are capable of acknowledging writes without necessarily 71 | # making them immediately visible. 72 | # 73 | # Default: 50 74 | # Data Type: Integer 75 | # Mutability: GLOBAL_OFFLINE 76 | # 77 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 78 | # storage backend. After starting the database for the first time, this 79 | # file's copy of this setting is ignored. Use JanusGraph's Management System 80 | # to read or modify this value after bootstrapping. 81 | cache.db-cache-clean-wait = 20 82 | 83 | # Default expiration time, in milliseconds, for entries in the 84 | # database-level cache. Entries are evicted when they reach this age even 85 | # if the cache has room to spare. Set to 0 to disable expiration (cache 86 | # entries live forever or until memory pressure triggers eviction when set 87 | # to 0). 88 | # 89 | # Default: 10000 90 | # Data Type: Long 91 | # Mutability: GLOBAL_OFFLINE 92 | # 93 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 94 | # storage backend. After starting the database for the first time, this 95 | # file's copy of this setting is ignored. Use JanusGraph's Management System 96 | # to read or modify this value after bootstrapping. 97 | cache.db-cache-time = 180000 98 | 99 | # Size of JanusGraph's database level cache. Values between 0 and 1 are 100 | # interpreted as a percentage of VM heap, while larger values are 101 | # interpreted as an absolute size in bytes. 102 | # 103 | # Default: 0.3 104 | # Data Type: Double 105 | # Mutability: MASKABLE 106 | cache.db-cache-size = 0.25 107 | -------------------------------------------------------------------------------- /0.5/conf/janusgraph-inmemory-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2021 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | # JanusGraph configuration sample: in-memory 20 | # 21 | # This file connects to an in-memory storage backend 22 | 23 | # The implementation of graph factory that will be used by gremlin server 24 | # 25 | # Default: org.janusgraph.core.JanusGraphFactory 26 | # Data Type: String 27 | # Mutability: LOCAL 28 | gremlin.graph=org.janusgraph.core.JanusGraphFactory 29 | 30 | # The primary persistence provider used by JanusGraph. This is required. 31 | # It should be set one of JanusGraph's built-in shorthand names for its 32 | # standard storage backends (shorthands: berkeleyje, cassandrathrift, 33 | # cassandra, astyanax, embeddedcassandra, cql, hbase, inmemory) or to the 34 | # full package and classname of a custom/third-party StoreManager 35 | # implementation. 36 | # 37 | # Default: (no default value) 38 | # Data Type: String 39 | # Mutability: LOCAL 40 | storage.backend=inmemory 41 | 42 | # Whether to enable JanusGraph's database-level cache, which is shared across 43 | # all transactions. Enabling this option speeds up traversals by holding 44 | # hot graph elements in memory, but also increases the likelihood of 45 | # reading stale data. Disabling it forces each transaction to 46 | # independently fetch graph elements from storage before reading/writing 47 | # them. 48 | # 49 | # Default: false 50 | # Data Type: Boolean 51 | # Mutability: MASKABLE 52 | cache.db-cache = true 53 | 54 | # How long, in milliseconds, database-level cache will keep entries after 55 | # flushing them. This option is only useful on distributed storage 56 | # backends that are capable of acknowledging writes without necessarily 57 | # making them immediately visible. 58 | # 59 | # Default: 50 60 | # Data Type: Integer 61 | # Mutability: GLOBAL_OFFLINE 62 | # 63 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 64 | # storage backend. After starting the database for the first time, this 65 | # file's copy of this setting is ignored. Use JanusGraph's Management System 66 | # to read or modify this value after bootstrapping. 67 | cache.db-cache-clean-wait = 20 68 | 69 | # Default expiration time, in milliseconds, for entries in the 70 | # database-level cache. Entries are evicted when they reach this age even 71 | # if the cache has room to spare. Set to 0 to disable expiration (cache 72 | # entries live forever or until memory pressure triggers eviction when set 73 | # to 0). 74 | # 75 | # Default: 10000 76 | # Data Type: Long 77 | # Mutability: GLOBAL_OFFLINE 78 | # 79 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 80 | # storage backend. After starting the database for the first time, this 81 | # file's copy of this setting is ignored. Use JanusGraph's Management System 82 | # to read or modify this value after bootstrapping. 83 | cache.db-cache-time = 180000 84 | 85 | # Size of JanusGraph's database level cache. Values between 0 and 1 are 86 | # interpreted as a percentage of VM heap, while larger values are 87 | # interpreted as an absolute size in bytes. 88 | # 89 | # Default: 0.3 90 | # Data Type: Double 91 | # Mutability: MASKABLE 92 | cache.db-cache-size = 0.25 93 | -------------------------------------------------------------------------------- /0.5/conf/log4j-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2019 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | log4j.appender.console=org.apache.log4j.ConsoleAppender 20 | log4j.appender.console.Threshold=INFO 21 | log4j.appender.console.layout=org.apache.log4j.PatternLayout 22 | log4j.appender.console.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n 23 | 24 | log4j.rootLogger=INFO, console 25 | -------------------------------------------------------------------------------- /0.5/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 4 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 5 | # 6 | # 7 | # Copyright 2019 JanusGraph Authors 8 | # 9 | # Licensed under the Apache License, Version 2.0 (the "License"); 10 | # you may not use this file except in compliance with the License. 11 | # You may obtain a copy of the License at 12 | # 13 | # http://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, software 16 | # distributed under the License is distributed on an "AS IS" BASIS, 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | # See the License for the specific language governing permissions and 19 | # limitations under the License. 20 | 21 | JANUS_PROPS="${JANUS_CONFIG_DIR}/janusgraph.properties" 22 | GREMLIN_YAML="${JANUS_CONFIG_DIR}/gremlin-server.yaml" 23 | 24 | # running as root; step down to run as janusgraph user 25 | if [ "$1" == 'janusgraph' ] && [ "$(id -u)" == "0" ]; then 26 | mkdir -p ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 27 | chown -R janusgraph:janusgraph ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 28 | chmod 700 ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 29 | 30 | exec chroot --skip-chdir --userspec janusgraph:janusgraph / "${BASH_SOURCE}" "$@" 31 | fi 32 | 33 | # running as non root user 34 | if [ "$1" == 'janusgraph' ]; then 35 | # setup config directory 36 | mkdir -p ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 37 | cp conf/gremlin-server/janusgraph-${JANUS_PROPS_TEMPLATE}-server.properties ${JANUS_CONFIG_DIR}/janusgraph.properties 38 | cp conf/gremlin-server/gremlin-server.yaml ${JANUS_CONFIG_DIR} 39 | chown -R "$(id -u):$(id -g)" ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 40 | chmod 700 ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 41 | chmod -R 600 ${JANUS_CONFIG_DIR}/* 42 | 43 | # apply configuration from environment 44 | while IFS='=' read -r envvar_key envvar_val; do 45 | if [[ "${envvar_key}" =~ janusgraph\. ]] && [[ ! -z ${envvar_val} ]]; then 46 | # strip namespace and use properties file delimiter for janusgraph properties 47 | envvar_key=${envvar_key#"janusgraph."} 48 | # Add new or update existing field in configuration file 49 | if grep -q -E "^\s*${envvar_key}\s*=\.*" ${JANUS_PROPS}; then 50 | sed -ri "s#^(\s*${envvar_key}\s*=).*#\\1${envvar_val}#" ${JANUS_PROPS} 51 | else 52 | echo "${envvar_key}=${envvar_val}" >> ${JANUS_PROPS} 53 | fi 54 | elif [[ "${envvar_key}" =~ gremlinserver(%d)?[.]{1}(.+) ]]; then 55 | # Check for edit mode %d after prefix 56 | if [[ ${BASH_REMATCH[1]} == "%d" ]]; then edit_mode="d"; else edit_mode="w"; fi 57 | # strip namespace from env variable and get value 58 | envvar_key=${BASH_REMATCH[2]} 59 | if [[ edit_mode == "d" ]]; then envvar_val=""; fi 60 | # add new or update existing field in configuration file 61 | yq ${edit_mode} -P -i ${GREMLIN_YAML} ${envvar_key} ${envvar_val} 62 | else 63 | continue 64 | fi 65 | done < <(env | sort -r) 66 | 67 | if [ "$2" == 'show-config' ]; then 68 | echo "# contents of ${JANUS_PROPS}" 69 | cat "$JANUS_PROPS" 70 | echo "---------------------------------------" 71 | echo "# contents of ${GREMLIN_YAML}" 72 | cat "$GREMLIN_YAML" 73 | exit 0 74 | else 75 | # wait for storage 76 | if ! [ -z "${JANUS_STORAGE_TIMEOUT:-}" ]; then 77 | F="$(mktemp --suffix .groovy)" 78 | echo "graph = JanusGraphFactory.open('${JANUS_CONFIG_DIR}/janusgraph.properties')" > $F 79 | timeout "${JANUS_STORAGE_TIMEOUT}s" bash -c \ 80 | "until bin/gremlin.sh -e $F > /dev/null 2>&1; do echo \"waiting for storage...\"; sleep 5; done" 81 | rm -f "$F" 82 | fi 83 | 84 | /usr/local/bin/load-initdb.sh & 85 | 86 | exec ${JANUS_HOME}/bin/gremlin-server.sh ${JANUS_CONFIG_DIR}/gremlin-server.yaml 87 | fi 88 | fi 89 | 90 | # override hosts for remote connections with Gremlin Console 91 | if ! [ -z "${GREMLIN_REMOTE_HOSTS:-}" ]; then 92 | sed -i "s/hosts\s*:.*/hosts: [$GREMLIN_REMOTE_HOSTS]/" ${JANUS_HOME}/conf/remote.yaml 93 | fi 94 | 95 | exec "$@" 96 | -------------------------------------------------------------------------------- /0.5/load-initdb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 4 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 5 | # 6 | # 7 | # Copyright 2019 JanusGraph Authors 8 | # 9 | # Licensed under the Apache License, Version 2.0 (the "License"); 10 | # you may not use this file except in compliance with the License. 11 | # You may obtain a copy of the License at 12 | # 13 | # http://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, software 16 | # distributed under the License is distributed on an "AS IS" BASIS, 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | # See the License for the specific language governing permissions and 19 | # limitations under the License. 20 | 21 | # exit early if directory is empty 22 | if ! [ "$(ls -A ${JANUS_INITDB_DIR})" ]; then 23 | exit 0 24 | fi 25 | 26 | # wait for JanusGraph Server 27 | if ! [ -z "${JANUS_SERVER_TIMEOUT:-}" ]; then 28 | timeout "${JANUS_SERVER_TIMEOUT}s" bash -c \ 29 | "until true &>/dev/null g 21 | -------------------------------------------------------------------------------- /0.6/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2019 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | FROM debian:buster-slim as builder 20 | 21 | ARG TARGETARCH 22 | ARG JANUS_VERSION=0.6.3 23 | ARG YQ_VERSION=3.4.1 24 | 25 | ENV JANUS_VERSION=${JANUS_VERSION} \ 26 | JANUS_HOME=/opt/janusgraph 27 | 28 | WORKDIR /opt 29 | 30 | RUN apt update -y && apt install -y gpg unzip curl && \ 31 | curl -fSL https://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/janusgraph-${JANUS_VERSION}.zip -o janusgraph.zip && \ 32 | curl -fSL https://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/janusgraph-${JANUS_VERSION}.zip.asc -o janusgraph.zip.asc && \ 33 | curl -fSL https://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/KEYS -o KEYS && \ 34 | curl -fSL https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_${TARGETARCH} -o yq && \ 35 | gpg --import KEYS && \ 36 | gpg --batch --verify janusgraph.zip.asc janusgraph.zip && \ 37 | unzip janusgraph.zip && \ 38 | mv janusgraph-${JANUS_VERSION} /opt/janusgraph && \ 39 | rm -rf ${JANUS_HOME}/elasticsearch && \ 40 | rm -rf ${JANUS_HOME}/javadocs && \ 41 | rm -rf ${JANUS_HOME}/log && \ 42 | rm -rf ${JANUS_HOME}/examples && \ 43 | rm -rf ${JANUS_HOME}/conf/janusgraph-*.properties && \ 44 | mv ${JANUS_HOME}/conf/gremlin-server/gremlin-server.yaml ${JANUS_HOME}/conf/janusgraph-server.yaml && \ 45 | rm -rf ${JANUS_HOME}/conf/gremlin-server 46 | 47 | COPY conf/ ${JANUS_HOME}/conf/ 48 | COPY scripts/remote-connect.groovy ${JANUS_HOME}/scripts/ 49 | 50 | FROM eclipse-temurin:8-jre 51 | 52 | ARG CREATED=test 53 | ARG REVISION=test 54 | ARG JANUS_VERSION=0.6.3 55 | 56 | ENV JANUS_VERSION=${JANUS_VERSION} \ 57 | JANUS_HOME=/opt/janusgraph \ 58 | JANUS_CONFIG_DIR=/etc/opt/janusgraph \ 59 | JANUS_DATA_DIR=/var/lib/janusgraph \ 60 | JANUS_SERVER_TIMEOUT=30 \ 61 | JANUS_STORAGE_TIMEOUT=60 \ 62 | JANUS_PROPS_TEMPLATE=berkeleyje-lucene \ 63 | JANUS_INITDB_DIR=/docker-entrypoint-initdb.d \ 64 | gremlinserver.graphs.graph=/etc/opt/janusgraph/janusgraph.properties \ 65 | gremlinserver.threadPoolWorker=1 \ 66 | gremlinserver.gremlinPool=8 67 | 68 | RUN groupadd -r janusgraph --gid=999 && \ 69 | useradd -r -g janusgraph --uid=999 -d ${JANUS_DATA_DIR} janusgraph && \ 70 | apt-get update -y && \ 71 | DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends krb5-user && \ 72 | rm -rf /var/lib/apt/lists/* 73 | 74 | COPY --from=builder /opt/janusgraph/ /opt/janusgraph/ 75 | COPY --from=builder /opt/yq /usr/bin/yq 76 | COPY docker-entrypoint.sh /usr/local/bin/ 77 | COPY load-initdb.sh /usr/local/bin/ 78 | 79 | RUN chmod 755 /usr/local/bin/docker-entrypoint.sh && \ 80 | chmod 755 /usr/local/bin/load-initdb.sh && \ 81 | chmod 755 /usr/bin/yq && \ 82 | mkdir -p ${JANUS_INITDB_DIR} ${JANUS_CONFIG_DIR} ${JANUS_DATA_DIR} && \ 83 | chown -R janusgraph:janusgraph ${JANUS_HOME} ${JANUS_INITDB_DIR} ${JANUS_CONFIG_DIR} ${JANUS_DATA_DIR} 84 | 85 | EXPOSE 8182 86 | 87 | WORKDIR ${JANUS_HOME} 88 | USER janusgraph 89 | 90 | ENTRYPOINT [ "docker-entrypoint.sh" ] 91 | CMD [ "janusgraph" ] 92 | 93 | LABEL org.opencontainers.image.title="JanusGraph Docker Image" \ 94 | org.opencontainers.image.description="Official JanusGraph Docker image" \ 95 | org.opencontainers.image.url="https://janusgraph.org/" \ 96 | org.opencontainers.image.documentation="https://docs.janusgraph.org/v0.6/" \ 97 | org.opencontainers.image.revision="${REVISION}" \ 98 | org.opencontainers.image.source="https://github.com/JanusGraph/janusgraph-docker/" \ 99 | org.opencontainers.image.vendor="JanusGraph" \ 100 | org.opencontainers.image.version="${JANUS_VERSION}" \ 101 | org.opencontainers.image.created="${CREATED}" \ 102 | org.opencontainers.image.license="Apache-2.0" 103 | -------------------------------------------------------------------------------- /0.6/conf/janusgraph-berkeleyje-es-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2021 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | # JanusGraph configuration sample: BerkeleyDB JE and Elasticsearch 20 | 21 | gremlin.graph = org.janusgraph.core.JanusGraphFactory 22 | 23 | # The primary persistence provider used by JanusGraph. This is required. It 24 | # should be set one of JanusGraph's built-in shorthand names for its standard 25 | # storage backends or to the full package and classname of a custom/third-party 26 | # StoreManager implementation. 27 | # 28 | # Default: (no default value) 29 | # Data Type: String 30 | # Mutability: LOCAL 31 | storage.backend = berkeleyje 32 | 33 | # Storage directory for those storage backends that require local storage. 34 | # 35 | # Default: (no default value) 36 | # Data Type: String 37 | # Mutability: LOCAL 38 | storage.directory = /var/lib/janusgraph/data 39 | 40 | # The indexing backend used to extend and optimize JanusGraph's query 41 | # functionality. This setting is optional. JanusGraph can use multiple 42 | # heterogeneous index backends. Hence, this option can appear more than 43 | # once, so long as the user-defined name between "index" and "backend" is 44 | # unique among appearances.Similar to the storage backend, this should be 45 | # set to one of JanusGraph's built-in shorthand names for its standard index 46 | # backends (shorthands: lucene, elasticsearch, es, solr) or to the full 47 | # package and classname of a custom/third-party IndexProvider 48 | # implementation. 49 | # 50 | # Default: elasticsearch 51 | # Data Type: String 52 | # Mutability: GLOBAL_OFFLINE 53 | # 54 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 55 | # storage backend. After starting the database for the first time, this 56 | # file's copy of this setting is ignored. Use JanusGraph's Management System 57 | # to read or modify this value after bootstrapping. 58 | index.search.backend = elasticsearch 59 | 60 | # The hostname or comma-separated list of hostnames of index backend 61 | # servers. This is only applicable to some index backends, such as 62 | # elasticsearch and solr. 63 | # 64 | # Default: 127.0.0.1 65 | # Data Type: class java.lang.String[] 66 | # Mutability: MASKABLE 67 | index.search.hostname = elasticsearch 68 | 69 | -------------------------------------------------------------------------------- /0.6/conf/janusgraph-berkeleyje-lucene-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2021 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | # JanusGraph configuration sample: BerkeleyDB JE and Apache Lucene 20 | 21 | gremlin.graph = org.janusgraph.core.JanusGraphFactory 22 | 23 | # The primary persistence provider used by JanusGraph. This is required. It 24 | # should be set one of JanusGraph's built-in shorthand names for its standard 25 | # storage backends or to the full package and classname of a custom/third-party 26 | # StoreManager implementation. 27 | # 28 | # Default: (no default value) 29 | # Data Type: String 30 | # Mutability: LOCAL 31 | storage.backend = berkeleyje 32 | 33 | # Storage directory for those storage backends that require local storage. 34 | # 35 | # Default: (no default value) 36 | # Data Type: String 37 | # Mutability: LOCAL 38 | storage.directory = /var/lib/janusgraph/data 39 | 40 | # The indexing backend used to extend and optimize JanusGraph's query 41 | # functionality. This setting is optional. JanusGraph can use multiple 42 | # heterogeneous index backends. Hence, this option can appear more than 43 | # once, so long as the user-defined name between "index" and "backend" is 44 | # unique among appearances.Similar to the storage backend, this should be 45 | # set to one of JanusGraph's built-in shorthand names for its standard 46 | # index backends (shorthands: lucene, elasticsearch, es, solr) or to the 47 | # full package and classname of a custom/third-party IndexProvider 48 | # implementation. 49 | # 50 | # Default: elasticsearch 51 | # Data Type: String 52 | # Mutability: GLOBAL_OFFLINE 53 | # 54 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in 55 | # JanusGraph's storage backend. After starting the database for the first 56 | # time, this file's copy of this setting is ignored. Use JanusGraph's 57 | # Management System to read or modify this value after bootstrapping. 58 | index.search.backend = lucene 59 | 60 | # Directory to store index data locally 61 | # 62 | # Default: (no default value) 63 | # Data Type: String 64 | # Mutability: MASKABLE 65 | index.search.directory = /var/lib/janusgraph/index 66 | -------------------------------------------------------------------------------- /0.6/conf/janusgraph-berkeleyje-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2021 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | # JanusGraph configuration sample: BerkeleyDB JE 20 | 21 | gremlin.graph = org.janusgraph.core.JanusGraphFactory 22 | 23 | # The primary persistence provider used by JanusGraph. This is required. It 24 | # should be set one of JanusGraph's built-in shorthand names for its standard 25 | # storage backends or to the full package and classname of a custom/third-party 26 | # StoreManager implementation. 27 | # 28 | # Default: (no default value) 29 | # Data Type: String 30 | # Mutability: LOCAL 31 | storage.backend = berkeleyje 32 | 33 | # Storage directory for those storage backends that require local storage. 34 | # 35 | # Default: (no default value) 36 | # Data Type: String 37 | # Mutability: LOCAL 38 | storage.directory = /var/lib/janusgraph/data 39 | -------------------------------------------------------------------------------- /0.6/conf/janusgraph-cql-es-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2021 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | gremlin.graph = org.janusgraph.core.JanusGraphFactory 20 | 21 | # JanusGraph configuration sample: Cassandra & Elasticsearch over sockets 22 | # 23 | # This file connects to Cassandra and Elasticsearch services running 24 | # on localhost over the CQL API and the Elasticsearch native 25 | # "Transport" API on their respective default ports. The Cassandra 26 | # and Elasticsearch services must already be running before starting 27 | # JanusGraph with this file. 28 | 29 | # The primary persistence provider used by JanusGraph. This is required. It 30 | # should be set one of JanusGraph's built-in shorthand names for its standard 31 | # storage backends or to the full package and classname of a custom/third-party 32 | # StoreManager implementation. 33 | # 34 | # Default: (no default value) 35 | # Data Type: String 36 | # Mutability: LOCAL 37 | storage.backend = cql 38 | 39 | # The hostname or comma-separated list of hostnames of storage backend 40 | # servers. This is only applicable to some storage backends, such as 41 | # cassandra and hbase. 42 | # 43 | # Default: 127.0.0.1 44 | # Data Type: class java.lang.String[] 45 | # Mutability: LOCAL 46 | storage.hostname = cassandra 47 | 48 | # The name of JanusGraph's keyspace. It will be created if it does not 49 | # exist. 50 | # 51 | # Default: janusgraph 52 | # Data Type: String 53 | # Mutability: LOCAL 54 | storage.cql.keyspace = janusgraph 55 | 56 | # Whether to enable JanusGraph's database-level cache, which is shared across 57 | # all transactions. Enabling this option speeds up traversals by holding 58 | # hot graph elements in memory, but also increases the likelihood of 59 | # reading stale data. Disabling it forces each transaction to 60 | # independently fetch graph elements from storage before reading/writing 61 | # them. 62 | # 63 | # Default: false 64 | # Data Type: Boolean 65 | # Mutability: MASKABLE 66 | cache.db-cache = true 67 | 68 | # How long, in milliseconds, database-level cache will keep entries after 69 | # flushing them. This option is only useful on distributed storage 70 | # backends that are capable of acknowledging writes without necessarily 71 | # making them immediately visible. 72 | # 73 | # Default: 50 74 | # Data Type: Integer 75 | # Mutability: GLOBAL_OFFLINE 76 | # 77 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 78 | # storage backend. After starting the database for the first time, this 79 | # file's copy of this setting is ignored. Use JanusGraph's Management System 80 | # to read or modify this value after bootstrapping. 81 | cache.db-cache-clean-wait = 20 82 | 83 | # Default expiration time, in milliseconds, for entries in the 84 | # database-level cache. Entries are evicted when they reach this age even 85 | # if the cache has room to spare. Set to 0 to disable expiration (cache 86 | # entries live forever or until memory pressure triggers eviction when set 87 | # to 0). 88 | # 89 | # Default: 10000 90 | # Data Type: Long 91 | # Mutability: GLOBAL_OFFLINE 92 | # 93 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 94 | # storage backend. After starting the database for the first time, this 95 | # file's copy of this setting is ignored. Use JanusGraph's Management System 96 | # to read or modify this value after bootstrapping. 97 | cache.db-cache-time = 180000 98 | 99 | # Size of JanusGraph's database level cache. Values between 0 and 1 are 100 | # interpreted as a percentage of VM heap, while larger values are 101 | # interpreted as an absolute size in bytes. 102 | # 103 | # Default: 0.3 104 | # Data Type: Double 105 | # Mutability: MASKABLE 106 | cache.db-cache-size = 0.25 107 | 108 | # The indexing backend used to extend and optimize JanusGraph's query 109 | # functionality. This setting is optional. JanusGraph can use multiple 110 | # heterogeneous index backends. Hence, this option can appear more than 111 | # once, so long as the user-defined name between "index" and "backend" is 112 | # unique among appearances.Similar to the storage backend, this should be 113 | # set to one of JanusGraph's built-in shorthand names for its standard index 114 | # backends (shorthands: lucene, elasticsearch, es, solr) or to the full 115 | # package and classname of a custom/third-party IndexProvider 116 | # implementation. 117 | # 118 | # Default: elasticsearch 119 | # Data Type: String 120 | # Mutability: GLOBAL_OFFLINE 121 | # 122 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 123 | # storage backend. After starting the database for the first time, this 124 | # file's copy of this setting is ignored. Use JanusGraph's Management System 125 | # to read or modify this value after bootstrapping. 126 | index.search.backend = elasticsearch 127 | 128 | # The hostname or comma-separated list of hostnames of index backend 129 | # servers. This is only applicable to some index backends, such as 130 | # elasticsearch and solr. 131 | # 132 | # Default: 127.0.0.1 133 | # Data Type: class java.lang.String[] 134 | # Mutability: MASKABLE 135 | index.search.hostname = elasticsearch 136 | 137 | # Or start ES inside the JanusGraph JVM 138 | #index.search.backend=elasticsearch 139 | #index.search.directory=db/es 140 | #index.search.elasticsearch.client-only=false 141 | #index.search.elasticsearch.local-mode=true 142 | -------------------------------------------------------------------------------- /0.6/conf/janusgraph-cql-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2021 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | gremlin.graph = org.janusgraph.core.JanusGraphFactory 20 | 21 | # JanusGraph configuration sample: Cassandra & Elasticsearch over sockets 22 | # 23 | # This file connects to Cassandra and Elasticsearch services running 24 | # on localhost over the CQL API and the Elasticsearch native 25 | # "Transport" API on their respective default ports. The Cassandra 26 | # and Elasticsearch services must already be running before starting 27 | # JanusGraph with this file. 28 | 29 | # The primary persistence provider used by JanusGraph. This is required. It 30 | # should be set one of JanusGraph's built-in shorthand names for its standard 31 | # storage backends or to the full package and classname of a custom/third-party 32 | # StoreManager implementation. 33 | # 34 | # Default: (no default value) 35 | # Data Type: String 36 | # Mutability: LOCAL 37 | storage.backend = cql 38 | 39 | # The hostname or comma-separated list of hostnames of storage backend 40 | # servers. This is only applicable to some storage backends, such as 41 | # cassandra and hbase. 42 | # 43 | # Default: 127.0.0.1 44 | # Data Type: class java.lang.String[] 45 | # Mutability: LOCAL 46 | storage.hostname = cassandra 47 | 48 | # The name of JanusGraph's keyspace. It will be created if it does not 49 | # exist. 50 | # 51 | # Default: janusgraph 52 | # Data Type: String 53 | # Mutability: LOCAL 54 | storage.cql.keyspace = janusgraph 55 | 56 | # Whether to enable JanusGraph's database-level cache, which is shared across 57 | # all transactions. Enabling this option speeds up traversals by holding 58 | # hot graph elements in memory, but also increases the likelihood of 59 | # reading stale data. Disabling it forces each transaction to 60 | # independently fetch graph elements from storage before reading/writing 61 | # them. 62 | # 63 | # Default: false 64 | # Data Type: Boolean 65 | # Mutability: MASKABLE 66 | cache.db-cache = true 67 | 68 | # How long, in milliseconds, database-level cache will keep entries after 69 | # flushing them. This option is only useful on distributed storage 70 | # backends that are capable of acknowledging writes without necessarily 71 | # making them immediately visible. 72 | # 73 | # Default: 50 74 | # Data Type: Integer 75 | # Mutability: GLOBAL_OFFLINE 76 | # 77 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 78 | # storage backend. After starting the database for the first time, this 79 | # file's copy of this setting is ignored. Use JanusGraph's Management System 80 | # to read or modify this value after bootstrapping. 81 | cache.db-cache-clean-wait = 20 82 | 83 | # Default expiration time, in milliseconds, for entries in the 84 | # database-level cache. Entries are evicted when they reach this age even 85 | # if the cache has room to spare. Set to 0 to disable expiration (cache 86 | # entries live forever or until memory pressure triggers eviction when set 87 | # to 0). 88 | # 89 | # Default: 10000 90 | # Data Type: Long 91 | # Mutability: GLOBAL_OFFLINE 92 | # 93 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 94 | # storage backend. After starting the database for the first time, this 95 | # file's copy of this setting is ignored. Use JanusGraph's Management System 96 | # to read or modify this value after bootstrapping. 97 | cache.db-cache-time = 180000 98 | 99 | # Size of JanusGraph's database level cache. Values between 0 and 1 are 100 | # interpreted as a percentage of VM heap, while larger values are 101 | # interpreted as an absolute size in bytes. 102 | # 103 | # Default: 0.3 104 | # Data Type: Double 105 | # Mutability: MASKABLE 106 | cache.db-cache-size = 0.25 107 | -------------------------------------------------------------------------------- /0.6/conf/janusgraph-inmemory-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2021 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | # JanusGraph configuration sample: in-memory 20 | # 21 | # This file connects to an in-memory storage backend 22 | 23 | # The implementation of graph factory that will be used by gremlin server 24 | # 25 | # Default: org.janusgraph.core.JanusGraphFactory 26 | # Data Type: String 27 | # Mutability: LOCAL 28 | gremlin.graph = org.janusgraph.core.JanusGraphFactory 29 | 30 | # The primary persistence provider used by JanusGraph. This is required. 31 | # It should be set one of JanusGraph's built-in shorthand names for its 32 | # standard storage backends (shorthands: berkeleyje, cassandrathrift, 33 | # cassandra, astyanax, embeddedcassandra, cql, hbase, inmemory) or to the 34 | # full package and classname of a custom/third-party StoreManager 35 | # implementation. 36 | # 37 | # Default: (no default value) 38 | # Data Type: String 39 | # Mutability: LOCAL 40 | storage.backend = inmemory 41 | 42 | # Whether to enable JanusGraph's database-level cache, which is shared across 43 | # all transactions. Enabling this option speeds up traversals by holding 44 | # hot graph elements in memory, but also increases the likelihood of 45 | # reading stale data. Disabling it forces each transaction to 46 | # independently fetch graph elements from storage before reading/writing 47 | # them. 48 | # 49 | # Default: false 50 | # Data Type: Boolean 51 | # Mutability: MASKABLE 52 | cache.db-cache = true 53 | 54 | # How long, in milliseconds, database-level cache will keep entries after 55 | # flushing them. This option is only useful on distributed storage 56 | # backends that are capable of acknowledging writes without necessarily 57 | # making them immediately visible. 58 | # 59 | # Default: 50 60 | # Data Type: Integer 61 | # Mutability: GLOBAL_OFFLINE 62 | # 63 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 64 | # storage backend. After starting the database for the first time, this 65 | # file's copy of this setting is ignored. Use JanusGraph's Management System 66 | # to read or modify this value after bootstrapping. 67 | cache.db-cache-clean-wait = 20 68 | 69 | # Default expiration time, in milliseconds, for entries in the 70 | # database-level cache. Entries are evicted when they reach this age even 71 | # if the cache has room to spare. Set to 0 to disable expiration (cache 72 | # entries live forever or until memory pressure triggers eviction when set 73 | # to 0). 74 | # 75 | # Default: 10000 76 | # Data Type: Long 77 | # Mutability: GLOBAL_OFFLINE 78 | # 79 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 80 | # storage backend. After starting the database for the first time, this 81 | # file's copy of this setting is ignored. Use JanusGraph's Management System 82 | # to read or modify this value after bootstrapping. 83 | cache.db-cache-time = 180000 84 | 85 | # Size of JanusGraph's database level cache. Values between 0 and 1 are 86 | # interpreted as a percentage of VM heap, while larger values are 87 | # interpreted as an absolute size in bytes. 88 | # 89 | # Default: 0.3 90 | # Data Type: Double 91 | # Mutability: MASKABLE 92 | cache.db-cache-size = 0.25 93 | -------------------------------------------------------------------------------- /0.6/conf/log4j-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2019 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | log4j.appender.console=org.apache.log4j.ConsoleAppender 20 | log4j.appender.console.Threshold=INFO 21 | log4j.appender.console.layout=org.apache.log4j.PatternLayout 22 | log4j.appender.console.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n 23 | 24 | log4j.rootLogger=INFO, console 25 | -------------------------------------------------------------------------------- /0.6/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 4 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 5 | # 6 | # 7 | # Copyright 2019 JanusGraph Authors 8 | # 9 | # Licensed under the Apache License, Version 2.0 (the "License"); 10 | # you may not use this file except in compliance with the License. 11 | # You may obtain a copy of the License at 12 | # 13 | # http://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, software 16 | # distributed under the License is distributed on an "AS IS" BASIS, 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | # See the License for the specific language governing permissions and 19 | # limitations under the License. 20 | 21 | JANUS_PROPS="${JANUS_CONFIG_DIR}/janusgraph.properties" 22 | JANUSGRAPH_SERVER_YAML="${JANUS_CONFIG_DIR}/janusgraph-server.yaml" 23 | 24 | # running as root; step down to run as janusgraph user 25 | if [ "$1" == 'janusgraph' ] && [ "$(id -u)" == "0" ]; then 26 | mkdir -p ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 27 | chown -R janusgraph:janusgraph ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 28 | chmod 700 ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 29 | 30 | exec chroot --skip-chdir --userspec janusgraph:janusgraph / "${BASH_SOURCE}" "$@" 31 | fi 32 | 33 | # running as non root user 34 | if [ "$1" == 'janusgraph' ]; then 35 | # setup config directory 36 | mkdir -p ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 37 | cp conf/janusgraph-${JANUS_PROPS_TEMPLATE}-server.properties ${JANUS_PROPS} 38 | cp conf/janusgraph-server.yaml ${JANUSGRAPH_SERVER_YAML} 39 | chown -R "$(id -u):$(id -g)" ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 40 | chmod 700 ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 41 | chmod -R 600 ${JANUS_CONFIG_DIR}/* 42 | 43 | # apply configuration from environment 44 | while IFS=' ' read -r envvar_key envvar_val; do 45 | if [[ "${envvar_key}" =~ janusgraph\. ]] && [[ ! -z ${envvar_val} ]]; then 46 | # strip namespace and use properties file delimiter for janusgraph properties 47 | envvar_key=${envvar_key#"janusgraph."} 48 | # Add new or update existing field in configuration file 49 | if grep -q -E "^\s*${envvar_key}\s*=\.*" ${JANUS_PROPS}; then 50 | sed -ri "s#^(\s*${envvar_key}\s*=).*#\\1${envvar_val}#" ${JANUS_PROPS} 51 | else 52 | echo "${envvar_key}=${envvar_val}" >> ${JANUS_PROPS} 53 | fi 54 | elif [[ "${envvar_key}" =~ gremlinserver(%d)?[.]{1}(.+) ]]; then 55 | # Check for edit mode %d after prefix 56 | if [[ ${BASH_REMATCH[1]} == "%d" ]]; then edit_mode="d"; else edit_mode="w"; fi 57 | # strip namespace from env variable and get value 58 | envvar_key=${BASH_REMATCH[2]} 59 | if [[ edit_mode == "d" ]]; then envvar_val=""; fi 60 | # add new or update existing field in configuration file 61 | yq ${edit_mode} -P -i ${JANUSGRAPH_SERVER_YAML} ${envvar_key} ${envvar_val} 62 | else 63 | continue 64 | fi 65 | done < <(env | sort -r | awk -F= '{ st = index($0, "="); print $1 " " substr($0, st+1) }') 66 | 67 | if [ "$2" == 'show-config' ]; then 68 | echo "# contents of ${JANUS_PROPS}" 69 | cat "$JANUS_PROPS" 70 | echo "---------------------------------------" 71 | echo "# contents of ${JANUSGRAPH_SERVER_YAML}" 72 | cat "$JANUSGRAPH_SERVER_YAML" 73 | exit 0 74 | else 75 | # wait for storage 76 | if ! [ -z "${JANUS_STORAGE_TIMEOUT:-}" ]; then 77 | F="$(mktemp --suffix .groovy)" 78 | echo "graph = JanusGraphFactory.open('${JANUS_PROPS}')" > $F 79 | timeout "${JANUS_STORAGE_TIMEOUT}s" bash -c \ 80 | "until bin/gremlin.sh -e $F > /dev/null 2>&1; do echo \"waiting for storage...\"; sleep 5; done" 81 | rm -f "$F" 82 | fi 83 | 84 | /usr/local/bin/load-initdb.sh & 85 | 86 | exec ${JANUS_HOME}/bin/janusgraph-server.sh ${JANUSGRAPH_SERVER_YAML} 87 | fi 88 | fi 89 | 90 | # override hosts for remote connections with Gremlin Console 91 | if ! [ -z "${GREMLIN_REMOTE_HOSTS:-}" ]; then 92 | sed -i "s/hosts\s*:.*/hosts: [$GREMLIN_REMOTE_HOSTS]/" ${JANUS_HOME}/conf/remote.yaml 93 | sed -i "s/hosts\s*:.*/hosts: [$GREMLIN_REMOTE_HOSTS]/" ${JANUS_HOME}/conf/remote-objects.yaml 94 | fi 95 | 96 | exec "$@" 97 | -------------------------------------------------------------------------------- /0.6/load-initdb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 4 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 5 | # 6 | # 7 | # Copyright 2019 JanusGraph Authors 8 | # 9 | # Licensed under the Apache License, Version 2.0 (the "License"); 10 | # you may not use this file except in compliance with the License. 11 | # You may obtain a copy of the License at 12 | # 13 | # http://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, software 16 | # distributed under the License is distributed on an "AS IS" BASIS, 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | # See the License for the specific language governing permissions and 19 | # limitations under the License. 20 | 21 | # exit early if directory is empty 22 | if ! [ "$(ls -A ${JANUS_INITDB_DIR})" ]; then 23 | exit 0 24 | fi 25 | 26 | # wait for JanusGraph Server 27 | if ! [ -z "${JANUS_SERVER_TIMEOUT:-}" ]; then 28 | timeout "${JANUS_SERVER_TIMEOUT}s" bash -c \ 29 | "until true &>/dev/null g 21 | -------------------------------------------------------------------------------- /1.0/Dockerfile: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2022 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | FROM debian:buster-slim as builder 20 | 21 | ARG TARGETARCH 22 | ARG JANUS_VERSION=1.0.0-rc2 23 | ARG YQ_VERSION=3.4.1 24 | 25 | ENV JANUS_VERSION=${JANUS_VERSION} \ 26 | JANUS_HOME=/opt/janusgraph 27 | 28 | WORKDIR /opt 29 | 30 | RUN apt update -y && apt install -y gpg unzip curl && \ 31 | curl -fSL https://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/janusgraph-${JANUS_VERSION}.zip -o janusgraph.zip && \ 32 | curl -fSL https://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/janusgraph-${JANUS_VERSION}.zip.asc -o janusgraph.zip.asc && \ 33 | curl -fSL https://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/KEYS -o KEYS && \ 34 | curl -fSL https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_${TARGETARCH} -o yq && \ 35 | gpg --import KEYS && \ 36 | gpg --batch --verify janusgraph.zip.asc janusgraph.zip && \ 37 | unzip janusgraph.zip && \ 38 | mv janusgraph-${JANUS_VERSION} /opt/janusgraph && \ 39 | rm -rf ${JANUS_HOME}/elasticsearch && \ 40 | rm -rf ${JANUS_HOME}/javadocs && \ 41 | rm -rf ${JANUS_HOME}/log && \ 42 | rm -rf ${JANUS_HOME}/examples && \ 43 | rm -rf ${JANUS_HOME}/conf/janusgraph-*.properties && \ 44 | mv ${JANUS_HOME}/conf/gremlin-server/gremlin-server.yaml ${JANUS_HOME}/conf/janusgraph-server.yaml && \ 45 | rm -rf ${JANUS_HOME}/conf/gremlin-server 46 | 47 | COPY conf/ ${JANUS_HOME}/conf/ 48 | COPY scripts/remote-connect.groovy ${JANUS_HOME}/scripts/ 49 | 50 | FROM eclipse-temurin:11-jre 51 | 52 | ARG CREATED=test 53 | ARG REVISION=test 54 | ARG JANUS_VERSION=1.0.0-rc2 55 | 56 | ENV JANUS_VERSION=${JANUS_VERSION} \ 57 | JANUS_HOME=/opt/janusgraph \ 58 | JANUS_CONFIG_DIR=/etc/opt/janusgraph \ 59 | JANUS_DATA_DIR=/var/lib/janusgraph \ 60 | JANUS_SERVER_TIMEOUT=30 \ 61 | JANUS_STORAGE_TIMEOUT=60 \ 62 | JANUS_PROPS_TEMPLATE=berkeleyje-lucene \ 63 | JANUS_INITDB_DIR=/docker-entrypoint-initdb.d \ 64 | gremlinserver.graphs.graph=/etc/opt/janusgraph/janusgraph.properties \ 65 | gremlinserver.threadPoolWorker=1 \ 66 | gremlinserver.gremlinPool=8 67 | 68 | RUN groupadd -r janusgraph --gid=999 && \ 69 | useradd -r -g janusgraph --uid=999 -d ${JANUS_DATA_DIR} janusgraph && \ 70 | apt-get update -y && \ 71 | DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends krb5-user && \ 72 | rm -rf /var/lib/apt/lists/* 73 | 74 | COPY --from=builder /opt/janusgraph/ /opt/janusgraph/ 75 | COPY --from=builder /opt/yq /usr/bin/yq 76 | COPY docker-entrypoint.sh /usr/local/bin/ 77 | COPY load-initdb.sh /usr/local/bin/ 78 | 79 | RUN chmod 755 /usr/local/bin/docker-entrypoint.sh && \ 80 | chmod 755 /usr/local/bin/load-initdb.sh && \ 81 | chmod 755 /usr/bin/yq && \ 82 | mkdir -p ${JANUS_INITDB_DIR} ${JANUS_CONFIG_DIR} ${JANUS_DATA_DIR} && \ 83 | chown -R janusgraph:janusgraph ${JANUS_HOME} ${JANUS_INITDB_DIR} ${JANUS_CONFIG_DIR} ${JANUS_DATA_DIR} 84 | 85 | EXPOSE 8182 86 | 87 | WORKDIR ${JANUS_HOME} 88 | USER janusgraph 89 | 90 | ENTRYPOINT [ "docker-entrypoint.sh" ] 91 | CMD [ "janusgraph" ] 92 | 93 | LABEL org.opencontainers.image.title="JanusGraph Docker Image" \ 94 | org.opencontainers.image.description="Official JanusGraph Docker image" \ 95 | org.opencontainers.image.url="https://janusgraph.org/" \ 96 | org.opencontainers.image.documentation="https://docs.janusgraph.org/v1.0/" \ 97 | org.opencontainers.image.revision="${REVISION}" \ 98 | org.opencontainers.image.source="https://github.com/JanusGraph/janusgraph-docker/" \ 99 | org.opencontainers.image.vendor="JanusGraph" \ 100 | org.opencontainers.image.version="${JANUS_VERSION}" \ 101 | org.opencontainers.image.created="${CREATED}" \ 102 | org.opencontainers.image.license="Apache-2.0" 103 | -------------------------------------------------------------------------------- /1.0/conf/janusgraph-berkeleyje-es-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2021 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | # JanusGraph configuration sample: BerkeleyDB JE and Elasticsearch 20 | 21 | gremlin.graph = org.janusgraph.core.JanusGraphFactory 22 | 23 | # The primary persistence provider used by JanusGraph. This is required. It 24 | # should be set one of JanusGraph's built-in shorthand names for its standard 25 | # storage backends or to the full package and classname of a custom/third-party 26 | # StoreManager implementation. 27 | # 28 | # Default: (no default value) 29 | # Data Type: String 30 | # Mutability: LOCAL 31 | storage.backend = berkeleyje 32 | 33 | # Storage directory for those storage backends that require local storage. 34 | # 35 | # Default: (no default value) 36 | # Data Type: String 37 | # Mutability: LOCAL 38 | storage.directory = /var/lib/janusgraph/data 39 | 40 | # The indexing backend used to extend and optimize JanusGraph's query 41 | # functionality. This setting is optional. JanusGraph can use multiple 42 | # heterogeneous index backends. Hence, this option can appear more than 43 | # once, so long as the user-defined name between "index" and "backend" is 44 | # unique among appearances.Similar to the storage backend, this should be 45 | # set to one of JanusGraph's built-in shorthand names for its standard index 46 | # backends (shorthands: lucene, elasticsearch, es, solr) or to the full 47 | # package and classname of a custom/third-party IndexProvider 48 | # implementation. 49 | # 50 | # Default: elasticsearch 51 | # Data Type: String 52 | # Mutability: GLOBAL_OFFLINE 53 | # 54 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 55 | # storage backend. After starting the database for the first time, this 56 | # file's copy of this setting is ignored. Use JanusGraph's Management System 57 | # to read or modify this value after bootstrapping. 58 | index.search.backend = elasticsearch 59 | 60 | # The hostname or comma-separated list of hostnames of index backend 61 | # servers. This is only applicable to some index backends, such as 62 | # elasticsearch and solr. 63 | # 64 | # Default: 127.0.0.1 65 | # Data Type: class java.lang.String[] 66 | # Mutability: MASKABLE 67 | index.search.hostname = elasticsearch 68 | 69 | -------------------------------------------------------------------------------- /1.0/conf/janusgraph-berkeleyje-lucene-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2021 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | # JanusGraph configuration sample: BerkeleyDB JE and Apache Lucene 20 | 21 | gremlin.graph = org.janusgraph.core.JanusGraphFactory 22 | 23 | # The primary persistence provider used by JanusGraph. This is required. It 24 | # should be set one of JanusGraph's built-in shorthand names for its standard 25 | # storage backends or to the full package and classname of a custom/third-party 26 | # StoreManager implementation. 27 | # 28 | # Default: (no default value) 29 | # Data Type: String 30 | # Mutability: LOCAL 31 | storage.backend = berkeleyje 32 | 33 | # Storage directory for those storage backends that require local storage. 34 | # 35 | # Default: (no default value) 36 | # Data Type: String 37 | # Mutability: LOCAL 38 | storage.directory = /var/lib/janusgraph/data 39 | 40 | # The indexing backend used to extend and optimize JanusGraph's query 41 | # functionality. This setting is optional. JanusGraph can use multiple 42 | # heterogeneous index backends. Hence, this option can appear more than 43 | # once, so long as the user-defined name between "index" and "backend" is 44 | # unique among appearances.Similar to the storage backend, this should be 45 | # set to one of JanusGraph's built-in shorthand names for its standard 46 | # index backends (shorthands: lucene, elasticsearch, es, solr) or to the 47 | # full package and classname of a custom/third-party IndexProvider 48 | # implementation. 49 | # 50 | # Default: elasticsearch 51 | # Data Type: String 52 | # Mutability: GLOBAL_OFFLINE 53 | # 54 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in 55 | # JanusGraph's storage backend. After starting the database for the first 56 | # time, this file's copy of this setting is ignored. Use JanusGraph's 57 | # Management System to read or modify this value after bootstrapping. 58 | index.search.backend = lucene 59 | 60 | # Directory to store index data locally 61 | # 62 | # Default: (no default value) 63 | # Data Type: String 64 | # Mutability: MASKABLE 65 | index.search.directory = /var/lib/janusgraph/index 66 | -------------------------------------------------------------------------------- /1.0/conf/janusgraph-berkeleyje-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2021 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | # JanusGraph configuration sample: BerkeleyDB JE 20 | 21 | gremlin.graph = org.janusgraph.core.JanusGraphFactory 22 | 23 | # The primary persistence provider used by JanusGraph. This is required. It 24 | # should be set one of JanusGraph's built-in shorthand names for its standard 25 | # storage backends or to the full package and classname of a custom/third-party 26 | # StoreManager implementation. 27 | # 28 | # Default: (no default value) 29 | # Data Type: String 30 | # Mutability: LOCAL 31 | storage.backend = berkeleyje 32 | 33 | # Storage directory for those storage backends that require local storage. 34 | # 35 | # Default: (no default value) 36 | # Data Type: String 37 | # Mutability: LOCAL 38 | storage.directory = /var/lib/janusgraph/data 39 | -------------------------------------------------------------------------------- /1.0/conf/janusgraph-cql-es-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2021 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | gremlin.graph = org.janusgraph.core.JanusGraphFactory 20 | 21 | # JanusGraph configuration sample: Cassandra & Elasticsearch over sockets 22 | # 23 | # This file connects to Cassandra and Elasticsearch services running 24 | # on localhost over the CQL API and the Elasticsearch native 25 | # "Transport" API on their respective default ports. The Cassandra 26 | # and Elasticsearch services must already be running before starting 27 | # JanusGraph with this file. 28 | 29 | # The primary persistence provider used by JanusGraph. This is required. It 30 | # should be set one of JanusGraph's built-in shorthand names for its standard 31 | # storage backends or to the full package and classname of a custom/third-party 32 | # StoreManager implementation. 33 | # 34 | # Default: (no default value) 35 | # Data Type: String 36 | # Mutability: LOCAL 37 | storage.backend = cql 38 | 39 | # The hostname or comma-separated list of hostnames of storage backend 40 | # servers. This is only applicable to some storage backends, such as 41 | # cassandra and hbase. 42 | # 43 | # Default: 127.0.0.1 44 | # Data Type: class java.lang.String[] 45 | # Mutability: LOCAL 46 | storage.hostname = cassandra 47 | 48 | # The name of JanusGraph's keyspace. It will be created if it does not 49 | # exist. 50 | # 51 | # Default: janusgraph 52 | # Data Type: String 53 | # Mutability: LOCAL 54 | storage.cql.keyspace = janusgraph 55 | 56 | # Whether to enable JanusGraph's database-level cache, which is shared across 57 | # all transactions. Enabling this option speeds up traversals by holding 58 | # hot graph elements in memory, but also increases the likelihood of 59 | # reading stale data. Disabling it forces each transaction to 60 | # independently fetch graph elements from storage before reading/writing 61 | # them. 62 | # 63 | # Default: false 64 | # Data Type: Boolean 65 | # Mutability: MASKABLE 66 | cache.db-cache = true 67 | 68 | # How long, in milliseconds, database-level cache will keep entries after 69 | # flushing them. This option is only useful on distributed storage 70 | # backends that are capable of acknowledging writes without necessarily 71 | # making them immediately visible. 72 | # 73 | # Default: 50 74 | # Data Type: Integer 75 | # Mutability: GLOBAL_OFFLINE 76 | # 77 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 78 | # storage backend. After starting the database for the first time, this 79 | # file's copy of this setting is ignored. Use JanusGraph's Management System 80 | # to read or modify this value after bootstrapping. 81 | cache.db-cache-clean-wait = 20 82 | 83 | # Default expiration time, in milliseconds, for entries in the 84 | # database-level cache. Entries are evicted when they reach this age even 85 | # if the cache has room to spare. Set to 0 to disable expiration (cache 86 | # entries live forever or until memory pressure triggers eviction when set 87 | # to 0). 88 | # 89 | # Default: 10000 90 | # Data Type: Long 91 | # Mutability: GLOBAL_OFFLINE 92 | # 93 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 94 | # storage backend. After starting the database for the first time, this 95 | # file's copy of this setting is ignored. Use JanusGraph's Management System 96 | # to read or modify this value after bootstrapping. 97 | cache.db-cache-time = 180000 98 | 99 | # Size of JanusGraph's database level cache. Values between 0 and 1 are 100 | # interpreted as a percentage of VM heap, while larger values are 101 | # interpreted as an absolute size in bytes. 102 | # 103 | # Default: 0.3 104 | # Data Type: Double 105 | # Mutability: MASKABLE 106 | cache.db-cache-size = 0.25 107 | 108 | # The indexing backend used to extend and optimize JanusGraph's query 109 | # functionality. This setting is optional. JanusGraph can use multiple 110 | # heterogeneous index backends. Hence, this option can appear more than 111 | # once, so long as the user-defined name between "index" and "backend" is 112 | # unique among appearances.Similar to the storage backend, this should be 113 | # set to one of JanusGraph's built-in shorthand names for its standard index 114 | # backends (shorthands: lucene, elasticsearch, es, solr) or to the full 115 | # package and classname of a custom/third-party IndexProvider 116 | # implementation. 117 | # 118 | # Default: elasticsearch 119 | # Data Type: String 120 | # Mutability: GLOBAL_OFFLINE 121 | # 122 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 123 | # storage backend. After starting the database for the first time, this 124 | # file's copy of this setting is ignored. Use JanusGraph's Management System 125 | # to read or modify this value after bootstrapping. 126 | index.search.backend = elasticsearch 127 | 128 | # The hostname or comma-separated list of hostnames of index backend 129 | # servers. This is only applicable to some index backends, such as 130 | # elasticsearch and solr. 131 | # 132 | # Default: 127.0.0.1 133 | # Data Type: class java.lang.String[] 134 | # Mutability: MASKABLE 135 | index.search.hostname = elasticsearch 136 | 137 | # Or start ES inside the JanusGraph JVM 138 | #index.search.backend=elasticsearch 139 | #index.search.directory=db/es 140 | #index.search.elasticsearch.client-only=false 141 | #index.search.elasticsearch.local-mode=true 142 | -------------------------------------------------------------------------------- /1.0/conf/janusgraph-cql-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2021 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | gremlin.graph = org.janusgraph.core.JanusGraphFactory 20 | 21 | # JanusGraph configuration sample: Cassandra & Elasticsearch over sockets 22 | # 23 | # This file connects to Cassandra and Elasticsearch services running 24 | # on localhost over the CQL API and the Elasticsearch native 25 | # "Transport" API on their respective default ports. The Cassandra 26 | # and Elasticsearch services must already be running before starting 27 | # JanusGraph with this file. 28 | 29 | # The primary persistence provider used by JanusGraph. This is required. It 30 | # should be set one of JanusGraph's built-in shorthand names for its standard 31 | # storage backends or to the full package and classname of a custom/third-party 32 | # StoreManager implementation. 33 | # 34 | # Default: (no default value) 35 | # Data Type: String 36 | # Mutability: LOCAL 37 | storage.backend = cql 38 | 39 | # The hostname or comma-separated list of hostnames of storage backend 40 | # servers. This is only applicable to some storage backends, such as 41 | # cassandra and hbase. 42 | # 43 | # Default: 127.0.0.1 44 | # Data Type: class java.lang.String[] 45 | # Mutability: LOCAL 46 | storage.hostname = cassandra 47 | 48 | # The name of JanusGraph's keyspace. It will be created if it does not 49 | # exist. 50 | # 51 | # Default: janusgraph 52 | # Data Type: String 53 | # Mutability: LOCAL 54 | storage.cql.keyspace = janusgraph 55 | 56 | # Whether to enable JanusGraph's database-level cache, which is shared across 57 | # all transactions. Enabling this option speeds up traversals by holding 58 | # hot graph elements in memory, but also increases the likelihood of 59 | # reading stale data. Disabling it forces each transaction to 60 | # independently fetch graph elements from storage before reading/writing 61 | # them. 62 | # 63 | # Default: false 64 | # Data Type: Boolean 65 | # Mutability: MASKABLE 66 | cache.db-cache = true 67 | 68 | # How long, in milliseconds, database-level cache will keep entries after 69 | # flushing them. This option is only useful on distributed storage 70 | # backends that are capable of acknowledging writes without necessarily 71 | # making them immediately visible. 72 | # 73 | # Default: 50 74 | # Data Type: Integer 75 | # Mutability: GLOBAL_OFFLINE 76 | # 77 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 78 | # storage backend. After starting the database for the first time, this 79 | # file's copy of this setting is ignored. Use JanusGraph's Management System 80 | # to read or modify this value after bootstrapping. 81 | cache.db-cache-clean-wait = 20 82 | 83 | # Default expiration time, in milliseconds, for entries in the 84 | # database-level cache. Entries are evicted when they reach this age even 85 | # if the cache has room to spare. Set to 0 to disable expiration (cache 86 | # entries live forever or until memory pressure triggers eviction when set 87 | # to 0). 88 | # 89 | # Default: 10000 90 | # Data Type: Long 91 | # Mutability: GLOBAL_OFFLINE 92 | # 93 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 94 | # storage backend. After starting the database for the first time, this 95 | # file's copy of this setting is ignored. Use JanusGraph's Management System 96 | # to read or modify this value after bootstrapping. 97 | cache.db-cache-time = 180000 98 | 99 | # Size of JanusGraph's database level cache. Values between 0 and 1 are 100 | # interpreted as a percentage of VM heap, while larger values are 101 | # interpreted as an absolute size in bytes. 102 | # 103 | # Default: 0.3 104 | # Data Type: Double 105 | # Mutability: MASKABLE 106 | cache.db-cache-size = 0.25 107 | -------------------------------------------------------------------------------- /1.0/conf/janusgraph-inmemory-server.properties: -------------------------------------------------------------------------------- 1 | # 2 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 3 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 4 | # 5 | # Copyright 2021 JanusGraph Authors 6 | # 7 | # Licensed under the Apache License, Version 2.0 (the "License"); 8 | # you may not use this file except in compliance with the License. 9 | # You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, software 14 | # distributed under the License is distributed on an "AS IS" BASIS, 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | # See the License for the specific language governing permissions and 17 | # limitations under the License. 18 | 19 | # JanusGraph configuration sample: in-memory 20 | # 21 | # This file connects to an in-memory storage backend 22 | 23 | # The implementation of graph factory that will be used by gremlin server 24 | # 25 | # Default: org.janusgraph.core.JanusGraphFactory 26 | # Data Type: String 27 | # Mutability: LOCAL 28 | gremlin.graph = org.janusgraph.core.JanusGraphFactory 29 | 30 | # The primary persistence provider used by JanusGraph. This is required. 31 | # It should be set one of JanusGraph's built-in shorthand names for its 32 | # standard storage backends (shorthands: berkeleyje, cassandrathrift, 33 | # cassandra, astyanax, embeddedcassandra, cql, hbase, inmemory) or to the 34 | # full package and classname of a custom/third-party StoreManager 35 | # implementation. 36 | # 37 | # Default: (no default value) 38 | # Data Type: String 39 | # Mutability: LOCAL 40 | storage.backend = inmemory 41 | 42 | # Whether to enable JanusGraph's database-level cache, which is shared across 43 | # all transactions. Enabling this option speeds up traversals by holding 44 | # hot graph elements in memory, but also increases the likelihood of 45 | # reading stale data. Disabling it forces each transaction to 46 | # independently fetch graph elements from storage before reading/writing 47 | # them. 48 | # 49 | # Default: false 50 | # Data Type: Boolean 51 | # Mutability: MASKABLE 52 | cache.db-cache = true 53 | 54 | # How long, in milliseconds, database-level cache will keep entries after 55 | # flushing them. This option is only useful on distributed storage 56 | # backends that are capable of acknowledging writes without necessarily 57 | # making them immediately visible. 58 | # 59 | # Default: 50 60 | # Data Type: Integer 61 | # Mutability: GLOBAL_OFFLINE 62 | # 63 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 64 | # storage backend. After starting the database for the first time, this 65 | # file's copy of this setting is ignored. Use JanusGraph's Management System 66 | # to read or modify this value after bootstrapping. 67 | cache.db-cache-clean-wait = 20 68 | 69 | # Default expiration time, in milliseconds, for entries in the 70 | # database-level cache. Entries are evicted when they reach this age even 71 | # if the cache has room to spare. Set to 0 to disable expiration (cache 72 | # entries live forever or until memory pressure triggers eviction when set 73 | # to 0). 74 | # 75 | # Default: 10000 76 | # Data Type: Long 77 | # Mutability: GLOBAL_OFFLINE 78 | # 79 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 80 | # storage backend. After starting the database for the first time, this 81 | # file's copy of this setting is ignored. Use JanusGraph's Management System 82 | # to read or modify this value after bootstrapping. 83 | cache.db-cache-time = 180000 84 | 85 | # Size of JanusGraph's database level cache. Values between 0 and 1 are 86 | # interpreted as a percentage of VM heap, while larger values are 87 | # interpreted as an absolute size in bytes. 88 | # 89 | # Default: 0.3 90 | # Data Type: Double 91 | # Mutability: MASKABLE 92 | cache.db-cache-size = 0.25 93 | -------------------------------------------------------------------------------- /1.0/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 4 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 5 | # 6 | # 7 | # Copyright 2019 JanusGraph Authors 8 | # 9 | # Licensed under the Apache License, Version 2.0 (the "License"); 10 | # you may not use this file except in compliance with the License. 11 | # You may obtain a copy of the License at 12 | # 13 | # http://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, software 16 | # distributed under the License is distributed on an "AS IS" BASIS, 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | # See the License for the specific language governing permissions and 19 | # limitations under the License. 20 | 21 | JANUS_PROPS="${JANUS_CONFIG_DIR}/janusgraph.properties" 22 | JANUSGRAPH_SERVER_YAML="${JANUS_CONFIG_DIR}/janusgraph-server.yaml" 23 | 24 | # running as root; step down to run as janusgraph user 25 | if [ "$1" == 'janusgraph' ] && [ "$(id -u)" == "0" ]; then 26 | mkdir -p ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 27 | chown -R janusgraph:janusgraph ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 28 | chmod 700 ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 29 | 30 | exec chroot --skip-chdir --userspec janusgraph:janusgraph / "${BASH_SOURCE}" "$@" 31 | fi 32 | 33 | # running as non root user 34 | if [ "$1" == 'janusgraph' ]; then 35 | # setup config directory 36 | mkdir -p ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 37 | cp conf/janusgraph-${JANUS_PROPS_TEMPLATE}-server.properties ${JANUS_PROPS} 38 | cp conf/janusgraph-server.yaml ${JANUSGRAPH_SERVER_YAML} 39 | chown -R "$(id -u):$(id -g)" ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 40 | chmod 700 ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 41 | chmod -R 600 ${JANUS_CONFIG_DIR}/* 42 | 43 | # apply configuration from environment 44 | while IFS=' ' read -r envvar_key envvar_val; do 45 | if [[ "${envvar_key}" =~ janusgraph\. ]] && [[ ! -z ${envvar_val} ]]; then 46 | # strip namespace and use properties file delimiter for janusgraph properties 47 | envvar_key=${envvar_key#"janusgraph."} 48 | # Add new or update existing field in configuration file 49 | if grep -q -E "^\s*${envvar_key}\s*=\.*" ${JANUS_PROPS}; then 50 | sed -ri "s#^(\s*${envvar_key}\s*=).*#\\1${envvar_val}#" ${JANUS_PROPS} 51 | else 52 | echo "${envvar_key}=${envvar_val}" >> ${JANUS_PROPS} 53 | fi 54 | elif [[ "${envvar_key}" =~ gremlinserver(%d)?[.]{1}(.+) ]]; then 55 | # Check for edit mode %d after prefix 56 | if [[ ${BASH_REMATCH[1]} == "%d" ]]; then edit_mode="d"; else edit_mode="w"; fi 57 | # strip namespace from env variable and get value 58 | envvar_key=${BASH_REMATCH[2]} 59 | if [[ edit_mode == "d" ]]; then envvar_val=""; fi 60 | # add new or update existing field in configuration file 61 | yq ${edit_mode} -P -i ${JANUSGRAPH_SERVER_YAML} ${envvar_key} ${envvar_val} 62 | else 63 | continue 64 | fi 65 | done < <(env | sort -r | awk -F= '{ st = index($0, "="); print $1 " " substr($0, st+1) }') 66 | 67 | if [ "$2" == 'show-config' ]; then 68 | echo "# contents of ${JANUS_PROPS}" 69 | cat "$JANUS_PROPS" 70 | echo "---------------------------------------" 71 | echo "# contents of ${JANUSGRAPH_SERVER_YAML}" 72 | cat "$JANUSGRAPH_SERVER_YAML" 73 | exit 0 74 | else 75 | # wait for storage 76 | if ! [ -z "${JANUS_STORAGE_TIMEOUT:-}" ]; then 77 | F="$(mktemp --suffix .groovy)" 78 | echo "graph = JanusGraphFactory.open('${JANUS_PROPS}')" > $F 79 | timeout "${JANUS_STORAGE_TIMEOUT}s" bash -c \ 80 | "until bin/gremlin.sh -e $F > /dev/null 2>&1; do echo \"waiting for storage...\"; sleep 5; done" 81 | rm -f "$F" 82 | fi 83 | 84 | /usr/local/bin/load-initdb.sh & 85 | 86 | exec ${JANUS_HOME}/bin/janusgraph-server.sh ${JANUSGRAPH_SERVER_YAML} 87 | fi 88 | fi 89 | 90 | # override hosts for remote connections with Gremlin Console 91 | if ! [ -z "${GREMLIN_REMOTE_HOSTS:-}" ]; then 92 | sed -i "s/hosts\s*:.*/hosts: [$GREMLIN_REMOTE_HOSTS]/" ${JANUS_HOME}/conf/remote.yaml 93 | sed -i "s/hosts\s*:.*/hosts: [$GREMLIN_REMOTE_HOSTS]/" ${JANUS_HOME}/conf/remote-objects.yaml 94 | fi 95 | 96 | exec "$@" 97 | -------------------------------------------------------------------------------- /1.0/load-initdb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # NOTE: THIS FILE IS GENERATED VIA "update.sh" 4 | # DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 5 | # 6 | # 7 | # Copyright 2019 JanusGraph Authors 8 | # 9 | # Licensed under the Apache License, Version 2.0 (the "License"); 10 | # you may not use this file except in compliance with the License. 11 | # You may obtain a copy of the License at 12 | # 13 | # http://www.apache.org/licenses/LICENSE-2.0 14 | # 15 | # Unless required by applicable law or agreed to in writing, software 16 | # distributed under the License is distributed on an "AS IS" BASIS, 17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | # See the License for the specific language governing permissions and 19 | # limitations under the License. 20 | 21 | # exit early if directory is empty 22 | if ! [ "$(ls -A ${JANUS_INITDB_DIR})" ]; then 23 | exit 0 24 | fi 25 | 26 | # wait for JanusGraph Server 27 | if ! [ -z "${JANUS_SERVER_TIMEOUT:-}" ]; then 28 | timeout "${JANUS_SERVER_TIMEOUT}s" bash -c \ 29 | "until true &>/dev/null g 21 | -------------------------------------------------------------------------------- /AUTHORS.txt: -------------------------------------------------------------------------------- 1 | # This is the official list of JanusGraph authors for copyright purposes. 2 | # 3 | # This file is distinct from the CONTRIBUTORS.txt files. 4 | # See the latter for an explanation. 5 | 6 | # Names should be added to this file as one of 7 | # Organization's name 8 | # Organization's name ... 9 | # Individual's name 10 | # Individual's name 11 | # See CONTRIBUTORS.txt for the meaning of multiple email addresses. 12 | 13 | # Please keep the list sorted. 14 | 15 | Google 16 | -------------------------------------------------------------------------------- /BUILDING.md: -------------------------------------------------------------------------------- 1 | # Building and Publishing of the Docker Images 2 | 3 | ## Building 4 | 5 | The `build-images.sh` script will build the docker images for all the Dockerfiles in the versioned 6 | folder directories. 7 | 8 | ```bash 9 | ./build-images.sh 10 | ``` 11 | 12 | Optionally build a specific version 13 | 14 | ```bash 15 | ./build-images.sh 0.4 16 | ``` 17 | 18 | ## Deployment 19 | 20 | We use continuous deployment via Travis CI to push images to Docker Hub. 21 | Every commit on `master` automatically triggers a deployment. 22 | 23 | Travis CI simply executes the `push-images.sh` script which will push the docker images for all the versioned folders 24 | in the repository. 25 | 26 | ## Updating and adding versions 27 | 28 | The `update.sh` script will update the Dockerfile in the relevant versioned folder directory to the provided version. 29 | 30 | ```bash 31 | ./update.sh 0.4.1 32 | ``` 33 | 34 | Alternatively the script will automatically determine the latest version using the GitHub Releases API (requires 35 | [jq](https://stedolan.github.io/jq/)). 36 | 37 | ```bash 38 | ./update 0.3 39 | ``` 40 | 41 | If the versioned folder directory does not exist it will be created and initialized with the resources from the 42 | `build` directory and the Dockerfile will be updated as described above. 43 | 44 | ```bash 45 | ./update.sh 0.4 46 | ``` 47 | 48 | Finally if no argument is provided then the Dockerfiles in all versioned directories will be updated to the relevant 49 | latest version using the GitHub Releases API (requires [jq](https://stedolan.github.io/jq/)). 50 | 51 | ```bash 52 | ./update.sh 53 | ``` 54 | 55 | [DH]: https://hub.docker.com/ 56 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | * Allow changes to gremlin-server.yaml using yq3. #55 4 | * Change tagging logic. #73 5 | * Switch base layer to 8-jre-slim-buster #75 6 | * Default user to janusgraph with uid:999 and gid:999 #77 7 | * Set /var/lib/janusgraph as home dir for user janusgraph #84 8 | * Include default assets into repo #85 9 | * Upgrade JanusGraph to 0.6 #91 10 | * Add image for JanusGraph 1.0, currently only for the release candidate #111 11 | * Use Java 11 for all versions 1.0 and higher #111 12 | -------------------------------------------------------------------------------- /CONTRIBUTORS.txt: -------------------------------------------------------------------------------- 1 | # This is the official list of people who have contributed to JanusGraph Docker 2 | # images. 3 | # 4 | # The AUTHORS.txt file lists the copyright holders; this file lists people. For 5 | # example, employees of an organization who assign copyright to their 6 | # organization are listed here but not in AUTHORS.txt, because their 7 | # organization holds the copyright. Similarly, contributors who assigned 8 | # copyright to a party other than their employer will appear in this list, but 9 | # not in AUTHORS.txt file. 10 | # 11 | # When adding J Random Contributor's name to this file, either J's name or J's 12 | # organization's name should be added to the AUTHORS.txt file, depending on 13 | # whether the individual or corporate CLA was used. 14 | 15 | # The original list was generated via: 16 | # 17 | # $ git log --all --format='%aN <%cE>' | sort -u --ignore-case 18 | # 19 | # and manual cleanup. 20 | 21 | # Names should be added to this file like so: 22 | # Individual's name 23 | # Individual's name 24 | 25 | # Please keep the list sorted. 26 | 27 | -------------------------------------------------------------------------------- /DCO.txt: -------------------------------------------------------------------------------- 1 | Developer Certificate of Origin 2 | Version 1.1 3 | 4 | Copyright (C) 2004, 2006 The Linux Foundation and its contributors. 5 | 1 Letterman Drive 6 | Suite D4700 7 | San Francisco, CA, 94129 8 | 9 | Everyone is permitted to copy and distribute verbatim copies of this 10 | license document, but changing it is not allowed. 11 | 12 | 13 | Developer's Certificate of Origin 1.1 14 | 15 | By making a contribution to this project, I certify that: 16 | 17 | (a) The contribution was created in whole or in part by me and I 18 | have the right to submit it under the open source license 19 | indicated in the file; or 20 | 21 | (b) The contribution is based upon previous work that, to the best 22 | of my knowledge, is covered under an appropriate open source 23 | license and I have the right under that license to submit that 24 | work with modifications, whether created in whole or in part 25 | by me, under the same open source license (unless I am 26 | permitted to submit under a different license), as indicated 27 | in the file; or 28 | 29 | (c) The contribution was provided directly to me by some other 30 | person who certified (a), (b) or (c) and I have not modified 31 | it. 32 | 33 | (d) I understand and agree that this project and the contribution 34 | are public and that a record of the contribution (including all 35 | personal information I submit with it, including my sign-off) is 36 | maintained indefinitely and may be redistributed consistent with 37 | this project or the open source license(s) involved. 38 | -------------------------------------------------------------------------------- /build-images.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2019 JanusGraph Authors 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | set -eu 18 | 19 | # optional version argument 20 | version="${1:-}" 21 | # get all versions 22 | versions=($(ls -d [0-9]*)) 23 | 24 | get_full_version () { 25 | echo "$(grep "ARG JANUS_VERSION" $1/Dockerfile | head -n 1 | cut -d"=" -f 2)" 26 | } 27 | 28 | get_latest_version () { 29 | for v in "${versions[@]}"; do 30 | full_version=$(get_full_version $v) 31 | if [[ $full_version != *"-"* ]]; then 32 | latest_version="${v}" 33 | fi 34 | done 35 | echo $latest_version 36 | } 37 | 38 | # get the last element of sorted version folders 39 | latest_version=$(get_latest_version) 40 | echo "latest_version: ${latest_version}" 41 | 42 | REVISION="$(git rev-parse --short HEAD)" 43 | CREATED="$(date -u +%Y-%m-%dT%H:%M:%SZ)" 44 | IMAGE_NAME="docker.io/janusgraph/janusgraph" 45 | 46 | echo "REVISION: ${REVISION}" 47 | echo "CREATED: ${CREATED}" 48 | echo "IMAGE_NAME: ${IMAGE_NAME}" 49 | 50 | # enable buildkit 51 | export DOCKER_BUILDKIT=1 52 | 53 | for v in "${versions[@]}"; do 54 | if [ -z "${version}" ] || [ "${version}" == "${v}" ]; then 55 | # prepare docker tags 56 | full_version=$(get_full_version $v) 57 | full_version_with_revision="${full_version}-${REVISION}" 58 | 59 | # build and test image 60 | docker build -f "${v}/Dockerfile" -t "${IMAGE_NAME}:${full_version}" ${v} --build-arg REVISION="$REVISION" --build-arg CREATED="$CREATED" 61 | ./test-image.sh "${IMAGE_NAME}:${full_version}" 62 | 63 | # add relevant tags 64 | docker tag "${IMAGE_NAME}:${full_version}" "${IMAGE_NAME}:${v}" 65 | echo "Successfully tagged ${IMAGE_NAME}:${v}" 66 | docker tag "${IMAGE_NAME}:${full_version}" "${IMAGE_NAME}:${full_version_with_revision}" 67 | echo "Successfully tagged ${IMAGE_NAME}:${full_version_with_revision}" 68 | if [ "${v}" == "${latest_version}" ]; then 69 | docker tag "${IMAGE_NAME}:${v}" "${IMAGE_NAME}:latest" 70 | echo "Successfully tagged ${IMAGE_NAME}:latest" 71 | fi 72 | fi 73 | done 74 | -------------------------------------------------------------------------------- /build/Dockerfile-openjdk11.template: -------------------------------------------------------------------------------- 1 | # Copyright 2022 JanusGraph Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | FROM debian:buster-slim as builder 16 | 17 | ARG TARGETARCH 18 | ARG JANUS_VERSION=placeholder 19 | ARG YQ_VERSION=3.4.1 20 | 21 | ENV JANUS_VERSION=${JANUS_VERSION} \ 22 | JANUS_HOME=/opt/janusgraph 23 | 24 | WORKDIR /opt 25 | 26 | RUN apt update -y && apt install -y gpg unzip curl && \ 27 | curl -fSL https://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/janusgraph-${JANUS_VERSION}.zip -o janusgraph.zip && \ 28 | curl -fSL https://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/janusgraph-${JANUS_VERSION}.zip.asc -o janusgraph.zip.asc && \ 29 | curl -fSL https://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/KEYS -o KEYS && \ 30 | curl -fSL https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_${TARGETARCH} -o yq && \ 31 | gpg --import KEYS && \ 32 | gpg --batch --verify janusgraph.zip.asc janusgraph.zip && \ 33 | unzip janusgraph.zip && \ 34 | mv janusgraph-${JANUS_VERSION} /opt/janusgraph && \ 35 | rm -rf ${JANUS_HOME}/elasticsearch && \ 36 | rm -rf ${JANUS_HOME}/javadocs && \ 37 | rm -rf ${JANUS_HOME}/log && \ 38 | rm -rf ${JANUS_HOME}/examples && \ 39 | rm -rf ${JANUS_HOME}/conf/janusgraph-*.properties && \ 40 | mv ${JANUS_HOME}/conf/gremlin-server/gremlin-server.yaml ${JANUS_HOME}/conf/janusgraph-server.yaml && \ 41 | rm -rf ${JANUS_HOME}/conf/gremlin-server 42 | 43 | COPY conf/ ${JANUS_HOME}/conf/ 44 | COPY scripts/remote-connect.groovy ${JANUS_HOME}/scripts/ 45 | 46 | FROM eclipse-temurin:11-jre 47 | 48 | ARG CREATED=test 49 | ARG REVISION=test 50 | ARG JANUS_VERSION=placeholder 51 | 52 | ENV JANUS_VERSION=${JANUS_VERSION} \ 53 | JANUS_HOME=/opt/janusgraph \ 54 | JANUS_CONFIG_DIR=/etc/opt/janusgraph \ 55 | JANUS_DATA_DIR=/var/lib/janusgraph \ 56 | JANUS_SERVER_TIMEOUT=30 \ 57 | JANUS_STORAGE_TIMEOUT=60 \ 58 | JANUS_PROPS_TEMPLATE=berkeleyje-lucene \ 59 | JANUS_INITDB_DIR=/docker-entrypoint-initdb.d \ 60 | gremlinserver.graphs.graph=/etc/opt/janusgraph/janusgraph.properties \ 61 | gremlinserver.threadPoolWorker=1 \ 62 | gremlinserver.gremlinPool=8 63 | 64 | RUN groupadd -r janusgraph --gid=999 && \ 65 | useradd -r -g janusgraph --uid=999 -d ${JANUS_DATA_DIR} janusgraph && \ 66 | apt-get update -y && \ 67 | DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends krb5-user && \ 68 | rm -rf /var/lib/apt/lists/* 69 | 70 | COPY --from=builder /opt/janusgraph/ /opt/janusgraph/ 71 | COPY --from=builder /opt/yq /usr/bin/yq 72 | COPY docker-entrypoint.sh /usr/local/bin/ 73 | COPY load-initdb.sh /usr/local/bin/ 74 | 75 | RUN chmod 755 /usr/local/bin/docker-entrypoint.sh && \ 76 | chmod 755 /usr/local/bin/load-initdb.sh && \ 77 | chmod 755 /usr/bin/yq && \ 78 | mkdir -p ${JANUS_INITDB_DIR} ${JANUS_CONFIG_DIR} ${JANUS_DATA_DIR} && \ 79 | chown -R janusgraph:janusgraph ${JANUS_HOME} ${JANUS_INITDB_DIR} ${JANUS_CONFIG_DIR} ${JANUS_DATA_DIR} 80 | 81 | EXPOSE 8182 82 | 83 | WORKDIR ${JANUS_HOME} 84 | USER janusgraph 85 | 86 | ENTRYPOINT [ "docker-entrypoint.sh" ] 87 | CMD [ "janusgraph" ] 88 | 89 | LABEL org.opencontainers.image.title="JanusGraph Docker Image" \ 90 | org.opencontainers.image.description="Official JanusGraph Docker image" \ 91 | org.opencontainers.image.url="https://janusgraph.org/" \ 92 | org.opencontainers.image.documentation="https://docs.janusgraph.org/v{MAJOR_MINOR_VERSION_PLACEHOLDER}/" \ 93 | org.opencontainers.image.revision="${REVISION}" \ 94 | org.opencontainers.image.source="https://github.com/JanusGraph/janusgraph-docker/" \ 95 | org.opencontainers.image.vendor="JanusGraph" \ 96 | org.opencontainers.image.version="${JANUS_VERSION}" \ 97 | org.opencontainers.image.created="${CREATED}" \ 98 | org.opencontainers.image.license="Apache-2.0" 99 | -------------------------------------------------------------------------------- /build/Dockerfile-openjdk8.template: -------------------------------------------------------------------------------- 1 | # Copyright 2019 JanusGraph Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | FROM debian:buster-slim as builder 16 | 17 | ARG TARGETARCH 18 | ARG JANUS_VERSION=placeholder 19 | ARG YQ_VERSION=3.4.1 20 | 21 | ENV JANUS_VERSION=${JANUS_VERSION} \ 22 | JANUS_HOME=/opt/janusgraph 23 | 24 | WORKDIR /opt 25 | 26 | RUN apt update -y && apt install -y gpg unzip curl && \ 27 | curl -fSL https://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/janusgraph-${JANUS_VERSION}.zip -o janusgraph.zip && \ 28 | curl -fSL https://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/janusgraph-${JANUS_VERSION}.zip.asc -o janusgraph.zip.asc && \ 29 | curl -fSL https://github.com/JanusGraph/janusgraph/releases/download/v${JANUS_VERSION}/KEYS -o KEYS && \ 30 | curl -fSL https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_${TARGETARCH} -o yq && \ 31 | gpg --import KEYS && \ 32 | gpg --batch --verify janusgraph.zip.asc janusgraph.zip && \ 33 | unzip janusgraph.zip && \ 34 | mv janusgraph-${JANUS_VERSION} /opt/janusgraph && \ 35 | rm -rf ${JANUS_HOME}/elasticsearch && \ 36 | rm -rf ${JANUS_HOME}/javadocs && \ 37 | rm -rf ${JANUS_HOME}/log && \ 38 | rm -rf ${JANUS_HOME}/examples && \ 39 | rm -rf ${JANUS_HOME}/conf/janusgraph-*.properties && \ 40 | mv ${JANUS_HOME}/conf/gremlin-server/gremlin-server.yaml ${JANUS_HOME}/conf/janusgraph-server.yaml && \ 41 | rm -rf ${JANUS_HOME}/conf/gremlin-server 42 | 43 | COPY conf/ ${JANUS_HOME}/conf/ 44 | COPY scripts/remote-connect.groovy ${JANUS_HOME}/scripts/ 45 | 46 | FROM eclipse-temurin:8-jre 47 | 48 | ARG CREATED=test 49 | ARG REVISION=test 50 | ARG JANUS_VERSION=placeholder 51 | 52 | ENV JANUS_VERSION=${JANUS_VERSION} \ 53 | JANUS_HOME=/opt/janusgraph \ 54 | JANUS_CONFIG_DIR=/etc/opt/janusgraph \ 55 | JANUS_DATA_DIR=/var/lib/janusgraph \ 56 | JANUS_SERVER_TIMEOUT=30 \ 57 | JANUS_STORAGE_TIMEOUT=60 \ 58 | JANUS_PROPS_TEMPLATE=berkeleyje-lucene \ 59 | JANUS_INITDB_DIR=/docker-entrypoint-initdb.d \ 60 | gremlinserver.graphs.graph=/etc/opt/janusgraph/janusgraph.properties \ 61 | gremlinserver.threadPoolWorker=1 \ 62 | gremlinserver.gremlinPool=8 63 | 64 | RUN groupadd -r janusgraph --gid=999 && \ 65 | useradd -r -g janusgraph --uid=999 -d ${JANUS_DATA_DIR} janusgraph && \ 66 | apt-get update -y && \ 67 | DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends krb5-user && \ 68 | rm -rf /var/lib/apt/lists/* 69 | 70 | COPY --from=builder /opt/janusgraph/ /opt/janusgraph/ 71 | COPY --from=builder /opt/yq /usr/bin/yq 72 | COPY docker-entrypoint.sh /usr/local/bin/ 73 | COPY load-initdb.sh /usr/local/bin/ 74 | 75 | RUN chmod 755 /usr/local/bin/docker-entrypoint.sh && \ 76 | chmod 755 /usr/local/bin/load-initdb.sh && \ 77 | chmod 755 /usr/bin/yq && \ 78 | mkdir -p ${JANUS_INITDB_DIR} ${JANUS_CONFIG_DIR} ${JANUS_DATA_DIR} && \ 79 | chown -R janusgraph:janusgraph ${JANUS_HOME} ${JANUS_INITDB_DIR} ${JANUS_CONFIG_DIR} ${JANUS_DATA_DIR} 80 | 81 | EXPOSE 8182 82 | 83 | WORKDIR ${JANUS_HOME} 84 | USER janusgraph 85 | 86 | ENTRYPOINT [ "docker-entrypoint.sh" ] 87 | CMD [ "janusgraph" ] 88 | 89 | LABEL org.opencontainers.image.title="JanusGraph Docker Image" \ 90 | org.opencontainers.image.description="Official JanusGraph Docker image" \ 91 | org.opencontainers.image.url="https://janusgraph.org/" \ 92 | org.opencontainers.image.documentation="https://docs.janusgraph.org/v{MAJOR_MINOR_VERSION_PLACEHOLDER}/" \ 93 | org.opencontainers.image.revision="${REVISION}" \ 94 | org.opencontainers.image.source="https://github.com/JanusGraph/janusgraph-docker/" \ 95 | org.opencontainers.image.vendor="JanusGraph" \ 96 | org.opencontainers.image.version="${JANUS_VERSION}" \ 97 | org.opencontainers.image.created="${CREATED}" \ 98 | org.opencontainers.image.license="Apache-2.0" 99 | -------------------------------------------------------------------------------- /build/conf/janusgraph-berkeleyje-es-server.properties: -------------------------------------------------------------------------------- 1 | # Copyright 2021 JanusGraph Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # JanusGraph configuration sample: BerkeleyDB JE and Elasticsearch 16 | 17 | gremlin.graph = org.janusgraph.core.JanusGraphFactory 18 | 19 | # The primary persistence provider used by JanusGraph. This is required. It 20 | # should be set one of JanusGraph's built-in shorthand names for its standard 21 | # storage backends or to the full package and classname of a custom/third-party 22 | # StoreManager implementation. 23 | # 24 | # Default: (no default value) 25 | # Data Type: String 26 | # Mutability: LOCAL 27 | storage.backend = berkeleyje 28 | 29 | # Storage directory for those storage backends that require local storage. 30 | # 31 | # Default: (no default value) 32 | # Data Type: String 33 | # Mutability: LOCAL 34 | storage.directory = /var/lib/janusgraph/data 35 | 36 | # The indexing backend used to extend and optimize JanusGraph's query 37 | # functionality. This setting is optional. JanusGraph can use multiple 38 | # heterogeneous index backends. Hence, this option can appear more than 39 | # once, so long as the user-defined name between "index" and "backend" is 40 | # unique among appearances.Similar to the storage backend, this should be 41 | # set to one of JanusGraph's built-in shorthand names for its standard index 42 | # backends (shorthands: lucene, elasticsearch, es, solr) or to the full 43 | # package and classname of a custom/third-party IndexProvider 44 | # implementation. 45 | # 46 | # Default: elasticsearch 47 | # Data Type: String 48 | # Mutability: GLOBAL_OFFLINE 49 | # 50 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 51 | # storage backend. After starting the database for the first time, this 52 | # file's copy of this setting is ignored. Use JanusGraph's Management System 53 | # to read or modify this value after bootstrapping. 54 | index.search.backend = elasticsearch 55 | 56 | # The hostname or comma-separated list of hostnames of index backend 57 | # servers. This is only applicable to some index backends, such as 58 | # elasticsearch and solr. 59 | # 60 | # Default: 127.0.0.1 61 | # Data Type: class java.lang.String[] 62 | # Mutability: MASKABLE 63 | index.search.hostname = elasticsearch 64 | 65 | -------------------------------------------------------------------------------- /build/conf/janusgraph-berkeleyje-lucene-server.properties: -------------------------------------------------------------------------------- 1 | # Copyright 2021 JanusGraph Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # JanusGraph configuration sample: BerkeleyDB JE and Apache Lucene 16 | 17 | gremlin.graph = org.janusgraph.core.JanusGraphFactory 18 | 19 | # The primary persistence provider used by JanusGraph. This is required. It 20 | # should be set one of JanusGraph's built-in shorthand names for its standard 21 | # storage backends or to the full package and classname of a custom/third-party 22 | # StoreManager implementation. 23 | # 24 | # Default: (no default value) 25 | # Data Type: String 26 | # Mutability: LOCAL 27 | storage.backend = berkeleyje 28 | 29 | # Storage directory for those storage backends that require local storage. 30 | # 31 | # Default: (no default value) 32 | # Data Type: String 33 | # Mutability: LOCAL 34 | storage.directory = /var/lib/janusgraph/data 35 | 36 | # The indexing backend used to extend and optimize JanusGraph's query 37 | # functionality. This setting is optional. JanusGraph can use multiple 38 | # heterogeneous index backends. Hence, this option can appear more than 39 | # once, so long as the user-defined name between "index" and "backend" is 40 | # unique among appearances.Similar to the storage backend, this should be 41 | # set to one of JanusGraph's built-in shorthand names for its standard 42 | # index backends (shorthands: lucene, elasticsearch, es, solr) or to the 43 | # full package and classname of a custom/third-party IndexProvider 44 | # implementation. 45 | # 46 | # Default: elasticsearch 47 | # Data Type: String 48 | # Mutability: GLOBAL_OFFLINE 49 | # 50 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in 51 | # JanusGraph's storage backend. After starting the database for the first 52 | # time, this file's copy of this setting is ignored. Use JanusGraph's 53 | # Management System to read or modify this value after bootstrapping. 54 | index.search.backend = lucene 55 | 56 | # Directory to store index data locally 57 | # 58 | # Default: (no default value) 59 | # Data Type: String 60 | # Mutability: MASKABLE 61 | index.search.directory = /var/lib/janusgraph/index 62 | -------------------------------------------------------------------------------- /build/conf/janusgraph-berkeleyje-server.properties: -------------------------------------------------------------------------------- 1 | # Copyright 2021 JanusGraph Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # JanusGraph configuration sample: BerkeleyDB JE 16 | 17 | gremlin.graph = org.janusgraph.core.JanusGraphFactory 18 | 19 | # The primary persistence provider used by JanusGraph. This is required. It 20 | # should be set one of JanusGraph's built-in shorthand names for its standard 21 | # storage backends or to the full package and classname of a custom/third-party 22 | # StoreManager implementation. 23 | # 24 | # Default: (no default value) 25 | # Data Type: String 26 | # Mutability: LOCAL 27 | storage.backend = berkeleyje 28 | 29 | # Storage directory for those storage backends that require local storage. 30 | # 31 | # Default: (no default value) 32 | # Data Type: String 33 | # Mutability: LOCAL 34 | storage.directory = /var/lib/janusgraph/data 35 | -------------------------------------------------------------------------------- /build/conf/janusgraph-cql-es-server.properties: -------------------------------------------------------------------------------- 1 | # Copyright 2021 JanusGraph Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | gremlin.graph = org.janusgraph.core.JanusGraphFactory 16 | 17 | # JanusGraph configuration sample: Cassandra & Elasticsearch over sockets 18 | # 19 | # This file connects to Cassandra and Elasticsearch services running 20 | # on localhost over the CQL API and the Elasticsearch native 21 | # "Transport" API on their respective default ports. The Cassandra 22 | # and Elasticsearch services must already be running before starting 23 | # JanusGraph with this file. 24 | 25 | # The primary persistence provider used by JanusGraph. This is required. It 26 | # should be set one of JanusGraph's built-in shorthand names for its standard 27 | # storage backends or to the full package and classname of a custom/third-party 28 | # StoreManager implementation. 29 | # 30 | # Default: (no default value) 31 | # Data Type: String 32 | # Mutability: LOCAL 33 | storage.backend = cql 34 | 35 | # The hostname or comma-separated list of hostnames of storage backend 36 | # servers. This is only applicable to some storage backends, such as 37 | # cassandra and hbase. 38 | # 39 | # Default: 127.0.0.1 40 | # Data Type: class java.lang.String[] 41 | # Mutability: LOCAL 42 | storage.hostname = cassandra 43 | 44 | # The name of JanusGraph's keyspace. It will be created if it does not 45 | # exist. 46 | # 47 | # Default: janusgraph 48 | # Data Type: String 49 | # Mutability: LOCAL 50 | storage.cql.keyspace = janusgraph 51 | 52 | # Whether to enable JanusGraph's database-level cache, which is shared across 53 | # all transactions. Enabling this option speeds up traversals by holding 54 | # hot graph elements in memory, but also increases the likelihood of 55 | # reading stale data. Disabling it forces each transaction to 56 | # independently fetch graph elements from storage before reading/writing 57 | # them. 58 | # 59 | # Default: false 60 | # Data Type: Boolean 61 | # Mutability: MASKABLE 62 | cache.db-cache = true 63 | 64 | # How long, in milliseconds, database-level cache will keep entries after 65 | # flushing them. This option is only useful on distributed storage 66 | # backends that are capable of acknowledging writes without necessarily 67 | # making them immediately visible. 68 | # 69 | # Default: 50 70 | # Data Type: Integer 71 | # Mutability: GLOBAL_OFFLINE 72 | # 73 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 74 | # storage backend. After starting the database for the first time, this 75 | # file's copy of this setting is ignored. Use JanusGraph's Management System 76 | # to read or modify this value after bootstrapping. 77 | cache.db-cache-clean-wait = 20 78 | 79 | # Default expiration time, in milliseconds, for entries in the 80 | # database-level cache. Entries are evicted when they reach this age even 81 | # if the cache has room to spare. Set to 0 to disable expiration (cache 82 | # entries live forever or until memory pressure triggers eviction when set 83 | # to 0). 84 | # 85 | # Default: 10000 86 | # Data Type: Long 87 | # Mutability: GLOBAL_OFFLINE 88 | # 89 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 90 | # storage backend. After starting the database for the first time, this 91 | # file's copy of this setting is ignored. Use JanusGraph's Management System 92 | # to read or modify this value after bootstrapping. 93 | cache.db-cache-time = 180000 94 | 95 | # Size of JanusGraph's database level cache. Values between 0 and 1 are 96 | # interpreted as a percentage of VM heap, while larger values are 97 | # interpreted as an absolute size in bytes. 98 | # 99 | # Default: 0.3 100 | # Data Type: Double 101 | # Mutability: MASKABLE 102 | cache.db-cache-size = 0.25 103 | 104 | # The indexing backend used to extend and optimize JanusGraph's query 105 | # functionality. This setting is optional. JanusGraph can use multiple 106 | # heterogeneous index backends. Hence, this option can appear more than 107 | # once, so long as the user-defined name between "index" and "backend" is 108 | # unique among appearances.Similar to the storage backend, this should be 109 | # set to one of JanusGraph's built-in shorthand names for its standard index 110 | # backends (shorthands: lucene, elasticsearch, es, solr) or to the full 111 | # package and classname of a custom/third-party IndexProvider 112 | # implementation. 113 | # 114 | # Default: elasticsearch 115 | # Data Type: String 116 | # Mutability: GLOBAL_OFFLINE 117 | # 118 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 119 | # storage backend. After starting the database for the first time, this 120 | # file's copy of this setting is ignored. Use JanusGraph's Management System 121 | # to read or modify this value after bootstrapping. 122 | index.search.backend = elasticsearch 123 | 124 | # The hostname or comma-separated list of hostnames of index backend 125 | # servers. This is only applicable to some index backends, such as 126 | # elasticsearch and solr. 127 | # 128 | # Default: 127.0.0.1 129 | # Data Type: class java.lang.String[] 130 | # Mutability: MASKABLE 131 | index.search.hostname = elasticsearch 132 | 133 | # Or start ES inside the JanusGraph JVM 134 | #index.search.backend=elasticsearch 135 | #index.search.directory=db/es 136 | #index.search.elasticsearch.client-only=false 137 | #index.search.elasticsearch.local-mode=true 138 | -------------------------------------------------------------------------------- /build/conf/janusgraph-cql-server.properties: -------------------------------------------------------------------------------- 1 | # Copyright 2021 JanusGraph Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | gremlin.graph = org.janusgraph.core.JanusGraphFactory 16 | 17 | # JanusGraph configuration sample: Cassandra & Elasticsearch over sockets 18 | # 19 | # This file connects to Cassandra and Elasticsearch services running 20 | # on localhost over the CQL API and the Elasticsearch native 21 | # "Transport" API on their respective default ports. The Cassandra 22 | # and Elasticsearch services must already be running before starting 23 | # JanusGraph with this file. 24 | 25 | # The primary persistence provider used by JanusGraph. This is required. It 26 | # should be set one of JanusGraph's built-in shorthand names for its standard 27 | # storage backends or to the full package and classname of a custom/third-party 28 | # StoreManager implementation. 29 | # 30 | # Default: (no default value) 31 | # Data Type: String 32 | # Mutability: LOCAL 33 | storage.backend = cql 34 | 35 | # The hostname or comma-separated list of hostnames of storage backend 36 | # servers. This is only applicable to some storage backends, such as 37 | # cassandra and hbase. 38 | # 39 | # Default: 127.0.0.1 40 | # Data Type: class java.lang.String[] 41 | # Mutability: LOCAL 42 | storage.hostname = cassandra 43 | 44 | # The name of JanusGraph's keyspace. It will be created if it does not 45 | # exist. 46 | # 47 | # Default: janusgraph 48 | # Data Type: String 49 | # Mutability: LOCAL 50 | storage.cql.keyspace = janusgraph 51 | 52 | # Whether to enable JanusGraph's database-level cache, which is shared across 53 | # all transactions. Enabling this option speeds up traversals by holding 54 | # hot graph elements in memory, but also increases the likelihood of 55 | # reading stale data. Disabling it forces each transaction to 56 | # independently fetch graph elements from storage before reading/writing 57 | # them. 58 | # 59 | # Default: false 60 | # Data Type: Boolean 61 | # Mutability: MASKABLE 62 | cache.db-cache = true 63 | 64 | # How long, in milliseconds, database-level cache will keep entries after 65 | # flushing them. This option is only useful on distributed storage 66 | # backends that are capable of acknowledging writes without necessarily 67 | # making them immediately visible. 68 | # 69 | # Default: 50 70 | # Data Type: Integer 71 | # Mutability: GLOBAL_OFFLINE 72 | # 73 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 74 | # storage backend. After starting the database for the first time, this 75 | # file's copy of this setting is ignored. Use JanusGraph's Management System 76 | # to read or modify this value after bootstrapping. 77 | cache.db-cache-clean-wait = 20 78 | 79 | # Default expiration time, in milliseconds, for entries in the 80 | # database-level cache. Entries are evicted when they reach this age even 81 | # if the cache has room to spare. Set to 0 to disable expiration (cache 82 | # entries live forever or until memory pressure triggers eviction when set 83 | # to 0). 84 | # 85 | # Default: 10000 86 | # Data Type: Long 87 | # Mutability: GLOBAL_OFFLINE 88 | # 89 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 90 | # storage backend. After starting the database for the first time, this 91 | # file's copy of this setting is ignored. Use JanusGraph's Management System 92 | # to read or modify this value after bootstrapping. 93 | cache.db-cache-time = 180000 94 | 95 | # Size of JanusGraph's database level cache. Values between 0 and 1 are 96 | # interpreted as a percentage of VM heap, while larger values are 97 | # interpreted as an absolute size in bytes. 98 | # 99 | # Default: 0.3 100 | # Data Type: Double 101 | # Mutability: MASKABLE 102 | cache.db-cache-size = 0.25 103 | -------------------------------------------------------------------------------- /build/conf/janusgraph-inmemory-server.properties: -------------------------------------------------------------------------------- 1 | # Copyright 2021 JanusGraph Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # JanusGraph configuration sample: in-memory 16 | # 17 | # This file connects to an in-memory storage backend 18 | 19 | # The implementation of graph factory that will be used by gremlin server 20 | # 21 | # Default: org.janusgraph.core.JanusGraphFactory 22 | # Data Type: String 23 | # Mutability: LOCAL 24 | gremlin.graph = org.janusgraph.core.JanusGraphFactory 25 | 26 | # The primary persistence provider used by JanusGraph. This is required. 27 | # It should be set one of JanusGraph's built-in shorthand names for its 28 | # standard storage backends (shorthands: berkeleyje, cassandrathrift, 29 | # cassandra, astyanax, embeddedcassandra, cql, hbase, inmemory) or to the 30 | # full package and classname of a custom/third-party StoreManager 31 | # implementation. 32 | # 33 | # Default: (no default value) 34 | # Data Type: String 35 | # Mutability: LOCAL 36 | storage.backend = inmemory 37 | 38 | # Whether to enable JanusGraph's database-level cache, which is shared across 39 | # all transactions. Enabling this option speeds up traversals by holding 40 | # hot graph elements in memory, but also increases the likelihood of 41 | # reading stale data. Disabling it forces each transaction to 42 | # independently fetch graph elements from storage before reading/writing 43 | # them. 44 | # 45 | # Default: false 46 | # Data Type: Boolean 47 | # Mutability: MASKABLE 48 | cache.db-cache = true 49 | 50 | # How long, in milliseconds, database-level cache will keep entries after 51 | # flushing them. This option is only useful on distributed storage 52 | # backends that are capable of acknowledging writes without necessarily 53 | # making them immediately visible. 54 | # 55 | # Default: 50 56 | # Data Type: Integer 57 | # Mutability: GLOBAL_OFFLINE 58 | # 59 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 60 | # storage backend. After starting the database for the first time, this 61 | # file's copy of this setting is ignored. Use JanusGraph's Management System 62 | # to read or modify this value after bootstrapping. 63 | cache.db-cache-clean-wait = 20 64 | 65 | # Default expiration time, in milliseconds, for entries in the 66 | # database-level cache. Entries are evicted when they reach this age even 67 | # if the cache has room to spare. Set to 0 to disable expiration (cache 68 | # entries live forever or until memory pressure triggers eviction when set 69 | # to 0). 70 | # 71 | # Default: 10000 72 | # Data Type: Long 73 | # Mutability: GLOBAL_OFFLINE 74 | # 75 | # Settings with mutability GLOBAL_OFFLINE are centrally managed in JanusGraph's 76 | # storage backend. After starting the database for the first time, this 77 | # file's copy of this setting is ignored. Use JanusGraph's Management System 78 | # to read or modify this value after bootstrapping. 79 | cache.db-cache-time = 180000 80 | 81 | # Size of JanusGraph's database level cache. Values between 0 and 1 are 82 | # interpreted as a percentage of VM heap, while larger values are 83 | # interpreted as an absolute size in bytes. 84 | # 85 | # Default: 0.3 86 | # Data Type: Double 87 | # Mutability: MASKABLE 88 | cache.db-cache-size = 0.25 89 | -------------------------------------------------------------------------------- /build/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2019 JanusGraph Authors 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | JANUS_PROPS="${JANUS_CONFIG_DIR}/janusgraph.properties" 18 | JANUSGRAPH_SERVER_YAML="${JANUS_CONFIG_DIR}/janusgraph-server.yaml" 19 | 20 | # running as root; step down to run as janusgraph user 21 | if [ "$1" == 'janusgraph' ] && [ "$(id -u)" == "0" ]; then 22 | mkdir -p ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 23 | chown -R janusgraph:janusgraph ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 24 | chmod 700 ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 25 | 26 | exec chroot --skip-chdir --userspec janusgraph:janusgraph / "${BASH_SOURCE}" "$@" 27 | fi 28 | 29 | # running as non root user 30 | if [ "$1" == 'janusgraph' ]; then 31 | # setup config directory 32 | mkdir -p ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 33 | cp conf/janusgraph-${JANUS_PROPS_TEMPLATE}-server.properties ${JANUS_PROPS} 34 | cp conf/janusgraph-server.yaml ${JANUSGRAPH_SERVER_YAML} 35 | chown -R "$(id -u):$(id -g)" ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 36 | chmod 700 ${JANUS_DATA_DIR} ${JANUS_CONFIG_DIR} 37 | chmod -R 600 ${JANUS_CONFIG_DIR}/* 38 | 39 | # apply configuration from environment 40 | while IFS=' ' read -r envvar_key envvar_val; do 41 | if [[ "${envvar_key}" =~ janusgraph\. ]] && [[ ! -z ${envvar_val} ]]; then 42 | # strip namespace and use properties file delimiter for janusgraph properties 43 | envvar_key=${envvar_key#"janusgraph."} 44 | # Add new or update existing field in configuration file 45 | if grep -q -E "^\s*${envvar_key}\s*=\.*" ${JANUS_PROPS}; then 46 | sed -ri "s#^(\s*${envvar_key}\s*=).*#\\1${envvar_val}#" ${JANUS_PROPS} 47 | else 48 | echo "${envvar_key}=${envvar_val}" >> ${JANUS_PROPS} 49 | fi 50 | elif [[ "${envvar_key}" =~ gremlinserver(%d)?[.]{1}(.+) ]]; then 51 | # Check for edit mode %d after prefix 52 | if [[ ${BASH_REMATCH[1]} == "%d" ]]; then edit_mode="d"; else edit_mode="w"; fi 53 | # strip namespace from env variable and get value 54 | envvar_key=${BASH_REMATCH[2]} 55 | if [[ edit_mode == "d" ]]; then envvar_val=""; fi 56 | # add new or update existing field in configuration file 57 | yq ${edit_mode} -P -i ${JANUSGRAPH_SERVER_YAML} ${envvar_key} ${envvar_val} 58 | else 59 | continue 60 | fi 61 | done < <(env | sort -r | awk -F= '{ st = index($0, "="); print $1 " " substr($0, st+1) }') 62 | 63 | if [ "$2" == 'show-config' ]; then 64 | echo "# contents of ${JANUS_PROPS}" 65 | cat "$JANUS_PROPS" 66 | echo "---------------------------------------" 67 | echo "# contents of ${JANUSGRAPH_SERVER_YAML}" 68 | cat "$JANUSGRAPH_SERVER_YAML" 69 | exit 0 70 | else 71 | # wait for storage 72 | if ! [ -z "${JANUS_STORAGE_TIMEOUT:-}" ]; then 73 | F="$(mktemp --suffix .groovy)" 74 | echo "graph = JanusGraphFactory.open('${JANUS_PROPS}')" > $F 75 | timeout "${JANUS_STORAGE_TIMEOUT}s" bash -c \ 76 | "until bin/gremlin.sh -e $F > /dev/null 2>&1; do echo \"waiting for storage...\"; sleep 5; done" 77 | rm -f "$F" 78 | fi 79 | 80 | /usr/local/bin/load-initdb.sh & 81 | 82 | exec ${JANUS_HOME}/bin/janusgraph-server.sh ${JANUSGRAPH_SERVER_YAML} 83 | fi 84 | fi 85 | 86 | # override hosts for remote connections with Gremlin Console 87 | if ! [ -z "${GREMLIN_REMOTE_HOSTS:-}" ]; then 88 | sed -i "s/hosts\s*:.*/hosts: [$GREMLIN_REMOTE_HOSTS]/" ${JANUS_HOME}/conf/remote.yaml 89 | sed -i "s/hosts\s*:.*/hosts: [$GREMLIN_REMOTE_HOSTS]/" ${JANUS_HOME}/conf/remote-objects.yaml 90 | fi 91 | 92 | exec "$@" 93 | -------------------------------------------------------------------------------- /build/load-initdb.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2019 JanusGraph Authors 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | # exit early if directory is empty 18 | if ! [ "$(ls -A ${JANUS_INITDB_DIR})" ]; then 19 | exit 0 20 | fi 21 | 22 | # wait for JanusGraph Server 23 | if ! [ -z "${JANUS_SERVER_TIMEOUT:-}" ]; then 24 | timeout "${JANUS_SERVER_TIMEOUT}s" bash -c \ 25 | "until true &>/dev/null g 17 | -------------------------------------------------------------------------------- /docker-compose-cql-es.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2019 JanusGraph Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: "3" 16 | 17 | services: 18 | janusgraph: 19 | image: docker.io/janusgraph/janusgraph:latest 20 | container_name: jce-janusgraph 21 | environment: 22 | JANUS_PROPS_TEMPLATE: cql-es 23 | janusgraph.storage.hostname: jce-cassandra 24 | janusgraph.index.search.hostname: jce-elastic 25 | ports: 26 | - "8182:8182" 27 | networks: 28 | - jce-network 29 | healthcheck: 30 | test: ["CMD", "bin/gremlin.sh", "-e", "scripts/remote-connect.groovy"] 31 | interval: 10s 32 | timeout: 30s 33 | retries: 3 34 | 35 | cassandra: 36 | image: cassandra:3 37 | container_name: jce-cassandra 38 | ports: 39 | - "9042:9042" 40 | - "9160:9160" 41 | networks: 42 | - jce-network 43 | 44 | elasticsearch: 45 | image: docker.elastic.co/elasticsearch/elasticsearch:6.6.0 46 | container_name: jce-elastic 47 | environment: 48 | - "ES_JAVA_OPTS=-Xms512m -Xmx512m" 49 | - "http.host=0.0.0.0" 50 | - "network.host=0.0.0.0" 51 | - "transport.host=127.0.0.1" 52 | - "cluster.name=docker-cluster" 53 | - "xpack.security.enabled=false" 54 | - "discovery.zen.minimum_master_nodes=1" 55 | ports: 56 | - "9200:9200" 57 | networks: 58 | - jce-network 59 | 60 | networks: 61 | jce-network: 62 | volumes: 63 | janusgraph-default-data: 64 | -------------------------------------------------------------------------------- /docker-compose-mount.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2019 JanusGraph Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: "3" 16 | 17 | services: 18 | janusgraph: 19 | image: docker.io/janusgraph/janusgraph:latest 20 | container_name: janusgraph-mount 21 | ports: 22 | - "8182:8182" 23 | volumes: 24 | # Named volume mounts. The data mount is only used when BerkeleyDB is used for storage. 25 | - "janusgraph-mount-data:/var/lib/janusgraph" 26 | # bind mounts for configs; use read only so not overridden by environment variables 27 | - "./example-config:/etc/opt/janusgraph/:ro" 28 | 29 | # use a named volume to maintain database data between restarts 30 | volumes: 31 | janusgraph-mount-data: 32 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2019 JanusGraph Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | version: "3" 16 | 17 | services: 18 | janusgraph: 19 | image: docker.io/janusgraph/janusgraph:latest 20 | container_name: janusgraph-default 21 | ports: 22 | - "8182:8182" 23 | # The mounted volume only makes sense if JanusGraph is being run with the BerekeleyDB storage. 24 | volumes: 25 | - "janusgraph-default-data:/var/lib/janusgraph" 26 | 27 | volumes: 28 | janusgraph-default-data: 29 | -------------------------------------------------------------------------------- /example-config/gremlin-server.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 JanusGraph Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | host: 0.0.0.0 16 | port: 8182 17 | threadPoolWorker: 1 18 | gremlinPool: 8 19 | scriptEvaluationTimeout: 30000 20 | serializedResponseTimeout: 30000 21 | channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer 22 | graphs: { graph: /etc/opt/janusgraph/janusgraph.properties } 23 | 24 | scriptEngines: { 25 | gremlin-groovy: { 26 | imports: [java.lang.Math], 27 | staticImports: [java.lang.Math.PI], 28 | scripts: [scripts/empty-sample.groovy] 29 | } 30 | } 31 | 32 | serializers: 33 | - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] } } 34 | - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true } } 35 | - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] } } 36 | - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV2d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] } } 37 | - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] } } 38 | - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV2d0, config: { ioRegistries: [org.janusgraph.graphdb.tinkerpop.JanusGraphIoRegistry] } } 39 | processors: 40 | - { className: org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor, config: { sessionTimeout: 28800000 } } 41 | metrics: { 42 | jmxReporter: { enabled: true}, 43 | slf4jReporter: { enabled: true, interval: 180000} 44 | } 45 | threadPoolBoss: 1 46 | maxInitialLineLength: 4096 47 | maxHeaderSize: 8192 48 | maxChunkSize: 8192 49 | maxContentLength: 65536 50 | maxAccumulationBufferComponents: 1024 51 | resultIterationBatchSize: 64 52 | writeBufferLowWaterMark: 32768 53 | writeBufferHighWaterMark: 65536 54 | -------------------------------------------------------------------------------- /example-config/janusgraph.properties: -------------------------------------------------------------------------------- 1 | # Copyright 2020 JanusGraph Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | gremlin.graph=org.janusgraph.core.JanusGraphFactory 16 | 17 | storage.backend=berkeleyje 18 | storage.directory=/var/lib/janusgraph/data 19 | index.default.backend=lucene 20 | index.default.directory=/var/lib/janusgraph/index 21 | -------------------------------------------------------------------------------- /push-images.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2019 JanusGraph Authors 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | set -eu 18 | 19 | # optional version argument 20 | version="${1:-}" 21 | # get all versions 22 | versions=($(ls -d [0-9]*)) 23 | 24 | get_full_version () { 25 | echo "$(grep "ARG JANUS_VERSION" $1/Dockerfile | head -n 1 | cut -d"=" -f 2)" 26 | } 27 | 28 | get_latest_version () { 29 | for v in "${versions[@]}"; do 30 | full_version=$(get_full_version $v) 31 | if [[ $full_version != *"-"* ]]; then 32 | latest_version="${v}" 33 | fi 34 | done 35 | echo $latest_version 36 | } 37 | 38 | # get the last element of sorted version folders 39 | latest_version=$(get_latest_version) 40 | echo "latest_version: ${latest_version}" 41 | 42 | REVISION="$(git rev-parse --short HEAD)" 43 | CREATED="$(date -u +”%Y-%m-%dT%H:%M:%SZ”)" 44 | IMAGE_NAME="docker.io/janusgraph/janusgraph" 45 | PLATFORMS="linux/amd64,linux/arm64" 46 | 47 | echo "REVISION: ${REVISION}" 48 | echo "CREATED: ${CREATED}" 49 | echo "IMAGE_NAME: ${IMAGE_NAME}" 50 | 51 | # enable buildkit 52 | export DOCKER_BUILDKIT=1 53 | 54 | for v in "${versions[@]}"; do 55 | if [ -z "${version}" ] || [ "${version}" == "${v}" ]; then 56 | # prepare docker tags 57 | full_version=$(get_full_version $v) 58 | full_version_with_revision="${full_version}-${REVISION}" 59 | 60 | # build and push the multi-arch image 61 | # unfortunately, when building a multi-arch image, we have to push it right after building it, 62 | # rather than save locally and then push it. see https://github.com/docker/buildx/issues/166 63 | if [[ $full_version != *"-"* ]]; then 64 | if [ "${v}" == "${latest_version}" ]; then 65 | docker buildx build ${v}\ 66 | --platform "${PLATFORMS}" -f "${v}/Dockerfile" \ 67 | -t "${IMAGE_NAME}:${full_version}" \ 68 | -t "${IMAGE_NAME}:${v}" \ 69 | -t "${IMAGE_NAME}:${full_version_with_revision}" \ 70 | -t "${IMAGE_NAME}:latest" \ 71 | --build-arg REVISION="$REVISION" \ 72 | --build-arg CREATED="$CREATED" \ 73 | --push 74 | else 75 | docker buildx build ${v}\ 76 | --platform "${PLATFORMS}" -f "${v}/Dockerfile" \ 77 | -t "${IMAGE_NAME}:${full_version}" \ 78 | -t "${IMAGE_NAME}:${v}" \ 79 | -t "${IMAGE_NAME}:${full_version_with_revision}" \ 80 | --build-arg REVISION="$REVISION" \ 81 | --build-arg CREATED="$CREATED" \ 82 | --push 83 | fi 84 | else 85 | docker buildx build ${v}\ 86 | --platform "${PLATFORMS}" -f "${v}/Dockerfile" \ 87 | -t "${IMAGE_NAME}:${full_version}" \ 88 | -t "${IMAGE_NAME}:${full_version_with_revision}" \ 89 | --build-arg REVISION="$REVISION" \ 90 | --build-arg CREATED="$CREATED" \ 91 | --push 92 | fi 93 | fi 94 | done 95 | -------------------------------------------------------------------------------- /test-image.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2019 JanusGraph Authors 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | set -eu 18 | 19 | IMAGE=$1 20 | 21 | if [ -z "${IMAGE:-}" ]; then 22 | echo "usage: test-image.sh image-name" 23 | exit 1 24 | fi 25 | 26 | echo "Testing ${IMAGE}..." 27 | 28 | ID=$(docker run --rm -d \ 29 | --health-cmd='./bin/gremlin.sh -e scripts/remote-connect.groovy' \ 30 | --health-interval=10s \ 31 | --health-retries=5 \ 32 | --health-start-period=10s \ 33 | ${IMAGE}) 34 | 35 | for i in $(seq 1 10); do 36 | res=$(docker ps --filter "id=$ID" --filter "health=healthy" -q) 37 | if [ -z "${res:-}" ]; then 38 | status=1 39 | sleep 10 40 | continue 41 | fi 42 | status=0 43 | break 44 | done 45 | 46 | if [ -z "${res:-}" ]; then 47 | echo "Timeout waiting for health check:" 48 | res=$(docker inspect --format "{{json .State.Health }}" $ID) 49 | # pretty print last output with jq if available 50 | echo $res | jq --raw-output '.[-1].Output' || echo $res 51 | fi 52 | 53 | docker stop $ID 54 | 55 | exit $status 56 | -------------------------------------------------------------------------------- /update.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Copyright 2019 JanusGraph Authors 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | set -Eeuo pipefail 18 | 19 | cd $(dirname $0) 20 | 21 | versions=( "$@" ) 22 | if [ ${#versions[@]} -eq 0 ]; then 23 | versions=($(ls -d [0-9]*)) 24 | fi 25 | 26 | # generate header for auto-generated files 27 | template-generated-warning() { 28 | COMMENT=$1 29 | cat <<-EOD 30 | ${COMMENT} 31 | ${COMMENT} NOTE: THIS FILE IS GENERATED VIA "update.sh" 32 | ${COMMENT} DO NOT EDIT IT DIRECTLY; CHANGES WILL BE OVERWRITTEN. 33 | ${COMMENT} 34 | EOD 35 | } 36 | 37 | # copy template file to version directory and add header 38 | copy-with-template-generated-warning() { 39 | FILE=$1 40 | COMMENT=$2 41 | template-generated-warning "${COMMENT}" > $dir/$FILE 42 | cat build/$FILE >> $dir/$FILE 43 | } 44 | 45 | for version in "${versions[@]}"; do 46 | if [[ $version =~ ^[0]+.[0-5](.[0-9]+)*$ ]]; then 47 | continue 48 | fi 49 | 50 | if [[ $version =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then 51 | # given latest version, get versioned directory 52 | major_minor_version=$(echo $version | cut -d"." -f 1-2) 53 | latest_version=$version 54 | else 55 | # given versioned directory, query GitHub API for latest version 56 | major_minor_version="$version" 57 | url=https://api.github.com/repos/janusgraph/janusgraph/tags 58 | filter='[.[].name|select(test("v'${version}'.[0-9]+[\\-a-z0-9]*$"))|ltrimstr("v")][0]' 59 | latest_version=$(curl -s "$url" | jq ''$filter'' | tr -d '"') 60 | if [ ${latest_version} == "null" ]; then 61 | echo "Version not found" 62 | exit 1 63 | fi 64 | fi 65 | 66 | dir=$major_minor_version 67 | echo "$version/$latest_version" 68 | mkdir -p $dir/conf $dir/scripts 69 | 70 | # determine JDK version to use 71 | if [[ $version =~ ^0\..* ]]; then 72 | jdk_version=8 73 | else 74 | jdk_version=11 75 | fi 76 | 77 | # copy Dockerfile and update version 78 | template-generated-warning "#" > "$dir/Dockerfile" 79 | sed -e 's!^\(ARG JANUS_VERSION\)\s*=.*!\1='"${latest_version}"'!' \ 80 | -e 's!{MAJOR_MINOR_VERSION_PLACEHOLDER}!'"${major_minor_version}"'!' \ 81 | build/Dockerfile-openjdk${jdk_version}.template >> "$dir/Dockerfile" 82 | 83 | # copy docker-entrypoint 84 | head -n 1 build/docker-entrypoint.sh > $dir/docker-entrypoint.sh 85 | template-generated-warning "#" >> $dir/docker-entrypoint.sh 86 | awk 'NR>1' build/docker-entrypoint.sh >> $dir/docker-entrypoint.sh 87 | 88 | # copy load-initdb 89 | head -n 1 build/load-initdb.sh > $dir/load-initdb.sh 90 | template-generated-warning "#" >> $dir/load-initdb.sh 91 | awk 'NR>1' build/load-initdb.sh >> $dir/load-initdb.sh 92 | 93 | # copy resources 94 | copy-with-template-generated-warning conf/janusgraph-berkeleyje-es-server.properties "#" 95 | copy-with-template-generated-warning conf/janusgraph-berkeleyje-lucene-server.properties "#" 96 | copy-with-template-generated-warning conf/janusgraph-berkeleyje-server.properties "#" 97 | copy-with-template-generated-warning conf/janusgraph-cql-es-server.properties "#" 98 | copy-with-template-generated-warning conf/janusgraph-cql-server.properties "#" 99 | copy-with-template-generated-warning conf/janusgraph-inmemory-server.properties "#" 100 | copy-with-template-generated-warning scripts/remote-connect.groovy "//" 101 | done 102 | --------------------------------------------------------------------------------