I'm seeing some lag time when creating a Docker st...
# prefect-community
a
I'm seeing some lag time when creating a Docker storage object.
Copy code
INFO - prefect.Docker | Building the flow's Docker storage...
The run stays in that state for a long time before finally logging out the steps from docker build. Any suggestions on how I can troubleshoot, or produce more verbose output? Any idea what is going on that would cause a significant delay here?
n
Hi @Adam Roderick - if you start your agent with the
--verbose
flag, you'll get a lot more insight into what's happening with the Docker build step
As for what could be causing the delay, my first guess is that Docker could be hitting some resource ceilings, I'm curious what that output will be though
It could also just be a very large image
Sorry, just realized I read that wrong, you're seeing that delay when building the storage at the registration step, right?
a
☝️ yes exactly that.
flow.storage = Docker(...
then
flow.register(...
n
Ah ok, I don't think there's a good way to get insight into what's going on there; the code for that step is pretty straightforward. Which OS are you running?
a
WSL on Windows
It does have a small amount of lag normally. But nothing like this
It's Ubuntu 20.04 LTS
Could the code be downloading a large docker base image every time, rather than using the locally cached image?
Python:3.7 is the base image in my Dockerfile
n
That could be the issue but I think there's normally some pulling output if that's the case, and afaik the Python image isn't anything craz. For reference here's the build step for the Client.
Which version of Docker are you running?
a
Docker version 19.03.8, build afacb8b7f0
It looks like WSL and docker combination is slow
n
Yeah I'm just reading some of the issues on GitHub about that, sorry for the delay
Unfortunately I don't think there's much Prefect can do to speed that up (or get insight into it) 😕
a
When I run a timeit on 'from prefect.environments.storage import Docker` on windows, it takes just under 1 second
When I run the same on WSL, it takes 10-13 seconds
I know that's not a prefect issue--thanks for looking into it
n
Wow, that's stark
a
If you have any ideas now or in the future, I'm all ears
Yeah--very stark. The other imports from Prefect have no difference
n
Oh one option is to use VSCode and its Remote WSL plugin, which'll store code in the WSL filesystem
Since it seems to be a networking issue
a
That's the setup I am using
It's a great option for development. But exhibits the same behavior
n
Oh no 😧
Well it sounds like the slowness was definitely on Docker's radar at some point, seems like networking was something they were looking to solve with WSL 2 😕 wish I could be of more help here, I'll keep you posted if I come across anything from the team.
a
Thanks, I'll do the same