Aric Huang
07/07/2021, 9:55 PMFailed to load and execute Flow's environment: FileNotFoundError(2, 'No such file or directory')
error running the flow, when using the job_template_path
option for KubernetesRun. I can successfully register the flow, and when running the flow it seems to be respecting the template.yml
I passed in (I see my Kubernetes cluster running an appropriate pod based on my template) - but after pulling the image I get the FileNotFoundError
. Thoughts on what is going on? My flow basically looks like this:
with Flow("Test") as test_flow:
...
test_flow.run_config = KubernetesRun(
job_template_path="template.yml"
)
test_flow.storage = GitHub(
repo="<path>",
path="flows/test_flow.py",
access_token_secret="GITHUB_ACCESS_TOKEN"
)
Aric Huang
07/07/2021, 9:56 PMjob_template
instead of job_template_path
, the flow runs successfully. e.g.
test_flow.run_config = KubernetesRun(
job_template="""
apiVersion: batch/v1
kind: Job
spec:
template:
spec:
containers:
...
"""
)
Aric Huang
07/07/2021, 9:58 PM13:44:54
INFO
GitHub
Downloading flow from GitHub storage - repo: '<REPO>, path: 'flows/test_flow.py', ref: 'main'
13:44:55
INFO
GitHub
Flow successfully downloaded. Using commit: 5eb783e29559bb4abf88af04d9889d356df03875
13:44:57
ERROR
execute flow-run
Failed to load and execute Flow's environment: FileNotFoundError(2, 'No such file or directory')
13:45:19
ERROR
k8s-infra
Pod prefect-job-0ef90fdd-4mpx7 failed.
Container 'test_flow' state: terminated
Exit Code:: 1
Reason: Error
Kevin Kho
Kevin Kho
job_template_path
is relative to where the agent is running, which is why the example uses s3 for it.Aric Huang
07/08/2021, 5:22 PM`job_template_path (str, optional)`: Path to a job template to use. If a local path (no file scheme, or a `file`/`local` scheme), the job template will be loaded on initialization and stored on thethis seems to imply thatobject as theKubernetesRun
field. Otherwise the job template will be loaded at runtime on the agent. Supported runtime file schemes include (job_template
,s3
, andgcs
(for paths local to the runtime agent)).agent
job_template_path
should be getting converted into job_template
and stored with the run config if it's a local path, and only use a path relative to the agent if agent://
file scheme is used. is that the intended behavior? right now, it seems to be expecting the file to exist on the agent even when using a local file path.Kevin Kho
Aric Huang
07/08/2021, 5:39 PMKevin Kho
Aric Huang
07/08/2021, 7:10 PMpath=<file>.py
path for Github storage, right? if it were possible to specify additional files to include for script-based storage, that could be useful for cases like this.Kevin Kho
Aric Huang
07/09/2021, 4:49 PMKevin Kho
Kevin Kho
Aric Huang
07/09/2021, 4:59 PMAric Huang
07/09/2021, 5:35 PMwith Flow("Template") as template_flow:
task = ShellTask()
result = task(command="echo Hello World")
template_flow.run_config = KubernetesRun(
job_template_path="flows/basic_template.yaml"
)
template_flow.storage = Git(
repo="<repo>",
flow_path="flows/template_flow.py",
git_token_secret_name="GITHUB_ACCESS_TOKEN",
git_token_username="<username>",
branch_name="main",
)
Aric Huang
07/09/2021, 5:37 PM10:34:17
INFO
agent
Submitted for execution: Job prefect-job-dbd5d6a1
10:34:19
ERROR
execute flow-run
Failed to load and execute Flow's environment: FileNotFoundError(2, 'No such file or directory')
Kevin Kho