Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 38 additions & 128 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,141 +112,51 @@ changelog:
- title: Others
order: 999

dockers:
- dockerfile: cmd/pgconfigctl/Dockerfile
id: pgconfigctl-amd64
ids:
- pgconfigctl
goarch: amd64
image_templates:
- "docker.io/pgconfig/pgconfigctl:amd64-v{{ .Commit }}"
- "ghcr.io/pgconfig/pgconfigctl:amd64-v{{ .Commit }}"

build_flag_templates:
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title=pgconfig-{{.ProjectName}}"
- "--label=org.opencontainers.image.website=pgconfig.org"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--platform=linux/amd64"
- dockerfile: cmd/pgconfigctl/Dockerfile
id: pgconfigctl-arm64
dockers_v2:
- id: pgconfigctl
ids:
- pgconfigctl
goarch: arm64
image_templates:
- "docker.io/pgconfig/pgconfigctl:arm64-v{{ .Commit }}"
- "ghcr.io/pgconfig/pgconfigctl:arm64-v{{ .Commit }}"

dockerfile: cmd/pgconfigctl/Dockerfile
use: buildx
build_flag_templates:
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title=pgconfig-{{.ProjectName}}"
- "--label=org.opencontainers.image.website=pgconfig.org"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--platform=linux/arm64"
- "--platform=linux/amd64,linux/arm64"
images:
- "docker.io/pgconfig/pgconfigctl"
- "ghcr.io/pgconfig/pgconfigctl"
tags:
- "v{{ .Version }}"
- "v{{ .Major }}.{{ .Minor }}"
- "v{{ .Major }}"
- "latest"
labels:
"org.opencontainers.image.created": "{{.Date}}"
"org.opencontainers.image.title": "pgconfig-{{.ProjectName}}"
"org.opencontainers.image.website": "pgconfig.org"
"org.opencontainers.image.revision": "{{.FullCommit}}"
"org.opencontainers.image.version": "{{.Version}}"

- dockerfile: cmd/api/Dockerfile
goarch: arm64
id: api-arm64
ids:
- api
image_templates:
- "docker.io/pgconfig/api:arm64-v{{ .Commit }}"
- "ghcr.io/pgconfig/api:arm64-v{{ .Commit }}"

build_flag_templates:
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title=pgconfig-{{.ProjectName}}"
- "--label=org.opencontainers.image.website=pgconfig.org"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--platform=linux/arm64"

