Ray Clusters¶
You can run this notebook directly in Colab.
For this chapter you need to install the following dependencies:
In [ ]:
Copied!
! pip install "ray==2.2.0" boto3
! pip install "ray==2.2.0" boto3
To import utility files for this chapter, on Colab you will also have to clone the repo and copy the code files to the base path of the runtime:
In [ ]:
Copied!
!git clone https://github.com/maxpumperla/learning_ray
%cp -r learning_ray/notebooks/* .
!git clone https://github.com/maxpumperla/learning_ray
%cp -r learning_ray/notebooks/* .
In [ ]:
Copied!
import ray
ray.init(address="auto")
print(ray.cluster_resources())
@ray.remote
def test():
return 12
ray.get([test.remote() for i in range(12)])
import ray
ray.init(address="auto")
print(ray.cluster_resources())
@ray.remote
def test():
return 12
ray.get([test.remote() for i in range(12)])
In [ ]:
Copied!
import ray
ray.init(address="ray://localhost:10001")
print(ray.cluster_resources())
@ray.remote
def test():
return 12
ray.get([test.remote() for i in range(12)])
import ray
ray.init(address="ray://localhost:10001")
print(ray.cluster_resources())
@ray.remote
def test():
return 12
ray.get([test.remote() for i in range(12)])