Ahmed Ezzat
04/20/2022, 7:06 AMChris Reuter
04/20/2022, 2:10 PMJason
04/20/2022, 2:55 PMprojects
from both Python and Jupyter Notebook:
from projects.example.flows.hello_world
from projects import Config
But when I run the same import from Prefect, I get the following error:
pipenv run prefect run -m projects.example.flows.hello_world
No module named 'projects'
Constantino Schillebeeckx
04/20/2022, 3:19 PMChris Reuter
04/20/2022, 6:55 PMLeigh-Ann Friedel
04/20/2022, 7:31 PMMars
04/20/2022, 8:09 PMflow.run()
for local dev, then edit the code and switch to flow.register()
. I don’t like editing the code to switch between local dev and deployment, and it doesn’t feel like your typical Python webapp dev loop. Is there a better way to do this?Jason
04/20/2022, 8:10 PMValueError: Local Secret "AWS_ACCOUNT_ID" was not found.
Kevin Kho
04/20/2022, 8:23 PMJason
04/20/2022, 8:30 PMmarque
04/21/2022, 1:35 AMprefect deployment create
. Getting a prefect.exceptions.ObjectAlreadyExists
error. Is this expected?Ahmed Ezzat
04/21/2022, 5:11 AMRasmus Lindqvist
04/21/2022, 5:48 AMprefect agent vertex start
? Or would you recommend deploying Prefect on in another way on GCP instead?Ben Ayers-Glassey
04/21/2022, 6:04 AMprefect describe flows ...
)?
What I'm wanting to do is mark each flow with the git repo and commit from which the flow was registered.
I'm thinking of situations where a flow run fails, so you want to see the source code; but if you're in an organization with many people making their own flows in different Git repos, you may not know which repo the flow is from, and so you want a way to easily find the source for a given flow.
We've been asking people to manually add a link to the Git repo in every flow's "README" section in the Prefect Cloud UI, but as far as I can tell, you can't populate that README section via Python or commandline.Malthe Karbo
04/21/2022, 6:52 AMChris Reuter
04/21/2022, 12:32 PMKonstantin
04/21/2022, 1:57 PM51 secret = VaultSecret("/######/######/###/#####/").run()
52 File "/usr/local/lib/python3.9/site-packages/prefect/utilities/tasks.py", line 456, in method
53 return run_method(self, *args, **kwargs)
54 File "/usr/local/lib/python3.9/site-packages/prefect/tasks/secrets/vault_secret.py", line 171, in run
55 value = self._get_vault_secret(name)
56 File "/usr/local/lib/python3.9/site-packages/prefect/tasks/secrets/vault_secret.py", line 87, in _get_vault_secret
57 vault_creds = PrefectSecret(self.vault_credentials_secret).run()
58 File "/usr/local/lib/python3.9/site-packages/prefect/tasks/secrets/base.py", line 66, in run
59 return _Secret(name).get()
60 File "/usr/local/lib/python3.9/site-packages/prefect/client/secrets.py", line 140, in get
61 raise ValueError(
62 ValueError: Local Secret "VAULT_CREDENTIALS" was not found.
my code:
from prefect.tasks.secrets.vault_secret import VaultSecret
secret = VaultSecret("/######/########/###/#####/").run()Kevin Mullins
04/21/2022, 2:06 PMAKS
. I’ve been using Docker
storage for my flows and just recently started using AzureResult
in my flows for result persistence. I’ve been letting the AzureResult
use the AZURE_STORAGE_CONNECTION_STRING
environment variable which is the recommendation from the documentation and plays nicely with k8s
secrets in AKS
. Just found after some infrastructure changes that the environment variable was not being used and finally found it it was because the Docker
storage was capturing the environment variable during registration and serializing the value via cloudpickle
into the flow. I’ll be looking into using secrets; however, I wanted to suggest maybe re-visiting the documentation or process to prevent accidental credential exposures in the Docker
storage.Joshua Greenhalgh
04/21/2022, 2:20 PMPod prefect-job-18e30a61-5tnpd failed.
Container 'flow' state: terminated
Exit Code:: 1
Reason: Error
In the logs...Tom Manterfield
04/21/2022, 2:42 PMKevin Weiler
04/21/2022, 3:00 PMAhmed Ezzat
04/21/2022, 3:05 PMgather
in prefect 2.0. I'm aware that tasks return instance of PrefectFuture
what I want is a way to get finished futures as soon as it completes, keep in mind I'm talking about a list of futures not just oneJoshua Greenhalgh
04/21/2022, 3:20 PMPatrick Tan
04/21/2022, 3:43 PMJake
04/21/2022, 3:58 PMAttributeError: 'V1Job' object has no attribute 'name'
and I’m not sure what this means. Prefect cloud is reporting that No heartbeat detected from the remote task; marking the run as failed.
This is a Kubernetes Agent. I looked at the logs and here is a stack trace:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/prefect/agent/kubernetes/agent.py", line 413, in heartbeat
self.manage_jobs()
File "/usr/local/lib/python3.6/site-packages/prefect/agent/kubernetes/agent.py", line 193, in manage_jobs
ERROR:agent:Error while managing existing k8s jobs
Traceback (most recent call last):
f"Job {job.name!r} is for flow run {flow_run_id!r} "
AttributeError: 'V1Job' object has no attribute 'name'
File "/usr/local/lib/python3.6/site-packages/prefect/agent/kubernetes/agent.py", line 190, in manage_jobs
flow_run_state = self.client.get_flow_run_state(flow_run_id)
File "/usr/local/lib/python3.6/site-packages/prefect/client/client.py", line 1664, in get_flow_run_state
raise ObjectNotFoundError(f"Flow run {flow_run_id!r} not found.")
prefect.exceptions.ObjectNotFoundError: Flow run 'af8b8a74-8ed0-4417-812a-566de859ce64' not found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/prefect/agent/kubernetes/agent.py", line 413, in heartbeat
self.manage_jobs()
File "/usr/local/lib/python3.6/site-packages/prefect/agent/kubernetes/agent.py", line 193, in manage_jobs
f"Job {job.name!r} is for flow run {flow_run_id!r} "
AttributeError: 'V1Job' object has no attribute 'name'
Deleting the Agent pod did not solve the issue. Any ideas?Matthew Seligson
04/21/2022, 4:25 PMBrian Phillips
04/21/2022, 4:30 PMMatt Delacour
04/21/2022, 4:42 PMDockerFlowRunner()
for that is unclear
• I am guessing that I would need to use tags to glue any logic around our different environments (prod / adhoc). But I don't know if work-queues need to be created "manually" for each new "Repo user" (see diagram)
Also feel free to point me to a tuto explaining all the best practices to deploy Prefect 🙏Niclas Roos
04/21/2022, 5:36 PMShuchita Tripathi
04/21/2022, 6:12 PMShuchita Tripathi
04/21/2022, 6:12 PMKevin Kho
04/21/2022, 6:15 PMwith Flow(..) as flow:
a = task_a()
b = task_b(a)
The result is more about checkpointingShuchita Tripathi
04/21/2022, 6:18 PMKevin Kho
04/21/2022, 6:23 PMprint
will execute during flow build time instead of runtime so the task value isn’t there yet and you print the Task object itself.
If you print inside a task it should be right because the execution will take place during flow.run()