Giter Club home page Giter Club logo

crunchy-containers's Introduction

Crunchy PostgreSQL Containers

v1.2, 2024-07-16

crunchy logo

This project includes a set of Dockerfiles that lets you build the Crunchy Certified PostgreSQL 9.5 Docker images.

The image by default is built on a RHEL 7.2 64 bit base, but can also be built on a centos 7 64 bit base. NOTE: to build the RHEL 7 version of this container, you need to build the Docker container on a licensed RHEL 7 host!

The containers will execute in a couple of environments:

  • Standalone - run the containers on a simple Docker environment

  • Openshift - run the containers within an Openshift environment

The project includes the following containers:

Build Prerequisites

1) Installing / configuring Docker

On an EL7 system, docker can be installed with the following commands:

  • sudo yum -y install docker

  • sudo groupadd docker

  • sudo usermod -a -G docker ${USER}

  • sudo systemctl start docker

2) Installing / configuring Go

"Go" can be installed with the following command:

  • subscription-manager repos --enable=rhel-7-server-optional-rpms

  • sudo yum -y install golang

To build the containers, add the following lines to your environment, adjusting the GOPATH as fits your actual path:

export GOPATH=$HOME/cdev
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN

3) Add the wget dependency

  • sudo yum -y install wget

4) Setting up config files for compilation

In order to compile the openshift-dedicated-container code, two files must be placed in the conf directory:

  • crunchypg95.repo or crunchypg93.repo

  • CRUNCHY-GPG-KEY.public

Both of these files can be obtained with the following procedure:

  • Request an account on access.crunchydata.com

  • Go to https://access.crunchydata.com/

  • In the upper-right, click "Customer Log In"

  • Enter your provided username and password

  • Click "submit"

  • Read the terms of use and click "I agree"

  • Change your password (first login) by Clicking on "Profile" in the upper right; enter your old password, a new password, and click "Change password"

  • Click on "Downloads" in the upper right corner

  • The "Download GPG Key" button will automatically download the CRUNCHY-GPG-KEY.public file

  • The "Download repo file (RHEL)" button will automatically download a personalized (to your user) crunchypg95.repo file

To build the documentation, you need some things installed:

yum -y install asciidoc ruby
gem install --pre asciidoctor-pdf
cd $HOME
wget http://laurent-laville.org/asciidoc/bootstrap/bootstrap-4.5.0.zip
asciidoc --backend install ./bootstrap-4.5.0.zip
mkdir -p .asciidoc/backends/bootstrap/js
cp $GOPATH/src/github.com/crunchydata/crunchy-containers/docs/bootstrap.js .asciidoc/backends/bootstrap/js/

To build the watch container, there is a dependency on the openshift oc command, install it as follows:

cd /tmp
wget https://github.com/openshift/origin/releases/download/v1.1.3/openshift-origin-client-tools-v1.1.3-cffae05-linux-64bit.tar.gz
tar xvzf openshift-origin-client-tools-v1.1.3-cffae05-linux-64bit.tar.gz
sudo cp openshift-origin-client-tools-v1.1.3-cffae05-linux-64bit/oc /usr/bin/oc

Installation

Build targets include two environment variables that determine the Docker base image to be used and the version of Postgresql to use.

Modify the following Makefile env variables for your desired target, currently rhel7 and centos7 are supported OS base images and 9.3 and 9.5 are supported versions of Postgresql:

OSFLAVOR=rhel7
PGVERSION=9.3

A complete build is performed as follows:

mkdir -p $HOME/cdev/pkg $HOME/cdev/bin $HOME/cdev/src
cd $GOPATH
go get github.com/tools/godep
cd $GOPATH/src/github.com/
mkdir crunchydata
cd crunchydata
git clone https://github.com/crunchydata/crunchy-containers.git
cd crunchy-containers
git checkout 1.2
godep restore
make downloadprometheus
make downloadgrafana
make all

For most of the examples, I use the psql command as a postgres client. To install PostgreSQL locally, run the following:

sudo cp crunchypg93.repo /etc/yum.repos.d
sudo yum -y install postgresql93-server postgresql93

The installation of postgres locally is also required to create a postgres user and group which are used by the examples to set the correct file permissions on local files used by the containers.

Testing

There is a small test suite to test out your initial installation, you run it with the following command:

make test

Testing openshift is performed as follows:

make testopenshift

crunchy-postgres Configuration Options

You can adjust the following Postgres configuration parameters by setting environment variables:

MAX_CONNECTIONS - defaults to 100
SHARED_BUFFERS - defaults to 128MB
TEMP_BUFFERS - defaults to 8MB
WORK_MEM - defaults to 4MB
MAX_WAL_SENDERS - defaults to 6

You have the ability to override the pg_hba.conf and postgresql.conf files used by the container. To enable this, you create a directory to hold your own copy of these configuration files.

Then you mount that directory into the container using the /pgconf volume mount as follows:

-v $YOURDIRECTORY:/pgconf

Inside YOURDIRECTORY would be your pg_hba.conf and postgresql.conf files. These files are not manipulated or changed by the container start scripts.

Various examples are provided in the /examples directory.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.