[serve] Clarify conda env docs (#12679)

This commit is contained in:
architkulkarni
2020-12-09 13:35:48 -06:00
committed by GitHub
parent f6241302a8
commit 6f3aacd087
+11 -5
View File
@@ -312,12 +312,18 @@ and another named ``ray-tf2`` with Ray Serve and Tensorflow 2. The Ray and
python versions must be the same in both environments. To specify
an environment for a backend to use, simply pass the environment name in to
:mod:`client.create_backend <ray.serve.api.Client.create_backend>`
as shown below. Be sure to run the script in an activated conda environment
(not required to be ``ray-tf1`` or ``ray-tf2``).
as shown below.
.. literalinclude:: ../../../python/ray/serve/examples/doc/conda_env.py
Alternatively, you may omit the argument ``env`` and call
:mod:`client.create_backend <ray.serve.api.Client.create_backend>`
from a script running in the conda environment you want the backend to run in.
.. warning::
The script must be run in an activated conda environment (not required to be
``ray-tf1`` or ``ray-tf2``). We hope to remove this restriction in the
future.
.. note::
If the argument ``env`` is omitted, backends will be started in the same
conda environment as the caller of
:mod:`client.create_backend <ray.serve.api.Client.create_backend>` by
default.