Hi Metaflow, I’m wondering if there will be suppo...
# ask-metaflow
a
Hi Metaflow, I’m wondering if there will be support for
alpine
images. Our security hardening policies will be much easier to work with if we’re able to run in the alpine image
3.10.9-alpine3.17
. @wide-battery-59962 @cold-actor-8608 @quiet-waiter-82239
1
a
You should be able to use these today with the image keyword for batch and kubernetes decorator.
You can also set the image as the default image for all flows within the metaflow config.
a
@square-wire-39606 thanks for the quick reply. I have been able to get my code to work on
3.10.8-buster
and
3.10.8-bullseye
, but running
3.10.8-alpine3.17
results in this error:
2023-01-17 13:39:50.551 [1673984330327840/start/1 (pid 24157)] [pod t-66kzw-k7vvh] Task is starting (Pod is pending, Container is terminated - StartError - failed to create containerd task: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "bash": executable file not found in $PATH: unknown)...
When I replace
bash
with
sh
, I get the following error:
[2023-01-17, 13:42:25 ] {{pod_manager.py:197}} INFO - sh: metaflow_CapacityManagementTrainingFlow_linux-64_f61c1642322721c49557ef07da6e069319773a80/bin/python: not found
. Any advice here?
f
@aloof-application-80784, does you flow use
@conda
?
a
yes
f
The error message you see about ".../python not found" is caused by a missed code package inside the container. If you'd check the generated command, you could find a long shell command with tools called which are likely missed in the docker image you used. Especially with alpine images, e.g. if there is no
tar
, then a downloaded code package is not unpacked, hence no python could be found. Flows with
@conda
require even more tools IIRC, something like wget. The real error messages are hidden but you could run the same command inside docker container locally. This way I managed to debug what was missed inside my custom docker images.
Surprisingly, sometimes even smth. basic like
python
or
pip
are missed
No really alpine, but even for ubuntu based image I had to do this:
Copy code
FROM nvidia/cuda:11.3.1-runtime-ubuntu20.04

RUN apt-get update --fix-missing && \
    apt-get install -y python3 python3-pip wget && \
    apt-get clean && \
    update-alternatives --install /usr/bin/python python /usr/bin/python3 10 && \
    update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 10
a
thanks @fancy-eve-65019! i’ll test out a private docker image