Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] Document how to use poetry as the python package manager #6119

Open
2 tasks done
eapolinario opened this issue Dec 19, 2024 · 1 comment
Open
2 tasks done

[Docs] Document how to use poetry as the python package manager #6119

eapolinario opened this issue Dec 19, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@eapolinario
Copy link
Contributor

eapolinario commented Dec 19, 2024

Description

https://python-poetry.org/ should be supported as a packager manager. In https://flyte-org.slack.com/archives/CP2HDHKE1/p1734613391404869?thread_ts=1734610263.071079&cid=CP2HDHKE1 a user figured out the right invocation of poetry in a dockerfile, it basically boils down to having this as the ENTRYPOINT in a docker file:

ENTRYPOINT ["poetry", "run", "--"]

We should add a full example to the docs to help poetry users run flytekit.

Dockerfile

A sample dockerfile might look something like

FROM pytorch/pytorch:2.1.2-cuda11.8-cudnn8-devel

# Install system dependencies
RUN apt-get update --fix-missing && \
    apt-get install -y git python3-pip && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# Install Python dependencies before copying the rest of the code
WORKDIR /app
COPY poetry.lock pyproject.toml /app/
RUN pip --disable-pip-version-check install "poetry==1.5.1" awscli && \
    poetry config virtualenvs.create true && \
    poetry config virtualenvs.in-project true && \
    poetry config virtualenvs.options.always-copy true && \
    poetry install --no-interaction --no-ansi

# Copy the rest of the code
COPY . /app

# Set up a generic entrypoint so we can run arbitrary commands in the poetry environment
# Pass an argument separator so that poetry doesn't consume any further argument separators
ENTRYPOINT ["poetry", "run", "--"]

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes
@eapolinario eapolinario added documentation Improvements or additions to documentation untriaged This issues has not yet been looked at by the Maintainers labels Dec 19, 2024
@eapolinario eapolinario added help wanted Extra attention is needed and removed untriaged This issues has not yet been looked at by the Maintainers labels Dec 19, 2024
@eapolinario
Copy link
Contributor Author

Let's add a new section called "package managers" and add support for pip and poetry there. pdm might next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
Status: Backlog
Development

No branches or pull requests

1 participant