Hi, is there any example about how to manage depen...
# flyte-support
a
Hi, is there any example about how to manage dependencies via poetry ? I want to build a docker image containing all the dependencies installed globally via poetry (I need to lock dependencies) and register the pipeline to the cluster with the custom image (already pushed to the registry) by using
pyflyte register -p ${FLYTE_PROJECT} -d ${FLYTE_DOMAIN} ${PIPELINE_PATH} --version ${PIPELINE_VERSION} --image "${IMAGE_NAME}:${PIPELINE_VERSION}"
command. Here’s the Dockerfile
Copy code
FROM python:3.11-slim

WORKDIR /usr/app

RUN apt-get update && apt-get install -y --no-install-recommends \
    curl gnupg build-essential cmake libssl-dev

RUN curl -sSL <https://install.python-poetry.org> | POETRY_VERSION=1.7.0 POETRY_HOME=$HOME/.poetry python \
    && ln -s $HOME/.poetry/bin/poetry /usr/bin/poetry \
    # install dependencies on the python interpreter and not in the poetry virtualenv
    && poetry config virtualenvs.create false 

COPY poetry.lock .
COPY pyproject.toml .

RUN poetry install --only main --no-interaction
When the workflow is run I get a
ModuleNotFoundError: No module named 'example'
. This is my folder structure
Copy code
pipelines
│   └── src
│       ├── README.md
│       └── example
│           ├── README.md
│           ├── __init__.py
│           ├── info.json
│           ├── main.py
│           ├── poetry.lock
│           └── pyproject.toml
Pyflyte command is run from the
pipelines's
parent directory, with pip all works good. Thank you
h
@ambitious-airplane-25777, this is odd. Even though we don't support it officially, we've users who rely on poetry for packaging and they seem to be able to use it with flytekit and fast registration. @tall-lock-23197, were you using poetry in https://flyte-org.slack.com/archives/CP2HDHKE1/p1715859881072219?thread_ts=1715770992.831729&amp;cid=CP2HDHKE1 ? In the meantime, @ambitious-airplane-25777, can you open a github issue to track this?
🙏 1
t
no, i wasn't using poetry.
a
Hi @high-accountant-32689, sure I'm going to open a GitHub issue soon
🙏 1
Hi @high-accountant-32689, I just opened the a Github issue about this https://github.com/flyteorg/flyte/issues/5592
🙏 1