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
2 changes: 1 addition & 1 deletion .coderabbit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ reviews:
- label: "nix"
instructions: "Apply when PR modifies Nix packaging: flake.nix, flake.lock, nix/*.nix, overlays, or postgresql derivations."
- label: "docker"
instructions: "Apply when PR changes Dockerfiles (Dockerfile-*), docker/ directory, or container build configuration."
instructions: "Apply when PR changes Dockerfiles (Dockerfile-*), or container build configuration."
- label: "ami"
instructions: "Apply when PR modifies Packer templates (*.pkr.hcl), AMI builds, QEMU image configuration, or ebssurrogate/."
- label: "security"
Expand Down
43 changes: 16 additions & 27 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,35 +1,24 @@
.DS_Store
.python-version
.mise.toml
venv/
*.swp
docker/cache/
.*
!.env
!.gitignore
!.gitkeep
!/.claude/
!/.coderabbit.yaml
!/.envrc.recommended
!/.github/
/.claude/settings.local.json

# ansible related
ansible/image-manifest*.json
testinfra-aio-container-logs.log

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
# python related
*$py.class
*.py[cod]
__pycache__/
venv/

#nix related
result*
.env-local
.history
.envrc
.direnv
.nixos-test-history

#IDE
.idea/
.vscode/

db/schema.sql
common-nix.vars.pkr.hcl

# pre-commit config is managed in nix
.pre-commit-config.yaml
db/schema.sql
nixos.qcow2
.lsp
.clj-kondo
result*
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ Here's a comprehensive overview of the project's directory structure:
| migrations/tests/database/ | Database-specific migration tests |
| migrations/tests/storage/ | Storage-related migration tests |
| migrations/tests/extensions/ | Extension migration tests |
| **docker/** | Container definitions and Docker-related files |
| docker/nix/ | Nix-based Docker build configurations |
| Dockerfile-15 | Docker image definition for PostgreSQL 15 |
| Dockerfile-17 | Docker image definition for PostgreSQL 17 |
| **tests/** | Integration and system tests |
Expand Down
78 changes: 0 additions & 78 deletions docker/Dockerfile

This file was deleted.

9 changes: 0 additions & 9 deletions docker/docker-compose.yml

This file was deleted.

16 changes: 0 additions & 16 deletions docker/nix/Dockerfile

This file was deleted.

9 changes: 0 additions & 9 deletions docker/nix/build_nix.sh

This file was deleted.

64 changes: 0 additions & 64 deletions nix/docs/image-size-analyzer-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,70 +63,6 @@ diff before.json after.json

## CI Usage

### GitHub Actions Example

```yaml
name: Image Size Analysis

on:
pull_request:
paths:
- 'docker/**'
- 'nix/**'
workflow_dispatch:

jobs:
analyze-image-size:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Nix
uses: cachix/install-nix-action@v27
with:
extra_nix_config: |
extra-substituters = https://nix-postgres-artifacts.s3.amazonaws.com
extra-trusted-public-keys = nix-postgres-artifacts:dGZlQOvKcNEjvT7QEAJbcV6b6uk7VF/hWMjhYleiaLI=

- name: Analyze image sizes
run: |
nix run .#image-size-analyzer -- --json > image-sizes.json

- name: Upload size report
uses: actions/upload-artifact@v4
with:
name: image-size-report
path: image-sizes.json

- name: Comment PR with sizes
if: github.event_name == 'pull_request'
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const report = JSON.parse(fs.readFileSync('image-sizes.json', 'utf8'));

let comment = '## Docker Image Size Report\n\n';
for (const image of report.images) {
const sizeGB = (image.total_size_bytes / 1073741824).toFixed(2);
comment += `### ${image.dockerfile}: ${sizeGB} GB\n\n`;

comment += '**Top 5 Nix Packages:**\n';
for (const pkg of image.nix_packages.slice(0, 5)) {
const sizeMB = (pkg.size_bytes / 1048576).toFixed(1);
comment += `- ${pkg.name}: ${sizeMB} MB\n`;
}
comment += '\n';
}

github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});
```

### Size Threshold Check

Add a job that fails if images exceed a size threshold:
Expand Down
File renamed without changes.
Empty file removed nix/docs/site/.keep
Empty file.
33 changes: 0 additions & 33 deletions testinfra/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,6 @@ pip3 install boto3 boto3-stubs[essential] docker ec2instanceconnectcli pytest py
```sh
set -euo pipefail
# cwd: repo root
# docker must be running

# build extensions & pg binaries
docker buildx build \
$(yq 'to_entries | map(select(.value|type == "!!str")) | map(" --build-arg " + .key + "=" + .value) | join("")' 'ansible/vars.yml') \
--target=extensions \
--tag=supabase/postgres:extensions \
--platform=linux/arm64 \
--load \
.
mkdir -p /tmp/extensions ansible/files/extensions
docker save supabase/postgres:extensions | tar xv -C /tmp/extensions
for layer in /tmp/extensions/*/layer.tar; do
tar xvf "$layer" -C ansible/files/extensions --strip-components 1
done
docker buildx build \
--build-arg ubuntu_release=noble \
--build-arg ubuntu_release_no=24.04 \
--build-arg postgresql_major=15 \
--build-arg postgresql_release=15.1 \
--build-arg CPPFLAGS=-mcpu=neoverse-n1 \
--build-arg CFLAGS=-g3
--file=docker/Dockerfile \
--target=pg-deb \
--tag=supabase/postgres:deb \
--platform=linux/arm64 \
--load \
.
mkdir -p /tmp/build ansible/files/postgres
docker save supabase/postgres:deb | tar xv -C /tmp/build
for layer in /tmp/build/*/layer.tar; do
tar xvf "$layer" -C ansible/files/postgres --strip-components 1
done

# build AMI
AWS_PROFILE=supabase-dev packer build \
Expand Down
Loading