https://prefect.io logo
Title
a

Andreas Nigg

07/23/2022, 6:46 AM
Hey, I've encountered a problem with prefect 2.0b12 (I'm running on prefect cloud 2.0). I changed my flow_runner configurations in my deployments to infrastructure. I'm using yaml-configuration for deployments. When trying to create the deployment with prefect deployment create <my-path>, I get the following error:
Found 1 invalid deployments:
    1 validation error for deployment with name 'sync_goodread_score_to_volat_bigquery'
    infrastructure
      Can't instantiate abstract class Infrastructure with abstract methods preview, run (type=type_error)
Please find my deployment in the thread
āœ… 1
name: sync_goodread_score_to_volat_bigquery
flow:
  path: ./sync_drive_goodread_score.py
  name: sync_drive_goodread_score
tags:
- k8s
infrastructure: 
  type: process
schedule:
  cron: "0 2 * * *"    
  timezone: "Europe/Vienna"
a

Anna Geller

07/23/2022, 1:00 PM
are you on self-hosted or Cloud? let me try to reproduce that
ok, @Andreas Nigg I was able to reproduce - this is a bug until we fix that, could you switch to the definition in Python rather than YAML? this should work
from prefect.infrastructure import Process
from prefect.deployments import Deployment
from prefect import flow


@flow
def hello_world():
    print("Hello world!")


Deployment(
    name="example",
    flow=hello_world,
    infrastructure=Process(),
)
@Marvin open "Deployments from YAML using
infrastructure
fail with: `Can't instantiate abstract class Infrastructure with abstract methods preview, run (type=type_error)`"
a

Andreas Nigg

07/24/2022, 5:23 AM
Thanks for investigating! Sorry for my late reply. ā€¢ With regards to the chnages documentation you sent: Perfectly describes what needs to be done. ā€¢ With regards to the workaround: I switched to python Deployment Definitions where I needed to specify an Infrastructure. (Like KubernetesJob). ā—¦ For all "Process" Deployments, I simply removed the "infrastructure" from the yaml definition - I've seen in the Source code, that Process is the default Infrastructure - so that seems fair šŸ™‚ Thanks for your support!
šŸ™Œ 1
a

Anna Geller

07/24/2022, 1:45 PM
nice work! Freut mich, dass ich helfen konnte šŸ™‚