Robin Eklund
09/28/2022, 8:14 AMprefect deployment build ./log_flow.py:log_flow -n log-simple -q test
which generate the yaml file. But it looks slightly different for infrastructure
where in the tutorial they have:
infrastructure:
type: process
env: {}
labels: {}
name: null
command:
- python
- -m
- prefect.engine
stream_output: true
and i have:
infrastructure:
type: process
env: {}
labels: {}
name: null
command: null
stream_output: true
block_type_slug: process
_block_type_slug: process
And when i run prefect deployment apply log_flow-deployment.yaml
I get this error:
prefect.exceptions.PrefectHTTPStatusError: Client error '403 Forbidden' for url '<prefect_domain>/api/block_types/016c45c9-6346-49c1-a1cb-da3021f915b2'
Response: {'detail': 'protected block types cannot be updated.'}
For more information check: <https://httpstatuses.com/403>
An exception occurred.
Anyone knows what i need to do?jpuris
09/28/2022, 8:34 AMResponse: {'detail': 'protected block types cannot be updated.'}
when applying said manifest though 🤷
prefect build
2.4.2 would generate
prefect deployment build ./log_flow.py:log_flow -n log-simple -q test
###
### A complete description of a Prefect Deployment for flow 'log-flow'
###
name: log-simple
description: null
version: c2966c5bd40b38928108be01c093c08a
# The work queue that will handle this deployment's runs
work_queue_name: test
tags: []
parameters: {}
schedule: null
infra_overrides: {}
infrastructure:
type: process
env: {}
labels: {}
name: null
command: null
stream_output: true
block_type_slug: process
_block_type_slug: process
###
### DO NOT EDIT BELOW THIS LINE
###
flow_name: log-flow
manifest_path: null
storage: null
path: /Users/jp/projects/test
entrypoint: log_flow.py:log_flow
parameter_openapi_schema:
title: Parameters
type: object
properties: {}
required: null
definitions: null
while prefect 2.0.1 would output
prefect deployment build ./log_flow.py:log_flow -n log-simple
###
### A complete description of a Prefect Deployment for flow 'log-flow'
###
name: log-simple
description: null
version: c2966c5bd40b38928108be01c093c08a
tags: []
parameters: {}
schedule: null
infra_overrides: {}
infrastructure:
type: process
env: {}
labels: {}
name: null
command:
- python
- -m
- prefect.engine
stream_output: true
###
### DO NOT EDIT BELOW THIS LINE
###
flow_name: log-flow
manifest_path: null
storage: null
path: /Users/jp/projects/test
entrypoint: log_flow.py:log_flow
parameter_openapi_schema:
title: Parameters
type: object
properties: {}
required: null
definitions: null
diff
❯ diff *yaml
6a7,8
> # The work queue that will handle this deployment's runs
> work_queue_name: test
16,19c18
< command:
< - python
< - -m
< - prefect.engine
---
> command: null
20a20,22
> block_type_slug: process
> _block_type_slug: process
>
log_flow.py
❯ cat log_flow.py
from prefect import flow
@flow
def log_flow() -> None:
print('Hello World!')
if __name__ == '__main__':
log_flow()
Deepanshu Aggarwal
09/28/2022, 9:44 AMjpuris
09/28/2022, 9:57 AMRobin Eklund
09/28/2022, 11:24 AMjpuris
09/28/2022, 11:31 AMRobin Eklund
09/28/2022, 11:42 AM2.4.0
and applying the deployment to prefect 22.4.2
, but i guess the minor version shouldn't matter?Rob Freedy
09/28/2022, 1:15 PMprefect config view
and double check your api key and api url?Robin Eklund
09/28/2022, 2:19 PMprefect config view
PREFECT_PROFILE='default'
PREFECT_API_URL='<the_prefect_domain>/api' (from profile)
Rob Freedy
09/28/2022, 2:38 PM