Tim
07/23/2024, 8:50 PMMarvin
07/23/2024, 8:50 PMprefect work-pool ls
2. Creating a Work-Pool: Create a new work-pool with specific options:
prefect work-pool create [OPTIONS] NAME
Options include:
- `--paused`: Create in a paused state
- `--type`: Define the infrastructure type
- `--set-as-default`: Set as default
Regarding exporting and importing configuration steps explicitly, you could theoretically script this by extracting current configurations using the inspect
command and then reapplying them using the create
command.
For more details, you can visit:
https://docs.prefect.io/latest/concepts/work-pools/
Any other specific features or nuances might need to wait for more official support or documentation updates.
Let me know if you need a deeper dive or more specific examples!Nate
07/23/2024, 10:53 PMIn [1]: from prefect import get_client
In [2]: from prefect.client.schemas.actions import WorkPoolCreate
...: async with get_client() as client:
...: work_pool = await client.read_work_pool('local')
...: new = await client.create_work_pool(WorkPoolCreate(name=f"{work_pool.name}-suffix", type=work_pool.type))
...: print(new)
...:
id=UUID('5b01683b-1b73-41af-b436-4c50ecccbec6') name='local-suffix' description=None type='process' base_job_template={} is_paused=False concurrency_limit=None status=WorkPoolStatus.NOT_READY default_queue_id=UUID('eee5ff9e-ba43-4fc4-a02c-3e629e266775')
Tim
07/24/2024, 3:07 PM