Verun Rahimtoola
06/14/2021, 9:06 PMError while deploying flow: ValidationError({'type': ['Unsupported value: UniversalRun']
with prefect version 0.14.21
Verun Rahimtoola
06/14/2021, 9:07 PMKevin Kho
Verun Rahimtoola
06/14/2021, 9:08 PMVerun Rahimtoola
06/14/2021, 9:09 PMKevin Kho
Verun Rahimtoola
06/14/2021, 9:14 PMKevin Kho
query Api {
api {
backend
mode
version
core_version
release_timestamp
}
}
Kevin Kho
Verun Rahimtoola
06/14/2021, 9:15 PM{
"data": {
"api": {
"backend": "SERVER",
"mode": "normal",
"version": "2021-01-05",
"core_version": "0.14.2",
"release_timestamp": "2021-01-05T22:33:00Z"
}
}
}
Verun Rahimtoola
06/14/2021, 9:15 PMVerun Rahimtoola
06/14/2021, 9:15 PMKevin Kho
Verun Rahimtoola
06/14/2021, 9:18 PMVerun Rahimtoola
06/15/2021, 4:16 PM0.14.21
- but we're still seeing that same errorVerun Rahimtoola
06/15/2021, 4:17 PMKevin Kho
Verun Rahimtoola
06/15/2021, 4:18 PMKevin Kho
Verun Rahimtoola
06/15/2021, 4:23 PMKevin Kho
Verun Rahimtoola
06/15/2021, 4:24 PMVerun Rahimtoola
06/15/2021, 4:24 PMVerun Rahimtoola
06/15/2021, 4:25 PMKevin Kho
flow.run_config = LocalRun()
Verun Rahimtoola
06/15/2021, 4:25 PMVerun Rahimtoola
06/15/2021, 4:45 PMVerun Rahimtoola
06/15/2021, 4:46 PMTraceback (most recent call last):
File "/home/aicompute/.local/lib/python3.6/site-packages/prefect/environments/storage/local.py", line 102, in get_flow
return prefect.core.flow.Flow.load(flow_location)
File "/home/aicompute/.local/lib/python3.6/site-packages/prefect/core/flow.py", line 1523, in load
return cloudpickle.load(f)
_pickle.UnpicklingError: invalid load key, '{'.
Verun Rahimtoola
06/15/2021, 4:46 PMpickletools
and got this, fyi:
ValueError: at position 0, opcode b'{' unknown
Verun Rahimtoola
06/15/2021, 4:46 PMKevin Kho
Verun Rahimtoola
06/15/2021, 4:48 PMVerun Rahimtoola
06/15/2021, 4:50 PMKevin Kho
Verun Rahimtoola
06/15/2021, 4:52 PMVerun Rahimtoola
06/15/2021, 5:13 PMfrom prefect import task, Flow
from prefect.storage import Docker, Local
# import a non-prefect package used for scraping reddit
import praw
@task
def whoami():
reddit = praw.Reddit(client_id='SI8pN3DSbt0zor',
client_secret='xaxkj7HNh8kwg8e5t4m6KvSrbTI',
password='1guiwevlfo00esyy',
user_agent='testscript by /u/fakebot3',
username='fakebot3')
return <http://reddit.user.me|reddit.user.me>()
storage = Local()
flow = Flow("test-local-storage", storage=storage, tasks=[whoami])
Verun Rahimtoola
06/15/2021, 5:14 PM{'type': ['Unsupported value: UniversalRun']}
error againVerun Rahimtoola
06/15/2021, 5:14 PM0.14.21
, can you pls try to reproduce and check?Verun Rahimtoola
06/15/2021, 5:16 PMDocker
storage with Local
(so we can test our agent)Kevin Kho
Verun Rahimtoola
06/15/2021, 5:18 PMLocalRun
for the flow's run_config, and it gets past that error, but then leads right back to the other error of:
Traceback (most recent call last):
File "/home/aicompute/.local/lib/python3.6/site-packages/prefect/environments/storage/local.py", line 102, in get_flow
return prefect.core.flow.Flow.load(flow_location)
File "/home/aicompute/.local/lib/python3.6/site-packages/prefect/core/flow.py", line 1523, in load
return cloudpickle.load(f)
_pickle.UnpicklingError: invalid load key, '{'.
Verun Rahimtoola
06/15/2021, 5:22 PMLocal
storage) that doesn't explicitly specify a run_config (say, LocalRun
) things break, and
2. even if we explicitly set flow.run_config = LocalRun()
it leads to the unpickling error above.Verun Rahimtoola
06/15/2021, 5:22 PMfrom prefect import task, Flow
from prefect.storage import Docker, Local
from prefect.run_configs import LocalRun
# import a non-prefect package used for scraping reddit
import praw
@task
def whoami():
reddit = praw.Reddit(client_id='SI8pN3DSbt0zor',
client_secret='xaxkj7HNh8kwg8e5t4m6KvSrbTI',
password='1guiwevlfo00esyy',
user_agent='testscript by /u/fakebot3',
username='fakebot3')
return <http://reddit.user.me|reddit.user.me>()
storage = Local()
flow = Flow("test-local-storage", storage=storage, tasks=[whoami])
flow.run_config = LocalRun() # have to specify this explicitly, otherwise things break when trying to deploy the flow to the local agent
Kevin Kho
Verun Rahimtoola
06/15/2021, 5:26 PMVerun Rahimtoola
06/15/2021, 5:27 PMKevin Kho
Kevin Kho
Kevin Kho
from prefect import task, Flow
from prefect.storage import Docker, Local
# import a non-prefect package used for scraping reddit
import praw
@task
def abc():
return 1
storage = Local()
flow = Flow("test-local-storage", storage=storage, tasks=[abc])
flow.register("omlds")
Verun Rahimtoola
06/15/2021, 6:11 PMKevin Kho
Kevin Kho
Verun Rahimtoola
06/15/2021, 6:12 PMVerun Rahimtoola
06/15/2021, 6:12 PMKevin Kho
prefect register ....
Verun Rahimtoola
06/15/2021, 6:12 PMVerun Rahimtoola
06/15/2021, 6:13 PMprefect register flow --file ./test_local_storage.py
Kevin Kho
prefect register flow
is deprecated)Verun Rahimtoola
06/15/2021, 6:15 PMKevin Kho
Verun Rahimtoola
06/15/2021, 6:19 PMKevin Kho
Kevin Kho
Verun Rahimtoola
06/15/2021, 8:53 PMKevin Kho