Skip to content
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

Starting supabase services with "supabase start" on clean environment is slow #2724

Open
kwypchlo opened this issue Oct 2, 2024 · 2 comments

Comments

@kwypchlo
Copy link

kwypchlo commented Oct 2, 2024

Is your feature request related to a problem? Please describe.
Starting containers with supabase start takes around 2-3 minutes on Github Actions CI.

  1. A lot of that time comes from downloading the images sequentially
  2. It also pulls images (at least some) that for services that are excluded - I excluded realtime and it still downloaded it (although it did not start it)

Describe the solution you'd like

  1. On supabase start, can we first pull all docker images in parallel before starting any service
  2. Do not download images for services that are excluded with --exclude ...

Describe alternatives you've considered

  1. It would be great if we could cache the images between CI runs with cache action although that does not help too much since cache is scoped to a specific branch anyway so any new branch will still pull all images
  2. If supabase would expose images with their versions before starting, maybe we could write a script to pull images manually and then start supabase

Additional context
Github Actions CI spins up clean environment on every run so any docker images downloaded on different runs or workflows cannot be accessed and will be discarded after the job is completed.

Related Github CI workflow

  supabase-types-up-to-date:
    runs-on: ubuntu-latest
    env:
      SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
      SUPABASE_DB_PASSWORD: ${{ secrets.SUPABASE_DB_PASSWORD }}
      SUPABASE_PROJECT_ID: ${{ secrets.SUPABASE_PROJECT_ID }}
    steps:
      - uses: actions/checkout@v4
      - uses: pnpm/action-setup@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '20'
          cache: 'pnpm'
      - run: pnpm i
      - run: pnpm supabase link --project-ref ${SUPABASE_PROJECT_ID}
      - run: pnpm supabase db start
