Setting up SmartMet Server Tutorial (Docker) - skaija/susan-testing GitHub Wiki

Tutorial

This tutorial explains how to setup the SmartMet Server using Docker.

Prereqs

Docker software has been installed on some Linux server where you have access to already.

Getting Docker version of the SmartMet Server

  1. Go to the place where public Docker contents are to verify what is available:
https://hub.docker.com/ 
  1. Search for Smartmet and you will get a page like below. Select fmidev/smartmetserver.

  1. Load configuration files to your host machine.

That is useful in case you will need to remove the container and recreate it with new parameters for some reason later (existing container cannot be changed). That way you will not loose the configuration done already even if the container is removed.

a. Go to the configuration repository in github to get the configuration files:

https://github.com/fmidev/docker-smartmetserver.git

b. Click the Clone or Download button

c. Select Download ZIP and save the file

Note: Another way to get the files is using:

$ git clone https://github.com/fmidev/docker-smartmetserver.git

Git clone will create default folder structures like below for the configuration files:

$HOME/docker-smartmetserver/smartmetconf
$HOME/docker-smartmetserver/smartmetconf/engines
$HOME/docker-smartmetserver/smartmetconf/plugins
  1. Create the docker image

There are two ways to create the docker image. You can build a fresh image by using docker build command or you can get the existing image of fmidev/smartmetserver by using docker pull command.

Using the docker build command

Create a fresh image using the dockerfile that is located on your machine.

$ docker build --no-cache -t fmidev/smartmetserver .

Using the docker pull command

Create the image using the existing image of fmidev/smartmetserver.

$ docker pull fmidev/smartmetserver

  1. Verify the fmidev/smartmetserver image is there by command docker images
$ docker images

  1. Start the SmartMet server locally by running the docker run command. Command below will do the following:
  • Creates a writeable container layer (smartmetserver) over the specified image (fmidev/smartmetserver)
  • Starts the smartmetserver container
  • Makes the container to run in the background (-d)
  • Gets it restarted always regardless of the exit status
  • Uses folder $HOME/smartmet-data for data
  • Uses folder $HOME/docker-smartmetserver/smartmetconf for configuration files (files were retrieved in step 3)
  • Binds port 80 of the container to port 8080 on the host machine.
$ docker run -d --restart=always --name smartmetserver -v $HOME/smartmet-data:/smartmet/data -v $HOME/docker-smartmetserver/smartmetconf:/etc/smartmet -p 8080:80 fmidev/smartmetserver
  1. Test your container in browser with examples below.

a. Query below should return the broadcast cluster status information at the frontend.

http://hostname:8080/admin?what=clusterinfo

Broadcast Cluster Information 
This server is a FRONTEND 
* Host: FServer
* Comment: SmartMet server in FServer
* HTTP interface: Host IP:port
* Throttle Limit: 0
* Broadcast Interface: Broadcast IP address

 Services known by the frontend server 
* URI's of different services and plugins

b. QEngine maintains QueryData in memory. Query below can be used to obtain the information about the currently loaded QueryData:

http://hostname:8080/admin?what=qengine

Note: Replace hostname with your host machine name, by localhost or by host-ip. This depends on where you have the container you are using.

Additional steps:

a. You can get data from external sources using the script you can find from:

https://github.com/fmidev/opendata-resources/tree/master/examples/fmiopendata-client/python

b. Change data to querydata using the instructions you can find from:

https://github.com/fmidev/smartmet-qdtools/wiki/gribtoqd

This is needed when data is imported from external sources to SmartMet-system.

Configuration

Review Main Configuration File Tutorial (Docker) for configuring the main configuration file smartmet.conf. Plugin and engine specific configuration tutorials can be found under the Plugin wiki page in question.

⚠️ **GitHub.com Fallback** ⚠️