diff --git a/versions/unreleased/404.html b/versions/unreleased/404.html index 3da4f600cf..25d2ae8c9d 100644 --- a/versions/unreleased/404.html +++ b/versions/unreleased/404.html @@ -4219,7 +4219,7 @@
  • - + diff --git a/versions/unreleased/api-ref/index.html b/versions/unreleased/api-ref/index.html index 999151f08d..0a918d2503 100644 --- a/versions/unreleased/api-ref/index.html +++ b/versions/unreleased/api-ref/index.html @@ -4234,7 +4234,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/agent/index.html b/versions/unreleased/api-ref/prefect/agent/index.html index 5877c3f638..e3229c7ba7 100644 --- a/versions/unreleased/api-ref/prefect/agent/index.html +++ b/versions/unreleased/api-ref/prefect/agent/index.html @@ -4343,7 +4343,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/artifacts/index.html b/versions/unreleased/api-ref/prefect/artifacts/index.html index c0ddb1de25..fb57d3f60b 100644 --- a/versions/unreleased/api-ref/prefect/artifacts/index.html +++ b/versions/unreleased/api-ref/prefect/artifacts/index.html @@ -4376,7 +4376,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/blocks/core/index.html b/versions/unreleased/api-ref/prefect/blocks/core/index.html index 57ef6cadab..ddcb834c5a 100644 --- a/versions/unreleased/api-ref/prefect/blocks/core/index.html +++ b/versions/unreleased/api-ref/prefect/blocks/core/index.html @@ -4461,7 +4461,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/blocks/fields/index.html b/versions/unreleased/api-ref/prefect/blocks/fields/index.html index ee81ed75f7..d7a6ef382f 100644 --- a/versions/unreleased/api-ref/prefect/blocks/fields/index.html +++ b/versions/unreleased/api-ref/prefect/blocks/fields/index.html @@ -4248,7 +4248,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/blocks/kubernetes/index.html b/versions/unreleased/api-ref/prefect/blocks/kubernetes/index.html index e9801ef09b..df945fea5e 100644 --- a/versions/unreleased/api-ref/prefect/blocks/kubernetes/index.html +++ b/versions/unreleased/api-ref/prefect/blocks/kubernetes/index.html @@ -4334,7 +4334,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/blocks/notifications/index.html b/versions/unreleased/api-ref/prefect/blocks/notifications/index.html index d7fe1f8568..8151b2284e 100644 --- a/versions/unreleased/api-ref/prefect/blocks/notifications/index.html +++ b/versions/unreleased/api-ref/prefect/blocks/notifications/index.html @@ -4405,7 +4405,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/blocks/system/index.html b/versions/unreleased/api-ref/prefect/blocks/system/index.html index f99271cb17..564020c6c5 100644 --- a/versions/unreleased/api-ref/prefect/blocks/system/index.html +++ b/versions/unreleased/api-ref/prefect/blocks/system/index.html @@ -4328,7 +4328,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/blocks/webhook/index.html b/versions/unreleased/api-ref/prefect/blocks/webhook/index.html index e93381df8f..20ae1d3f35 100644 --- a/versions/unreleased/api-ref/prefect/blocks/webhook/index.html +++ b/versions/unreleased/api-ref/prefect/blocks/webhook/index.html @@ -4312,7 +4312,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/cli/agent/index.html b/versions/unreleased/api-ref/prefect/cli/agent/index.html index 5b94064cfe..7a3ee100a9 100644 --- a/versions/unreleased/api-ref/prefect/cli/agent/index.html +++ b/versions/unreleased/api-ref/prefect/cli/agent/index.html @@ -4295,7 +4295,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/cli/artifact/index.html b/versions/unreleased/api-ref/prefect/cli/artifact/index.html index 6a79792087..794242acbf 100644 --- a/versions/unreleased/api-ref/prefect/cli/artifact/index.html +++ b/versions/unreleased/api-ref/prefect/cli/artifact/index.html @@ -4317,7 +4317,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/cli/block/index.html b/versions/unreleased/api-ref/prefect/cli/block/index.html index 90b7858f73..35b5f21905 100644 --- a/versions/unreleased/api-ref/prefect/cli/block/index.html +++ b/versions/unreleased/api-ref/prefect/cli/block/index.html @@ -4372,7 +4372,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/cli/cloud-webhook/index.html b/versions/unreleased/api-ref/prefect/cli/cloud-webhook/index.html index 3715af6769..c617d04567 100644 --- a/versions/unreleased/api-ref/prefect/cli/cloud-webhook/index.html +++ b/versions/unreleased/api-ref/prefect/cli/cloud-webhook/index.html @@ -4228,7 +4228,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/cli/cloud/index.html b/versions/unreleased/api-ref/prefect/cli/cloud/index.html index 07113a3008..366aa9153d 100644 --- a/versions/unreleased/api-ref/prefect/cli/cloud/index.html +++ b/versions/unreleased/api-ref/prefect/cli/cloud/index.html @@ -4383,7 +4383,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/cli/concurrency_limit/index.html b/versions/unreleased/api-ref/prefect/cli/concurrency_limit/index.html index 628450565c..f02f77ebf4 100644 --- a/versions/unreleased/api-ref/prefect/cli/concurrency_limit/index.html +++ b/versions/unreleased/api-ref/prefect/cli/concurrency_limit/index.html @@ -4339,7 +4339,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/cli/config/index.html b/versions/unreleased/api-ref/prefect/cli/config/index.html index 76ba8e7232..f89e4ae181 100644 --- a/versions/unreleased/api-ref/prefect/cli/config/index.html +++ b/versions/unreleased/api-ref/prefect/cli/config/index.html @@ -4328,7 +4328,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/cli/deploy/index.html b/versions/unreleased/api-ref/prefect/cli/deploy/index.html index 5db2791ed4..6828e0502a 100644 --- a/versions/unreleased/api-ref/prefect/cli/deploy/index.html +++ b/versions/unreleased/api-ref/prefect/cli/deploy/index.html @@ -4115,6 +4115,17 @@ +
  • + +
  • + + + + init + + + +
  • @@ -4295,7 +4306,7 @@
  • - + @@ -8791,6 +8802,17 @@ +
  • + +
  • + + + + init + + + +
  • @@ -8894,7 +8916,7 @@

    -

    Module containing implementation for deploying projects.

    +

    Module containing implementation for deploying flows.

    @@ -8930,125 +8952,7 @@

    Source code in prefect/cli/deploy.py -
     83
    - 84
    - 85
    - 86
    - 87
    - 88
    - 89
    - 90
    - 91
    - 92
    - 93
    - 94
    - 95
    - 96
    - 97
    - 98
    - 99
    -100
    -101
    -102
    -103
    -104
    -105
    -106
    -107
    -108
    -109
    -110
    -111
    -112
    -113
    -114
    -115
    -116
    -117
    -118
    -119
    -120
    -121
    -122
    -123
    -124
    -125
    -126
    -127
    -128
    -129
    -130
    -131
    -132
    -133
    -134
    -135
    -136
    -137
    -138
    -139
    -140
    -141
    -142
    -143
    -144
    -145
    -146
    -147
    -148
    -149
    -150
    -151
    -152
    -153
    -154
    -155
    -156
    -157
    -158
    -159
    -160
    -161
    -162
    -163
    -164
    -165
    -166
    -167
    -168
    -169
    -170
    -171
    -172
    -173
    -174
    -175
    -176
    -177
    -178
    -179
    -180
    -181
    -182
    -183
    -184
    -185
    -186
    -187
    -188
    -189
    -190
    -191
    -192
    -193
    -194
    -195
    -196
    -197
    -198
    -199
    -200
    -201
    +            
    201
     202
     203
     204
    @@ -9192,7 +9096,118 @@ 

    342 343 344 -345

    @app.command()
    +345
    +346
    +347
    +348
    +349
    +350
    +351
    +352
    +353
    +354
    +355
    +356
    +357
    +358
    +359
    +360
    +361
    +362
    +363
    +364
    +365
    +366
    +367
    +368
    +369
    +370
    +371
    +372
    +373
    +374
    +375
    +376
    +377
    +378
    +379
    +380
    +381
    +382
    +383
    +384
    +385
    +386
    +387
    +388
    +389
    +390
    +391
    +392
    +393
    +394
    +395
    +396
    +397
    +398
    +399
    +400
    +401
    +402
    +403
    +404
    +405
    +406
    +407
    +408
    +409
    +410
    +411
    +412
    +413
    +414
    +415
    +416
    +417
    +418
    +419
    +420
    +421
    +422
    +423
    +424
    +425
    +426
    +427
    +428
    +429
    +430
    +431
    +432
    +433
    +434
    +435
    +436
    +437
    +438
    +439
    +440
    +441
    +442
    +443
    +444
    +445
    +446
    +447
    +448
    +449
    +450
    +451
    +452
    +453
    +454
    +455
    +456
    @app.command()
     async def deploy(
         entrypoint: str = typer.Argument(
             None,
    @@ -9201,12 +9216,6 @@ 

    " `./path/to/file.py:flow_func_name`" ), ), - flow_name: str = typer.Option( - None, - "--flow", - "-f", - help="DEPRECATED: The name of a registered flow to create a deployment for.", - ), names: List[str] = typer.Option( None, "--name", @@ -9392,7 +9401,6 @@

    options = { "entrypoint": entrypoint, - "flow_name": flow_name, "description": description, "version": version, "tags": tags, @@ -9462,6 +9470,262 @@

    +
    + + + +

    + init + + + async + + +

    + + +
    + +

    Initialize a new deployment configuration recipe.

    + +
    + Source code in prefect/cli/deploy.py +
     84
    + 85
    + 86
    + 87
    + 88
    + 89
    + 90
    + 91
    + 92
    + 93
    + 94
    + 95
    + 96
    + 97
    + 98
    + 99
    +100
    +101
    +102
    +103
    +104
    +105
    +106
    +107
    +108
    +109
    +110
    +111
    +112
    +113
    +114
    +115
    +116
    +117
    +118
    +119
    +120
    +121
    +122
    +123
    +124
    +125
    +126
    +127
    +128
    +129
    +130
    +131
    +132
    +133
    +134
    +135
    +136
    +137
    +138
    +139
    +140
    +141
    +142
    +143
    +144
    +145
    +146
    +147
    +148
    +149
    +150
    +151
    +152
    +153
    +154
    +155
    +156
    +157
    +158
    +159
    +160
    +161
    +162
    +163
    +164
    +165
    +166
    +167
    +168
    +169
    +170
    +171
    +172
    +173
    +174
    +175
    +176
    +177
    +178
    +179
    +180
    +181
    +182
    +183
    +184
    +185
    +186
    +187
    +188
    +189
    +190
    +191
    +192
    +193
    +194
    +195
    +196
    +197
    +198
    @app.command()
    +async def init(
    +    name: str = None,
    +    recipe: str = None,
    +    fields: List[str] = typer.Option(
    +        None,
    +        "-f",
    +        "--field",
    +        help=(
    +            "One or more fields to pass to the recipe (e.g., image_name) in the format"
    +            " of key=value."
    +        ),
    +    ),
    +):
    +    """
    +    Initialize a new deployment configuration recipe.
    +    """
    +    inputs = {}
    +    fields = fields or []
    +    recipe_paths = prefect.__module_path__ / "deployments" / "recipes"
    +
    +    for field in fields:
    +        key, value = field.split("=")
    +        inputs[key] = value
    +
    +    if not recipe and is_interactive():
    +        recipe_paths = prefect.__module_path__ / "deployments" / "recipes"
    +        recipes = []
    +
    +        for r in recipe_paths.iterdir():
    +            if r.is_dir() and (r / "prefect.yaml").exists():
    +                with open(r / "prefect.yaml") as f:
    +                    recipe_data = yaml.safe_load(f)
    +                    recipe_name = r.name
    +                    recipe_description = recipe_data.get(
    +                        "description", "(no description available)"
    +                    )
    +                    recipe_dict = {
    +                        "name": recipe_name,
    +                        "description": recipe_description,
    +                    }
    +                    recipes.append(recipe_dict)
    +
    +        selected_recipe = prompt_select_from_table(
    +            app.console,
    +            "Would you like to initialize your deployment configuration with a recipe?",
    +            columns=[
    +                {"header": "Name", "key": "name"},
    +                {"header": "Description", "key": "description"},
    +            ],
    +            data=recipes,
    +            opt_out_message="No, I'll use the default deployment configuration.",
    +            opt_out_response={},
    +        )
    +        if selected_recipe != {}:
    +            recipe = selected_recipe["name"]
    +
    +    if recipe and (recipe_paths / recipe / "prefect.yaml").exists():
    +        with open(recipe_paths / recipe / "prefect.yaml") as f:
    +            recipe_inputs = yaml.safe_load(f).get("required_inputs") or {}
    +
    +        if recipe_inputs:
    +            if set(recipe_inputs.keys()) < set(inputs.keys()):
    +                # message to user about extra fields
    +                app.console.print(
    +                    (
    +                        f"Warning: extra fields provided for {recipe!r} recipe:"
    +                        f" '{', '.join(set(inputs.keys()) - set(recipe_inputs.keys()))}'"
    +                    ),
    +                    style="red",
    +                )
    +            elif set(recipe_inputs.keys()) > set(inputs.keys()):
    +                table = Table(
    +                    title=f"[red]Required inputs for {recipe!r} recipe[/red]",
    +                )
    +                table.add_column("Field Name", style="green", no_wrap=True)
    +                table.add_column(
    +                    "Description", justify="left", style="white", no_wrap=False
    +                )
    +                for field, description in recipe_inputs.items():
    +                    if field not in inputs:
    +                        table.add_row(field, description)
    +
    +                app.console.print(table)
    +
    +                for key, description in recipe_inputs.items():
    +                    if key not in inputs:
    +                        inputs[key] = typer.prompt(key)
    +
    +            app.console.print("-" * 15)
    +
    +    try:
    +        files = [
    +            f"[green]{fname}[/green]"
    +            for fname in initialize_project(name=name, recipe=recipe, inputs=inputs)
    +        ]
    +    except ValueError as exc:
    +        if "Unknown recipe" in str(exc):
    +            exit_with_error(
    +                f"Unknown recipe {recipe!r} provided - run [yellow]`prefect init"
    +                "`[/yellow] to see all available recipes."
    +            )
    +        else:
    +            raise
    +
    +    files = "\n".join(files)
    +    empty_msg = (
    +        f"Created project in [green]{Path('.').resolve()}[/green]; no new files"
    +        " created."
    +    )
    +    file_msg = (
    +        f"Created project in [green]{Path('.').resolve()}[/green] with the following"
    +        f" new files:\n{files}"
    +    )
    +    app.console.print(file_msg if files else empty_msg)
    +
    +
    +
    + +
    + + diff --git a/versions/unreleased/api-ref/prefect/cli/deployment/index.html b/versions/unreleased/api-ref/prefect/cli/deployment/index.html index 3f7e1ae35c..a0e8a073c4 100644 --- a/versions/unreleased/api-ref/prefect/cli/deployment/index.html +++ b/versions/unreleased/api-ref/prefect/cli/deployment/index.html @@ -4427,7 +4427,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/cli/dev/index.html b/versions/unreleased/api-ref/prefect/cli/dev/index.html index 1005a82bf7..e63acfd513 100644 --- a/versions/unreleased/api-ref/prefect/cli/dev/index.html +++ b/versions/unreleased/api-ref/prefect/cli/dev/index.html @@ -4383,7 +4383,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/cli/flow/index.html b/versions/unreleased/api-ref/prefect/cli/flow/index.html index 94b014fe67..be380b6a0c 100644 --- a/versions/unreleased/api-ref/prefect/cli/flow/index.html +++ b/versions/unreleased/api-ref/prefect/cli/flow/index.html @@ -4306,7 +4306,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/cli/flow_run/index.html b/versions/unreleased/api-ref/prefect/cli/flow_run/index.html index 3a6e7ce8e7..fd0a5970fc 100644 --- a/versions/unreleased/api-ref/prefect/cli/flow_run/index.html +++ b/versions/unreleased/api-ref/prefect/cli/flow_run/index.html @@ -4339,7 +4339,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/cli/kubernetes/index.html b/versions/unreleased/api-ref/prefect/cli/kubernetes/index.html index c7f8d98444..2c3b084f26 100644 --- a/versions/unreleased/api-ref/prefect/cli/kubernetes/index.html +++ b/versions/unreleased/api-ref/prefect/cli/kubernetes/index.html @@ -4317,7 +4317,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/cli/profile/index.html b/versions/unreleased/api-ref/prefect/cli/profile/index.html index b2c79d1d8b..e390e62ba3 100644 --- a/versions/unreleased/api-ref/prefect/cli/profile/index.html +++ b/versions/unreleased/api-ref/prefect/cli/profile/index.html @@ -16,7 +16,7 @@ - + @@ -4350,7 +4350,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/cli/root/index.html b/versions/unreleased/api-ref/prefect/cli/root/index.html index 88af7913c2..85c2326ea4 100644 --- a/versions/unreleased/api-ref/prefect/cli/root/index.html +++ b/versions/unreleased/api-ref/prefect/cli/root/index.html @@ -13,7 +13,7 @@ - + @@ -4238,7 +4238,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/cli/server/index.html b/versions/unreleased/api-ref/prefect/cli/server/index.html index 6ab0aa31fb..303512a5c3 100644 --- a/versions/unreleased/api-ref/prefect/cli/server/index.html +++ b/versions/unreleased/api-ref/prefect/cli/server/index.html @@ -4238,7 +4238,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/cli/shell/index.html b/versions/unreleased/api-ref/prefect/cli/shell/index.html index 544f6cbfa7..63de1f451b 100644 --- a/versions/unreleased/api-ref/prefect/cli/shell/index.html +++ b/versions/unreleased/api-ref/prefect/cli/shell/index.html @@ -4238,7 +4238,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/cli/variable/index.html b/versions/unreleased/api-ref/prefect/cli/variable/index.html index 840eea6219..8291b16a82 100644 --- a/versions/unreleased/api-ref/prefect/cli/variable/index.html +++ b/versions/unreleased/api-ref/prefect/cli/variable/index.html @@ -4238,7 +4238,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/cli/work_pool/index.html b/versions/unreleased/api-ref/prefect/cli/work_pool/index.html index adb5dc37d5..0fede8b409 100644 --- a/versions/unreleased/api-ref/prefect/cli/work_pool/index.html +++ b/versions/unreleased/api-ref/prefect/cli/work_pool/index.html @@ -4238,7 +4238,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/cli/work_queue/index.html b/versions/unreleased/api-ref/prefect/cli/work_queue/index.html index 8a4491e3e0..3b6ca35ce4 100644 --- a/versions/unreleased/api-ref/prefect/cli/work_queue/index.html +++ b/versions/unreleased/api-ref/prefect/cli/work_queue/index.html @@ -4238,7 +4238,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/cli/worker/index.html b/versions/unreleased/api-ref/prefect/cli/worker/index.html index 9ec9ab57ff..9779fb7ae1 100644 --- a/versions/unreleased/api-ref/prefect/cli/worker/index.html +++ b/versions/unreleased/api-ref/prefect/cli/worker/index.html @@ -4238,7 +4238,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/client/base/index.html b/versions/unreleased/api-ref/prefect/client/base/index.html index 8dd4682fa3..0221f2df65 100644 --- a/versions/unreleased/api-ref/prefect/client/base/index.html +++ b/versions/unreleased/api-ref/prefect/client/base/index.html @@ -4362,7 +4362,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/client/cloud/index.html b/versions/unreleased/api-ref/prefect/client/cloud/index.html index 8382eca35c..5c1e36b1ea 100644 --- a/versions/unreleased/api-ref/prefect/client/cloud/index.html +++ b/versions/unreleased/api-ref/prefect/client/cloud/index.html @@ -4334,7 +4334,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/client/orchestration/index.html b/versions/unreleased/api-ref/prefect/client/orchestration/index.html index 8d8e9e027a..8c8f5fcb20 100644 --- a/versions/unreleased/api-ref/prefect/client/orchestration/index.html +++ b/versions/unreleased/api-ref/prefect/client/orchestration/index.html @@ -5313,7 +5313,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/client/schemas/index.html b/versions/unreleased/api-ref/prefect/client/schemas/index.html index c5d6bb9dde..79ef8ec454 100644 --- a/versions/unreleased/api-ref/prefect/client/schemas/index.html +++ b/versions/unreleased/api-ref/prefect/client/schemas/index.html @@ -6471,7 +6471,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/client/utilities/index.html b/versions/unreleased/api-ref/prefect/client/utilities/index.html index cc7876fc78..1c55aad5c7 100644 --- a/versions/unreleased/api-ref/prefect/client/utilities/index.html +++ b/versions/unreleased/api-ref/prefect/client/utilities/index.html @@ -4306,7 +4306,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/concurrency/asyncio/index.html b/versions/unreleased/api-ref/prefect/concurrency/asyncio/index.html index 5c1a62aa0a..18700f8cf8 100644 --- a/versions/unreleased/api-ref/prefect/concurrency/asyncio/index.html +++ b/versions/unreleased/api-ref/prefect/concurrency/asyncio/index.html @@ -4236,7 +4236,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/concurrency/common/index.html b/versions/unreleased/api-ref/prefect/concurrency/common/index.html index 0d8c57dbce..968b05de8a 100644 --- a/versions/unreleased/api-ref/prefect/concurrency/common/index.html +++ b/versions/unreleased/api-ref/prefect/concurrency/common/index.html @@ -4236,7 +4236,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/concurrency/events/index.html b/versions/unreleased/api-ref/prefect/concurrency/events/index.html index 08ab21e30d..d8e5a422c2 100644 --- a/versions/unreleased/api-ref/prefect/concurrency/events/index.html +++ b/versions/unreleased/api-ref/prefect/concurrency/events/index.html @@ -4236,7 +4236,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/concurrency/services/index.html b/versions/unreleased/api-ref/prefect/concurrency/services/index.html index 54ad67d57e..ef9f5c3988 100644 --- a/versions/unreleased/api-ref/prefect/concurrency/services/index.html +++ b/versions/unreleased/api-ref/prefect/concurrency/services/index.html @@ -4236,7 +4236,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/concurrency/sync/index.html b/versions/unreleased/api-ref/prefect/concurrency/sync/index.html index d1900bff03..5b38499b9a 100644 --- a/versions/unreleased/api-ref/prefect/concurrency/sync/index.html +++ b/versions/unreleased/api-ref/prefect/concurrency/sync/index.html @@ -4236,7 +4236,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/context/index.html b/versions/unreleased/api-ref/prefect/context/index.html index d434f762fa..2214b645f6 100644 --- a/versions/unreleased/api-ref/prefect/context/index.html +++ b/versions/unreleased/api-ref/prefect/context/index.html @@ -4236,7 +4236,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/deployments/base/index.html b/versions/unreleased/api-ref/prefect/deployments/base/index.html index 00552f33cc..e6c7a3a0b8 100644 --- a/versions/unreleased/api-ref/prefect/deployments/base/index.html +++ b/versions/unreleased/api-ref/prefect/deployments/base/index.html @@ -4236,7 +4236,7 @@
  • - + @@ -4854,17 +4854,6 @@ -
  • - -
  • - - - - find_prefect_directory - - - -
  • @@ -4876,28 +4865,6 @@ -
  • - -
  • - - - - register_flow - - - - -
  • - -
  • - - - - set_prefect_hidden_dir - - - -
  • @@ -8857,17 +8824,6 @@ - - -
  • - - - - find_prefect_directory - - - -
  • @@ -8879,28 +8835,6 @@ -
  • - -
  • - - - - register_flow - - - - -
  • - -
  • - - - - set_prefect_hidden_dir - - - -
  • @@ -9004,7 +8938,7 @@

    -

    Core primitives for managing Prefect projects. Projects provide a minimally opinionated +

    Core primitives for managing Prefect deployments via prefect deploy, providing a minimally opinionated build system for managing flows and deployments.

    To get started, follow along with the deloyments tutorial.

    @@ -9105,31 +9039,31 @@

    Source code in prefect/deployments/base.py -
    159
    -160
    -161
    -162
    -163
    -164
    -165
    -166
    -167
    -168
    -169
    -170
    -171
    -172
    -173
    -174
    -175
    -176
    -177
    -178
    -179
    -180
    -181
    -182
    -183
    def configure_project_by_recipe(recipe: str, **formatting_kwargs) -> dict:
    +            
    121
    +122
    +123
    +124
    +125
    +126
    +127
    +128
    +129
    +130
    +131
    +132
    +133
    +134
    +135
    +136
    +137
    +138
    +139
    +140
    +141
    +142
    +143
    +144
    +145
    def configure_project_by_recipe(recipe: str, **formatting_kwargs) -> dict:
         """
         Given a recipe name, returns a dictionary representing base configuration options.
     
    @@ -9224,7 +9158,45 @@ 

    Source code in prefect/deployments/base.py -
     69
    +            
     31
    + 32
    + 33
    + 34
    + 35
    + 36
    + 37
    + 38
    + 39
    + 40
    + 41
    + 42
    + 43
    + 44
    + 45
    + 46
    + 47
    + 48
    + 49
    + 50
    + 51
    + 52
    + 53
    + 54
    + 55
    + 56
    + 57
    + 58
    + 59
    + 60
    + 61
    + 62
    + 63
    + 64
    + 65
    + 66
    + 67
    + 68
    + 69
      70
      71
      72
    @@ -9273,45 +9245,7 @@ 

    115 116 117 -118 -119 -120 -121 -122 -123 -124 -125 -126 -127 -128 -129 -130 -131 -132 -133 -134 -135 -136 -137 -138 -139 -140 -141 -142 -143 -144 -145 -146 -147 -148 -149 -150 -151 -152 -153 -154 -155 -156

    def create_default_prefect_yaml(
    +118
    def create_default_prefect_yaml(
         path: str, name: str = None, contents: Optional[Dict[str, Any]] = None
     ) -> bool:
         """
    @@ -9410,67 +9344,6 @@ 

    - find_prefect_directory - -

    - - -
    - -

    Given a path, recurses upward looking for .prefect/ directories.

    -

    Once found, returns absolute path to the ./prefect directory, which is assumed to reside within the -root for the current project.

    -

    If one is never found, None is returned.

    - -
    - Source code in prefect/deployments/base.py -
    33
    -34
    -35
    -36
    -37
    -38
    -39
    -40
    -41
    -42
    -43
    -44
    -45
    -46
    -47
    -48
    -49
    -50
    def find_prefect_directory(path: Path = None) -> Optional[Path]:
    -    """
    -    Given a path, recurses upward looking for .prefect/ directories.
    -
    -    Once found, returns absolute path to the ./prefect directory, which is assumed to reside within the
    -    root for the current project.
    -
    -    If one is never found, `None` is returned.
    -    """
    -    path = Path(path or ".").resolve()
    -    parent = path.parent.resolve()
    -    while path != parent:
    -        prefect_dir = path.joinpath(".prefect")
    -        if prefect_dir.is_dir():
    -            return prefect_dir
    -
    -        path = parent.resolve()
    -        parent = path.parent.resolve()
    -
    -
    -
    - -
    - - -
    - - -

    initialize_project @@ -9566,7 +9439,45 @@

    Source code in prefect/deployments/base.py -
    216
    +            
    178
    +179
    +180
    +181
    +182
    +183
    +184
    +185
    +186
    +187
    +188
    +189
    +190
    +191
    +192
    +193
    +194
    +195
    +196
    +197
    +198
    +199
    +200
    +201
    +202
    +203
    +204
    +205
    +206
    +207
    +208
    +209
    +210
    +211
    +212
    +213
    +214
    +215
    +216
     217
     218
     219
    @@ -9586,47 +9497,7 @@ 

    233 234 235 -236 -237 -238 -239 -240 -241 -242 -243 -244 -245 -246 -247 -248 -249 -250 -251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276

    def initialize_project(
    +236
    def initialize_project(
         name: str = None, recipe: str = None, inputs: Optional[Dict[str, Any]] = None
     ) -> List[str]:
         """
    @@ -9683,8 +9554,6 @@ 

    files.append(".prefectignore") if create_default_prefect_yaml(".", name=project_name, contents=configuration): files.append("prefect.yaml") - if set_prefect_hidden_dir(): - files.append(".prefect/") return files

    @@ -9694,272 +9563,6 @@

    -
    - - - -

    - register_flow - - - async - - -

    - - -
    - -

    Register a flow with this project from an entrypoint.

    - - - -

    Parameters:

    - - - - - - - - - - - - - - - - - - - - - - - -
    NameTypeDescriptionDefault
    entrypoint - str - -
    -

    the entrypoint to the flow to register

    -
    -
    - required -
    force - bool - -
    -

    whether or not to overwrite an existing flow with the same name

    -
    -
    - False -
    - - - -

    Raises:

    - - - - - - - - - - - - - -
    TypeDescription
    - ValueError - -
    -

    if force is False and registration would overwrite an existing flow

    -
    -
    - -
    - Source code in prefect/deployments/base.py -
    279
    -280
    -281
    -282
    -283
    -284
    -285
    -286
    -287
    -288
    -289
    -290
    -291
    -292
    -293
    -294
    -295
    -296
    -297
    -298
    -299
    -300
    -301
    -302
    -303
    -304
    -305
    -306
    -307
    -308
    -309
    -310
    -311
    -312
    -313
    -314
    -315
    -316
    -317
    -318
    -319
    -320
    -321
    -322
    -323
    -324
    -325
    -326
    -327
    -328
    -329
    -330
    -331
    -332
    -333
    -334
    -335
    -336
    -337
    -338
    async def register_flow(entrypoint: str, force: bool = False):
    -    """
    -    Register a flow with this project from an entrypoint.
    -
    -    Args:
    -        entrypoint (str): the entrypoint to the flow to register
    -        force (bool, optional): whether or not to overwrite an existing flow with the same name
    -
    -    Raises:
    -        ValueError: if `force` is `False` and registration would overwrite an existing flow
    -    """
    -    try:
    -        fpath, obj_name = entrypoint.rsplit(":", 1)
    -    except ValueError as exc:
    -        if str(exc) == "not enough values to unpack (expected 2, got 1)":
    -            missing_flow_name_msg = (
    -                "Your flow entrypoint must include the name of the function that is"
    -                f" the entrypoint to your flow.\nTry {entrypoint}:<flow_name> as your"
    -                f" entrypoint. If you meant to specify '{entrypoint}' as the deployment"
    -                f" name, try `prefect deploy -n {entrypoint}`."
    -            )
    -            raise ValueError(missing_flow_name_msg)
    -        else:
    -            raise exc
    -
    -    flow = await run_sync_in_worker_thread(load_flow_from_entrypoint, entrypoint)
    -
    -    fpath = Path(fpath).absolute()
    -    prefect_dir = find_prefect_directory()
    -    if not prefect_dir:
    -        raise FileNotFoundError(
    -            "No .prefect directory could be found - run `prefect project"
    -            " init` to create one."
    -        )
    -
    -    entrypoint = f"{fpath.relative_to(prefect_dir.parent)!s}:{obj_name}"
    -
    -    flows_file = prefect_dir / "flows.json"
    -    if flows_file.exists():
    -        with flows_file.open(mode="r") as f:
    -            flows = json.load(f)
    -    else:
    -        flows = {}
    -
    -    ## quality control
    -    if flow.name in flows and flows[flow.name] != entrypoint:
    -        if not force:
    -            raise ValueError(
    -                f"Conflicting entry found for flow with name {flow.name!r}.\nExisting"
    -                f" entrypoint: {flows[flow.name]}\nAttempted entrypoint:"
    -                f" {entrypoint}\n\nYou can try removing the existing entry for"
    -                f" {flow.name!r} from your [yellow]~/.prefect/flows.json[/yellow]."
    -            )
    -
    -    flows[flow.name] = entrypoint
    -
    -    with flows_file.open(mode="w") as f:
    -        json.dump(flows, f, sort_keys=True, indent=2)
    -
    -    return flow
    -
    -
    -
    - -
    - - -
    - - - -

    - set_prefect_hidden_dir - -

    - - -
    - -

    Creates default .prefect/ directory if one does not already exist. -Returns boolean specifying whether or not a directory was created.

    -

    If a path is provided, the directory will be created in that location.

    - -
    - Source code in prefect/deployments/base.py -
    53
    -54
    -55
    -56
    -57
    -58
    -59
    -60
    -61
    -62
    -63
    -64
    -65
    -66
    def set_prefect_hidden_dir(path: str = None) -> bool:
    -    """
    -    Creates default `.prefect/` directory if one does not already exist.
    -    Returns boolean specifying whether or not a directory was created.
    -
    -    If a path is provided, the directory will be created in that location.
    -    """
    -    path = Path(path or ".") / ".prefect"
    -
    -    # use exists so that we dont accidentally overwrite a file
    -    if path.exists():
    -        return False
    -    path.mkdir(mode=0o0700)
    -    return True
    -
    -
    -
    - -
    - - diff --git a/versions/unreleased/api-ref/prefect/deployments/deployments/index.html b/versions/unreleased/api-ref/prefect/deployments/deployments/index.html index 266d23eb62..2050d688f7 100644 --- a/versions/unreleased/api-ref/prefect/deployments/deployments/index.html +++ b/versions/unreleased/api-ref/prefect/deployments/deployments/index.html @@ -4236,7 +4236,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/deployments/runner/index.html b/versions/unreleased/api-ref/prefect/deployments/runner/index.html index 2c1faa11e9..c57ab8f9ca 100644 --- a/versions/unreleased/api-ref/prefect/deployments/runner/index.html +++ b/versions/unreleased/api-ref/prefect/deployments/runner/index.html @@ -4236,7 +4236,7 @@
  • - + diff --git a/versions/unreleased/api-ref/prefect/deployments/steps/core/index.html b/versions/unreleased/api-ref/prefect/deployments/steps/core/index.html index 808551e3fa..bb9c436410 100644 --- a/versions/unreleased/api-ref/prefect/deployments/steps/core/index.html +++ b/versions/unreleased/api-ref/prefect/deployments/steps/core/index.html @@ -4236,7 +4236,7 @@
  • - + @@ -8916,11 +8916,11 @@

    -

    Core primitives for running Prefect project steps.

    -

    Project steps are YAML representations of Python functions along with their inputs.

    +

    Core primitives for running Prefect deployment steps.

    +

    Deployment steps are YAML representations of Python functions along with their inputs.

    Whenever a step is run, the following actions are taken: