Dockers

Specifications

The following pre-made docker images are available:

Name

fdi

httppool

Description

linux with fdi tested and ready to run.

Apache HTTPPool server, tested and started.

Base

Ubuntu 18.04 (~268MB compressed)

fdi (~271MB compressed)

Installed

Package and DEV, SERV dependencies.

Package and DEV, SERV dependencies.

User in docker

fdi

``apache``(Convenience links in home dir.)

Pull

docker pull mhastro/fdi

docker pull mhastro/httppool

Build

make build_docker

make build_server

Launch

make launch_docker

make launch_server

Entrypoint

dockerfile_entrypoint.sh

fdi/pns/resources/httppool_server_entrypoint_2.sh

Ports

--

9884

Run the make commands in the package root directory of fdi.

Configure

A file named .secret is needed by the build and launch commands. This is an example .secret:

HOST_PORT=9884
HOST_USER=...
HOST_PASS=...
MQ_HOST=123.45.67.89
MQ_PORT=9876
MQ_USER=...
MQ_PASS=...

Server credentials are set during server start up, when pnslocal.py config file is loaded. pnslocal.py and other configuration files are updated by the Entrypoint files (see the table above) when the docker starts. The Entrypoint files uses environment variables, which are set by the command line with --env-file so that sensitive information are not left on the command line.

More convenience commands

Login the latest built running container:

make it

Stop the latest built running container:

make rm_docker

Remove the latest built running container and image:

make rm_dockeri

Watch /var/log/apache2/error-ps.log inside the httppool docker updating (after launching):

make t

Tip

If you see error of log file not found, you are running the fdi docker by mistake. Only the pool server docker has the log.

Make the images locally

The following shows how to build the docker images yourself.

First make a virtual environment:

virtualenv -p python3.6 poolserver
cd poolserver
. bin/activate

Then install fdi following instructions in Installation and Notes for Developers , e.g.

git clone http://mercury.bao.ac.cn:9006/mh/fdi.git
cd fdi
git checkout develop
make install EXT="[DEV,SERV]"

Modify docker_entrypoint.sh if needed.

Now you can make the fdi docker easily:

make build_docker

To build httppool image, modify the FROM line in fdi/pns/resources/httppool_server_2.docker to delete mhastro/.

Modify fdi/pns/resources/httppool_server_entrypoint.sh if needed.

Make the httppool image

make build_server