Tony Yun
10/05/2021, 3:29 PMRunNamespacedJob
task. I had set the log_level='info'
option, but when it’s failed, no any logs are being sent to Prefect. Instead, I only get this from UI.
FAIL signal raised: FAIL('Job dbt-run-from-flow failed, check Kubernetes pod logs for more information.')
After going to the k8s pod, I see exception logs:
dbt ls --models tm_snowflake.* --profiles-dir=. --profile default --target dev
Encountered an error while reading profiles:
ERROR Runtime Error
Compilation Error
Could not render {{ env_var('DBT_PASSWORD') }}: Env var required but not provided: 'DBT_PASSWORD'
Encountered an error:
Runtime Error
Could not run dbt
make: *** [Makefile:6: ls] Error 2
How could I pass any logs from k8s pods to Prefect UI?Kevin Kho
ReadNamespacedPodLogs
task you have to use to pull the logsTony Yun
10/05/2021, 3:34 PMKevin Kho
Kevin Kho
Tony Yun
10/05/2021, 3:37 PMKevin Kho
Tony Yun
10/05/2021, 3:40 PMTony Yun
10/05/2021, 3:46 PMKevin Kho
Kevin Kho
Tony Yun
10/05/2021, 3:51 PMTony Yun
10/05/2021, 3:51 PMTony Yun
10/05/2021, 3:54 PMgenerateName
to generate Random k8s job names:
https://github.com/PrefectHQ/prefect/blob/8fcb9aa97d739fa25405c60cbb28b649c130bd3e/src/prefect/tasks/kubernetes/job.py#L706Tony Yun
10/05/2021, 3:54 PMKevin Kho
Kevin Kho
Kevin Kho
Tony Yun
10/05/2021, 4:00 PMTony Yun
10/05/2021, 7:16 PMKevin Kho
Tony Yun
10/06/2021, 2:48 PMKevin Kho