extra_files:
- rules.yml
- pg-docs.yml
- dockerfile: cmd/api/Dockerfile
goarch: amd64
id: api-amd64
- id: api
ids:
- api
image_templates:
- "docker.io/pgconfig/api:amd64-v{{ .Commit }}"
- "ghcr.io/pgconfig/api:amd64-v{{ .Commit }}"
- "registry.heroku.com/{{ .Env.HEROKU_APP_NAME }}/web:latest"
dockerfile: cmd/api/Dockerfile
use: buildx
build_flag_templates:
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.title=pgconfig-{{.ProjectName}}"
- "--label=org.opencontainers.image.website=pgconfig.org"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--platform=linux/amd64"
- "--platform=linux/amd64,linux/arm64"
extra_files:
- rules.yml
- pg-docs.yml
docker_manifests:
- name_template: docker.io/pgconfig/api:v{{ .Tag }}
image_templates:
- "docker.io/pgconfig/api:arm64-v{{ .Commit }}"
- "docker.io/pgconfig/api:amd64-v{{ .Commit }}"
- name_template: "docker.io/pgconfig/api:v{{ .Major }}.{{ .Minor }}"
image_templates:
- "docker.io/pgconfig/api:arm64-v{{ .Commit }}"
- "docker.io/pgconfig/api:amd64-v{{ .Commit }}"
- name_template: "docker.io/pgconfig/api:v{{ .Major }}"
image_templates:
- "docker.io/pgconfig/api:arm64-v{{ .Commit }}"
- "docker.io/pgconfig/api:amd64-v{{ .Commit }}"
- name_template: "docker.io/pgconfig/api:latest"
image_templates:
- "docker.io/pgconfig/api:arm64-v{{ .Commit }}"
- "docker.io/pgconfig/api:amd64-v{{ .Commit }}"
- name_template: "docker.io/pgconfig/pgconfigctl:v{{ .Tag }}"
image_templates:
- "docker.io/pgconfig/pgconfigctl:arm64-v{{ .Commit }}"
- "docker.io/pgconfig/pgconfigctl:amd64-v{{ .Commit }}"
- name_template: "docker.io/pgconfig/pgconfigctl:v{{ .Major }}.{{ .Minor }}"
image_templates:
- "docker.io/pgconfig/pgconfigctl:arm64-v{{ .Commit }}"
- "docker.io/pgconfig/pgconfigctl:amd64-v{{ .Commit }}"
- name_template: "docker.io/pgconfig/pgconfigctl:v{{ .Major }}"
image_templates:
- "docker.io/pgconfig/pgconfigctl:arm64-v{{ .Commit }}"
- "docker.io/pgconfig/pgconfigctl:amd64-v{{ .Commit }}"
- name_template: "docker.io/pgconfig/pgconfigctl:latest"
image_templates:
- "docker.io/pgconfig/pgconfigctl:arm64-v{{ .Commit }}"
- "docker.io/pgconfig/pgconfigctl:amd64-v{{ .Commit }}"
- name_template: ghcr.io/pgconfig/api:v{{ .Tag }}
image_templates:
- "ghcr.io/pgconfig/api:arm64-v{{ .Commit }}"
- "ghcr.io/pgconfig/api:amd64-v{{ .Commit }}"
- name_template: "ghcr.io/pgconfig/api:v{{ .Major }}.{{ .Minor }}"
image_templates:
- "ghcr.io/pgconfig/api:arm64-v{{ .Commit }}"
- "ghcr.io/pgconfig/api:amd64-v{{ .Commit }}"
- name_template: "ghcr.io/pgconfig/api:v{{ .Major }}"
image_templates:
- "ghcr.io/pgconfig/api:arm64-v{{ .Commit }}"
- "ghcr.io/pgconfig/api:amd64-v{{ .Commit }}"
- name_template: "ghcr.io/pgconfig/api:latest"
image_templates:
- "ghcr.io/pgconfig/api:arm64-v{{ .Commit }}"
- "ghcr.io/pgconfig/api:amd64-v{{ .Commit }}"
- name_template: "ghcr.io/pgconfig/pgconfigctl:v{{ .Tag }}"
image_templates:
- "ghcr.io/pgconfig/pgconfigctl:arm64-v{{ .Commit }}"
- "ghcr.io/pgconfig/pgconfigctl:amd64-v{{ .Commit }}"
- name_template: "ghcr.io/pgconfig/pgconfigctl:v{{ .Major }}.{{ .Minor }}"
image_templates:
- "ghcr.io/pgconfig/pgconfigctl:arm64-v{{ .Commit }}"
- "ghcr.io/pgconfig/pgconfigctl:amd64-v{{ .Commit }}"
- name_template: "ghcr.io/pgconfig/pgconfigctl:v{{ .Major }}"
image_templates:
- "ghcr.io/pgconfig/pgconfigctl:arm64-v{{ .Commit }}"
- "ghcr.io/pgconfig/pgconfigctl:amd64-v{{ .Commit }}"
- name_template: "ghcr.io/pgconfig/pgconfigctl:latest"
image_templates:
- "ghcr.io/pgconfig/pgconfigctl:arm64-v{{ .Commit }}"
- "ghcr.io/pgconfig/pgconfigctl:amd64-v{{ .Commit }}"
images:
- "docker.io/pgconfig/api"
- "ghcr.io/pgconfig/api"
- "registry.heroku.com/{{ .Env.HEROKU_APP_NAME }}/web"
tags:
- "v{{ .Version }}"
- "v{{ .Major }}.{{ .Minor }}"
- "v{{ .Major }}"
- "latest"
labels:
"org.opencontainers.image.created": "{{.Date}}"
"org.opencontainers.image.title": "pgconfig-{{.ProjectName}}"
"org.opencontainers.image.website": "pgconfig.org"
"org.opencontainers.image.revision": "{{.FullCommit}}"
"org.opencontainers.image.version": "{{.Version}}"
3 changes: 2 additions & 1 deletion cmd/api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
FROM alpine:3.13 as builder
FROM scratch
ARG TARGETPLATFORM
EXPOSE 3000
ENV PORT=3000

COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

