prefect.deployments.base
¶
Core primitives for managing Prefect projects. Projects provide a minimally opinionated build system for managing flows and deployments.
To get started, follow along with the deloyments tutorial.
configure_project_by_recipe
¶
Given a recipe name, returns a dictionary representing base configuration options.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
recipe |
str
|
the name of the recipe to use |
required |
formatting_kwargs |
dict
|
additional keyword arguments to format the recipe |
{}
|
Raises:
Type | Description |
---|---|
ValueError
|
if provided recipe name does not exist. |
Source code in /home/runner/work/docs/docs/prefect_source/src/prefect/deployments/base.py
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 |
|
create_default_prefect_yaml
¶
Creates default prefect.yaml
file in the provided path if one does not already exist;
returns boolean specifying whether a file was created.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
the name of the project; if not provided, the current directory name will be used |
None
|
contents |
dict
|
a dictionary of contents to write to the file; if not provided, defaults will be used |
None
|
Source code in /home/runner/work/docs/docs/prefect_source/src/prefect/deployments/base.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 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 |
|
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 /home/runner/work/docs/docs/prefect_source/src/prefect/deployments/base.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
initialize_project
¶
Initializes a basic project structure with base files. If no name is provided, the name of the current directory is used. If no recipe is provided, one is inferred.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
the name of the project; if not provided, the current directory name |
None
|
recipe |
str
|
the name of the recipe to use; if not provided, one is inferred |
None
|
inputs |
dict
|
a dictionary of inputs to use when formatting the recipe |
None
|
Returns:
Type | Description |
---|---|
List[str]
|
List[str]: a list of files / directories that were created |
Source code in /home/runner/work/docs/docs/prefect_source/src/prefect/deployments/base.py
215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 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 |
|
register_flow
async
¶
Register a flow with this project from an entrypoint.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
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:
Type | Description |
---|---|
ValueError
|
if |
Source code in /home/runner/work/docs/docs/prefect_source/src/prefect/deployments/base.py
278 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 |
|
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 /home/runner/work/docs/docs/prefect_source/src/prefect/deployments/base.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|