Screenshot 2024-10-03 at 21 03 38
2024-10-03T18:02:31.1751317Z Starting database...
2024-10-03T18:02:31.7695071Z 15.6.1.100: Pulling from supabase/postgres
2024-10-03T18:02:31.9030911Z failed to display json stream: toomanyrequests: Rate exceeded
2024-10-03T18:02:31.9032093Z Retrying after 4s: public.ecr.aws/supabase/postgres:15.6.1.100
2024-10-03T18:02:36.4653334Z 15.6.1.100: Pulling from supabase/postgres
2024-10-03T18:02:36.6297487Z 9ea8908f4765: Pulling fs layer
2024-10-03T18:02:36.6298365Z e2c55b1e4551: Pulling fs layer
2024-10-03T18:02:36.6298883Z dfb707497f25: Pulling fs layer
2024-10-03T18:02:36.6299447Z aa24dcd21fe0: Pulling fs layer
2024-10-03T18:02:36.6299934Z 3c28594260bc: Pulling fs layer
2024-10-03T18:02:36.6300443Z afa035d51773: Pulling fs layer
2024-10-03T18:02:36.6300958Z 4f4fb700ef54: Pulling fs layer
2024-10-03T18:02:36.6301419Z cddf6e3eb380: Pulling fs layer
2024-10-03T18:02:36.6301934Z 7ade595abf95: Pulling fs layer
2024-10-03T18:02:36.6302454Z 17c5408e2234: Pulling fs layer
2024-10-03T18:02:36.6302962Z b0db1759c897: Pulling fs layer
2024-10-03T18:02:36.6303433Z 6ccb2db84a20: Pulling fs layer
2024-10-03T18:02:36.6303912Z 9ddbb272812f: Pulling fs layer
2024-10-03T18:02:36.6304480Z 13814d721c6b: Pulling fs layer
2024-10-03T18:02:36.6304937Z 488a1bdd00c7: Pulling fs layer
2024-10-03T18:02:36.6305437Z 557885fdc89b: Pulling fs layer
2024-10-03T18:02:36.6306518Z 97a88c80469e: Pulling fs layer
2024-10-03T18:02:36.6307470Z 78a9d7b491a3: Pulling fs layer
2024-10-03T18:02:36.6308349Z a47a4341532c: Pulling fs layer
2024-10-03T18:02:36.6309209Z 281f35f0e1e8: Pulling fs layer
2024-10-03T18:02:36.6310243Z 5c78b2c33eee: Pulling fs layer
2024-10-03T18:02:36.6311108Z 01e71296511e: Pulling fs layer
2024-10-03T18:02:36.6319815Z 0acf1ab06345: Pulling fs layer
2024-10-03T18:02:36.6322407Z 71979a5e9217: Pulling fs layer
2024-10-03T18:02:36.6323028Z 433e20cb2a74: Pulling fs layer
2024-10-03T18:02:36.6323620Z 8c2f80b47d8b: Pulling fs layer
2024-10-03T18:02:36.6324154Z 39b5718358d5: Pulling fs layer
2024-10-03T18:02:36.6324672Z d1d60230b6f6: Pulling fs layer
2024-10-03T18:02:36.6325147Z 7d32c6770638: Pulling fs layer
2024-10-03T18:02:36.6325993Z 3a8be9df3a0e: Pulling fs layer
2024-10-03T18:02:36.6326523Z 333c78a9d2fa: Pulling fs layer
2024-10-03T18:02:36.6326995Z 56eaeaaa104b: Pulling fs layer
2024-10-03T18:02:36.6329474Z 9d4954006987: Pulling fs layer
2024-10-03T18:02:36.6329984Z 09a1942346e2: Pulling fs layer
2024-10-03T18:02:36.6330540Z b61e826f4398: Pulling fs layer
2024-10-03T18:02:36.6331065Z 353258960638: Pulling fs layer
2024-10-03T18:02:36.6331537Z fac96fe1c02d: Pulling fs layer
2024-10-03T18:02:36.6332073Z d56b1247b0a6: Pulling fs layer
2024-10-03T18:02:36.6332533Z 05acf711ad2a: Pulling fs layer
2024-10-03T18:02:36.6333094Z 6619e0a1fd0b: Pulling fs layer
2024-10-03T18:02:36.6333552Z c678ffbb3c77: Pulling fs layer
2024-10-03T18:02:36.6334007Z c3acd740c875: Pulling fs layer
2024-10-03T18:02:36.6334568Z 655a8d617144: Pulling fs layer
2024-10-03T18:02:36.6335013Z bd3e3a556585: Pulling fs layer
2024-10-03T18:02:36.6335996Z aa24dcd21fe0: Waiting
2024-10-03T18:02:36.6336781Z 3c28594260bc: Waiting
2024-10-03T18:02:36.6338878Z afa035d51773: Waiting
2024-10-03T18:02:36.6339898Z 4f4fb700ef54: Waiting
2024-10-03T18:02:36.6340629Z cddf6e3eb380: Waiting
2024-10-03T18:02:36.6341133Z 7ade595abf95: Waiting
2024-10-03T18:02:36.6341543Z 17c5408e2234: Waiting
2024-10-03T18:02:36.6342429Z b0db1759c897: Waiting
2024-10-03T18:02:36.6343198Z d1d60230b6f6: Waiting
2024-10-03T18:02:36.6344199Z 6ccb2db84a20: Waiting
2024-10-03T18:02:36.6345099Z 7d32c6770638: Waiting
2024-10-03T18:02:36.6346172Z 9ddbb272812f: Waiting
2024-10-03T18:02:36.6346982Z 13814d721c6b: Waiting
2024-10-03T18:02:36.6347632Z 488a1bdd00c7: Waiting
2024-10-03T18:02:36.6348307Z 557885fdc89b: Waiting
2024-10-03T18:02:36.6349115Z 97a88c80469e: Waiting
2024-10-03T18:02:36.6349795Z 78a9d7b491a3: Waiting
2024-10-03T18:02:36.6350448Z 3a8be9df3a0e: Waiting
2024-10-03T18:02:36.6351177Z 333c78a9d2fa: Waiting
2024-10-03T18:02:36.6351932Z a47a4341532c: Waiting
2024-10-03T18:02:36.6352585Z 56eaeaaa104b: Waiting
2024-10-03T18:02:36.6353262Z 281f35f0e1e8: Waiting
2024-10-03T18:02:36.6354012Z 5c78b2c33eee: Waiting
2024-10-03T18:02:36.6354828Z 01e71296511e: Waiting
2024-10-03T18:02:36.6355795Z 0acf1ab06345: Waiting
2024-10-03T18:02:36.6356461Z 71979a5e9217: Waiting
2024-10-03T18:02:36.6357205Z 9d4954006987: Waiting
2024-10-03T18:02:36.6357884Z 433e20cb2a74: Waiting
2024-10-03T18:02:36.6358585Z 09a1942346e2: Waiting
2024-10-03T18:02:36.6359298Z 8c2f80b47d8b: Waiting
2024-10-03T18:02:36.6359963Z b61e826f4398: Waiting
2024-10-03T18:02:36.6360697Z 39b5718358d5: Waiting
2024-10-03T18:02:36.6361292Z 353258960638: Waiting
2024-10-03T18:02:36.6362054Z fac96fe1c02d: Waiting
2024-10-03T18:02:36.6362713Z d56b1247b0a6: Waiting
2024-10-03T18:02:36.6363336Z 05acf711ad2a: Waiting
2024-10-03T18:02:36.6364258Z 6619e0a1fd0b: Waiting
2024-10-03T18:02:36.6364897Z c678ffbb3c77: Waiting
2024-10-03T18:02:36.6365831Z 655a8d617144: Waiting
2024-10-03T18:02:36.6366592Z bd3e3a556585: Waiting
2024-10-03T18:02:36.6367190Z c3acd740c875: Waiting
2024-10-03T18:02:36.8061340Z dfb707497f25: Verifying Checksum
2024-10-03T18:02:36.8063508Z dfb707497f25: Download complete
2024-10-03T18:02:36.9367931Z 9ea8908f4765: Verifying Checksum
2024-10-03T18:02:36.9371561Z 9ea8908f4765: Download complete
2024-10-03T18:02:37.0083303Z aa24dcd21fe0: Verifying Checksum
2024-10-03T18:02:37.0093553Z aa24dcd21fe0: Download complete
2024-10-03T18:02:37.2025469Z e2c55b1e4551: Verifying Checksum
2024-10-03T18:02:37.2027629Z e2c55b1e4551: Download complete
2024-10-03T18:02:37.2172784Z afa035d51773: Verifying Checksum
2024-10-03T18:02:37.2177007Z afa035d51773: Download complete
2024-10-03T18:02:37.3324149Z 4f4fb700ef54: Verifying Checksum
2024-10-03T18:02:37.3325172Z 4f4fb700ef54: Download complete
2024-10-03T18:02:37.3916949Z 3c28594260bc: Verifying Checksum
2024-10-03T18:02:37.3918356Z 3c28594260bc: Download complete
2024-10-03T18:02:37.5084131Z 7ade595abf95: Verifying Checksum
2024-10-03T18:02:37.5090250Z 7ade595abf95: Download complete
2024-10-03T18:02:37.6533849Z 17c5408e2234: Verifying Checksum
2024-10-03T18:02:37.6535370Z 17c5408e2234: Download complete
2024-10-03T18:02:37.7090129Z b0db1759c897: Verifying Checksum
2024-10-03T18:02:37.7093366Z b0db1759c897: Download complete
2024-10-03T18:02:37.8124827Z 6ccb2db84a20: Verifying Checksum
2024-10-03T18:02:37.8128290Z 6ccb2db84a20: Download complete
2024-10-03T18:02:37.8657480Z 9ddbb272812f: Verifying Checksum
2024-10-03T18:02:37.8661221Z 9ddbb272812f: Download complete
2024-10-03T18:02:37.9911262Z 13814d721c6b: Verifying Checksum
2024-10-03T18:02:37.9924379Z 13814d721c6b: Download complete
2024-10-03T18:02:38.0431047Z 488a1bdd00c7: Verifying Checksum
2024-10-03T18:02:38.0432835Z 488a1bdd00c7: Download complete
2024-10-03T18:02:38.1610643Z 557885fdc89b: Verifying Checksum
2024-10-03T18:02:38.1618276Z 557885fdc89b: Download complete
2024-10-03T18:02:38.2607624Z 97a88c80469e: Download complete
2024-10-03T18:02:38.3664095Z 78a9d7b491a3: Verifying Checksum
2024-10-03T18:02:38.3676811Z 78a9d7b491a3: Download complete
2024-10-03T18:02:38.4405729Z a47a4341532c: Verifying Checksum
2024-10-03T18:02:38.4421126Z a47a4341532c: Download complete
2024-10-03T18:02:38.6109382Z 5c78b2c33eee: Verifying Checksum
2024-10-03T18:02:38.6110810Z 5c78b2c33eee: Download complete
2024-10-03T18:02:38.8721773Z 01e71296511e: Verifying Checksum
2024-10-03T18:02:38.8736629Z 01e71296511e: Download complete
2024-10-03T18:02:39.0714293Z 281f35f0e1e8: Verifying Checksum
2024-10-03T18:02:39.0723129Z 281f35f0e1e8: Download complete
2024-10-03T18:02:39.0896834Z 0acf1ab06345: Verifying Checksum
2024-10-03T18:02:39.0901719Z 0acf1ab06345: Download complete
2024-10-03T18:02:39.4700523Z 433e20cb2a74: Verifying Checksum
2024-10-03T18:02:39.4701776Z 433e20cb2a74: Download complete
2024-10-03T18:02:39.4742563Z 71979a5e9217: Verifying Checksum
2024-10-03T18:02:39.4754099Z 71979a5e9217: Download complete
2024-10-03T18:02:39.4951261Z cddf6e3eb380: Verifying Checksum
2024-10-03T18:02:39.4953472Z cddf6e3eb380: Download complete
2024-10-03T18:02:39.6185018Z 39b5718358d5: Verifying Checksum
2024-10-03T18:02:39.6186321Z 39b5718358d5: Download complete
2024-10-03T18:02:39.6199045Z 8c2f80b47d8b: Verifying Checksum
2024-10-03T18:02:39.6200109Z 8c2f80b47d8b: Download complete
2024-10-03T18:02:39.6774719Z d1d60230b6f6: Verifying Checksum
2024-10-03T18:02:39.6775894Z d1d60230b6f6: Download complete
2024-10-03T18:02:39.7688017Z 3a8be9df3a0e: Verifying Checksum
2024-10-03T18:02:39.7690164Z 3a8be9df3a0e: Download complete
2024-10-03T18:02:39.7702415Z 7d32c6770638: Verifying Checksum
2024-10-03T18:02:39.7703359Z 7d32c6770638: Download complete
2024-10-03T18:02:39.8302006Z 333c78a9d2fa: Download complete
2024-10-03T18:02:39.9248279Z 9d4954006987: Verifying Checksum
2024-10-03T18:02:39.9249548Z 9d4954006987: Download complete
2024-10-03T18:02:39.9359212Z 56eaeaaa104b: Verifying Checksum
2024-10-03T18:02:39.9360988Z 56eaeaaa104b: Download complete
2024-10-03T18:02:39.9802171Z 09a1942346e2: Verifying Checksum
2024-10-03T18:02:39.9803170Z 09a1942346e2: Download complete
2024-10-03T18:02:40.0152757Z 9ea8908f4765: Pull complete
2024-10-03T18:02:40.0790293Z 353258960638: Verifying Checksum
2024-10-03T18:02:40.0791611Z 353258960638: Download complete
2024-10-03T18:02:40.0806629Z b61e826f4398: Verifying Checksum
2024-10-03T18:02:40.0808681Z b61e826f4398: Download complete
2024-10-03T18:02:40.1333196Z fac96fe1c02d: Verifying Checksum
2024-10-03T18:02:40.1335328Z fac96fe1c02d: Download complete
2024-10-03T18:02:40.2231108Z 05acf711ad2a: Verifying Checksum
2024-10-03T18:02:40.2235002Z 05acf711ad2a: Download complete
2024-10-03T18:02:40.2311966Z d56b1247b0a6: Verifying Checksum
2024-10-03T18:02:40.2314067Z d56b1247b0a6: Download complete
2024-10-03T18:02:40.2678291Z 6619e0a1fd0b: Verifying Checksum
2024-10-03T18:02:40.2682774Z 6619e0a1fd0b: Download complete
2024-10-03T18:02:40.3737113Z c678ffbb3c77: Verifying Checksum
2024-10-03T18:02:40.3739248Z c678ffbb3c77: Download complete
2024-10-03T18:02:40.3881294Z c3acd740c875: Verifying Checksum
2024-10-03T18:02:40.3891827Z c3acd740c875: Download complete
2024-10-03T18:02:40.4535455Z 655a8d617144: Verifying Checksum
2024-10-03T18:02:40.4539952Z 655a8d617144: Download complete
2024-10-03T18:02:40.5353286Z bd3e3a556585: Verifying Checksum
2024-10-03T18:02:40.5366946Z bd3e3a556585: Download complete
2024-10-03T18:02:45.7309355Z e2c55b1e4551: Pull complete
2024-10-03T18:02:45.7468618Z dfb707497f25: Pull complete
2024-10-03T18:02:45.7631302Z aa24dcd21fe0: Pull complete
2024-10-03T18:02:47.5253954Z 3c28594260bc: Pull complete
2024-10-03T18:02:47.6659021Z afa035d51773: Pull complete
2024-10-03T18:02:47.6801243Z 4f4fb700ef54: Pull complete
2024-10-03T18:04:00.1322686Z cddf6e3eb380: Pull complete
2024-10-03T18:04:00.1472741Z 7ade595abf95: Pull complete
2024-10-03T18:04:00.5970163Z 17c5408e2234: Pull complete
2024-10-03T18:04:00.6123700Z b0db1759c897: Pull complete
2024-10-03T18:04:00.6243928Z 6ccb2db84a20: Pull complete
2024-10-03T18:04:00.6373998Z 9ddbb272812f: Pull complete
2024-10-03T18:04:00.6553718Z 13814d721c6b: Pull complete
2024-10-03T18:04:00.7214623Z 488a1bdd00c7: Pull complete
2024-10-03T18:04:00.7416625Z 557885fdc89b: Pull complete
2024-10-03T18:04:00.7533173Z 97a88c80469e: Pull complete
2024-10-03T18:04:00.7634298Z 78a9d7b491a3: Pull complete
2024-10-03T18:04:00.7884789Z a47a4341532c: Pull complete
2024-10-03T18:04:03.9940544Z 281f35f0e1e8: Pull complete
2024-10-03T18:04:05.1389744Z 5c78b2c33eee: Pull complete
2024-10-03T18:04:05.1762596Z 01e71296511e: Pull complete
2024-10-03T18:04:05.1883883Z 0acf1ab06345: Pull complete
2024-10-03T18:04:05.2207339Z 71979a5e9217: Pull complete
2024-10-03T18:04:05.5093212Z 433e20cb2a74: Pull complete
2024-10-03T18:04:05.5202474Z 8c2f80b47d8b: Pull complete
2024-10-03T18:04:05.5354712Z 39b5718358d5: Pull complete
2024-10-03T18:04:05.5460518Z d1d60230b6f6: Pull complete
2024-10-03T18:04:05.5555175Z 7d32c6770638: Pull complete
2024-10-03T18:04:05.5649415Z 3a8be9df3a0e: Pull complete
2024-10-03T18:04:05.5767527Z 333c78a9d2fa: Pull complete
2024-10-03T18:04:05.5860172Z 56eaeaaa104b: Pull complete
2024-10-03T18:04:05.5987014Z 9d4954006987: Pull complete
2024-10-03T18:04:05.6075729Z 09a1942346e2: Pull complete
2024-10-03T18:04:05.6163807Z b61e826f4398: Pull complete
2024-10-03T18:04:05.6259763Z 353258960638: Pull complete
2024-10-03T18:04:05.6356462Z fac96fe1c02d: Pull complete
2024-10-03T18:04:05.6574970Z d56b1247b0a6: Pull complete
2024-10-03T18:04:05.6666110Z 05acf711ad2a: Pull complete
2024-10-03T18:04:05.6754813Z 6619e0a1fd0b: Pull complete
2024-10-03T18:04:05.6926555Z c678ffbb3c77: Pull complete
2024-10-03T18:04:05.7069280Z c3acd740c875: Pull complete
2024-10-03T18:04:06.0218892Z 655a8d617144: Pull complete
2024-10-03T18:04:06.0640652Z bd3e3a556585: Pull complete
2024-10-03T18:04:06.0687392Z Digest: sha256:e4fc2cbf9a5b7508e0a179dba37142e9c9035d44dc03043557bd706768ceff37
2024-10-03T18:04:06.0699440Z Status: Downloaded newer image for public.ecr.aws/supabase/postgres:15.6.1.100
2024-10-03T18:04:17.4410225Z Setting up initial schema...
2024-10-03T18:04:18.0101467Z v2.30.34: Pulling from supabase/realtime
2024-10-03T18:04:18.2014225Z 09f376ebb190: Pulling fs layer
2024-10-03T18:04:18.2015885Z 68b794319434: Pulling fs layer
2024-10-03T18:04:18.2016816Z 73f8237dcd61: Pulling fs layer
2024-10-03T18:04:18.2017779Z 46a75fee84db: Pulling fs layer
2024-10-03T18:04:18.2018551Z ab199435ca35: Pulling fs layer
2024-10-03T18:04:18.2019379Z ec2eaff1d254: Pulling fs layer
2024-10-03T18:04:18.2020134Z 609cf02e987f: Pulling fs layer
2024-10-03T18:04:18.2020648Z 4f4fb700ef54: Pulling fs layer
2024-10-03T18:04:18.2021216Z ec2eaff1d254: Waiting
2024-10-03T18:04:18.2021647Z 609cf02e987f: Waiting
2024-10-03T18:04:18.2022046Z 46a75fee84db: Waiting
2024-10-03T18:04:18.2022539Z ab199435ca35: Waiting
2024-10-03T18:04:18.2022928Z 4f4fb700ef54: Waiting
2024-10-03T18:04:18.4043350Z 73f8237dcd61: Verifying Checksum
2024-10-03T18:04:18.4051704Z 73f8237dcd61: Download complete
2024-10-03T18:04:18.4563490Z 68b794319434: Verifying Checksum
2024-10-03T18:04:18.4572436Z 68b794319434: Download complete
2024-10-03T18:04:18.5015956Z 09f376ebb190: Verifying Checksum
2024-10-03T18:04:18.5017761Z 09f376ebb190: Download complete
2024-10-03T18:04:18.5700822Z 46a75fee84db: Verifying Checksum
2024-10-03T18:04:18.5703447Z 46a75fee84db: Download complete
2024-10-03T18:04:18.6214689Z ab199435ca35: Verifying Checksum
2024-10-03T18:04:18.6216261Z ab199435ca35: Download complete
2024-10-03T18:04:18.7290807Z 4f4fb700ef54: Verifying Checksum
2024-10-03T18:04:18.7297045Z 4f4fb700ef54: Download complete
2024-10-03T18:04:18.7412156Z ec2eaff1d254: Verifying Checksum
2024-10-03T18:04:18.7414649Z ec2eaff1d254: Download complete
2024-10-03T18:04:18.7441403Z 609cf02e987f: Verifying Checksum
2024-10-03T18:04:18.7442389Z 609cf02e987f: Download complete
2024-10-03T18:04:19.7357932Z 09f376ebb190: Pull complete
2024-10-03T18:04:20.7708016Z 68b794319434: Pull complete
2024-10-03T18:04:20.8028992Z 73f8237dcd61: Pull complete
2024-10-03T18:04:20.8178127Z 46a75fee84db: Pull complete
2024-10-03T18:04:20.8280818Z ab199435ca35: Pull complete
2024-10-03T18:04:21.9440301Z ec2eaff1d254: Pull complete
2024-10-03T18:04:21.9639346Z 609cf02e987f: Pull complete
2024-10-03T18:04:21.9748018Z 4f4fb700ef54: Pull complete
2024-10-03T18:04:21.9789755Z Digest: sha256:f43c080c74915340687727a34b21ae9cacc5ac21380d05b61efebeca6fd7ca4f
2024-10-03T18:04:21.9802094Z Status: Downloaded newer image for public.ecr.aws/supabase/realtime:v2.30.34
2024-10-03T18:04:32.0276023Z v1.11.7: Pulling from supabase/storage-api
2024-10-03T18:04:32.1959173Z 43c4264eed91: Already exists
2024-10-03T18:04:32.1974030Z c36270121b0c: Already exists
2024-10-03T18:04:32.1989814Z 842cd80f9366: Already exists
2024-10-03T18:04:32.2004611Z 737da86e5e86: Already exists
2024-10-03T18:04:32.2022896Z 00c02f8b12a9: Pulling fs layer
2024-10-03T18:04:32.2024421Z 2e621ecbb396: Pulling fs layer
2024-10-03T18:04:32.2026236Z b415c57cbbba: Pulling fs layer
2024-10-03T18:04:32.2027206Z a520247df952: Pulling fs layer
2024-10-03T18:04:32.2028004Z a424820b2b0b: Pulling fs layer
2024-10-03T18:04:32.2028755Z 2df34a6ddde3: Pulling fs layer
2024-10-03T18:04:32.2029624Z a520247df952: Waiting
2024-10-03T18:04:32.2030266Z a424820b2b0b: Waiting
2024-10-03T18:04:32.2030904Z 2df34a6ddde3: Waiting
2024-10-03T18:04:32.3490722Z 2e621ecbb396: Verifying Checksum
2024-10-03T18:04:32.3492145Z 2e621ecbb396: Download complete
2024-10-03T18:04:32.3552854Z b415c57cbbba: Verifying Checksum
2024-10-03T18:04:32.3557426Z b415c57cbbba: Download complete
2024-10-03T18:04:32.5026765Z a520247df952: Verifying Checksum
2024-10-03T18:04:32.5029460Z a520247df952: Download complete
2024-10-03T18:04:32.6059928Z a424820b2b0b: Verifying Checksum
2024-10-03T18:04:32.6066210Z a424820b2b0b: Download complete
2024-10-03T18:04:32.6599186Z 2df34a6ddde3: Verifying Checksum
2024-10-03T18:04:32.6604182Z 2df34a6ddde3: Download complete
2024-10-03T18:04:32.6982634Z 00c02f8b12a9: Verifying Checksum
2024-10-03T18:04:32.6983852Z 00c02f8b12a9: Download complete
2024-10-03T18:04:36.2607286Z 00c02f8b12a9: Pull complete
2024-10-03T18:04:36.2785822Z 2e621ecbb396: Pull complete
2024-10-03T18:04:36.3018116Z b415c57cbbba: Pull complete
2024-10-03T18:04:36.3212163Z a520247df952: Pull complete
2024-10-03T18:04:47.3346932Z a424820b2b0b: Pull complete
2024-10-03T18:04:47.4498940Z 2df34a6ddde3: Pull complete
2024-10-03T18:04:47.4539245Z Digest: sha256:de95d0a652bb7fd79840171f3a70a6c9d1d303787b5de9c6aa34defecc09c0f3
2024-10-03T18:04:47.4552047Z Status: Downloaded newer image for public.ecr.aws/supabase/storage-api:v1.11.7
2024-10-03T18:04:55.0383742Z v2.162.1: Pulling from supabase/gotrue
2024-10-03T18:04:55.1723936Z failed to display json stream: toomanyrequests: Rate exceeded
2024-10-03T18:04:55.1725493Z Retrying after 4s: public.ecr.aws/supabase/gotrue:v2.162.1
2024-10-03T18:04:59.7270215Z v2.162.1: Pulling from supabase/gotrue
2024-10-03T18:04:59.8568937Z failed to display json stream: toomanyrequests: Rate exceeded
2024-10-03T18:04:59.8570145Z Retrying after 8s: public.ecr.aws/supabase/gotrue:v2.162.1
2024-10-03T18:05:08.4319194Z v2.162.1: Pulling from supabase/gotrue
2024-10-03T18:05:08.6053566Z 43c4264eed91: Already exists
2024-10-03T18:05:08.6065430Z 21fc705ccc3b: Pulling fs layer
2024-10-03T18:05:08.6069788Z 5d39bf7b29ef: Pulling fs layer
2024-10-03T18:05:08.6070837Z f1d92147e5d8: Pulling fs layer
2024-10-03T18:05:08.6071759Z 0c97c878828f: Pulling fs layer
2024-10-03T18:05:08.6075450Z 645cca11acbe: Pulling fs layer
2024-10-03T18:05:08.6077970Z 0c97c878828f: Waiting
2024-10-03T18:05:08.6078738Z 645cca11acbe: Waiting
2024-10-03T18:05:08.7517603Z 21fc705ccc3b: Verifying Checksum
2024-10-03T18:05:08.7518736Z 21fc705ccc3b: Download complete
2024-10-03T18:05:08.7748238Z 5d39bf7b29ef: Download complete
2024-10-03T18:05:08.7827283Z 21fc705ccc3b: Pull complete
2024-10-03T18:05:08.8447789Z f1d92147e5d8: Verifying Checksum
2024-10-03T18:05:08.8451050Z f1d92147e5d8: Download complete
2024-10-03T18:05:08.9158477Z 0c97c878828f: Verifying Checksum
2024-10-03T18:05:08.9159863Z 0c97c878828f: Download complete
2024-10-03T18:05:08.9213298Z 645cca11acbe: Verifying Checksum
2024-10-03T18:05:08.9214378Z 645cca11acbe: Download complete
2024-10-03T18:05:08.9233222Z 5d39bf7b29ef: Pull complete
2024-10-03T18:05:09.1750893Z f1d92147e5d8: Pull complete
2024-10-03T18:05:09.1986291Z 0c97c878828f: Pull complete
2024-10-03T18:05:09.2079037Z 645cca11acbe: Pull complete
2024-10-03T18:05:09.2116525Z Digest: sha256:2956a45a86b04f9133d9d663a6b2700609dfb2798dbb910551eaad3f5f989e2c
2024-10-03T18:05:09.2127392Z Status: Downloaded newer image for public.ecr.aws/supabase/gotrue:v2.162.1
2024-10-03T18:05:09.7326587Z Seeding globals from roles.sql...
2024-10-03T18:05:09.7426503Z Applying migration 20240702115500_db_init.sql...
2024-10-03T18:05:10.8886449Z Seeding data from seed.sql...
@avallete
Copy link
Contributor

