Justin Liu
07/20/2021, 8:41 PMFailed to load and execute Flow's environment: ValidationError({'type': ['Unsupported value: Git']})
. This is our code, works with GitHub storage
import prefect
from prefect.storage import Git
from prefect.run_configs import ECSRun, LocalRun
from prefect import task, Flow, Parameter
from prefect.client import Secret
RUN_CONFIG = ECSRun(image='image/image',
cpu='1 vcpu', memory='2 GB')
STORAGE = Git(repo='name/repo', flow_path='path_to_this_file', git_token_secret_name='token')
@task
def say_hello():
logger = prefect.context.get("logger")
<http://logger.info|logger.info>("Hi")
with Flow("git-storage", storage=STORAGE, run_config=RUN_CONFIG) as flow:
say_hello()
Kevin Kho
Justin Liu
07/20/2021, 8:47 PMJustin Liu
07/20/2021, 8:47 PMKevin Kho
Justin Liu
07/20/2021, 8:49 PMKevin Kho
Justin Liu
07/20/2021, 8:51 PMJustin Liu
07/20/2021, 8:53 PMKevin Kho
Justin Liu
07/20/2021, 8:53 PMKevin Kho
Justin Liu
07/20/2021, 8:55 PMKevin Kho
Kevin Kho
Justin Liu
07/20/2021, 8:58 PMKevin Kho
Justin Liu
07/20/2021, 8:59 PMJustin Liu
07/20/2021, 8:59 PMJustin Liu
07/20/2021, 8:59 PMKevin Kho
Justin Liu
07/20/2021, 9:00 PMKevin Kho
Justin Liu
07/20/2021, 9:11 PMJustin Liu
07/20/2021, 9:11 PMKevin Kho
.py
files or stuff like .sql
files?Justin Liu
07/20/2021, 9:12 PMJustin Liu
07/20/2021, 9:12 PMKevin Kho
.py
, it would be better if you packaged it in the Docker container as a Python module. You might be able to get it to work with Git storage through relative imports, but it is very likely to break because having it as modules does that path handling and imports for you. Git storage is meant for more stuff like .yml
files. In this case I think Git storage downloads your repo and goes in it so if it was described with a relative path, it should work.Justin Liu
07/20/2021, 10:50 PMstream = open('test.yml', 'r')
. it said file not found basically, do you have any ideas why?Kevin Kho
.yml
. This is the second time I heard of difficulty so will take note of it. If test.yml
is in the same folder as the script, I think we can open an issue.Justin Liu
07/20/2021, 10:54 PM['lib', 'proc', 'etc', 'media', 'srv', 'usr', 'opt', 'var', 'sbin', 'dev', 'sys', 'bin', 'root', 'lib64', 'mnt', 'tmp', 'run', 'boot', 'home']
Kevin Kho
Justin Liu
07/21/2021, 4:08 PMKevin Kho
Justin Liu
07/21/2021, 4:12 PMKevin Kho
Justin Liu
07/21/2021, 4:24 PMKevin Kho
Justin Liu
07/21/2021, 4:32 PMKevin Kho
Justin Liu
07/21/2021, 7:10 PMKevin Kho
Justin Liu
07/21/2021, 7:51 PMKevin Kho
Kevin Kho
Justin Liu
07/21/2021, 10:26 PM