Alex Welch
02/26/2021, 8:06 PMGitHub
storage? Reason for this is two-fold. Since we would be using the same block of code for just about every flow, it would help keep it semi-DRY. Second, it would allow us to pass different configs depending on environment variables (dev
vs prod
)
from prefect_utils import (
RUN_CONFIG,
STORAGE
)
flow.storage=STORAGE
flow.run_config=RUN_CONFIG
It works with the S3
storage. But when trying to use GitHub
I get the below.
Failed to load and execute Flow's environment: ModuleNotFoundError("No module named 'prefect_utils'")
The module is in the same folder as the flow (flows/
). Is this an issue because when the flow is ran it is being ran from the parent directory? thus an issue with relative paths?Alex Welch
02/26/2021, 8:19 PMS3
Storage using the below code but not on GitHub
import sys
import os
sys.path.insert(0, os.path.abspath('..'))
import prefect
from prefect import task, Flow
from flows.prefect_utils import (
RUN_CONFIG,
STORAGE
)
One guess is that when the repo is cloned it is a directory. So in the event of RepoA
after the clone, the path would be RepoA.flows.prefect_utils
, Though I’m not sure how to remedy thisAlex Welch
02/26/2021, 8:26 PMpipeline/
├─ flows/
│ ├─ __init__.py
│ ├─ my_flow.py
│ ├─ prefect_utils.py
├─ notebooks/
│ ├─ jupyter_notebook_to_run
So I guess, the first question is, between the two Storage classes, do they both start at the same place (ie. in the pipeline
directory) or does the GitHub
Storage class start one directory above the pipeline
directory?nicholas
nicholas
Alex Welch
02/26/2021, 10:01 PMAlex Welch
02/26/2021, 10:03 PMDockerRun
? or could i issue a command to do the repo cloning and then run prefect at that pointnicholas
Alex Welch
02/26/2021, 10:28 PM