Repository navigation
Expand file tree
/
Copy pathtemplate.yaml
More file actions
34 lines (30 loc) · 1.71 KB
/
Copy pathtemplate.yaml
File metadata and controls
34 lines (30 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# This file is used by `render workflows init` to scaffold new projects.
# It tells the CLI how to display this template and what instructions to show
# after scaffolding. You can safely ignore it when using this example directly.
name: Postgres Backfill
description: Resumable Postgres backfill as a flow, one checkpointed step per chunk
workflowsRoot: .
renderBuildCommand: pip install -r requirements.txt
renderStartCommand: python main.py
nextSteps:
- label: Enter your project directory
command: cd {{dir}}
- label: Create a local database
command: createdb postgres_backfill
hint: Needs a local Postgres. The seed_orders task creates the tables.
- label: Add your database URL
command: cp .env.example .env
hint: Then check DATABASE_URL in .env. The local task server loads .env when it starts, so do this first.
- label: Start your local task server
command: render workflows dev -- {{startCommand}}
hint: Needs Render CLI 2.37 or later to run flows locally.
- label: Seed 200,000 orders (in another terminal)
command: "render workflows tasks runs start seed_orders --local --input='[200000]'"
- label: Backfill in chunks of 5,000, with chunk 10 failing once
command: "render workflows tasks runs start backfill_orders --local --input='[5000, null, 10]'"
hint: Chunk 10 retries on its own; chunks 0 to 9 don't run again. The result ends with "remaining_nulls" 0.
- label: Deploy to Render
hint: |
If this project is the repository root, remove the rootDir entry from render.yaml.
Push the project to your repository, then deploy the Blueprint with the Render CLI or Dashboard.
See the README for both paths and the commands that seed the table and start a backfill.