Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Download distribution version of bazel 4.2.1 (the version used in ray version 1.9.2 and current development), and apply patch to allow statically linking utilities (attached to this pagebazel-4.2.1-static-utils.patch)

Code Block
wget https://github.com/bazelbuild/bazel/releases/download/4.2.1/bazel-4.2.1-dist.zip
mkdir bazel-4.2.1-dist
cd bazel-4.2.1-dist
unzip ../bazel-4.2.1-dist.zip

patch -i ../bazel-4.2.1-static-utils.patch

bash compile.sh

Note: the patch command may not be correct for how I created the patch. This is meant as an approximate guide, so you may have to correct some things to get them to work.

3. Prepare ray build environment

We prepare another conda environment for building ray as we may need different requirements from building bazel.

Code Block
conda create python=3.8 -p ./ray_build_venv
cp ./bazel-4.2.1-dist/output/bazel ./ray_build_venv/bin

Note: I didn't note exactly what build dependencies I needed, they will be added later if found to be needed.

4. Build Ray

First, we activate gcc 9 and our ray build environment, then we can checkout ray and apply the needed patch for the stdc++fs library. (ray-fs.patch)

Code Block
conda activate ./ray_build_venv

git clone git@github.com:ray-project/ray
cd ray
git checkout ray-1.9.2

patch -i ../ray-fs.patch

cd python
python setup.py bdist_wheel

The finished wheel will be in the directory python/dist 

Once completed, we can use pip to install the ray-1.9.2 wheel in a python environment of our choice, however we must ensure gcc 9 is properly available in our environment.