flyte
flyte copied to clipboard
[BUG] failed to connect to docker daemon when building an ImageSpec for dynamic task
Describe the bug
Running the following repro code on sandbox produces a docker daemon error.
from flytekit import ImageSpec, task, dynamic
repro_img = ImageSpec(
name="repro",
apt_packages=["curl"],
packages=["flytekitplugins-envd"],
registry="localhost:30000",
)
@task(container_image=repro_img)
def foo():
print("foo")
@dynamic(container_image=repro_img)
def bar():
foo()
run via pyflyte run --remote repro.py bar
produces:
failed to run command envd build --path /tmp/flyteo_2xj3qe/local_flytekit/3380aff32c23bed8fb601083a1416478 --platform linux/amd64 --output type=image,name=localhost:30000/bowtie2:_7gw_tFHBpyC9hcIkTtvLg..,push=true with error b'error: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?\n'
Expected behavior
The execution should either fail earlier since specifying a container for dynamic tasks is likely inappropriate or should proceed through the workflow without issue.
Additional context to reproduce
No response
Screenshots
No response
Are you sure this issue hasn't been raised already?
- [X] Yes
Have you read the Code of Conduct?
- [X] Yes
The underlying issue here is that the dynamic
workflow is triggering an image build during runtime.
chatted with @kumare3, and he suggested saving the fully qualified image as a serialization setting and at execution time we use the context to use the built image (or fail fast)
We already have image config. We should have it in there. It will automatically be saved