# Documentation around runtime enivronments

**URL:** https://discuss.ray.io/t/documentation-around-runtime-enivronments/6716
**Category:** Ray Core
**Created:** [July 5, 2022, 1:41am UTC](https://discuss.ray.io/t/documentation-around-runtime-enivronments/6716 "2022-07-05T01:41:03Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Nintorac](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/nintorac/32/2590_2.png) [@Nintorac](https://discuss.ray.io/u/Nintorac)
#### Post date: [July 5, 2022, 1:41am UTC](https://discuss.ray.io/t/documentation-around-runtime-enivronments/6716/1 "2022-07-05T01:41:03Z")

</div>

**How severe does this issue affect your experience of using Ray?**

- Medium: It contributes to significant difficulty to complete my task, but I can work around it.

if i specify pip packages in the runtime\_env when/where does this get built?

I want to preinstall some larger packages and then allow users to bring their own for smaller ones, this doesn’t seem to work as the preinstalled packages get a `module not found`

From the documentation page I see these two passages which seem to contradict each other

> Runtime environments can be used on top of the prepared cluster environment from the first approach. Runtime environments also allow you to set dependencies per-task, per-actor, and per-job on a long-running Ray cluster.

> However, using runtime environments you can dynamically specify packages to be automatically downloaded and installed in an isolated virtual environment for your Ray job, or for specific Ray tasks or actors.

from [Environment Dependencies — Ray 2.8.0](https://docs.ray.io/en/latest/ray-core/handling-dependencies.html#runtime-environments)

Unless I made a mistake the second passage seems to reflect reality, however the first passage would be a nice feature if it could be implemented. Having the choice could be good.

The downside of isolated environments is that I now have to carry heavy dependencies around with the runtime env and I have seen hangs of \>30mins when trying to deploy a runtime environment with pytorch + dagster which are both fairly heavy.

If I could specify resources to build the environment that may be a happy medium.

related slack thread

> **[Slack is your productivity platform](https://ray-distributed.slack.com/?redir=%2Farchives%2FC01DLHZHRBJ%2Fp1656910046078219%3Fname%3DC01DLHZHRBJ%26perma%3D1656910046078219)**
>
> Slack is a new way to communicate with your team. It’s faster, better organized, and more secure than email.

---

<div class="post-metadata">

### Author: ![Stephanie\_Wang](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/stephanie_wang/32/18_2.png) [@Stephanie\_Wang](https://discuss.ray.io/u/Stephanie_Wang)
#### Post date: [July 5, 2022, 5:50pm UTC](https://discuss.ray.io/t/documentation-around-runtime-enivronments/6716/2 "2022-07-05T17:50:51Z")

</div>

@shrekris question about runtime\_envs

---

<div class="post-metadata">

### Author: ![architkulkarni](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/architkulkarni/32/10_2.png) [@architkulkarni](https://discuss.ray.io/u/architkulkarni)
#### Post date: [July 5, 2022, 11:32pm UTC](https://discuss.ray.io/t/documentation-around-runtime-enivronments/6716/3 "2022-07-05T23:32:49Z")

</div>

Hi @Nintorac, thanks for pointing out the doc inconsistency. Indeed, the environment is not isolated, unless you use the `"conda"` field. I’ll make a note to remove this from the docs.

In particular, you can preinstall your “heavy” dependencies on the cluster before starting Ray, either by using `setup_commands` in the Ray `cluster.yaml` ([Cluster YAML Configuration Options — Ray 1.13.0](https://docs.ray.io/en/latest/cluster/config.html)), or by making them part of your docker image.

Later, when anyone uses the `"pip"` field of `runtime_env`, those packages will be installed at runtime, but the existing “heavy” dependencies will still be importable.

Can you give more details about the `ModuleNotFound` error you saw?

---

<div class="post-metadata">

### Author: ![Nintorac](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/nintorac/32/2590_2.png) [@Nintorac](https://discuss.ray.io/u/Nintorac)
#### Post date: [July 6, 2022, 1:03am UTC](https://discuss.ray.io/t/documentation-around-runtime-enivronments/6716/4 "2022-07-06T01:03:11Z")

</div>

Ok great, thanks for the clarification around docs

> [@architkulkarni](#):
>
> Can you give more details about the `ModuleNotFound` error you saw?

I was moving quickly so likely user error. Tried to reproduce now but I am getting errors from elsewhere and about to go on break so it’s a bit of a can of worms that I’ll leave for when I get back but I’ll try to remember to update here when I get around to it
