Skip to content

Fly.io development #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
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
58 changes: 58 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build and Push Docker Image

on:
push:
branches:
- js-flyio-dev

env:
REGISTRY: docker.io
IMAGE_NAME: flyio/percona-postgresql-operator

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed for git describe

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha,format=short

- name: Get PGMonitor
run: make get-pgmonitor

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./build/postgres-operator/Dockerfile
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max

Large diffs are not rendered by default.

1,815 changes: 1,642 additions & 173 deletions build/crd/percona/generated/pgv2.percona.com_perconapgclusters.yaml

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions cmd/postgres-operator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"time"
"unicode"

"github.com/getsentry/sentry-go"
"github.com/pkg/errors"
"go.opentelemetry.io/otel"
uzap "go.uber.org/zap"
Expand Down Expand Up @@ -70,6 +71,16 @@ func assertNoError(err error) {
}

func main() {
err := sentry.Init(sentry.ClientOptions{
Dsn: os.Getenv("SENTRY_DSN"),
EnableTracing: true,
TracesSampleRate: 1.0,
})
if err != nil {
fmt.Printf("Sentry initialization failed: %v\n", err)
}
defer sentry.Flush(2 * time.Second)

otelFlush, err := initOpenTelemetry()
assertNoError(err)
defer otelFlush()
Expand Down
4 changes: 2 additions & 2 deletions config/bundle/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ resources:
- ../manager/namespace
images:
- name: postgres-operator
newName: percona/percona-postgresql-operator
newTag: 2.5.0
newName: perconalab/percona-postgresql-operator
newTag: js-flyio-dev
1,815 changes: 1,642 additions & 173 deletions config/crd/bases/pgv2.percona.com_perconapgclusters.yaml

Large diffs are not rendered by default.

1,577 changes: 1,577 additions & 0 deletions config/crd/bases/postgres-operator.crunchydata.com_postgresclusters.yaml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions config/cw-bundle/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ resources:

images:
- name: postgres-operator
newName: percona/percona-postgresql-operator
newTag: 2.5.0
newName: perconalab/percona-postgresql-operator
newTag: js-flyio-dev
4 changes: 2 additions & 2 deletions config/manager/cluster/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ patchesStrategicMerge:

images:
- name: postgres-operator
newName: percona/percona-postgresql-operator
newTag: 2.5.0
newName: perconalab/percona-postgresql-operator
newTag: js-flyio-dev
4 changes: 2 additions & 2 deletions config/manager/namespace/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ patchesStrategicMerge:

images:
- name: postgres-operator
newName: percona/percona-postgresql-operator
newTag: 2.5.0
newName: perconalab/percona-postgresql-operator
newTag: js-flyio-dev
8,952 changes: 5,999 additions & 2,953 deletions deploy/bundle.yaml

Large diffs are not rendered by default.

18 changes: 15 additions & 3 deletions deploy/cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -379,11 +379,23 @@ spec:
matchLabels:
postgres-operator.crunchydata.com/data: pgbackrest
topologyKey: kubernetes.io/hostname
env:
- name: AWS_WEB_IDENTITY_TOKEN_FILE
value: "/var/run/secrets/eks.amazonaws.com/serviceaccount/token"
- name: AWS_ROLE_ARN
value: "arn:aws:iam::123456789012:role/my-role"
# Add sidecars to the repo host pod
sidecars:
- name: s3-helper
image: amazon/aws-cli:latest
command: ["sleep"]
args: ["infinity"]
resources:
limits:
cpu: 100m
memory: 128Mi
# tolerations:
# - effect: NoSchedule
# key: role
# operator: Equal
# value: connection-poolers
# priorityClassName: high-priority
#
# topologySpreadConstraints:
Expand Down
28,940 changes: 15,993 additions & 12,947 deletions deploy/crd.yaml

Large diffs are not rendered by default.

8,952 changes: 5,999 additions & 2,953 deletions deploy/cw-bundle.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion deploy/cw-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spec:
value: INFO
- name: DISABLE_TELEMETRY
value: "false"
image: percona/percona-postgresql-operator:2.5.0
image: perconalab/percona-postgresql-operator:js-flyio-dev
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
Expand Down
2 changes: 1 addition & 1 deletion deploy/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ spec:
value: INFO
- name: DISABLE_TELEMETRY
value: "false"
image: percona/percona-postgresql-operator:2.5.0
image: perconalab/percona-postgresql-operator:js-flyio-dev
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.22.6
require (
github.com/Percona-Lab/percona-version-service v0.0.0-20230404081016-ea25e30cdcbc
github.com/evanphx/json-patch/v5 v5.9.0
github.com/getsentry/sentry-go v0.27.0
github.com/go-logr/logr v1.4.2
github.com/go-openapi/errors v0.22.0
github.com/go-openapi/runtime v0.28.0
Expand Down
14 changes: 10 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nos
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ=
github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps=
github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY=
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
Expand Down Expand Up @@ -136,10 +140,10 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/moby/spdystream v0.4.0 h1:Vy79D6mHeJJjiPdFEL2yku1kl0chZpJfZcPpb16BRl8=
Expand Down Expand Up @@ -168,6 +172,8 @@ github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
github.com/pganalyze/pg_query_go/v5 v5.1.0 h1:MlxQqHZnvA3cbRQYyIrjxEjzo560P6MyTgtlaf3pmXg=
github.com/pganalyze/pg_query_go/v5 v5.1.0/go.mod h1:FsglvxidZsVN+Ltw3Ai6nTgPVcK2BPukH3jCDEqc1Ug=
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down
Loading