Skip to content

Commit 7c33b58

Browse files
committed
Improve advanced install docs
1 parent 1a9cb41 commit 7c33b58

File tree

1 file changed

+76
-47
lines changed

1 file changed

+76
-47
lines changed

ADVANCED-INSTALL.md

Lines changed: 76 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,88 @@
11
# PgDD Advanced installation
22

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:
68

9+
* CPU Architecture
10+
* Operating System version
11+
* Postgres version
712

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
973
1074
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/`.
1277
1378
14-
### Prereqs
79+
### Prerequisites
1580
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.
1883
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`.
2186
2287
2388
```bash
@@ -48,7 +113,7 @@ cargo install cargo-deb
48113
```
49114
50115
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
52117
to Postgres versions or glibc updates. Not typically required to follow pgrx
53118
developments.
54119
@@ -101,42 +166,6 @@ sudo dpkg -i --force-overwrite ./pgdd.deb
101166
102167
103168
104-
## Use Docker to build binary packages
105-
106-
Ubuntu 22.04 (Jammy) binaries are available for 0.5.1 for Postgres 12
107-
through Postgres 16.
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-
### Specific Postgres version and OS
118-
119-
The `./build.sh` is setup to loop through all supported Postgres versions and OSs.
120-
121-
The Postgres version behavior can be altered manually by commenting out the line
122-
with all versions and uncommenting the line with a specific Postgres version:
123-
124-
```bash
125-
PG_VERS=("pg12" "pg13" "pg14" "pg15" "pg16")
126-
#PG_VERS=("pg16")
127-
```
128-
129-
To limit to a single OS change this line:
130-
131-
```bash
132-
for image in `ls docker/ ` ; do
133-
```
134-
135-
To `grep <osname>` to limit.
136-
137-
```bash
138-
for image in `ls docker/ | grep lunar ` ; do
139-
```
140169
141170
## pgrx Generate graphviz
142171

0 commit comments

Comments
 (0)