Emerson Franks
09/07/2022, 11:40 PM$ prefect deployment build health_check.py:health_check -n health_check -t kubernetes -i kubernetes-job -sb azure/logblock -o health_check_20220907 --override image=<http://recroomdataplatmdev.azurecr.io/orion-adlfs:latestfor|recroomdataplatmdev.azurecr.io/orion-adlfs:latestfor> --override namespace=aug2022 --interval=300 -q kubernetes
Traceback (most recent call last):
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "C:\repos\RecNetDP.Orchestration\flows\health_check.py", line 5, in <module>
az_block=Azure.load("logblock")
File "C:\Python310\lib\site-packages\prefect\utilities\asyncutils.py", line 198, in wrapper
raise RuntimeError(
RuntimeError: A 'sync_compatible' method was called from a context that was previously async but is now sync. The sync call must be changed to run in a worker thread to support sending the coroutine for 'load' to the main thread.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Python310\lib\site-packages\prefect\cli\_utilities.py", line 41, in wrapper
return fn(*args, **kwargs)
File "C:\Python310\lib\site-packages\prefect\utilities\asyncutils.py", line 212, in wrapper
return run_async_in_new_loop(async_fn, *args, **kwargs)
File "C:\Python310\lib\site-packages\prefect\utilities\asyncutils.py", line 141, in run_async_in_new_loop
return anyio.run(partial(__fn, *args, **kwargs))
File "C:\Python310\lib\site-packages\anyio\_core\_eventloop.py", line 70, in run
return asynclib.run(func, *args, **backend_options)
File "C:\Python310\lib\site-packages\anyio\_backends\_asyncio.py", line 292, in run
return native_run(wrapper(), debug=debug)
File "C:\Python310\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete
return future.result()
File "C:\Python310\lib\site-packages\anyio\_backends\_asyncio.py", line 287, in wrapper
return await func(*args)
File "C:\Python310\lib\site-packages\prefect\cli\deployment.py", line 494, in build
flow = prefect.utilities.importtools.import_object(entrypoint)
File "C:\Python310\lib\site-packages\prefect\utilities\importtools.py", line 193, in import_object
module = load_script_as_module(script_path)
File "C:\Python310\lib\site-packages\prefect\utilities\importtools.py", line 156, in load_script_as_module
raise ScriptError(user_exc=exc, path=path) from exc
prefect.exceptions.ScriptError: Script at 'health_check.py' encountered an exception
An exception occurred.
import prefect
from prefect import task, flow, get_run_logger
from prefect.filesystems import Azure
az_block=Azure.load("logblock")
@task
def log_platform_info():
import platform
import sys
from prefect.orion.api.server import ORION_API_VERSION
logger=get_run_logger()
<http://logger.info|logger.info>(f"Host's network name: {platform.node()}")
<http://logger.info|logger.info>(f"Python version: {platform.python_version()}")
<http://logger.info|logger.info>(f"Platform information (instance type): {platform.platform()}")
<http://logger.info|logger.info>(f"OS/Arch: {sys.platform} {platform.machine()}")
<http://logger.info|logger.info>(f"Prefect Version: {prefect.__version__}")
<http://logger.info|logger.info>(f"Prefect API Version: {ORION_API_VERSION}")
@flow
def health_check():
log_platform_info()
if __name__ == "__main__":
health_check()
prefect deployment build health_check.py:health_check -n health_check -t kubernetes -i kubernetes-job -sb azure/logblock -o health_check_20220907 --override image=${acr} --override namespace=aug2022 --interval=300 -q kubernetes
Keith
09/09/2022, 8:28 PMEmerson Franks
09/14/2022, 7:54 PMSaman
09/21/2022, 11:55 AM