|
1 | 1 | # PgDD Advanced installation |
2 | 2 |
|
3 | | -This page covers installing PgDD from source locally, and the Docker build |
4 | | -method based on [ZomboDB's build system](https://github.com/zombodb/zombodb) |
5 | | -used to create the binaries for multiple versions. |
| 3 | +This page covers two methods that can be used to build binary installers |
| 4 | +for PgDD. |
| 5 | +The two methods that can be used to build binaries are the Docker build system |
| 6 | +and manually installing `pgrx` on the target OS and architecture. |
| 7 | +Installers are specific to three (3) details: |
6 | 8 |
|
| 9 | +* CPU Architecture |
| 10 | +* Operating System version |
| 11 | +* Postgres version |
7 | 12 |
|
8 | | -## Create Binary installer for your system |
| 13 | + |
| 14 | +The Docker build method uses OS specific `Dockerfile` to provide one binary |
| 15 | +installer for each supported Postgres version. This is the best approach |
| 16 | +when the appropriate `Dockerfile` already exists. |
| 17 | + |
| 18 | + |
| 19 | +## Use Docker to build binary packages |
| 20 | + |
| 21 | +The Docker build method was originally based on |
| 22 | +[ZomboDB's build system](https://github.com/zombodb/zombodb) and has |
| 23 | +evolved with this project since then. |
| 24 | + |
| 25 | +To generate the full suite of binaries change into the `./build` directory |
| 26 | +and run `build.sh`. This currently creates 15 total binary installers for |
| 27 | +3 different OSs (Postgres 12 - 16). |
| 28 | + |
| 29 | +```bash |
| 30 | +cd build/ |
| 31 | +time bash ./build.sh |
| 32 | +``` |
| 33 | + |
| 34 | +Individual installers can be found under `./target/artifacts`. A package of |
| 35 | +all installers is saved to `./build/pgdd-binaries.tar.gz`. |
| 36 | + |
| 37 | +> Tagged versions of PgDD include LTS OS binaries with their [release notes](https://github.com/rustprooflabs/pgdd/releases). |
| 38 | +
|
| 39 | + |
| 40 | +### Customize Docker Build system |
| 41 | + |
| 42 | +The Docker build system can be adjusted locally to build a binary for |
| 43 | +a specific Postgres version and/or specific OS. |
| 44 | + |
| 45 | +The `./build/build.sh` script has the logic to be adjusted to control this. |
| 46 | +The Postgres versions can be altered manually by commenting out the line |
| 47 | +with all versions and uncommenting the line with a specific Postgres version. |
| 48 | +The two lines in the script are shown below. |
| 49 | + |
| 50 | +```bash |
| 51 | +PG_VERS=("pg12" "pg13" "pg14" "pg15" "pg16") |
| 52 | +#PG_VERS=("pg16") |
| 53 | +``` |
| 54 | + |
| 55 | + |
| 56 | +To only build for Postgres on a single OS, add a `grep <osname` command to the |
| 57 | +loop logic. The original file that runs for all OSs with Dockerfiles looks like |
| 58 | +the following line. |
| 59 | + |
| 60 | +```bash |
| 61 | +for image in `ls docker/ ` ; do |
| 62 | +``` |
| 63 | +
|
| 64 | +To build for only `lunar` (Ubuntu 23.04) add ` | grep lunar ` as shown in the |
| 65 | +following example. |
| 66 | +
|
| 67 | +```bash |
| 68 | +for image in `ls docker/ | grep lunar ` ; do |
| 69 | +``` |
| 70 | +
|
| 71 | +
|
| 72 | +## Create Binary Installer w/out Docker |
9 | 73 |
|
10 | 74 | The following steps walk through creating a package on a typical |
11 | | -Ubuntu based system with Postgres 15. |
| 75 | +Ubuntu based system with Postgres 15. These manual instructions can be used |
| 76 | +when you do not want to use the Docker based build system under `./build/`. |
12 | 77 |
|
13 | 78 |
|
14 | | -### Prereqs |
| 79 | +### Prerequisites |
15 | 80 |
|
16 | | -pgrx and its dependencies are the main prereq for PgDD. |
17 | | -Install Prereqs and ensure PostgreSQL dev tools are installed. |
| 81 | +The main perquisites for PgDD are `pgrx` and its dependencies. |
| 82 | +Install prereqs and ensure PostgreSQL dev tools are installed. |
18 | 83 |
|
19 | | -> See the [Cargo pgrx](https://github.com/tcdi/pgrx/tree/master/cargo-pgrx) |
20 | | -documentation for more information on using pgrx. |
| 84 | +> See the [cargo pgrx](https://github.com/pgcentralfoundation/pgrx/tree/master/cargo-pgrx) |
| 85 | +documentation for more information on using `pgrx`. |
21 | 86 |
|
22 | 87 |
|
23 | 88 | ```bash |
@@ -48,7 +113,7 @@ cargo install cargo-deb |
48 | 113 | ``` |
49 | 114 |
|
50 | 115 |
|
51 | | -Initialize pgrx. Need to run this after install AND occasionally to get updates |
| 116 | +Initialize `pgrx`. Need to run this after install AND occasionally to get updates |
52 | 117 | to Postgres versions or glibc updates. Not typically required to follow pgrx |
53 | 118 | developments. |
54 | 119 |
|
@@ -101,19 +166,6 @@ sudo dpkg -i --force-overwrite ./pgdd.deb |
101 | 166 |
|
102 | 167 |
|
103 | 168 |
|
104 | | -## Use Docker to build binary packages |
105 | | - |
106 | | -Ubuntu 22.04 (Jammy) binaries are available for 0.5.0 for Postgres 11 |
107 | | -through Postgres 15. |
108 | | - |
109 | | - |
110 | | -```bash |
111 | | -cd build/ |
112 | | -time bash ./build.sh |
113 | | -``` |
114 | | - |
115 | | -Tagged versions will be attached to their [releases](https://github.com/rustprooflabs/pgdd/releases). |
116 | | - |
117 | 169 |
|
118 | 170 | ## pgrx Generate graphviz |
119 | 171 |
|
|
0 commit comments