metaflow icon indicating copy to clipboard operation
metaflow copied to clipboard

Fix code packaging when the flow file is in the root directory

Open savingoyal opened this issue 4 years ago • 3 comments

From Darshan Patel on Metaflow Slack -

hey team, I'm getting an error while running a flow on AWS Batch. Metaflow is able to create a batch job definition and kicks a run on Batch but on the batch agent I'm getting following error. do you know what can cause this error?

Setting up task environment.
Downloading code package...
Code package downloaded.
Task is starting.
python: can't open file 'test.py': [Errno 2] No such file or directory

savingoyal avatar Feb 09 '22 04:02 savingoyal

@savingoyal my team encountered this error when running metaflow within a poetry environment on Ubuntu. We tracked down the problem to this line. On Ubuntu, poetry managed virtual environments are stored at: /home/ubuntu/.cache/pypoetry/virtualenvs/. The flow we are calling is part of a shared generic training library we use to easily configure and launch training jobs either locally or on batch. However since metaflow is ignoring "hidden" paths when constructing the tarball and the flow we are calling is stored within a package inside a hidden poetry path, the flow isn't getting added to the tarball. Do you have any advice on how to handle this? There is the exclude_hidden flag in the walk function, but that isn't exposed to the user. Else I'm thinking it could be a good idea to add some extra logic to make sure the flow is added to the tarball no matter what. Thanks!

elliott-imhoff avatar Mar 08 '23 18:03 elliott-imhoff

We ended up solving this issue by having our training library copy the flow to a non-hidden tempdir before calling it. Kinda hacky but works

elliott-imhoff avatar Mar 10 '23 20:03 elliott-imhoff

Apparently the walk function was ignoring my experimentation folder .scrap where my flow was. 6 hours of debugging.

git commit -m "sui**de"

mormoassaf avatar Aug 28 '24 17:08 mormoassaf