Compiling C++ files, packaging in container and deployment

Hello,

Can you please help share pointers on how do users compile C++ code changes present in the workspace, and package code changes in the container for deployments in Kubernetes?

CC: @Dmitri

Thanks

@sangcho @ijrsvt
In other words, how should one compile local Ray core C++ changes and build the changes into a Docker image.

I think the way you can do this is to actually clone ray, build it locally Building Ray from Source — Ray v1.4.1, and package them as a container.

ok, thanks @sangcho , I will try those steps, can you please share sample Dockerfile that I can use to add C++ code changes to the container?

I’d probably just push the change to the github or other source control systems and checkout to that branch. Is what you are looking for re-building the wheel after the container is created?

I imagine you could build the wheel locally or wherever you’d like and have a Dockerfile that copies the wheel into the container and pip installs there.

Hello,I followed the documentation, I get the below error:

Exception information:
Traceback (most recent call last):
  File "/home/asmalvan/anaconda3/envs/ray/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 180, in _main
    status = self.run(options, args)
  File "/home/asmalvan/anaconda3/envs/ray/lib/python3.7/site-packages/pip/_internal/cli/req_command.py", line 204, in wrapper
    return func(self, options, args)
  File "/home/asmalvan/anaconda3/envs/ray/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 402, in run
    pycompile=options.compile,
  File "/home/asmalvan/anaconda3/envs/ray/lib/python3.7/site-packages/pip/_internal/req/__init__.py", line 85, in install_given_reqs
    pycompile=pycompile,
  File "/home/asmalvan/anaconda3/envs/ray/lib/python3.7/site-packages/pip/_internal/req/req_install.py", line 787, in install
    unpacked_source_directory=self.unpacked_source_directory,
  File "/home/asmalvan/anaconda3/envs/ray/lib/python3.7/site-packages/pip/_internal/operations/install/editable_legacy.py", line 46, in install_editable
    cwd=unpacked_source_directory,
  File "/home/asmalvan/anaconda3/envs/ray/lib/python3.7/site-packages/pip/_internal/utils/subprocess.py", line 244, in call_subprocess
    raise InstallationSubprocessError(proc.returncode, command_desc)
pip._internal.exceptions.InstallationSubprocessError: Command errored out with exit status 1: /home/asmalvan/anaconda3/envs/ray/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/asmalvan/code/ray141/ray/python/setup.py'"'"'; __file__='"'"'/home/asmalvan/code/ray141/ray/python/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command output.
Removed build tracker: '/tmp/pip-req-tracker-u9n0vfp1'```

I am using RHEL8.4 to build

I have used ray base image to build entire ray as mentioned in documentation, I now have a build which is installed in the container:

Installed /ray/python
/home/ray/anaconda3/lib/python3.7/site-packages/setuptools/dist.py:692: UserWarning: Module Cython was already imported from /home/ray/anaconda3/lib/python3.7/site-packages/Cython/__init__.py, but /ray/python/.eggs/Cython-0.29.23-py3.7-linux-x86_64.egg is being added to sys.path
  pkg_resources.working_set.add(dist, replace=True)
/home/ray/anaconda3/lib/python3.7/site-packages/setuptools/dist.py:692: UserWarning: Module cython was already imported from /home/ray/anaconda3/lib/python3.7/site-packages/cython.py, but /ray/python/.eggs/Cython-0.29.23-py3.7-linux-x86_64.egg is being added to sys.path
  pkg_resources.working_set.add(dist, replace=True)

Successfully installed ray-2.0.0.dev0

Will try to commit this container and launch it on minikube cluster as next steps

Hello,

I managed to compile the entire ray source but still unable to see the changes deployed on the container.

  • I made few logger changes to file gcs_init_data.cc
  • Using instructions here I managed to compile Building Ray from Source — Ray v1.4.1 .cc file.
  • I made a wheel by running python setup.py bdist_wheel
  • When the created wheel is installed locally via pip install wheel-name.whl shows logger changes for gcs_init_data.cc in log file gcs_server.out
  • To deploy logger changes on the minkube, I built a new container and copied created wheel in the container.
  • The wheel is installed inside the container to be deployed by another pip install.
  • The new container when deployed onminikube does not show the logger changes that were made before building the container.

Can you please help, what I am missing here? happy to share more information

Before installing the wheel, make sure Ray is not installed in the container. That’s all I can think of at the moment.

1 Like