Sign inSign up

spitzenidee/postgresql_rdkit

By spitzenidee

•Updated over 8 years ago

A container image combining a Postgresql database (9.6) with rdkit Postgresql cartridge.

Image
1

1.8K

spitzenidee/postgresql_rdkit repository overview

⁠Supported tags:

  • 10.3, latest (pinned to RDKit release "2017_09_3")
  • 9.6.8 (pinned to RDKit release "2017_09_3")
  • 9.6.5
  • 9.6.2

I removed the image tagged "9.6", since with 9.6.2 a newer, non-breaking update of Postgresql is available. Dropping a running 9.6 container, pulling 9.6.2 and recreating the container using the same command works flawlessly. No data migration necessary, AFAICT.

⁠How to build the image on your own:

git clone -b master --single-branch https://github.com/spitzenidee/postgresql_rdkit.git⁠ docker build -t postgresql_rdkit:9.6 postgresql_rdkit

The Dockerfile underlying this build / image can be found on Github: https://github.com/spitzenidee/postgresql_rdkit⁠

⁠About this build

Automated builds for this image sadly fail each time, due to resource restrictions on DockerHub for that process - it always timed out after 2 hours, and if not it still failed. Hence, I had to build it on my local machine and push it manually. 32 cores to the rescue ;-)

This image is deducted from the great work of InformaticsMatters (https://hub.docker.com/r/informaticsmatters/rdkit_cartridge/⁠). However I had problems with directory / file permission on "docker run", plus I wanted to have the most current Postgresql version for my rdkit ventures. So I updated and amended the Dockerfile where appropriate.

Be aware that this build is a really fat one (1.08GB at the moment). I do not plan on moving towards Alpine Linux (https://alpinelinux.org/⁠) since I don't think the extra effort of dealing with manual installation / building of numerous dependencies (libboost, numpy, etc) is worth a few hundred megabytes.

⁠Build Details

  • This image is based in the official Postgresql Debian Jessie image (https://hub.docker.com/_/postgres/⁠).
  • During build it clones the most current master branch of the rdkit sources (https://github.com/rdkit/rdkit⁠), and compiles and installs the postgresql rdkit cartrdige.
  • The rdkit build process uses all available CPU cores of your (host) system while building the container. That is, if you have 8 cores, "make" will be started with 8 threads via "make -j nproc".
  • With only one core, expect a build time of one hour or even more.
  • Building with 32 or 48 cores/threads should take around 5-10 minutes.
  • Image size is a whopping 1.08GB at the moment for the Debian-based build. Let's see about an Alpine-based build in the future.

⁠Starting a container

After pulling the image, running a container similar to the following should work:

docker run -d --name postgresql_rdkit --restart unless-stopped -p 5432:5432 -v <static_pgsql_files>:/var/lib/postgresql/data spitzenidee/postgresql_rdkit:latest

This command...:

  • ...names the container "postgresql_rdkit".
  • ...sets a restart policy for the container. Optional, unless you'd like your database to be brought up with each restart of the Docker daemon automatically.
  • ...exposes port 5432 (standard postgresql port) to the host/outside.
  • ...maps the external directory <static_pgsql_files> (choose appropriately) into the container pgsql data location "/var/lib/postgresql/data", so data is kept statically outside the container and is not lost.

In case you'd like to exchange data with the host for e.g. importing schema dumps, you can map a second volume into the container by adding something as follows to make huge data available in the inside: [...] -v /opt/data_exchange:/opt/data_exchange [...]

⁠Creating schemata and activating the rdkit cartridge

You may then connect to the database with your favorite management tool or via console and create new rdkit-enabled schemata like the following:

psql -h localhost -U postgres -c "CREATE SCHEMA chemical" psql -h localhost -U postgres -c "CREATE EXTENSION rdkit WITH SCHEMA chemical"

...which boils down to the two DDL commands:

CREATE SCHEMA chemical CREATE EXTENSION rdkit WITH SCHEMA chemical

Tag summary

Content type

Image

Digest

Size

390.8 MB

Last updated

over 8 years ago

docker pull spitzenidee/postgresql_rdkit