Hello! I'm using `pyflyte run --remote ...` and ev...
# flyte-support
m
Hello! I'm using
pyflyte run --remote ...
and everything is working, but I notice that my
.flyteignore
file is not being obeyed in
--copy auto
mode, only
all
. Is this the intended behavior? The function that lists the imported files isn't being passed the ignore_group object.
Due to some legacy situations in how the project is laid out, this results in the targz being ~100MB large, as opposed to ~100kB.
t
this was the intended behavior yeah, it was assumed perhaps incorrectly that if you loaded a python file, that it would need to be included. because if not, presumably when you go to run the task, the container will attempt to load it again. and if it doesn’t find it it’ll fail
did you try verbose mode to list out all the files that it’s bundling?
m
Yeah, I'm testing things that way and by grabbing and inspecting the uploaded fast-serialized file from cloud storage. The specific issue is that my team's virtual environment folder is store directly alongside the project code, so that whole folder is packaged with
--copy auto
, typically something we've relied on ignore files to deal with. And
-v
makes is very obvious when a bunch of the file trees start with
.venv/...
. Unfortunately, all the pre-existing project tooling relies on the virtual environment being there, so moving it would be a whole project itself.
t
mind going through that logic and seeing where it’s failing for you?
m
I think I've found that
site.getsitepackages()
is returning a list of paths that combine to a
os.path.commonpath
that does not exist in the site packages list, so
if os.path.commonpath(site_packages + [mod_file]) in site_packages_set
is always false.
Copy code
>>> site.getsitepackages()
['/home/bennettrand/project/python/.venv/lib/python3.10/site-packages', '/home/bennettrand/project/python/.venv/local/lib/python3.10/dist-packages', '/home/bennettrand/project/python/.venv/lib/python3/dist-packages', '/home/bennettrand/project/python/.venv/lib/python3.10/dist-packages']
>>> os.path.commonpath(site.getsitepackages())
'/home/bennettrand/project/python/.venv'
>>> os.path.commonpath(site.getsitepackages()) in set(site.getsitepackages())
False
This change seems to make fast-serialization work as expected in my and my coworkers' environments
t
got it. would you mind making a pr out of this?
m
Yes, I can.
t
thank you thank you
m
t
thank you. if you can construct a unit test without too much time that would be much appreciated
m
According to the test I've written, it seems like my bugfix isn't working correctly in Windows. I may be able to get a proper Windows development environment running in several hours so I can debug it properly, instead of waiting for the CI to fail.
Sorry, I can't spend any more time on this PR right now, and I'm unsure why the CI is failing. (tests that are failing seem unrelated to my changes)