Azure-docs: Perhaps provide `environment.yml` file for Conda setup

Created on 1 Feb 2019  Â·  7Comments  Â·  Source: MicrosoftDocs/azure-docs

Since a few of the steps in this configuration guide is about the setup for the Conda environment, and manual configuration is always coupled with some risks of error, wouldn't it be a good idea to provide an environment.yml file for the setup?

The file would of cuourse include the necessary version of python as well as the necessary packages and minimize the risk for error. Additional packages could be added either after environment creation using conda install <package> or by modifying the environment.yml file. It would of course also be an easy way to keep the environment updated across teams, since the file could be included in the VCS of the project(s).


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

assigned-to-author doc-enhancement machine-learninsvc triaged

All 7 comments

@ArvidBaa Thanks for the feedback! We are currently investigating and will update you shortly.

@rastala Hi Roope, is possible for us to provide environmental doc for our customer? Thanks.

@YutongTie-MSFT - #please-assign to trevorbye

@ArvidBaa we likely will not provide an env.yml file in this documentation, because it is a simple environment where we are only specifying a Python version and an install of the SDK, both of which can be flexible. We also have multiple ways to install with pip extras so if we provide a .yml file it may not work for everyone's use case. However, I see your point of being able to duplicate your environments as they become more complicated.

The SDK has a class for working with Conda envs, and you can write them to .yml very easily so you don't have to do it manually. Here is a code example that will write an environment file to the current dir:

from azureml.core.conda_dependencies import CondaDependencies

env = CondaDependencies()
env.set_python_version("3.6.5")

env.add_pip_package("azureml-sdk")
env.add_conda_package("scikit-learn")
env.add_pip_package("nltk==3.2.5")

with open("env_test.yml", "w") as f:
    f.write(env.serialize_to_string())

You can also use CondaDependencies objects with many other functions in the SDK, so it becomes easy to replicate environments in compute targets, images, etc.

Here is the ref link for the class: https://docs.microsoft.com/en-us/python/api/azureml-core/azureml.core.conda_dependencies.condadependencies?view=azure-ml-py

@trevorbye that is probably the best way, all things considered. Thank you!

@ArvidBaa - If this is good and completes your issue, #please-close.

@j-martens, I am happy with the answer!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

spottedmahn picture spottedmahn  Â·  3Comments

Agazoth picture Agazoth  Â·  3Comments

JamesDLD picture JamesDLD  Â·  3Comments

Ponant picture Ponant  Â·  3Comments

paulmarshall picture paulmarshall  Â·  3Comments