From 48319df9f048ac22705e563ecbbc32d8e65f9aac Mon Sep 17 00:00:00 2001 From: Jamil Date: Sat, 26 Apr 2025 15:43:32 -0700 Subject: [PATCH] revert(#8893): Revert adding wal2json dev image (#8908) Turns out that the standard `pgoutput` plugin shipped with Postgres will do everything we need it to, and there are good examples of prior art decoding its binary output in Elixir (in production). So to avoid adding a dependency on `wal2json` here, we'll go with that. --- .github/workflows/_elixir.yml | 6 ++--- .github/workflows/build-postgres.yml | 36 ---------------------------- docker-compose.yml | 3 +-- elixir/Dockerfile.postgres-dev | 19 --------------- 4 files changed, 4 insertions(+), 60 deletions(-) delete mode 100644 .github/workflows/build-postgres.yml delete mode 100644 elixir/Dockerfile.postgres-dev diff --git a/.github/workflows/_elixir.yml b/.github/workflows/_elixir.yml index 8eb4d4693..0c1267a10 100644 --- a/.github/workflows/_elixir.yml +++ b/.github/workflows/_elixir.yml @@ -16,7 +16,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} services: postgres: - image: us-east1-docker.pkg.dev/firezone-staging/firezone/postgres:15 + image: postgres:15 ports: - 5432:5432 env: @@ -131,7 +131,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} services: postgres: - image: us-east1-docker.pkg.dev/firezone-staging/firezone/postgres:15 + image: postgres:15 ports: - 5432:5432 env: @@ -185,7 +185,7 @@ jobs: MIX_TEST_PARTITION: [1] services: postgres: - image: us-east1-docker.pkg.dev/firezone-staging/firezone/postgres:15 + image: postgres:15 ports: - 5432:5432 env: diff --git a/.github/workflows/build-postgres.yml b/.github/workflows/build-postgres.yml deleted file mode 100644 index 2da963756..000000000 --- a/.github/workflows/build-postgres.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Build Postgres - -on: - workflow_dispatch: - schedule: - - cron: "0 0 * * *" - -permissions: - id-token: write - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Set up QEMU - uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 - - uses: ./.github/actions/gcp-docker-login - id: login - with: - project: firezone-staging - - name: Build and push - uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0 - with: - context: elixir - file: elixir/Dockerfile.postgres-dev - platforms: | - linux/amd64 - linux/arm64 - push: true - tags: | - ${{ steps.login.outputs.registry }}/firezone/postgres:latest - ${{ steps.login.outputs.registry }}/firezone/postgres:${{ github.sha }} - ${{ steps.login.outputs.registry }}/firezone/postgres:15 diff --git a/docker-compose.yml b/docker-compose.yml index 9ecfa438d..89eb5b1b3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,8 +2,7 @@ services: # Dependencies postgres: # TODO: Enable pgaudit on dev instance. See https://github.com/pgaudit/pgaudit/issues/44#issuecomment-455090262 - # Includes wal2json - image: us-east1-docker.pkg.dev/firezone-staging/firezone/postgres:15 + image: postgres:15 command: ["postgres", "-c", "wal_level=logical"] volumes: - postgres-data:/var/lib/postgresql/data diff --git a/elixir/Dockerfile.postgres-dev b/elixir/Dockerfile.postgres-dev deleted file mode 100644 index 7c5c97ff3..000000000 --- a/elixir/Dockerfile.postgres-dev +++ /dev/null @@ -1,19 +0,0 @@ -# Builds a Postgres image with needed extensions and modules for local development - -# Install wal2json -ARG POSTGRES_VERSION=15 -FROM postgres:${POSTGRES_VERSION}-alpine AS builder -RUN apk add --no-cache \ - build-base \ - git \ - llvm \ - clang \ - curl -ARG WAL2JSON_VERSION=2_6 -RUN curl -fssL https://github.com/eulerto/wal2json/archive/refs/tags/wal2json_${WAL2JSON_VERSION}.tar.gz | tar -xzf - -C /tmp --strip-components=1 -WORKDIR /tmp -RUN USE_PGXS=1 make && make install - -# Prepare final image -FROM postgres:${POSTGRES_VERSION}-alpine -COPY --from=builder /tmp/wal2json.so /usr/local/lib/postgresql/