# Can I specify runtime env in JobSubmissionClient?

**URL:** <https://discuss.ray.io/t/can-i-specify-runtime-env-in-jobsubmissionclient/8576>\
**Category:** Ray Core\
**Created:** [December 6, 2022, 11:43pm UTC](https://discuss.ray.io/t/can-i-specify-runtime-env-in-jobsubmissionclient/8576 "2022-12-06T23:43:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allie\_Yang](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/allie_yang/32/196_2.png) [@Allie\_Yang](https://discuss.ray.io/u/Allie_Yang)\
**Post date:** [December 6, 2022, 11:43pm UTC](https://discuss.ray.io/t/can-i-specify-runtime-env-in-jobsubmissionclient/8576/1 "2022-12-06T23:43:47Z")

</div>

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

If I want to use JobSubmissionClient to submit the jobs to remote cluster, all of the jobs have the same runtime env. Instead of submit them one by one and thus the runtime env would need to be uploaded everytime (for later time, it would check the env are the same and skip upload, but it still takes lots of time) for hundreds and thousands of task, is there any way I can specify the runtime env for all jobs I am submitting, thus it only checks the env one time?

I don’t see an arg for runtime env in JobSubmissionClient

---

<div class="post-metadata">

**Author:** ![sangcho](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sangcho/32/425_2.png) [@sangcho](https://discuss.ray.io/u/sangcho)\
**Post date:** [December 8, 2022, 7:21am UTC](https://discuss.ray.io/t/can-i-specify-runtime-env-in-jobsubmissionclient/8576/2 "2022-12-08T07:21:20Z")

</div>

Maybe this one?

I also could find it from the API doc! [Python SDK API Reference — Ray 3.0.0.dev0](https://docs.ray.io/en/master/cluster/running-applications/job-submission/jobs-package-ref.html#ray.job_submission.JobSubmissionClient.submit_job)

 ![Screen Shot 2022-12-07 at 11.20.36 PM](https://us1.discourse-cdn.com/flex020/uploads/ray/original/2X/7/7399b9514468544405c51a2f1887ba1b9bea87a2.png)

---

<div class="post-metadata">

**Author:** ![Allie\_Yang](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/allie_yang/32/196_2.png) [@Allie\_Yang](https://discuss.ray.io/u/Allie_Yang)\
**Post date:** [December 8, 2022, 9:36pm UTC](https://discuss.ray.io/t/can-i-specify-runtime-env-in-jobsubmissionclient/8576/3 "2022-12-08T21:36:23Z")

</div>

Thanks, in your suggested way, if I have 100 jobs to submit, all of them have same runtime env. Then I would need to submit 100 times of runtime env, which takes significant waiting time (though it will skip uploading for the rest of the same 99 runtime env, but it takes time to check). So I am wondering if I can specify the runtime env for **ALL** the jobs I am going to submit, and just upload the runtime env 1 time for all the 100 jobs?

---

<div class="post-metadata">

**Author:** ![sangcho](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sangcho/32/425_2.png) [@sangcho](https://discuss.ray.io/u/sangcho)\
**Post date:** [December 9, 2022, 2:34am UTC](https://discuss.ray.io/t/can-i-specify-runtime-env-in-jobsubmissionclient/8576/4 "2022-12-09T02:34:01Z")

</div>

Hmm how long does it take to “time to check”? As you said, after you upload the first time, it shouldn’t re-upload the runtime env, and usually that should be sufficient for performance. cc @architkulkarni do you have good answer for ^ question?

---

<div class="post-metadata">

**Author:** ![Allie\_Yang](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/allie_yang/32/196_2.png) [@Allie\_Yang](https://discuss.ray.io/u/Allie_Yang)\
**Post date:** [December 9, 2022, 7:39pm UTC](https://discuss.ray.io/t/can-i-specify-runtime-env-in-jobsubmissionclient/8576/5 "2022-12-09T19:39:55Z")

</div>

I think it takes about roughly 5-10s per job. Usually I submit hundreds of jobs, eg 500 jobs, that’s a lot of wait time.

But I think it is running or queueing the job at the backend…so I am not really “waiting” anyway, so on a second thought, maybe this is fine 🙂

---

<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:** [December 10, 2022, 12:57am UTC](https://discuss.ray.io/t/can-i-specify-runtime-env-in-jobsubmissionclient/8576/6 "2022-12-10T00:57:56Z")

</div>

Hi @Allie_Yang , sorry you’re running into this issue. The runtime\_env should be being cached automatically. Can you share more details about which`runtime_env` you’re using? Also, do you observe the `5-10s` delay per job only when using `runtime_env`? If so, are you able to share the output of `dashboard_agent.log` or checking `runtime_env_setup-*.log`? These should give more insight into what’s going on. These logs would be located at `/tmp/ray/session_latest/logs` on the head node.

---

<div class="post-metadata">

**Author:** ![Allie\_Yang](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/allie_yang/32/196_2.png) [@Allie\_Yang](https://discuss.ray.io/u/Allie_Yang)\
**Post date:** [December 10, 2022, 7:21am UTC](https://discuss.ray.io/t/can-i-specify-runtime-env-in-jobsubmissionclient/8576/7 "2022-12-10T07:21:23Z")

</div>

Hi Archit, I think it is not delay. The job is successfully submitted into the queue. But it will repeatedly print the msg for 99 times out of 100 total job on the terminal which is not needed and make me wait for the printing to finish.

> INFO:ray.dashboard.modules.dashboard\_sdk:Package gcs://\_ray\_pkg\_33b56a5f4e84bca8.zip already exists, skipping upload.

My runtime has 90~ pip packages, a 50MB working-dir.
