Hello! I'm very new to Flyte, so sorry if this is ...
# flyte-support
d
Hello! I'm very new to Flyte, so sorry if this is a very basic question. I have set up flyte locally with a mini-cluster with - flytectl demo start This works well when trying simple flyte runs. However, when I try to use my own custom image, I seem to mess something up. I upload my built image to my local docker registry and then try to run
Copy code
pyflyte run --remote --image localhost:30000/image/test-image:latest test_file.py run_test
Flyte finds the image, but can't find my test_file.py within the image. I get
Copy code
ModuleNotFoundError: No module named 'test_file'
whenever I try to run it. It works without the --image flag, but whenever I try to use my custom image it fails. If I run
Copy code
pyflyte run test_file.py run_test
within the image it works out of the box without needing to modify any envs/change folder. I'm not sure if I missed something or missunderstood how I'm supposed to work with custom images. My custom docker-image in my latest test is just mimicing the behaviour of https://github.com/flyteorg/flytesnacks/blob/master/examples/basics/Dockerfile
s
you may need to set PYTHONPATH=/root in your image or follow the following snippet as flyte expects you to be in the /root directory which may be the problem
Copy code
@task(container_image="localhost:30000/esmfold:latest", environment={"PYTHONPATH": "/root"}, requests=Resources(cpu="7", mem="28Gi"))
def run_esmfold(sequences: list[str]) -> list[FlyteFile]:
    ...
thx 3
🙌🏽 1
d
Thanks! Will try that out tomorrow!
t
let us know if setting the pythonpath doesn’t work magnus.
d
It worked, thanks!
With this in mind, does the pods running Flyte tasks need to have root access then within the container? Or can that be avoided somehow?
Nvm my last question, I could just force it to another folder.
t
the default image doesn’t have root access actually https://github.com/flyteorg/flytekit/blob/master/Dockerfile
112 Views