Skip to content
Luca Cinquini edited this page Jan 11, 2017 · 37 revisions

Description

This repository contains Docker images for running ESGF services in various node configurations.

Pre-Requisites

A host system with the latest version of Docker Engine installed (at this time, Docker 1.12+). Tested on MacOSX and Linux CentOS.

Quick Start

The following instructions explain how to run an ESGF node as a set of interacting Docker containers on your host system. Docker Engine must be up and running before proceeding. On MacOSX, you need to perform the following commands within a Docker shell window.

  • Clone the current repository, cd to the top-level directory. Checkout the latest stable branch, which is named "vN" (for example, "v1"),

  • Define your environment:

    • ESGF_HOSTNAME must reference the Fully Qualified Domain Name of the host where the containers will be running:
      • on linux - use the actual server host name:
        • export ESGF_HOSTNAME=`hostname`
      • on mac - choose a custom host name, and bind it to the current IP address of the Mac, for example:
        • export ESGF_HOSTNAME=my-node.esgf.org
        • edit /private/etc/hosts and map my-node.esgf.org to the current Mac IP address (which you can find from the Control Panel - Network Settings), for example: 192.168.0.5 my-node.esgf.org
    • ESGF_CONFIG must reference a directory on the host system that will store all the site-specific configuration:
      • for example: export ESGF_CONFIG=~/esgf_config
      • mkdir -p $ESGF_CONFIG
    • ESGF_DATA_DIR must reference the root of the data directory on your host
      • for example: export ESGF_DATA_DIR=~/esgf_data
      • mkdir -p $ESGF_DATA_DIR
    • ESGF_VERSION is the version of the ESGF/Docker stack to be used, which is recommended to be the latest stable version
      • for example: export ESGF_VERSION=1.0
  • Initialize your node configuration: create a self-signed certificate for $ESGF_HOSTNAME and populate the $ESGF_CONFIG directory with initial content. Note: if gond through these instructions more than one time, make sure you don't have previous containers that were configured with a different version of the certificates. So before re-initializing the node, issue a "docker-compose down" command from the top level esgf-docker/ directory.

    • from the scripts/ directory:
      • ./esgf_node_init.sh
      • ls -l $ESGF_CONFIG
  • Optional: pre-download the latest version of all ESGF Docker images. If not done now, the images will be pulled down automatically one by one when each service is started.

    • from the scripts/ directory: ./docker_pull_all.sh $ESGF_VERSION
  • Start all ESGF services in daemon mode, then look at the combined logs:

    • docker images (make sure the version of the images matches what you expect from $ESGF_VERSION)
    • from the top-level esgf-docker/ directory:
      • docker-compose up -d
      • docker-compose logs -f
  • Do some testing:

    • In a browser, access the top-level CoG page for the node: https://$ESGF_HOSTNAME/
    • Login with the rootAdmin openid: https://$ESGF_HOSTNAME/esgf-idp/openid/rootAdmin (password: changeit)
    • Access the top-level TDS catalog: http://$ESGF_HOSTNAME/thredds
    • Download one of the test files. You will have to log onto the ORP with the same openid as above.
  • Change the ESGF root password. You must first stop the containers, then run a script that picks up the new password from an environment variable. This must be done after the containers have been started at least once, because the initial default password is hard-coded into the postgres image.

    • from the top-level esgf/ directory: docker-compose stop
    • for example, export ESGF_PASSWORD=abc123
    • from the scripts/ directory: ./change_password.sh
    • restart the ESGF services to make sure everything still works: docker-compose up -d
    • Note that the above operation will change the ESGF password for all modules, except for the password used by the rootAdmin openid to log onto the web (this is by design, so that the two passwords can be different). This last password can be changed through the CoG interface once rootAdmin is logged in.
  • Stop all services, and optionally remove all containers and associated data volumes:

    • docker-compose stop
    • optional: docker-compose down
    • optional: docker volume ls -qf dangling=true | xargs docker volume rm
Clone this wiki locally