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

[Contribution Request] pf cli - extend the pf flow build command to support different python versions #3830

Open
lealgamb opened this issue Oct 23, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@lealgamb
Copy link

lealgamb commented Oct 23, 2024

Is your contribution request related to a problem? Please describe.
Yes. We are using the pf flow build command to deploy our flow as an app service. The generated Dockerfile uses Python 3.9, but some of our flow's requirements (e.g., semantic-kernel==1.11.0) need Python 3.10 or above. We need a way to specify the Python version in the Dockerfile.

Detail the functionality and value.
The contribution will allow users to specify the Python version in the Dockerfile generated by the pf flow build command. This can be achieved by accepting a conda YAML file instead of a requirements.txt file, similar to how AzureML supports specifying the Python version for environments. This enhancement will provide greater flexibility and ensure compatibility with dependencies that require newer Python versions.

Additional context
Here is the current Dockerfile that is generated for reference:

# syntax=docker/dockerfile:1
FROM docker.io/continuumio/miniconda3:latest

WORKDIR /

COPY ./flow/requirements.txt /flow/requirements.txt

# gcc is for build psutil in MacOS
RUN apt-get update && apt-get install -y runit gcc

# create conda environment
RUN conda create -n promptflow-serve python=3.9.16 pip=23.0.1 -q -y && \
    conda run -n promptflow-serve \
    pip install -r /flow/requirements.txt && \
    conda run -n promptflow-serve pip install keyrings.alt && \
    conda run -n promptflow-serve pip install gunicorn==20.1.0 && \
    conda run -n promptflow-serve pip install 'uvicorn>=0.27.0,<1.0.0' && \
    conda run -n promptflow-serve pip cache purge && \
    conda clean -a -y

COPY ./flow /flow

EXPOSE 8080

COPY ./connections /connections

# reset runsvdir
RUN rm -rf /var/runit
COPY ./runit /var/runit
# grant permission
RUN chmod -R +x /var/runit

COPY ./start.sh /
CMD ["bash", "./start.sh"]

Here is a sample conda_dependencies.yml for reference that we use in other AzureML processes:

name: custom_env 
dependencies:
- python=3.10
- pip

- pip:
  - semantic-kernel==1.11.0
  - ...
@lealgamb lealgamb added the enhancement New feature or request label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant