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
11 changes: 5 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,7 @@ jobs:
timeout-minutes: 20
env:
UV_RESOLUTION: ${{ matrix.resolution }}
USES_SUPABASE_CLI: ${{ contains(fromJSON('["realtime", "storage"]'), matrix.package) }}
USES_INFRA: ${{ contains(fromJSON('["realtime", "storage", "auth", "postgrest"]'), matrix.package) }}
USES_SUPABASE_CLI: ${{ contains(fromJSON('["realtime", "storage", "auth", "postgrest"]'), matrix.package) }}
steps:
- name: Clone Repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
Expand Down Expand Up @@ -150,17 +149,17 @@ jobs:
# fails the container start with "address already in use".
- name: Reserve infra ports
if: ${{ env.USES_SUPABASE_CLI == 'true' }}
run: sudo sysctl -w net.ipv4.ip_local_reserved_ports=54320-54329,55320-55329
run: sudo sysctl -w net.ipv4.ip_local_reserved_ports=54320-54329,55320-55329,56320-56329,57320-57329

# Pulling images from the registries on every job gets throttled
# (429 / "Data limit exceeded"), so reuse the images between runs.
- name: Cache docker images
if: ${{ env.USES_INFRA == 'true' }}
if: ${{ env.USES_SUPABASE_CLI == 'true' }}
id: docker-images
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: /tmp/docker-images
key: docker-images-${{ matrix.package }}-${{ steps.supabase-cli.outputs.version || 'compose' }}-${{ hashFiles(format('src/{0}/infra/**', matrix.package)) }}
key: docker-images-${{ matrix.package }}-${{ steps.supabase-cli.outputs.version }}-${{ hashFiles(format('src/{0}/infra/**', matrix.package)) }}

- name: Load cached docker images
if: ${{ steps.docker-images.outputs.cache-hit == 'true' }}
Expand All @@ -177,7 +176,7 @@ jobs:

# On a cache miss cache-hit is an empty string, not 'false'.
- name: Save docker images to cache
if: ${{ env.USES_INFRA == 'true' && steps.docker-images.outputs.cache-hit != 'true' }}
if: ${{ env.USES_SUPABASE_CLI == 'true' && steps.docker-images.outputs.cache-hit != 'true' }}
run: |
mkdir -p /tmp/docker-images
docker ps --all --format '{{.Image}}' | sort -u \
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ cd supabase-py
This repository relies on the following dependencies for development:
- `uv` for python project management.
- `make` for running project commands.
- `docker` for both `postgrest` and `auth` test containers.
- `supabase-cli` for both `storage` and `realtime` test containers.
- `supabase-cli` and `docker` for the `auth`, `postgrest`, `storage` and `realtime` test containers.

All of these dependencies are included in the nix shell environment, through `flake.nix`. If you've got `nix` installed, you may prefer to use it through `nix develop`.

Expand Down
2 changes: 0 additions & 2 deletions infra.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,3 @@ endef
# $(call supabase_cleanup,<project id>)
supabase_cleanup = supabase --workdir infra stop --no-backup >/dev/null 2>&1 || true; \
docker ps -aq --filter "label=com.supabase.cli.project=$(1)" | xargs docker rm -f >/dev/null 2>&1 || true

compose_cleanup = (cd infra && docker compose down --remove-orphans >/dev/null 2>&1) || true
29 changes: 13 additions & 16 deletions src/auth/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,26 @@ help::

include ../../infra.mk

start-infra:
@$(call retry_start_infra,$(compose_cleanup),(cd infra && docker compose up -d))
help::
@echo " start-infra -- start containers for tests"
AUTH_EXCLUDED_SERVICES := studio,postgrest,realtime,storage-api,imgproxy,edge-runtime,logflare,vector,supavisor,postgres-meta

.DELETE_ON_ERROR:

SIGNING_KEYS := infra/supabase/signing_keys.json

clean-infra:
cd infra &&\
docker compose down --remove-orphans &&\
docker system prune -a --volumes -f
$(SIGNING_KEYS):
echo '[]' > $@
supabase --workdir infra gen signing-key --algorithm ES256 --append
Comment thread
spydon marked this conversation as resolved.
Resolved

start-infra: $(SIGNING_KEYS)
@$(call retry_start_infra,$(call supabase_cleanup,auth-py-tests),supabase --workdir infra start -x $(AUTH_EXCLUDED_SERVICES))
help::
@echo " clean-infra -- delete all stored information about the containers"
@echo " start-infra -- start containers for tests"

stop-infra:
cd infra &&\
docker compose down --remove-orphans
supabase --workdir infra stop
help::
@echo " stop-infra -- stop containers for tests"

sync-infra:
uv run --package supabase_auth scripts/gh-download.py --repo=supabase/gotrue-js --branch=master --folder=infra
help::
@echo " sync-infra -- update locked versions for test containers"

build-sync:
uv run --package supabase_auth scripts/run-unasync.py
help::
Expand Down
85 changes: 0 additions & 85 deletions src/auth/infra/db/00-schema.sql

This file was deleted.

156 changes: 0 additions & 156 deletions src/auth/infra/docker-compose.yml

This file was deleted.

5 changes: 5 additions & 0 deletions src/auth/infra/supabase/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Supabase
.branches
.temp
.env
signing_keys.json
Loading
Loading