Skip to content

Commit

Permalink
Merge pull request #185 from RADAR-base/release-2.0.1
Browse files Browse the repository at this point in the history
Release 2.0.1
  • Loading branch information
nivemaham committed Feb 14, 2019
2 parents 5606ba3 + 03ae40c commit a6bd481
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RADAR-Docker
# RADAR-Docker 2.0.1

The dockerized RADAR stack for deploying the RADAR-base platform. Component repositories can be found at [RADAR-base DockerHub org](https://hub.docker.com/u/radarbase/dashboard/)

Expand Down
15 changes: 11 additions & 4 deletions dcompose-stack/radar-cp-hadoop-stack/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# RADAR platform
# RADAR-Docker for RADAR-base platform

This docker-compose stack contains the full operational RADAR platform. Once configured, it is meant to run on a single server with at least 16 GB memory and 4 CPU cores. It is tested on Ubuntu 16.04 and on macOS 11.1 with Docker 17.06.
This docker-compose stack contains the full operational RADAR-base platform. Once configured, it is meant to run on a single server with at least 16 GB memory and 4 CPU cores. It is tested on Ubuntu 16.04 and on macOS 11.1 with Docker 17.06.

## Configuration

Expand Down Expand Up @@ -52,9 +52,16 @@ This is a set of optional configuration which is not required but could be usefu

3. To enable optional services, please set the `ENABLE_OPTIONAL_SERVICES` parameter in `.env` file to `true`. By default optional services are disabled. You can check which service are optional in the file `optional-services.yml`

3.1 Copy `etc/redcap-integration/radar.yml.template` to `etc/redcap-integration/radar.yml` and modify it to configure the properties of Redcap instance and the management portal. For reference on configuration of this file look at the Readme file here - <https://github.com/RADAR-base/RADAR-RedcapIntegration#configuration>. In the REDcap portal under Project Setup, define the Data Trigger as `https://<YOUR_HOST_URL>/redcapint/trigger`. Also need to configure the webserver config, just uncomment the location block at `etc/webserver/optional-services.conf.template` and copy it to `etc/webserver/optional-services.conf`.
3.1 Copy `etc/redcap-integration/radar.yml.template` to `etc/redcap-integration/radar.yml` and modify it to configure the properties of Redcap instance and the management portal. For reference on configuration of this file look at [the README](https://github.com/RADAR-base/RADAR-RedcapIntegration#configuration). In the REDcap portal under Project Setup, define the Data Trigger as `https://<YOUR_HOST_URL>/redcapint/trigger`. Also need to configure the webserver config, just uncomment the location block at `etc/webserver/optional-services.conf.template` and copy it to `etc/webserver/optional-services.conf`.

3.2 For the Fitbit Connector, please specify the `FITBIT_API_CLIENT_ID` and `FITBIT_API_CLIENT_SECRET` in the .env file. Then copy the `etc/fitbit/docker/users/fitbit-user.yml.template` to `etc/fitbit/docker/users/fitbit-user.yml` and fill out all the details of the fitbit user. If multiple users, then for each user create a separate file in the `etc/fitbit/docker/users/` directory containing all the fields as in the template. For more information about users configuration for fitbit, read [here](https://github.com/RADAR-base/RADAR-REST-Connector#usage).
3.2 For the Fitbit Connector, please specify the `FITBIT_API_CLIENT_ID` and `FITBIT_API_CLIENT_SECRET` in the .env file. Then copy the `etc/fitbit/docker/users/fitbit-user.yml.template` to `etc/fitbit/docker/users/fitbit-user.yml` and fill out all the details of the fitbit user. If multiple users, then for each user create a separate file in the `etc/fitbit/docker/users/` directory containing all the fields as in the template. For more information about users configuration for fitbit, read [here](https://github.com/RADAR-base/RADAR-REST-Connector#usage).

4. The systemd scripts described in the next paragraph include a health check. To enable system health notifications to Slack, install its [Incoming Webhooks app](https://api.slack.com/incoming-webhooks). With the webhook URL that you configure there, set in `.env`:

```shell
HEALTHCHECK_SLACK_NOTIFY=yes
HEALTHCHECK_SLACK_WEBHOOK_URL=https://...
```

## Usage

Expand Down
2 changes: 1 addition & 1 deletion dcompose-stack/radar-cp-hadoop-stack/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ services:
# Management Portal #
#---------------------------------------------------------------------------#
managementportal-app:
image: radarbase/management-portal:0.5.2
image: radarbase/management-portal:0.5.3
networks:
- default
- api
Expand Down
8 changes: 4 additions & 4 deletions dcompose-stack/radar-cp-hadoop-stack/etc/env.template
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ POSTGRES_USER=postgresdb-user
POSTGRES_PASSWORD=
FROM_EMAIL=from-email
MANAGEMENTPORTAL_CATALOGUE_SERVER_ENABLE_AUTO_IMPORT=false
HEALTHCHECK_HIPCHAT_NOTIFY=no
HEALTHCHECK_HIPCHAT_ROOM_ID=""
HEALTHCHECK_HIPCHAT_TOKEN=""
HEALTHCHECK_SLACK_NOTIFY=no
HEALTHCHECK_SLACK_WEBHOOK_URL=
HEALTHCHECK_SLACK_CHANNEL=#radar-ops
HDFS_BASE_VERSION=3.0.3-alpine
HDFS_DATA_DIR_1=/usr/local/var/lib/docker/hdfs-data-1
HDFS_DATA_DIR_2=/usr/local/var/lib/docker/hdfs-data-2
Expand All @@ -39,4 +39,4 @@ ENABLE_OPTIONAL_SERVICES=false
FITBIT_API_CLIENT_ID=fitbit-client
FITBIT_API_CLIENT_SECRET=fitbit-secret
NGINX_PROXIES=
RADAR_SCHEMAS_VERSION=0.4.2
RADAR_SCHEMAS_VERSION=0.4.3
25 changes: 10 additions & 15 deletions dcompose-stack/radar-cp-hadoop-stack/lib/check-health.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,19 @@ stack=bin/radar-docker
. lib/util.sh
. ./.env

function hipchat_notify() {
# Send notification via HipChat, if configured.
if [ "$HEALTHCHECK_HIPCHAT_NOTIFY" == "yes" ] ; then
if [ -z "$HEALTHCHECK_HIPCHAT_ROOM_ID" ] ; then
echo "Error: HipChat notifications are enabled, but \$HEALTHCHECK_HIPCHAT_ROOM_ID is undefined. Unable to send HipChat notification."
exit 1
fi

if [ -z "$HEALTHCHECK_HIPCHAT_TOKEN" ] ; then
echo "Error: HipChat notifications are enabled, but \$HEALTHCHECK_HIPCHAT_TOKEN is undefined. Unable to send HipChat notification."
function slack_notify() {
# Send notification via Slack, if configured.
if [ "$HEALTHCHECK_SLACK_NOTIFY" == "yes" ] ; then
if [ -z "$HEALTHCHECK_SLACK_WEBHOOK_URL" ] ; then
echo "Error: Slack notifications are enabled, but \$HEALTHCHECK_SLACK_WEBHOOK_URL is undefined. Unable to send Slack notification."
exit 1
fi

channel=${HEALTHCHECK_SLACK_CHANNEL:-#radar-ops}
color=$1
body=$2
curl -X POST -H "Content-Type: application/json" --header "Authorization: Bearer $HEALTHCHECK_HIPCHAT_TOKEN" \
-d "{\"color\": \"$color\", \"message_format\": \"text\", \"message\": \"$body\" }" \
https://api.hipchat.com/v2/room/$HEALTHCHECK_HIPCHAT_ROOM_ID/notification
curl -X POST --data-urlencode "payload={\"channel\": \"$channel\", \"username\": \"radar-healthcheck\", \"icon_emoji\": \":hospital:\", \"attachments\": [{\"color\": \"$color\", \"fallback\": \"$body\", \"fields\": [{\"title\": \"Health update\", \"value\": \"$body\"}]}]}" \
$HEALTHCHECK_SLACK_WEBHOOK_URL
fi
}

Expand Down Expand Up @@ -52,7 +47,7 @@ display_host="${SERVER_NAME} ($(hostname -f), $(curl -s http://ipecho.net/plain)
if [ "${#unhealthy[@]}" -eq 0 ]; then
if [ -f .unhealthy ]; then
rm -f .unhealthy
hipchat_notify green "All services on ${display_host} are healthy again"
slack_notify good "All services on ${display_host} are healthy again"
fi
echo "All services are healthy"
else
Expand All @@ -75,7 +70,7 @@ else

echo "${unhealthy[@]}" > .unhealthy

hipchat_notify red "$body"
slack_notify danger "$body"

exit 1
fi

0 comments on commit a6bd481

Please sign in to comment.