I deployed Ray on AKS using the Ray Helm chart with a custom image based on rayproject/ray:1.9.2-py38. (all images used are based on this same base image for consistency).
I want to deploy a Ray Serve endpoint using a K8S Job (I need to use Job rather than running code locally and connecting to Ray through port-forwarding because of organizational constraints). I need to include additional .py files which contain helper functions for my main.py file to run and deploy to Ray Serve. I am having difficulty here. I am open to all suggestions. I have tried to ray.init(address="ray://isc-ray-cluster-ray-head:10001", runtime_env = {"."}
as noted in the in other topics here and in the docs and indeed this seems to be make the most sense, however, I am encountering the following error message (note my āmain.pyā is actually called deploy_iris.py and yes I am deploying that olā faithfull iris model ):
Traceback (most recent call last):
File "deploy_iris.py", line 30, in <module>
ray.init(address="ray://isc-ray-cluster-ray-head:10001",
File "/home/ray/anaconda3/lib/python3.8/site-packages/ray/_private/client_mode_hook.py", line 105, in wrapper
return func(*args, **kwargs)
File "/home/ray/anaconda3/lib/python3.8/site-packages/ray/worker.py", line 775, in init
return builder.connect()
File "/home/ray/anaconda3/lib/python3.8/site-packages/ray/client_builder.py", line 151, in connect
client_info_dict = ray.util.client_connect.connect(
File "/home/ray/anaconda3/lib/python3.8/site-packages/ray/util/client_connect.py", line 33, in connect
conn = ray.connect(
File "/home/ray/anaconda3/lib/python3.8/site-packages/ray/util/client/__init__.py", line 228, in connect
conn = self.get_context().connect(*args, **kw_args)
File "/home/ray/anaconda3/lib/python3.8/site-packages/ray/util/client/__init__.py", line 88, in connect
self.client_worker._server_init(job_config, ray_init_kwargs)
File "/home/ray/anaconda3/lib/python3.8/site-packages/ray/util/client/worker.py", line 683, in _server_init
runtime_env = upload_working_dir_if_needed(
File "/home/ray/anaconda3/lib/python3.8/site-packages/ray/_private/runtime_env/working_dir.py", line 44, in upload_working_dir_if_needed
working_dir_uri = get_uri_for_directory(working_dir, excludes=excludes)
File "/home/ray/anaconda3/lib/python3.8/site-packages/ray/_private/runtime_env/packaging.py", line 322, in get_uri_for_directory
hash_val = _hash_directory(directory, directory,
File "/home/ray/anaconda3/lib/python3.8/site-packages/ray/_private/runtime_env/packaging.py", line 119, in _hash_directory
_dir_travel(root, excludes, handler, logger=logger)
File "/home/ray/anaconda3/lib/python3.8/site-packages/ray/_private/runtime_env/packaging.py", line 86, in _dir_travel
_dir_travel(sub_path, excludes, handler, logger=logger)
File "/home/ray/anaconda3/lib/python3.8/site-packages/ray/_private/runtime_env/packaging.py", line 86, in _dir_travel
_dir_travel(sub_path, excludes, handler, logger=logger)
File "/home/ray/anaconda3/lib/python3.8/site-packages/ray/_private/runtime_env/packaging.py", line 86, in _dir_travel
_dir_travel(sub_path, excludes, handler, logger=logger)
[Previous line repeated 2 more times]
File "/home/ray/anaconda3/lib/python3.8/site-packages/ray/_private/runtime_env/packaging.py", line 83, in _dir_travel
raise e
File "/home/ray/anaconda3/lib/python3.8/site-packages/ray/_private/runtime_env/packaging.py", line 80, in _dir_travel
handler(path)
File "/home/ray/anaconda3/lib/python3.8/site-packages/ray/_private/runtime_env/packaging.py", line 110, in handler
with path.open("rb") as f:
File "/home/ray/anaconda3/lib/python3.8/pathlib.py", line 1218, in open
return io.open(self, mode, buffering, encoding, errors, newline,
File "/home/ray/anaconda3/lib/python3.8/pathlib.py", line 1074, in _opener
return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/ray/anaconda3/pkgs/python-3.8.5-h7579374_1/compiler_compat/ld'
my K8S job Dockerfile is as follows:
FROM XXXX.azurecr.io/isc-ray-base:latest
COPY deploy_iris.py deploy_iris.py
COPY utils_auth.py utils_auth.py
CMD ["python", "deploy_iris.py"]
where isc-ray-base is custom image built from rayproject/ray:1.9.2-py38. but adding additional packages we need.
p.s.: brute forcing it by simply placing all my code in a single large main.py and removing the runtime_env from ray.init works as expected.
Happy to provide more details as needed! Iām not sure if this is a bug or I am not doing something correctly/missing some lines in my Dockerfile
Thank you so much in advance!