# Unclear how to deploy ray service with working\_dir in GS bucket

**URL:** <https://discuss.ray.io/t/unclear-how-to-deploy-ray-service-with-working-dir-in-gs-bucket/9086>\
**Category:** Uncategorized\
**Created:** [January 24, 2023, 2:16am UTC](https://discuss.ray.io/t/unclear-how-to-deploy-ray-service-with-working-dir-in-gs-bucket/9086 "2023-01-24T02:16:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![uthark](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/uthark/32/3771_2.png) [@uthark](https://discuss.ray.io/u/uthark)\
**Post date:** [January 24, 2023, 2:16am UTC](https://discuss.ray.io/t/unclear-how-to-deploy-ray-service-with-working-dir-in-gs-bucket/9086/1 "2023-01-24T02:16:20Z")

</div>

Hello! I’m trying to launch ray serve task in the kubernetes cluster.  
I packaged working dir as a zip and uploaded it to the Google Cloud Storage bucket.  
I used this as a starter for my deployment [kuberay/ray-operator/config/samples/ray\_v1alpha1\_rayservice.yaml at release-0.3 · ray-project/kuberay · GitHub](https://github.com/ray-project/kuberay/blob/release-0.3/ray-operator/config/samples/ray_v1alpha1_rayservice.yaml#L14) and replaced working\_dir  
url with the path in google bucket.  
I get the error message You must `pip install smart_open` and `pip install google-cloud-storage` to fetch URIs in Google Cloud Storage bucket. But I don’t understand where this should be executed.  
I tried to add pip section into serveConfig, but it seems to be ignored

```auto
  serveConfig:
    importPath: fruit.deployment_graph
    runtimeEnv: |
      working_dir: "gs://mybucket/fruit-example.zip"
      pip:
      - google-cloud-storage==1.43.0
      - smart-open

```

Could someone please point me out what do I miss?

---

<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:** [January 24, 2023, 3:13pm UTC](https://discuss.ray.io/t/unclear-how-to-deploy-ray-service-with-working-dir-in-gs-bucket/9086/2 "2023-01-24T15:13:26Z")

</div>

Hi @uthark sorry for the poor experience here. I think the problem is that if specified in the `runtime_env`, there is no guarantee that the `pip` packages will be installed before the `working_dir` downloading happens, since those packages are installed at runtime.

Is it possible to preinstall the `pip` packages on all the cluster nodes, or somehow specify them in the container image you’re using? cc @Sihan_Wang in case you already have some direct experience with this

---

<div class="post-metadata">

**Author:** ![uthark](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/uthark/32/3771_2.png) [@uthark](https://discuss.ray.io/u/uthark)\
**Post date:** [January 24, 2023, 5:54pm UTC](https://discuss.ray.io/t/unclear-how-to-deploy-ray-service-with-working-dir-in-gs-bucket/9086/3 "2023-01-24T17:54:59Z")

</div>

Do I understand it correctly that you propose to build a new docker image on top of rayproject/ray:2.2.0-py39-gpu and add required pip packages?

---

<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:** [January 31, 2023, 12:52am UTC](https://discuss.ray.io/t/unclear-how-to-deploy-ray-service-with-working-dir-in-gs-bucket/9086/4 "2023-01-31T00:52:32Z")

</div>

Sorry for the delayed response, yes that would be my proposal. Basically, anything that allows `smart_open` and `google-cloud-storage` to be already installed before Ray is started.

---

<div class="post-metadata">

**Author:** ![saifjilani](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/saifjilani/32/4481_2.png) [@saifjilani](https://discuss.ray.io/u/saifjilani)\
**Post date:** [May 25, 2023, 8:47pm UTC](https://discuss.ray.io/t/unclear-how-to-deploy-ray-service-with-working-dir-in-gs-bucket/9086/5 "2023-05-25T20:47:00Z")

</div>

Hi, how can we pip install smart\_open and google-cloud-storage on the ray cluster before ray starts. (is there any option other than building a new docker image ontop of rayproject/ray:2.2.0-py39-gpu)

---

<div class="post-metadata">

**Author:** ![Jules\_Damji](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/jules_damji/32/4058_2.png) [@Jules\_Damji](https://discuss.ray.io/u/Jules_Damji)\
**Post date:** [May 26, 2023, 9:50pm UTC](https://discuss.ray.io/t/unclear-how-to-deploy-ray-service-with-working-dir-in-gs-bucket/9086/6 "2023-05-26T21:50:37Z")

</div>

@saifjilani You will to build a docker image atop rayproject/ray:2.2.0-py39-gpu as suggested above by @architkulkarni to @uthark response and make those part of the required pip packages.
