How in the world can I debug this docker build fai...
# general
g
How in the world can I debug this docker build failure?
Copy code
#16 [stage-2 7/7] COPY ml/models/ml_deploy_generic/main.py /app/ml_deploy_generic/main.py
#16 ERROR: failed to calculate checksum of ref 1c414b65-2ff2-4a2a-879b-99491b158448::8rcggb0i4egs3r8zeuqyfg7ma: failed to walk /var/lib/docker/tmp/buildkit-mount2748830907/ml/models/ml_deploy_generic: lstat /var/lib/docker/tmp/buildkit-mount2748830907/ml/models/ml_deploy_generic: no such file or directory

#14 [stage-2 5/7] COPY --from=deps /opt/openai /opt/openai
#14 CANCELED
------
 > [stage-2 7/7] COPY ml/models/ml_deploy_generic/main.py /app/ml_deploy_generic/main.py:
------
Dockerfile:29
--------------------
  27 |
  28 |     #COPY ml/models/${model_name}/main.py /app/${model_name}/main.py
  29 | >>> COPY ml/models/ml_deploy_generic/main.py /app/ml_deploy_generic/main.py
  30 |
  31 |     ENV VIRTUAL_ENV=/opt/${PACKAGE_NAME}
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 1c414b65-2ff2-4a2a-879b-99491b158448::8rcggb0i4egs3r8zeuqyfg7ma: failed to walk /var/lib/docker/tmp/buildkit-mount2748830907/ml/models/ml_deploy_generic: lstat /var/lib/docker/tmp/buildkit-mount2748830907/ml/models/ml_deploy_generic: no such file or directory
pants peek:
Copy code
$ pants peek ml/models/ml_deploy_generic:docker-openai | jq ".[0].dependencies"
[
  "ml/models/ml_deploy_generic:img-deps-openai",
  "ml/models/ml_deploy_generic:img-srcs-openai",
  "ml/models/ml_deploy_generic/main.py"
]
I fixed this by adding an explicit file target instead of using python_sources. I'm curious if this is expected behavior.
b
For debugging, I would start by looking at the sandboxwhere docker is invoked and confirming that’s as you expect. (https://www.pantsbuild.org/2.19/docs/using-pants/troubleshooting-common-issues#debug-tip-inspect-the-sandbox-with---keep-sandboxes)
g
@broad-processor-92400 would you expect an explicit dependency on a python source to be included?
The docker image docks only mentions file/files explcitly
b
I don’t know
g
Thanks
I did try doing the sandboxes option and it never left it behind. I wonder if I need to use always (I was using on_failure)
n
Yes from memory it needs to be a files target
g
That is not very intuitive. I'll submit a bug request to at least warn.