Devin Flake
12/05/2023, 6:18 PMprefect.yaml
as well - it doesn't seem to be downloading the flow code:Devin Flake
12/05/2023, 6:18 PMimport httpx
from prefect import flow
@flow(log_prints=True)
def get_repo_info(repo_name: str = "PrefectHQ/prefect"):
url = f"<https://api.github.com/repos/{repo_name}>"
response = httpx.get(url)
response.raise_for_status()
repo = response.json()
print(f"{repo_name} repository statistics 🤓:")
print(f"Stars 🌠 : {repo['stargazers_count']}")
print(f"Forks 🍴 : {repo['forks_count']}")
if __name__ == "__main__":
print("This is my-first-deployment")
get_repo_info.deploy(
name="my-first-deployment",
work_pool_name="arte-k8s",
image="prefecthq/prefect:2-python3.11-conda",
build=False
)
Devin Flake
12/05/2023, 6:18 PMname: workers_test
prefect-version: 2.14.4
build: null
push:
- prefect_azure.deployments.steps.push_to_azure_blob_storage:
id: push_code
requires: prefect-azure>=0.2.8
container: prefect-server
folder: Deployments
credentials: "{{ prefect.blocks.azure-blob-storage-credentials.my-credentials-block }}"
pull:
- prefect_azure.deployments.steps.pull_from_azure_blob_storage:
id: pull_code
requires: prefect-azure>=0.2.8
container: '{{ push_code.container }}'
folder: '{{ push_code.folder }}'
credentials: "{{ prefect.blocks.azure-blob-storage-credentials.my-credentials-block }}"
deployments:
- name: null
version: null
tags: []
description: null
schedule: {}
flow_name: null
entrypoint: null
parameters: {}
work_pool:
name: arte-k8s
work_queue_name: default
job_variables: {}
push: push_code
pull: pull_code
Devin Flake
12/05/2023, 6:19 PMKevin Grismore
12/05/2023, 6:22 PM.deploy()
, so you don't need a prefect.yaml
Kevin Grismore
12/05/2023, 6:23 PMprefect.yaml
file is read when running prefect deploy -n <my_deployment_name>
via the CLI. Both prefect deploy
and .deploy()
achieve the outcome of creating a deployment, so you only need to use one of them.Kevin Grismore
12/05/2023, 6:25 PM.deploy()
.Devin Flake
12/05/2023, 6:25 PM