Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ray - yagna & websocat as pip dependencies #139

Merged
merged 7 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/markdoc/partials/ray/installation-alert.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% alert level="info" %}
**Note:** As an added convenience, the installation of `ray-on-golem` ensures that both `ray` and `yagna` are set up for you. With these components in place, you're well-prepared to harness the full potential of Ray on the Golem Network.
{% /alert %}
14 changes: 2 additions & 12 deletions src/markdoc/partials/ray/quickstart.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@

# QuickStart

This quickstart shows you how to set Ray and Ray on Golem up, start your cluster, test it, and then stop it.
It limits the explanation to the bare minimum - if you are looking for more details jump to [setup tutorial](/docs/creators/ray/setup-tutorial)


## Install software

{% partial file="ray/recommend-venv.md" /%}
Expand All @@ -16,21 +14,13 @@ The first step is installing Ray on Golem. It will install Ray as a dependency.
pip3 install -U ray-on-golem
```

For now, you also need to download and install the Golem node software which is essential for connecting to the Golem network.

```bash
# install yagna - golem network daemon
curl -sSf https://join.golem.network/as-requestor | bash -
```

{% partial file="ray/websocat-requirement.md" /%}
{% partial file="ray/installation-alert.md" /%}

## Set the cluster up

With the packages in place, you can download our sample golem cluster configuration yaml, and use it with `ray up` to start up the cluster.
It will give you a cluster of one node (which will expand when you feed it with work) on the Golem test network (free, but not very powerful)


```bash
# Download the golem-cluster.yaml
wget https://github.com/golemfactory/ray-on-golem/raw/main/golem-cluster.yaml
Expand Down Expand Up @@ -59,11 +49,11 @@ ray down golem-cluster.yaml --yes
## Summary

By completing the above quickstart you have successfully:

- Installed ray and ray-on-golem packages
- Downloaded the example golem cluster yaml and the example ray application
- Started up the Ray on Golem cluster
- Run the app on your local computer and then on the cluster
- Stopped the cluster

Congratulations!

12 changes: 0 additions & 12 deletions src/markdoc/partials/ray/websocat-requirement.md

This file was deleted.

1 change: 0 additions & 1 deletion src/pages/docs/creators/ray/concept.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ The beauty of the solution is that you can run the app locally, and when you are
## What do you need

To use Ray on Golem, you need to install the Ray framework and Ray on Golem cluster manager.
For the time being, you also need to download Yagna - a Golem daemon facilitating communication with the Golem network.

When you have the software installed, you need a cluster configuration yaml file. We provide an example yaml, which contains everything needed to start up a small, free cluster running on the Golem test network.

Expand Down
73 changes: 43 additions & 30 deletions src/pages/docs/creators/ray/conversion-to-ray-on-golem-tutorial.md

Large diffs are not rendered by default.

16 changes: 3 additions & 13 deletions src/pages/docs/creators/ray/setup-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To start a Ray cluster on Golem, you will use the Ray cluster launcher with the

{% partial file="ray/recommend-venv.md" /%}

The Ray cluster launcher is part of the Ray CLI. Use the CLI to start and stop a ray cluster using commands such as `ray up` and `ray down`.
The Ray cluster launcher is part of the Ray CLI. Use the CLI to start and stop a Ray cluster using commands such as `ray up` and `ray down`.
You can use pip to install the Ray CLI with cluster launcher support.

You need to download the Golem cluster manager, which enables Ray to utilize the Golem network nodes.
Expand All @@ -28,17 +28,7 @@ It will install the default ray package as a dependency, but if you want more Ra
pip3 install -U ray-on-golem
```

{% partial file="ray/websocat-requirement.md" /%}

## Install yagna (Golem daemon used to schedule work on the Golem Network)

For now, you need to manually install Yagna to be able to connect to the Golem network.
Later on, we will make the installation happen behind the scenes.

```bash
# install yagna - golem network daemon
curl -sSf https://join.golem.network/as-requestor | bash -
```
{% partial file="ray/installation-alert.md" /%}

## Start Ray with the Ray cluster launcher

Expand All @@ -53,7 +43,7 @@ The command to start the cluster is `ray up`:
wget https://github.com/golemfactory/ray-on-golem/raw/main/golem-cluster.yaml

# In this command:
# * Yagna starts in the background (if not running)
# * yagna starts in the background (if not running)
# * ray-on-golem cluster manager starts in the background
# * ray head node is started on a golem provider
ray up golem-cluster.yaml --yes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,8 @@ We have tested Ray on Golem on Ubuntu and WSL, but it should work on other Linux
Ray on Golem image contains only the basic Python libraries.

If you need any dependencies in your Ray app,
you can use `pip` via [cluster yaml `initialization_commands`](https://golem-docs-git-mateusz-ray-on-golem-pre-alpha-golem.vercel.app/docs/creators/ray/cluster-yaml-reference#initializationcommands)
you can use `pip` via [cluster yaml `initialization_commands`](/docs/creators/ray/cluster-yaml-reference#initializationcommands)

You can also instruct Ray on Golem to use the needed libraries during execution by passing the `runtime_env` parameter to `ray.init()`.
It is demonstrated for example in [this tutorial](/docs/creators/ray/conversion-to-ray-on-golem-tutorial#passendplaylibraryrequirementtoray).

## Websocat

{% partial file="ray/websocat-requirement.md" /%}