-
Notifications
You must be signed in to change notification settings - Fork 7
/
prefect.yaml
66 lines (61 loc) · 2.23 KB
/
prefect.yaml
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
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
# see https://docs.prefect.io/2.18.0/concepts/deployments-ux/
name: prefect-demo
prefect-version: 2.18.0
# build section allows you to manage and build docker images
# build: null
deployments:
- name: yaml
version: snapshot
tags: ["s3"]
description: deployment pulling from s3
entrypoint: flows/param_flow.py:param
parameters:
i: 1
work_pool:
name: kubes-pool
# optional work queue
# work_queue_name: null
# see https://prefecthq.github.io/prefect-kubernetes/worker/#prefect_kubernetes.worker.KubernetesWorkerVariables
job_variables:
image: prefect-registry:5000/flow:latest
image_pull_policy: Always
service_account_name: prefect-flows
# deletes completed jobs see https://kubernetes.io/docs/concepts/workloads/controllers/job/#ttl-mechanism-for-finished-jobs
finished_job_ttl: 300
# used to download the stored flow from minio when the job starts
# TODO: fetch from secret see https://github.com/PrefectHQ/prefect-kubernetes/issues/83
env:
AWS_ACCESS_KEY_ID: minioadmin
AWS_SECRET_ACCESS_KEY: minioadmin
# schedule can be added here
# schedule: null
# example using s3 to store flow code
push:
- prefect_aws.deployments.steps.push_to_s3:
bucket: minio-flows
folder: param
client_parameters:
endpoint_url: http://localhost:9000
pull:
- prefect_aws.deployments.steps.pull_from_s3:
bucket: minio-flows
folder: param
client_parameters:
endpoint_url: http://minio:9000
- name: yaml
version: snapshot
description: deployment with flow inside docker container
entrypoint: flows/retry_flow.py:retry
work_pool:
name: kubes-pool
job_variables:
# TODO: fetch this from build, rather than hard-code
image: prefect-registry:5000/flow:latest
# TODO: demonstrate these as defaults on the workpool
image_pull_policy: Always
service_account_name: prefect-flows
finished_job_ttl: 300
pull:
# required see https://github.com/PrefectHQ/prefect/issues/10285
- prefect.deployments.steps.set_working_directory:
directory: /opt/prefect