Andrew Decker
05/12/2022, 8:37 PMLocalStorage
and KubernetesRun
, as shown in this example. We're trying to follow the same pattern in that example, and our setup registers flows in CI via the Prefect CLI when a PR is merged into the main branch.
When doing this, the flow is actually run while building in our CI environment (in this case, I just have a print statement in the flow to verify that it's running).
Is there a recommended pattern to register flows in CI without running them?flows/ingest.py
file
# This is flows/ingest.py
...
with Flow(
name=FLOW_NAME,
storage=Local(
add_default_labels=False,
stored_as_script=True,
path="flows/ingest.py",
),
run_config=KubernetesRun(
image=f"{ECR_REGISTRY}/{IMAGE}:{IMAGE_TAG}", labels=[IMAGE, ENV, FLOW_NAME]
),
executor=LocalExecutor(),
) as flow:
print("12345 we are running the flow")
get()
, and then adds
if __name__ == "__main__":
get().run()
to the bottom of the fileAnna Geller
Andrew Decker
05/12/2022, 9:03 PMAnna Geller
Andrew Decker
05/12/2022, 9:22 PMAnna Geller
Andrew Decker
05/12/2022, 9:22 PMAnna Geller
Andrew Decker
05/12/2022, 9:22 PMAnna Geller
Andrew Decker
05/12/2022, 9:31 PMAnna Geller
export PREFECT__CLOUD__USE_LOCAL_SECRETS=true