-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy.py
35 lines (29 loc) · 905 Bytes
/
deploy.py
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
from pathlib import Path
import emoji
from prefect import flow
from prefect.docker import DockerImage
docker_image = DockerImage(
name="zzstoatzz/prefect-pack",
tag="with-special-deps",
dockerfile=str(Path(__file__).parent / "Dockerfile"),
)
@flow
def emoji_flow(message: str = "Hello, World!"):
return emoji.emojize(message)
if __name__ == "__main__":
"""test it out from repo root (using dockerhub as registry):
```bash
python flows/with_special_deps/deploy.py
prefect deployment run "emoji-flow/emoji-deployment"
prefect worker start --pool docker-work
```
"""
flow.from_source(
source="https://github.com/zzstoatzz/prefect-pack.git",
entrypoint="flows/with_special_deps/deploy.py:emoji_flow",
).deploy(
name="emoji-deployment",
work_pool_name="docker-work",
image=docker_image,
push=True,
)