Git Product home page Git Product logo

embedded-postgres-binaries's Introduction

Embedded Postgres Binaries

Introduction

This project provides lightweight bundles of PostgreSQL binaries with reduced size that are intended for testing purposes. It is a supporting project for the primary io.zonky.test:embedded-database-spring-test and io.zonky.test:embedded-postgres projects. However, with a little effort, the embedded binaries can also be integrated with other projects.

Provided features

  • Lightweight bundles of PostgreSQL binaries with reduced size (~10MB)
  • Embedded PostgreSQL 11+ binaries even for Linux platform
  • Configurable version of PostgreSQL binaries

Projects using embedded binaries

Postgres version

The version of the postgres binaries can be managed by importing embedded-postgres-binaries-bom in a required version into your dependency management section.

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>io.zonky.test.postgres</groupId>
            <artifactId>embedded-postgres-binaries-bom</artifactId>
            <version>13.2.0</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

A list of all available versions of postgres binaries is here: https://mvnrepository.com/artifact/io.zonky.test.postgres/embedded-postgres-binaries-bom

Supported architectures

By default, only dependencies for amd64 architecture, in the io.zonky.test:embedded-database-spring-test and io.zonky.test:embedded-postgres projects, are included. Support for other architectures can be enabled by adding the corresponding Maven dependencies as shown in the example below.

<dependency>
    <groupId>io.zonky.test.postgres</groupId>
    <artifactId>embedded-postgres-binaries-linux-i386</artifactId>
    <scope>test</scope>
</dependency>

Supported platforms: Darwin, Windows, Linux, Alpine Linux
Supported architectures: amd64, i386, arm32v6, arm32v7, arm64v8, ppc64le

Note that not all architectures are supported by all platforms, look here for an exhaustive list of all available artifacts: https://mvnrepository.com/artifact/io.zonky.test.postgres

Since PostgreSQL 10.0, there are additional artifacts with alpine-lite suffix. These artifacts contain postgres binaries for Alpine Linux with disabled ICU support for further size reduction.

Building from Source

The project uses a Gradle-based build system. In the instructions below, ./gradlew is invoked from the root of the source tree and serves as a cross-platform, self-contained bootstrap mechanism for the build.

Prerequisites

Git, JDK 6 or later and Docker

Be sure that your JAVA_HOME environment variable points to the jdk1.6.0 folder extracted from the JDK download.

Compiling non-native architectures rely on emulation, so it is necessary to register qemu-*-static executables:

docker run --rm --privileged multiarch/qemu-user-static:register --reset

Note that the complete build of all supported architectures is now supported only on Linux platform.

Check out sources

git clone [email protected]:zonkyio/embedded-postgres-binaries.git

Make complete build

Builds all supported artifacts for all supported platforms and architectures, and also builds a BOM to control the versions of postgres binaries.

./gradlew clean install --parallel -Pversion=10.6.0 -PpgVersion=10.6

Note that the complete build can take a very long time, even a few hours, depending on the performance of the machine on which the build is running.

Make partial build

Builds only binaries for a specified platform/submodule.

./gradlew clean :repacked-platforms:install -Pversion=10.6.0 -PpgVersion=10.6

Build only a single binary

Builds only a single binary for a specified platform and architecture.

./gradlew clean install -Pversion=10.6.0 -PpgVersion=10.6 -ParchName=arm64v8 -PdistName=alpine

It is also possible to include the PostGIS extension by passing the postgisVersion parameter, e.g. -PpostgisVersion=2.5.2. Note that this option is not (yet) available for Windows and Mac OS platforms.

Optional parameters:

  • postgisVersion
    • default value: unset
    • supported values: a postgis version number (only 2.5.2+, 2.4.7+, 2.3.9+ versions are supported)
  • archName
    • default value: amd64
    • supported values: amd64, i386, arm32v6, arm32v7, arm64v8, ppc64le
  • distName
    • default value: debian-like distribution
    • supported values: the default value or alpine
  • dockerImage
    • default value: resolved based on the platform
    • supported values: any supported docker image
  • qemuPath

License

The project is released under version 2.0 of the Apache License.

embedded-postgres-binaries's People

Contributors

hgschmie avatar hordijk avatar t0r0x avatar tomix26 avatar zetten avatar

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.