Josh Greenhalgh
03/25/2021, 4:54 PMRunNamespacedJob
task);
How can I force it to defer trying to access the cluster until its actually running?Josh Greenhalgh
03/25/2021, 4:55 PMTraceback (most recent call last):
File "/usr/local/lib/python3.8/runpy.py", line 185, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/local/lib/python3.8/runpy.py", line 111, in _get_module_details
__import__(pkg_name)
File "/home/circleci/project/prefect_pipelines/__init__.py", line 8, in <module>
from prefect_pipelines.pod_tasks.flow import flow as pod_tasks
File "/home/circleci/project/prefect_pipelines/pod_tasks/flow.py", line 12, in <module>
make_coal_input.run()
File "/home/circleci/.cache/pypoetry/virtualenvs/prefect-pipelines-3aSsmiER-py3.8/lib/python3.8/site-packages/prefect/utilities/tasks.py", line 454, in method
return run_method(self, *args, **kwargs)
File "/home/circleci/.cache/pypoetry/virtualenvs/prefect-pipelines-3aSsmiER-py3.8/lib/python3.8/site-packages/prefect/tasks/kubernetes/job.py", line 713, in run
client.BatchV1Api, get_kubernetes_client("job", kubernetes_api_key_secret)
File "/home/circleci/.cache/pypoetry/virtualenvs/prefect-pipelines-3aSsmiER-py3.8/lib/python3.8/site-packages/prefect/utilities/kubernetes.py", line 54, in get_kubernetes_client
kubernetes_api_key = Secret(kubernetes_api_key_secret).get()
File "/home/circleci/.cache/pypoetry/virtualenvs/prefect-pipelines-3aSsmiER-py3.8/lib/python3.8/site-packages/prefect/client/secrets.py", line 131, in get
raise ValueError(
ValueError: Secrets should only be retrieved during a Flow run, not while building a Flow.
Josh Greenhalgh
03/25/2021, 4:56 PMJosh Greenhalgh
03/26/2021, 3:22 PMnicholas
Jim Crist-Harif
03/26/2021, 3:23 PMrun
method) which should never be called during registration. Perhaps you're calling run somewhere in your flow script?Josh Greenhalgh
03/26/2021, 3:25 PMmy_job = RunNamespacedJob(body=the_job_sepc)
Then import my_job
in the flow and then call my_job.run()
So I should just call my_job()
?Jim Crist-Harif
03/26/2021, 3:26 PMrun
(as that runs immediately). my_job()
would be correct, yes.Josh Greenhalgh
03/26/2021, 3:26 PM