An introductory tutorial about leveraging Ray core features for distributed patterns.
An introductory tutorial about leveraging Ray core features for distributed patterns.
These examples have been tested in the following environments:
Using:
See the slides.pdf
file for the presentation slide deck that
accompanies this tutorial.
To get started use git
to clone this public repository:
git clone https://github.com/DerwenAI/ray_tutorial.git
cd ray_tutorial
Set up a local virtual environment and activate it:
python3 -m venv venv
source venv/bin/activate
Then use pip
to install the required dependencies:
python3 -m pip install -U pip
python3 -m pip install -r requirements.txt
python3 -m ipykernel install
Alternatively, if you use conda
for installing Python packages:
conda create -n ray_tutorial python=3.7
conda activate ray_tutorial
python3 -m pip install -r requirements.txt
conda install ipykernel --name Python3
Note: if you run into any problems on Python 3.8 with "wheels"
during a pip
installation, you may need to use the conda
approach instead.
For some of the visualizations in pi.ipynb
you also need to
install graphviz
Then launch the JupyterLab environment to run examples in this repo:
jupyter-lab
Browse to http://localhost:8888/lab to continue.
First, install docker and docker-compose, then:
docker-compose up -d
Docker compose will start a JupyterLab service without requiring use of a security token.
Browse to http://localhost:8888/lab to continue.
To stop this container:
docker-compose stop
A Guided Tour of Ray Core covers an introductory, hands-on coding tour through the core features of Ray, which provide powerful yet easy-to-use design patterns for implementing distributed systems in Python. This training includes a brief talk to provide overview of concepts, then coding for remote functions, tasks, object references and resolutions, actors, and so on.
Then we'll follow with Q&A. All code is available in notebooks in the GitHub repo.
Note: this material is not intended as an introduction to the higher level components in Ray, such as RLlib and Ray Tune.
ex_01_remo_func.ipynb
ex_02_remo_func.ipynb
ex_02_remo_objs.ipynb
ex_03_remo_meth.ipynb
ex_04_mult_pool.ipynb
ex_05_job_lib.ipynb
pi.ipynb
python-patterns