Skip to content

Commit

Permalink
Fix pre-built installation instructions (#248)
Browse files Browse the repository at this point in the history
* Remove outdated comment about ownership handling

* Update pre-built installation instructions

* Add Getting Started documentation

* Update docs/src/getting-started.md

Co-authored-by: Glenn Moynihan <glennmoy@gmail.com>

---------

Co-authored-by: Glenn Moynihan <glennmoy@gmail.com>
  • Loading branch information
omus and glennmoy committed Jul 8, 2024
1 parent 5e7111e commit 3cabf25
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 8 deletions.
3 changes: 2 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ using Documenter
pages = ["API Documentation" => "index.md",
"Installation" => "installation.md",
"Developer Guide" => "developer-guide.md",
"Building Artifacts" => "building-artifacts.md"]
"Building Artifacts" => "building-artifacts.md"
"Getting Started" => "getting-started.md"]

makedocs(; modules=[Ray],
format=Documenter.HTML(; prettyurls=get(ENV, "CI", nothing) == "true"),
Expand Down
41 changes: 41 additions & 0 deletions docs/src/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Getting Started

To get started with using Ray.jl you'll need to start by creating a Ray cluster. You can start by creating a local cluster by using:

```sh
ray start --head
```

After that you can run your Ray application in Julia. These applications start with the following commands to connect the Julia process to the Ray cluster:

```julia
using Ray
Ray.init()
```

A trivial Ray.jl application could look like:

```julia
using Ray
Ray.init()

# Define the square task.
square = x -> x * x

# Launch four parallel square tasks. Each task returns an object reference.
refs = [Ray.submit_task(square, (i,)) for i in 0:3]

# Retrieve results.
Ray.get.(refs)
# [0, 1, 4, 9]
```

Once you have finished running Ray applications you can shut down your cluster by using:

```sh
ray stop
```

## Further Reading

The [official Ray Core documentation](https://docs.ray.io/en/latest/ray-core/walkthrough.html) is a great resource for learning more about Ray. That documentation primarily provides Python examples which use a similar syntax to that of Ray.jl. Remember that `Actor`s are not yet supported in Ray.jl.
15 changes: 11 additions & 4 deletions docs/src/installation.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Installation

Ultimately we aim to make installing Ray.jl as simple as running `Pkg.add("Ray")`. However, at the moment there are some manual steps are required to install Ray.jl. For users with machines using the Linux x86_64 or macOS aarch64 (Apple Silicon) platforms we have provided pre-built binaries for each Ray.jl release.
Ultimately we aim to make installing Ray.jl as simple as running `Pkg.add("Ray")`. However, at the moment there are some manual steps are required to install Ray.jl. For users with machines using the Linux x86_64 or macOS aarch64 (Apple Silicon) platforms we have provided pre-built binary dependencies for each Ray.jl release.

To install these dependencies and Ray.jl run the following:
Additionally, the pre-built dependencies requires you are using the following versions of Julia and Python:

- Julia 1.8 - 1.9 (Linux x86_64 / macOS aarch64)
- Python 3.7 - 3.11

To install the pre-built version of Ray.jl run:

```sh
# Install the Ray CLI
Expand All @@ -15,8 +20,10 @@ ARCH=$(uname -m)
RELEASE="ray-2.5.1+1"
pip install -U "ray[default] @ https://github.com/beacon-biosignals/ray/releases/download/$RELEASE/${RELEASE%+*}-${PYTHON}-${OS}_${ARCH}.whl" "pydantic<2"

# Install the Julia packages "ray_julia_jll" and "Ray"
TAG="v0.1.0" julia -e 'using Pkg; Pkg.add(PackageSpec(url="https://github.com/beacon-biosignals/Ray.jl", rev=ENV["TAG"]))'
ray start --head && ray stop

# Install the Ray.jl Julia package
julia -e 'using Pkg; Pkg.add(PackageSpec(url="https://github.com/beacon-biosignals/Ray.jl", rev="v0.0.4"))'
```

Users attempting to use Ray.jl on other platforms can attempt to [build the package from source](./developer-guide.md).
3 changes: 0 additions & 3 deletions src/object_ref.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ function _get_ownership_info(obj_ref::ObjectRef)
return owner_address, serialized_object_status
end

# TODO: this is not currently used pending investigation of how to properly handle ownership
# see https://github.com/beacon-biosignals/Ray.jl/issues/77#issuecomment-1717675779
# and https://github.com/beacon-biosignals/Ray.jl/pull/108
function _register_ownership(obj_ref::ObjectRef, outer_obj_ref::Union{ObjectRef,Nothing},
owner_address::ray_jll.Address,
serialized_object_status::String)
Expand Down

0 comments on commit 3cabf25

Please sign in to comment.