From e6a15bd7c36a946ddf0782af9518689998993238 Mon Sep 17 00:00:00 2001 From: Carlos Rueda Date: Wed, 29 Nov 2017 12:58:35 -0800 Subject: [PATCH] initial commit --- README.md | 53 +++++++++++++++ config/notifyemails | 4 ++ config/orront.conf | 157 ++++++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 44 +++++++++++++ setenv.sh | 19 ++++++ 5 files changed, 277 insertions(+) create mode 100644 README.md create mode 100644 config/notifyemails create mode 100644 config/orront.conf create mode 100644 docker-compose.yml create mode 100644 setenv.sh diff --git a/README.md b/README.md new file mode 100644 index 0000000..4c592d4 --- /dev/null +++ b/README.md @@ -0,0 +1,53 @@ +This template is intended to facilitate the set-up of a brand new ORR instance. + +Only requirements on your target machine are +[Docker Engine](https://docs.docker.com/engine/installation/) +and [Docker Compose](https://docs.docker.com/compose/install/). + +With this template you can focus on the needed configuration +and let Docker take care of pulling the service images +and launching your ORR instance. + +The steps are: + +### Get the template + +Download the latest template version from +https://github.com/mmisw/orr-instance-template/releases, +expand the tarball on your target machine +and `cd` to the home directory there. + +Or, if you have a Git client: + + git clone https://github.com/mmisw/orr-instance-template.git myORR + cd myORR + rm -rf .git + +### Environment variables + +`setenv.sh` can be used to define a number of environment variables +that are used in later steps: + + vi setenv.sh + source setenv.sh + +### Configuration + +Edit `config/orront.conf`, the master configuration for your ORR instance. + +Also, optionally, edit `config/notifyemails`. + +### Launching + +`docker-compose.yml` specifies the services comprising the ORR system. +No changes are typically needed in this file unless otherwise +indicated in ORR documentation, release notes, or other communications. + +Launch the ORR system: + + docker-compose up -d + +### Documentation + +More comprehensive install documentation is available at +https://mmisw.org/orrdoc/install/. diff --git a/config/notifyemails b/config/notifyemails new file mode 100644 index 0000000..3d37e8d --- /dev/null +++ b/config/notifyemails @@ -0,0 +1,4 @@ +# List of email addresses to be notified upon any registration +# event (users, organizations, and ontologies). +# This file is checked whenever any of such events occurs. +# Put each email address in a line by itself below. diff --git a/config/orront.conf b/config/orront.conf new file mode 100644 index 0000000..c8b1b9b --- /dev/null +++ b/config/orront.conf @@ -0,0 +1,157 @@ +############################################################################## +# This is the master ORR configuration file. +############################################################################## + +## The ${...} substitution syntax (e.g., ${branding.instanceName}) allows to +## refer # to the value assigned to a specific entry elsewhere in this file. +## The ${?...} substitution syntax allows to override settings via environment +## variables. See +## https://github.com/typesafehub/config#optional-system-or-env-variable-overrides + +## --------------------------------------------------------------------------- +## There will be an "admin" user automatically created upon initial start of +## the ORR. This user will have all privileges on your ORR instance. +admin { + ## (required) Password to be given to the ORR 'admin' user. + password = "actual-admin-pw" + + ## (required) Email address associated with the ORR 'admin' user. + email = "jane@example.com" + + ## (optional) comma-separated list of additional usernames to be granted + ## admin privilege right upon creation of the corresponding account. + #extra = "foo, bar" +} + +## --------------------------------------------------------------------------- +## User authentication +auth { + ## (required) A strong password to generate authentication tokens. + secret = "actual-strong-password" +} + +## --------------------------------------------------------------------------- +## Info about the deployment of this ORR instance. +deployment { + ## (required) The (external) URL of this ORR instance. No trailing slash. + url = "http://localhost:9090/ont" + + ## (required) The (external) URL of the SPARQL endpoint. No trailing slash. + sparqlEndpoint = "http://localhost:9090/sparql" +} + +## --------------------------------------------------------------------------- +branding { + ## (required) A short name used in email messages and other places. + instanceName = "MyORR" + + ## (optional) HTML fragment to be inserted right before + footer = """ +
+ MyORR footer +
+ """ + + ## (optional) URL of image to show in the page header. + ## By default, this will be MMI ORR's logo. + #logo = "?" + + ## (optional) URL for "Terms of Use" link. + ## No default value (so no such link is shown). + #tou = "?" + + ## (optional) "Contact us" link. + ## No default value (so no such link is shown). + ## Examples: "https://somewhere/contactus", "mailto:addr@example.net" + #contactUs = "mailto:"${admin.email} +} + +## --------------------------------------------------------------------------- +## Optional section. +#googleAnalytics { +# propertyId = "?" +#} + +## --------------------------------------------------------------------------- +## Optional section. +## See https://www.google.com/recaptcha/intro/. +#recaptcha { +# privateKey = "?" +# siteKey = "?" +#} + +## --------------------------------------------------------------------------- +## MongoDB +mongo { + ## (required) Name of Mongo database to be used for ORR purposes. + ## Can be changed if desired/needed. + db = "orr-ont" + + ## (required) Mongo server host. Should be same value as indicated in + ## `docker-compose.yml` for the environment of the orr service. + host = "mongo" + + ## (required) Mongo server port. Should be same value as indicated in + ## `docker-compose.yml` for the environment of the orr service. + port = 27017 +} + +## --------------------------------------------------------------------------- +## files: managed file locations. +files { + ## DO NOT change this. + baseDirectory = "/opt/orr-ont-base-directory" +} + +## --------------------------------------------------------------------------- +## AllegroGraph server (which supports the triple store and SPARQL endpoint) +agraph { + ## (required) The AG username to access the triple store + userName = "test" + + ## (required) The password for the AG username above: + password = "actual-pw" + + ## (required) Name of the AG repository for the ORR. + ## Can be changed if desired. + repoName = "mmiorr" + + ## (required) AGraph server host. Should be same value as indicated in + ## `docker-compose.yml` for the environment of the orr service. + host = "agraph" + + ## (required) AGraph server port. Should be same value as indicated in + ## `docker-compose.yml` for the environment of the orr service. + port = 10035 + + ## DO NOT change: + sparqlEndpoint = "http://"${agraph.host}":"${agraph.port}/repositories/${agraph.repoName} + + ## initDelay: (optional) Re-attempt triple store initialization after this delay. + initDelay = 20 seconds +} + +## --------------------------------------------------------------------------- +## (Required) email related information used for user account management and +## notifications. +email { + ## (required) account used for sending emails + account { + username = "baz@example.net" + password = "actual-pw" + } + + ## (required) corresponding email server for the account above. + server { + host = "?" + port = 465 + prot = "smtps" + debug = false + } + + ## info used to compose emails (when user resets password; notifications + ## about registrations, etc.): + from = ${branding.instanceName}" <"${admin.email}">" + replyTo = ${admin.email} + mailer = ${branding.instanceName} +} diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..6109d8f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,44 @@ +version: '2' + +services: + orr: + image: mmisw/orr:3.7.0 + container_name: orr + depends_on: + - agraph + - mongo + + ports: + - "${ORR_HOST_PORT}:8080" + + volumes: + - ${HOST_CONFIG_DIR}:/etc/orront + - ${ORR_HOST_DATA}:/opt/orr-ont-base-directory + + environment: + - MONGO_HOST=mongo + - MONGO_PORT=27017 + + - AGRAPH_HOST=agraph + - AGRAPH_PORT=10035 + + agraph: + image: franzinc/agraph:v6.1.1 + container_name: agraph + mem_limit: 1g + + ports: + - "${AGRAPH_HOST_PORT}:10035" + + volumes: + - ${ORR_HOST_DATA}:/opt/orr-ont-base-directory + + mongo: + image: mongo + container_name: mongo + + ports: + - "${MONGO_HOST_PORT}:27017" + + volumes: + - ${MONGO_HOST_DATA}:/data/db diff --git a/setenv.sh b/setenv.sh new file mode 100644 index 0000000..f563325 --- /dev/null +++ b/setenv.sh @@ -0,0 +1,19 @@ +# Define these environment variables prior to running your ORR instance. + +# Configuration directory on the host +export HOST_CONFIG_DIR=$PWD/config + +# Host ORR data directory +export ORR_HOST_DATA=$PWD/orr_data + +# Host port for the ORR service +export ORR_HOST_PORT=9090 + +# Host Mongo data directory +export MONGO_HOST_DATA=$PWD/mongo_data + +# Host port for the Mongo service +export MONGO_HOST_PORT=27017 + +# Host port for the AGraph service +export AGRAPH_HOST_PORT=10035