WORKDIR /app
COPY api /app
COPY ${TARGETPLATFORM}/api /app
COPY *.yml /app

ENTRYPOINT [ "/app/api" ]
4 changes: 3 additions & 1 deletion cmd/api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func getDefaultPort(envName string) int {
return out
}

func init() {
func initAPI() {
flag.IntVar(&port, "port", getDefaultPort("PORT"), "Listen port")
flag.StringVar(&rulesFile, "rules-file", "./rules.yml", "Rules file")
flag.StringVar(&docsFile, "docs-file", "./pg-docs.yml", "Rules file")
Expand All @@ -42,6 +42,8 @@ func init() {
}

func main() {
initAPI()

log.Printf("PGConfig API - %s\n", version.Pretty())

app := routes.New()
Expand Down
3 changes: 2 additions & 1 deletion cmd/pgconfigctl/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
FROM scratch
COPY pgconfigctl /
ARG TARGETPLATFORM
COPY ${TARGETPLATFORM}/pgconfigctl /
CMD ["/pgconfigctl"]
34 changes: 17 additions & 17 deletions rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,18 @@ categories:
io_method:
abstract: Controls the asynchronous I/O implementation used by PostgreSQL. Options are "worker" (dedicated I/O worker processes), "io_uring" (Linux io_uring interface), and "sync" (traditional synchronous I/O).
recomendations:
Tuning AIO in PostgreSQL 18 - Tomas Vondra: https://vondra.me/posts/tuning-aio-in-postgresql-18/
Waiting for Postgres 18: Accelerating Disk Reads with Asynchronous I/O - pganalyze: https://pganalyze.com/blog/postgres-18-async-io
PostgreSQL 18: Better I/O performance with AIO - Cybertec: https://www.cybertec-postgresql.com/en/postgresql-18-better-i-o-performance-with-aio/
PostgreSQL 18 Asynchronous I/O - Neon: https://neon.com/postgresql/postgresql-18/asynchronous-io
PostgreSQL 18: The AIO Revolution - dev.to: https://dev.to/mattleads/postgresql-18-the-aio-revolution-uuidv7-and-the-path-to-unprecedented-performance-415m
"Tuning AIO in PostgreSQL 18 - Tomas Vondra": https://vondra.me/posts/tuning-aio-in-postgresql-18/
"Waiting for Postgres 18: Accelerating Disk Reads with Asynchronous I/O - pganalyze": https://pganalyze.com/blog/postgres-18-async-io
"PostgreSQL 18: Better I/O performance with AIO - Cybertec": https://www.cybertec-postgresql.com/en/postgresql-18-better-i-o-performance-with-aio/
"PostgreSQL 18 Asynchronous I/O - Neon": https://neon.com/postgresql/postgresql-18/asynchronous-io
"PostgreSQL 18: The AIO Revolution - dev.to": https://dev.to/mattleads/postgresql-18-the-aio-revolution-uuidv7-and-the-path-to-unprecedented-performance-415m
io_workers:
abstract: Number of background I/O worker processes used when io_method is set to "worker". Determines how many concurrent I/O operations can be performed asynchronously.
recomendations:
Tuning AIO in PostgreSQL 18 - Tomas Vondra: https://vondra.me/posts/tuning-aio-in-postgresql-18/
Waiting for Postgres 18: Accelerating Disk Reads with Asynchronous I/O - pganalyze: https://pganalyze.com/blog/postgres-18-async-io
PostgreSQL 18: Better I/O performance with AIO - Cybertec: https://www.cybertec-postgresql.com/en/postgresql-18-better-i-o-performance-with-aio/
PostgreSQL 18 Asynchronous I/O - Neon: https://neon.com/postgresql/postgresql-18/asynchronous-io
"Tuning AIO in PostgreSQL 18 - Tomas Vondra": https://vondra.me/posts/tuning-aio-in-postgresql-18/
"Waiting for Postgres 18: Accelerating Disk Reads with Asynchronous I/O - pganalyze": https://pganalyze.com/blog/postgres-18-async-io
"PostgreSQL 18: Better I/O performance with AIO - Cybertec": https://www.cybertec-postgresql.com/en/postgresql-18-better-i-o-performance-with-aio/
"PostgreSQL 18 Asynchronous I/O - Neon": https://neon.com/postgresql/postgresql-18/asynchronous-io
maintenance_io_concurrency:
abstract: Sets the number of concurrent I/O operations that PostgreSQL expects can be executed simultaneously during maintenance operations such as VACUUM and CREATE INDEX.
io_combine_limit:
Expand All @@ -91,20 +91,20 @@ categories:
abstract: Server-wide limit that clamps io_combine_limit, controlling the largest I/O size in operations that combine I/O.
recomendations:
"Allow io_combine_limit up to 1MB": https://www.postgresql.org/message-id/CA+hUKGKd=U1zSFYNjwBBrXV3NsqR2U8dCUrCBVeB0DQ8Vb8Dwg@mail.gmail.com
Tuning AIO in PostgreSQL 18 - Tomas Vondra: https://vondra.me/posts/tuning-aio-in-postgresql-18/
Waiting for Postgres 18: Accelerating Disk Reads with Asynchronous I/O - pganalyze: https://pganalyze.com/blog/postgres-18-async-io
PostgreSQL 18: Better I/O performance with AIO - Cybertec: https://www.cybertec-postgresql.com/en/postgresql-18-better-i-o-performance-with-aio/
PostgreSQL 18 Asynchronous I/O - Neon: https://neon.com/postgresql/postgresql-18/asynchronous-io
"Tuning AIO in PostgreSQL 18 - Tomas Vondra": https://vondra.me/posts/tuning-aio-in-postgresql-18/
"Waiting for Postgres 18: Accelerating Disk Reads with Asynchronous I/O - pganalyze": https://pganalyze.com/blog/postgres-18-async-io
"PostgreSQL 18: Better I/O performance with AIO - Cybertec": https://www.cybertec-postgresql.com/en/postgresql-18-better-i-o-performance-with-aio/
"PostgreSQL 18 Asynchronous I/O - Neon": https://neon.com/postgresql/postgresql-18/asynchronous-io
The Ultimate PostgreSQL 18 Asynchronous I/O Tuning Checklist (With Examples): https://www.cybrosys.com/research-and-development/postgres/the-ultimate-postgresql-18-asynchronous-io-tuning-checklist-with-examples
PostgreSQL 18 Asynchronous Disk I/O - Deep Dive Into Implementation: https://www.credativ.de/en/blog/postgresql-en/postgresql-18-asynchronous-disk-i-o-deep-dive-into-implementation/
io_max_concurrency:
abstract: Maximum number of concurrent I/O requests that can be in flight at once.
recomendations:
"PostgreSQL 18 Beta 1 io_max_concurrency": https://www.postgresql.org/message-id/9673.1747250758@sss.pgh.pa.us
Tuning AIO in PostgreSQL 18 - Tomas Vondra: https://vondra.me/posts/tuning-aio-in-postgresql-18/
Waiting for Postgres 18: Accelerating Disk Reads with Asynchronous I/O - pganalyze: https://pganalyze.com/blog/postgres-18-async-io
PostgreSQL 18: Better I/O performance with AIO - Cybertec: https://www.cybertec-postgresql.com/en/postgresql-18-better-i-o-performance-with-aio/
PostgreSQL 18 Asynchronous I/O - Neon: https://neon.com/postgresql/postgresql-18/asynchronous-io
"Tuning AIO in PostgreSQL 18 - Tomas Vondra": https://vondra.me/posts/tuning-aio-in-postgresql-18/
"Waiting for Postgres 18: Accelerating Disk Reads with Asynchronous I/O - pganalyze": https://pganalyze.com/blog/postgres-18-async-io
"PostgreSQL 18: Better I/O performance with AIO - Cybertec": https://www.cybertec-postgresql.com/en/postgresql-18-better-i-o-performance-with-aio/
"PostgreSQL 18 Asynchronous I/O - Neon": https://neon.com/postgresql/postgresql-18/asynchronous-io
The Ultimate PostgreSQL 18 Asynchronous I/O Tuning Checklist (With Examples): https://www.cybrosys.com/research-and-development/postgres/the-ultimate-postgresql-18-asynchronous-io-tuning-checklist-with-examples
PostgreSQL 18 Asynchronous Disk I/O - Deep Dive Into Implementation: https://www.credativ.de/en/blog/postgresql-en/postgresql-18-asynchronous-disk-i-o-deep-dive-into-implementation/
file_copy_method:
Expand Down