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

Conda dependencies in train stage #37

Closed
skandermoalla opened this issue Nov 30, 2022 · 5 comments
Closed

Conda dependencies in train stage #37

skandermoalla opened this issue Nov 30, 2022 · 5 comments

Comments

@skandermoalla
Copy link
Contributor

Hello,

At the moment the template supports installing dependencies withpip in the train stage specified in pip-train.requirements.txt. Is there a way to add conda dependencies as well?
Best practices are to install the conda dependencies first then the pip ones.

Thanks!

@skandermoalla
Copy link
Contributor Author

skandermoalla commented Dec 1, 2022

A related question is how to integrate a project using a environment.yml file to manage dependencies with conda and pip to the Cresset framework. I believe this could be showcased in a How to migrate from an environment.yml file section in the README.

@veritas9872
Copy link
Collaborator

Hello. This is something that I struggled with in the early days of the project. One major issue I faced was that mixing conda and pip requirements caused reproducibility and overwriting issues. Are there any packages that cannot be installed via pip? If not, the best way would be to find pip equivalents of conda packages.

@veritas9872
Copy link
Collaborator

veritas9872 commented Dec 4, 2022

@skandermoalla If there are packages only available in conda, the best method would be to add the environment.yaml file to the train-builds stage. Please take the following steps.

  1. Add environment.yaml to the .dockerignore file to allow Docker to read the environment file.
  2. Copy the environment.yaml into the Dockerfile.
  3. Assuming that the PYthon version, etc. are the same, add conda create -y environment.yaml to the line above the pip install.

However, I have not tested using conda's interactive features inside a Dockerfile and this may cause further issues. Unless the requirements are highly specific, I would recommend converting them to pip packages, though this may be an initial nuisance.

@skandermoalla
Copy link
Contributor Author

Thanks for the follow-up! I switched to having all the dependencies with pip, but I still believe Cresset would benefit from supporting conda train dependencies in thee future.

@veritas9872
Copy link
Collaborator

Installing via conda does not appear impossible, though it may encourage bad habits. I will consider implementing it as an option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants