Skip to content

omega1x/center1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

center1

center1 is a project for combining the analytical power of PostgreSQL and R-project worlds in a single optimized Docker-container for further prototyping and in-situ analytics.

Key features:

  • PostgreSQL 18.1
  • R 4.2.2 over PL/R
  • opinionated set of R-packages including but not limited to:
    • amazing data.table
    • brilliant igraph
    • trending duckdb
    • author's pipenostics for domain-specific usage
    • and many other packages that have proven to be effective author's domain-specific analytic routines.

Usage

Compose PostgreSQL configuration

🛈 The next instuctions are appropriate inside the project directorу

Select and edit the proper configuration file from conf-directory or create your own:

MY_CONF="default"  # do not specify subdirectory and extension

Then substitue postgresql.conf with the selected one:

sudo rm -f "$(pwd)/postgresql.conf"
cat "$(pwd)/conf/$MY_CONF.conf" > "$(pwd)/postgresql.conf"

Provide readable/writable access:

sudo chown 999:999 "$(pwd)/postgresql.conf"

Locate data storage

Create an empty pgdata-directory for storing database data in appropriate path:

POSTGRES_STORAGE="$(pwd)/pgdata"
sudo rm -rf "$POSTGRES_STORAGE"
mkdir "$POSTGRES_STORAGE"

Provide readable/writable access:

sudo chown -R 999:999 "$POSTGRES_STORAGE"

Docker run

Run the fresh container:

docker run -d \
  --name center1-"$MY_CONF"-01 \
  -p 5432:5432 \
  -v "$POSTGRES_STORAGE:/var/lib/postgresql/18/docker" \
  -v "$(pwd)/postgresql.conf:/etc/postgresql/postgresql.conf" \
  docker.io/omega1x/center1:v0.01 \
  -c 'config_file=/etc/postgresql/postgresql.conf'

Check connection

Check basic accessability:

PGPASSWORD="a2026" \
psql \
  --host=127.0.0.1 \
  --username=api \
  --dbname=center1 \
  -P pager=off \
  --command="SELECT true AS connection;"

Check PL/R functionality:

PGPASSWORD="a2026" \
psql \
  --host=127.0.0.1 \
  --username=api \
  --dbname=center1 \
  -P pager=off \
  --command="SELECT plr_version();"

⚠ Use your value for the host parameter.

Build image

Use the trivial way to build the image:

docker image build --tag=docker.io/omega1x/center1:v0.01 $(pwd)

About

Opinionated configuration of PostgreSQL for prototyping and data analytics in the context of power systems

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors