Dockerized TDM.
This repository contains files necessary to build and run a TDM Docker container which runs in conjunction with the THREDDS Docker container to provide indexes for GRIB featureCollections. The container can run on a different VM from THREDDS provided it has access to the same data directory THREDDS has access to via an NFS mount, for example. The Unidata TDM Docker images associated with this repository are available on DockerHub.
See tags listed on dockerhub.
Before you begin using this Docker container project, make sure your system has Docker installed. Docker Compose is optional but recommended.
You can either pull the image from DockerHub with:
docker pull unidata/tdm-docker:<version>
Or you can build it yourself with:
- Clone the repository:
git clone https://github.com/Unidata/tdm-docker.git
- Navigate to the project directory:
cd tdm-docker
- Build the Docker image:
docker build -t tdm-docker:<version> .
To run the TDM Docker container, beyond a basic Docker setup, we recommend installing docker-compose. docker-compose
serves two purposes:
-
Reduce headaches involving unwieldy
docker
command lines where you are runningdocker
with multiple volume mounts and port forwards. In situations like these,docker
commands become difficult to issue and read. Instead, the lengthydocker
command is captured in adocker-compose.yml
that is easy to read, maintain, and can be committed to version control. -
Coordinate the running of two or more containers. This can be useful for taking into account the same volume mountings, for example.
However, docker-compose
use is not mandatory. There is an example docker-compose.yml in this repository.
Once you have completed your setup you can run the container with:
docker-compose up -d tdm
The output of such command should be something like:
Creating tdm
To stop this container:
docker-compose stop tdm
To clean the slate and remove the container (not the image, the container):
docker-compose rm -f tdm
Upgrading to a newer version of the container is easy. Simply stop the container via docker
or docker-compose
, followed by
docker pull unidata/tdm-docker:<version>
and restart the container. Refer to the new version from the command line or in the docker-compose.yml
.
docker ps
which should give you output that looks something like this:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d4a1424d9375 unidata/tdm-docker:4.5 "/entrypoint.sh tdm.…" 5 weeks ago Up 5 weeks tdm
To run the TDM Docker container, beyond a basic Docker setup, we recommend installing docker-compose. We will assume you have knowledge on how to configure a TDS.
version: '3'
services:
tdm:
image: unidata/tdm-docker:5.4
container_name: tdm
volumes:
- /path/to/your/thredds/directory:/usr/local/tomcat/content/thredds
- /path/to/your/data/directory1:/path/to/your/data/directory1
env_file:
- "compose${THREDDS_COMPOSE_ENV_LOCAL}.env"
In the docker-compose.yml
file, volumes
mapping section, you will point the TDM to the TDS content root directory and the /data
directory corresponding to the DataRoots
element in threddsConfig.xml
. E.g.,
volumes:
# data directory
- /data/:/data/
# TDS content root directory
- ~/tdsconfig/:/usr/local/tomcat/content/thredds/
- /logs/tdm/:/usr/local/tomcat/content/tdm/logs
Also note the /data
directory will be the same directory the TDS container will be pointing to.
Because you will most likely run this container in conjunction with the thredds-docker
container, see the thredds-docker
project README for additional parameterization via the compose.env
file. Pay special attention to the TDS_HOST
environment variable which will tell the TDM where the TDS lives so that it can communicate with it. See the section below on coordinating with the TDS.
See parent unidata/tomcat container.
Set the UID/GID of the TDM user via the compose.env
file. If not set, the default UID/GID is 1000/1000
.
The TDM will notify the TDS of data changes via an HTTPS port 8443
triggering mechanism. It is important the TDM password (TDM_PW
environment variable) defined in the docker-compose.yml file corresponds to the SHA digested password in the tomcat-users.xml file. See the parent Tomcat container for how to create a SHA digested password. Also, because this mechanism works via port 8443
, you will have to get your HTTPS certificates in place. Again see the parent Tomcat container on how to install certificates, self-signed or otherwise.
Not having the Tomcat tdm
user password and digested password in sync can be a big source of frustration. One way to diagnose this problem is to look at the TDM logs and grep
for trigger
. You will find something like:
fc.NAM-CONUS_80km.log:2016-11-02T16:09:54.305 +0000 WARN - FAIL send trigger to https://tds.scigw.unidata.ucar.edu/thredds/admin/collection/trigger?trigger=never&collection=NAM-CONUS_80km status = 401
Enter the trigger URL in your browser:
https://tds.scigw.unidata.ucar.edu/thredds/admin/collection/trigger?trigger=never&collection=NAM-CONUS_80km
At this point the browser will prompt you for a tdm
login and password you defined in the docker-compose.yml
. If the triggering mechanism is successful, you see a TRIGGER SENT
message. Otherwise, make sure your HTTPS certificate is present, and ensure the tdm
password in the docker-compose.yml
, and digested password in the tomcat-users.xml
are in sync.
In order to cite this project, please simply make use of the Unidata THREDDS Data Server DOI: https://doi.org/10.5065/D6N014KG https://doi.org/10.5065/D6N014KG
If you have a question or would like support for this TDM Docker container, consider submitting a GitHub issue. Alternatively, you may wish to start a discussion on the THREDDS Community mailing list: [email protected].
For general TDS questions, please see the THREDDS support page.