Hi there, thanks for your feedback.

  1. It would be great if we could cache the images between CI runs with the cache action. However, that doesn’t help too much since the cache is scoped to a specific branch, so any new branch will still need to pull all the images.

Based on GitHub workflow runs and cache documentation, this could actually be the right approach, as long as your CLI version is the same between main and your PR branch:

https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows

Access restrictions provide cache isolation and security by creating a logical boundary between different branches or tags. Workflow runs can restore caches created in either the current branch or the default branch (usually main).

So, an action that would run start on main and cache the pulled Docker image would allow all subsequent PRs to reuse those cached images.

I tried this approach on a repo to see if it would really improve CI times, but unfortunately, it seems like a dead end. The "caching and restoring" of Docker images took as long as simply pulling them over:

Here, with cache, the total time is 2m24s:
Screenshot 2024-10-13 at 01 17 17

Without cache 2m11s:
Screenshot 2024-10-13 at 01 18 09

We could potentially add some logic to skip pulling images if services aren't being run, but sadly, that will likely result in only a very marginal performance improvement.

@kwypchlo
Copy link
Author

Thanks for picking this up @avallete, I hoped that the result would be at least 20-25% improvement.

I did some research of my own and created a docker compose file with all the images for supabase db start (so less images than if I would run supabase start) and leveraged it to pull the images in parallel with docker compose pull and the results were underwhelming as well.

Using supabase db start
Screenshot 2024-10-13 at 15 37 50

Using docker compose pull to download images (below) and then supabase db start:

 supabase-storage-api
 supabase-postgres
 supabase-postgrest
 supabase-realtime
 supabase-gotrue
Screenshot 2024-10-13 at 15 37 18

I will set up a self-hosted runner on a beefy dedicated machine that will keep the images locally available between runs and see if it works and whether that helps in any significant capacity. I had some issues with self-hosted non-disposable machines before so not sure I will be able to pursue that.

We could potentially add some logic to skip pulling images if services aren't being run, but sadly, that will likely result in only a very marginal performance improvement.

That seems potentially like something that could give a bit of a boost for everyone using the cli and reduce amount of data pulled from the network so if you have capacity to work on it that would definitely be appreciated. I already had some workflows crash due to rate limits when pulling images during supabase db start although that does not happen often enough to consider it an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants