Skip to content

Commit e46fd46

Browse files
committed
Updated instructions for running with Code Engine.
1 parent f914d0b commit e46fd46

File tree

2 files changed

+60
-65
lines changed

2 files changed

+60
-65
lines changed

deploy/ibm_cloud_code_engine/README.md

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,32 @@ limitations under the License.
1818

1919
# CodeFlare on IBM Cloud Code Engine
2020

21-
IBM Cloud Code Engine is a fully managed, serverless platform that runs your containerized workloads, including web apps, microservices, event-driven functions and batch jobs with run-to-completion characteristics.
21+
IBM Cloud Code Engine is a fully managed, serverless platform that runs your containerized workloads, including web apps, microservices, event-driven functions, and batch jobs with run-to-completion characteristics.
2222

23-
CodeFlare Pipelines can use IBM Cloud Code Engine to seamlessly scale pipeline on a serverless backend.
23+
CodeFlare can use IBM Cloud Code Engine to seamlessly scale pipelines on a serverless backend.
2424

25-
The following steps describe how to deploy the examples in [notebooks](./notebooks) on a serverless backend with Code Engine (they expand the steps to run Ray on Code Engine [here](https://www.ibm.com/cloud/blog/ray-on-ibm-cloud-code-engine))
25+
The following steps describe how to deploy the examples in [notebooks](https://github.com/project-codeflare/codeflare/tree/develop/notebooks) on a serverless backend with Code Engine (they expand the steps to run Ray on Code Engine [here](https://www.ibm.com/cloud/blog/ray-on-ibm-cloud-code-engine))
2626

2727
## Install pre-requisities
2828

29-
Install the pre-requisites for Code Engine and Ray
29+
Install the pre-requisites for Code Engine and Ray:
3030

3131
1. Get ready with IBM Code Engine:
3232

3333
- [Set up your Code Engine CLI](https://cloud.ibm.com/docs/codeengine?topic=codeengine-install-cli)
34-
- [Create your first Code Engine Project using the CLI](https://cloud.ibm.com/docs/codeengine?topic=codeengine-manage-project)
34+
- [optional] [Create your first Code Engine Project using the CLI](https://cloud.ibm.com/docs/codeengine?topic=codeengine-manage-project)
3535

3636
2. [Set up the Kubernetes CLI](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
3737

38-
3. Install Kubernetes (assuming Ray and Python dependcies have been installed with the steps [here](../../README.md).
38+
3. Install Kubernetes:
3939

4040
```shell
4141
pip install kubernetes
4242
```
4343

4444
## Step 1 - Define your Ray Cluster on Code Engine
4545

46-
If not already done, create a project in Code Engine:
46+
If not already done in the previous step, create a Code Engine project:
4747

4848
```shell
4949
ibmcloud ce project create -n <your project name>
@@ -52,10 +52,10 @@ ibmcloud ce project create -n <your project name>
5252
Select the Code Engine project and switch the `kubectl` context to the project:
5353

5454
```shell
55-
ibmcloud ce project select -n <your project name> -k
55+
ibmcloud ce project select -n <your project name> -k
5656
```
5757
58-
Extract the Kubernetes namespace assigned to your project. The namespace can be found in the NAME column in theoutput of the command:
58+
Extract the Kubernetes namespace assigned to your project. The namespace can be found in the `NAME` column in the output of the command:
5959
6060
```shell
6161
kubectl get namespace
@@ -67,7 +67,7 @@ Export the namespace:
6767
export NAMESPACE=<namespace from above>
6868
```
6969

70-
Update With the following command you can download a basic Ray cluster definition and customize it for your namespace:
70+
A reference Ray cluster definition can be customized for your namespace with the following commands:
7171
```shell
7272
cd ./deploy/ibm_cloud_code_engine/
7373
sed "s/NAMESPACE/$NAMESPACE/" ./example-cluster.yaml.template > ./example-cluster.yaml
@@ -76,45 +76,42 @@ sed "s/NAMESPACE/$NAMESPACE/" ./example-cluster.yaml.template > ./example-cluste
7676
This reference deployment file will create a Ray cluster with following characteristics:
7777

7878
- a cluster named example-cluster with up to 10 workers using the Kubernetes provider pointing to your Code Engine project
79-
- A head node type with 1 vCPU and 2GiB memory using the CodeFlare image codeflare:nightly
80-
- A worker node type with 1 vCPU and 2GiB memory using the ray image codeflare:nightly
79+
- A head node type with 1 vCPU and 2GB of memory using the CodeFlare image `codeflare:latest`
80+
- A worker node type with 1 vCPU and 2GB memory using the ray image `codeflare:latest`
8181
- The default startup commands to start Ray within the container and listen to the proper ports
8282
- The autoscaler upscale speed is set to 2 for quick upscaling in this short and simple demo
8383

8484
## Step 2 - Start Ray cluster
8585

86-
You can start now the Ray cluster by running
87-
```
86+
You can now start the Ray cluster by running:
87+
88+
```shell
8889
ray up example-cluster.yaml
8990
```
9091

91-
This command will create the Ray head node as Kubernetes Pod in your Code Engine project. When you create the Ray cluster for the first time, it can take up to three minutes until the Ray image is downloaded from the Ray repository.
92+
This command will create the Ray head node as Kubernetes Pod in your Code Engine project. When you create the Ray cluster for the first time, it can take few minutes until the Ray image is downloaded from the container registry.
9293

9394
## Step 3 - Run sample Pipeline with Jupyter
9495

95-
Edit the sample notebook to connect to a running Ray cluster with the command:
96-
```
97-
ray.init(address='auto', _redis_password='5241590000000000')
98-
```
96+
A Jupyter server will be automatically running on the head node. To access the server from your local machine, execute the command:
9997

100-
```
101-
ray exec example-cluster.yaml 'jupyter notebook --port=8899 <add file here>'
98+
```shell
99+
kubectl -n $NAMESPACE port-forward <ray-cluster-name> 8888:8888
102100
```
103101

104-
To foward access to the Jupyter notebook, do:
105-
```
106-
kubectl -n $NAMESPACE port-forward <ray-cluster-name> 8899:8899
107-
```
102+
You can now access the Jupyter server by pointing your browser to the following url:
108103

109-
Set up access to Jupyter notebook:
110-
< how to obtain the token >
104+
```shell
105+
http://127.0.0.1:8888/lab
106+
```
111107

112-
<!-->
113-
To access Ray dashboard, do:
108+
Once in the the Jupyer envrionment, examples are found in the `codeflare/notebooks` directory in the container image. Documentation for reference use cases can be found in [Examples](https://codeflare.readthedocs.io/en/latest/).
114109

115-
In your browser, go to:
116-
-->
110+
To execute any of the notebooks with the Ray cluster running on Code Engine, edit the `ray.init()` line with the following parameters:
117111
118-
Once in a Jupyer envrionment, refer to [notebooks](../../notebooks) for example pipeline. Documentation for reference use cases can be found in [Examples](https://codeflare.readthedocs.io/en/latest/).
112+
```python
113+
ray.init(address='auto', _redis_password='5241590000000000')
114+
```
119115
116+
This change will allow pipelines to be auto-scaled on the underlying Ray cluster running on Code Engine (up to 10 workers with the reference deployment). The number of workers and scaling parameters can be adjusted in the `yaml` file.
120117

docs/source/getting_started/starting.md

Lines changed: 31 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,32 @@ limitations under the License.
2020

2121
## CodeFlare on IBM Cloud Code Engine
2222

23-
IBM Cloud Code Engine is a fully managed, serverless platform that runs your containerized workloads, including web apps, microservices, event-driven functions and batch jobs with run-to-completion characteristics.
23+
IBM Cloud Code Engine is a fully managed, serverless platform that runs your containerized workloads, including web apps, microservices, event-driven functions, and batch jobs with run-to-completion characteristics.
2424

25-
CodeFlare Pipelines can use IBM Cloud Code Engine to seamlessly scale pipeline on a serverless backend.
25+
CodeFlare can use IBM Cloud Code Engine to seamlessly scale pipelines on a serverless backend.
2626

27-
The following steps describe how to deploy the examples in [notebooks](./notebooks) on a serverless backend with Code Engine (they expand the steps to run Ray on Code Engine [here](https://www.ibm.com/cloud/blog/ray-on-ibm-cloud-code-engine))
27+
The following steps describe how to deploy the examples in [notebooks](https://github.com/project-codeflare/codeflare/tree/develop/notebooks) on a serverless backend with Code Engine (they expand the steps to run Ray on Code Engine [here](https://www.ibm.com/cloud/blog/ray-on-ibm-cloud-code-engine))
2828

2929
### Install pre-requisities
3030

31-
Install the pre-requisites for Code Engine and Ray
31+
Install the pre-requisites for Code Engine and Ray:
3232

3333
1. Get ready with IBM Code Engine:
3434

3535
- [Set up your Code Engine CLI](https://cloud.ibm.com/docs/codeengine?topic=codeengine-install-cli)
36-
- [Create your first Code Engine Project using the CLI](https://cloud.ibm.com/docs/codeengine?topic=codeengine-manage-project)
36+
- [optional] [Create your first Code Engine Project using the CLI](https://cloud.ibm.com/docs/codeengine?topic=codeengine-manage-project)
3737

3838
2. [Set up the Kubernetes CLI](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
3939

40-
3. Install Kubernetes (assuming Ray and Python dependcies have been installed with the steps [here](../../README.md).
40+
3. Install Kubernetes:
4141

4242
```shell
4343
pip install kubernetes
4444
```
4545

4646
### Step 1 - Define your Ray Cluster on Code Engine
4747

48-
If not already done, create a project in Code Engine:
48+
If not already done in the previous step, create a Code Engine project:
4949

5050
```shell
5151
ibmcloud ce project create -n <your project name>
@@ -54,10 +54,10 @@ ibmcloud ce project create -n <your project name>
5454
Select the Code Engine project and switch the `kubectl` context to the project:
5555

5656
```shell
57-
ibmcloud ce project select -n <your project name> -k
57+
ibmcloud ce project select -n <your project name> -k
5858
```
5959
60-
Extract the Kubernetes namespace assigned to your project. The namespace can be found in the NAME column in theoutput of the command:
60+
Extract the Kubernetes namespace assigned to your project. The namespace can be found in the `NAME` column in the output of the command:
6161
6262
```shell
6363
kubectl get namespace
@@ -69,7 +69,7 @@ Export the namespace:
6969
export NAMESPACE=<namespace from above>
7070
```
7171

72-
Update With the following command you can download a basic Ray cluster definition and customize it for your namespace:
72+
A reference Ray cluster definition can be customized for your namespace with the following commands:
7373
```shell
7474
cd ./deploy/ibm_cloud_code_engine/
7575
sed "s/NAMESPACE/$NAMESPACE/" ./example-cluster.yaml.template > ./example-cluster.yaml
@@ -78,50 +78,48 @@ sed "s/NAMESPACE/$NAMESPACE/" ./example-cluster.yaml.template > ./example-cluste
7878
This reference deployment file will create a Ray cluster with following characteristics:
7979

8080
- a cluster named example-cluster with up to 10 workers using the Kubernetes provider pointing to your Code Engine project
81-
- A head node type with 1 vCPU and 2GiB memory using the CodeFlare image codeflare:nightly
82-
- A worker node type with 1 vCPU and 2GiB memory using the ray image codeflare:nightly
81+
- A head node type with 1 vCPU and 2GB of memory using the CodeFlare image `codeflare:latest`
82+
- A worker node type with 1 vCPU and 2GB memory using the ray image `codeflare:latest`
8383
- The default startup commands to start Ray within the container and listen to the proper ports
8484
- The autoscaler upscale speed is set to 2 for quick upscaling in this short and simple demo
8585

8686
### Step 2 - Start Ray cluster
8787

88-
You can start now the Ray cluster by running
89-
```
88+
You can now start the Ray cluster by running:
89+
90+
```shell
9091
ray up example-cluster.yaml
9192
```
9293

93-
This command will create the Ray head node as Kubernetes Pod in your Code Engine project. When you create the Ray cluster for the first time, it can take up to three minutes until the Ray image is downloaded from the Ray repository.
94+
This command will create the Ray head node as Kubernetes Pod in your Code Engine project. When you create the Ray cluster for the first time, it can take few minutes until the Ray image is downloaded from the container registry.
9495

9596
### Step 3 - Run sample Pipeline with Jupyter
9697

97-
Edit the sample notebook to connect to a running Ray cluster with the command:
98-
```
99-
ray.init(address='auto', _redis_password='5241590000000000')
100-
```
98+
A Jupyter server will be automatically running on the head node. To access the server from your local machine, execute the command:
10199

102-
```
103-
ray exec example-cluster.yaml 'jupyter notebook --port=8899 <add file here>'
100+
```shell
101+
kubectl -n $NAMESPACE port-forward <ray-cluster-name> 8888:8888
104102
```
105103

106-
To foward access to the Jupyter notebook, do:
107-
```
108-
kubectl -n $NAMESPACE port-forward <ray-cluster-name> 8899:8899
104+
You can now access the Jupyter server by pointing your browser to the following url:
105+
106+
```shell
107+
http://127.0.0.1:8888/lab
109108
```
110109

111-
Set up access to Jupyter notebook:
112-
< how to obtain the token >
110+
Once in the the Jupyer envrionment, examples are found in the `codeflare/notebooks` directory in the container image. Documentation for reference use cases can be found in [Examples](https://codeflare.readthedocs.io/en/latest/).
113111

114-
<!-->
115-
To access Ray dashboard, do:
112+
To execute any of the notebooks with the Ray cluster running on Code Engine, edit the `ray.init()` line with the following parameters:
116113
117-
In your browser, go to:
118-
-->
114+
```python
115+
ray.init(address='auto', _redis_password='5241590000000000')
116+
```
119117
120-
Once in a Jupyer envrionment, refer to [notebooks](../../notebooks) for example pipeline. Documentation for reference use cases can be found in [Examples](https://codeflare.readthedocs.io/en/latest/).
118+
This change will allow pipelines to be auto-scaled on the underlying Ray cluster running on Code Engine (up to 10 workers with the reference deployment). The number of workers and scaling parameters can be adjusted in the `yaml` file.
121119
122120
## CodeFlare on OpenShift Container Platform (OCP)
123121
124-
A few installation deployment targets are provided below.
122+
A few installation deployment targets are provided below:
125123
126124
- [Ray Cluster Using Operator on Openshift](#Openshift-Ray-Cluster-Operator)
127125
- [Ray Cluster on Openshift](#Openshift-Cluster)
@@ -276,4 +274,4 @@ Jupyter setup demo [Reference repository](https://github.com/erikerlandson/ray-o
276274
277275
### Running examples
278276
279-
Once in a Jupyer envrionment, refer to [notebooks](../../notebooks) for example pipeline. Documentation for reference use cases can be found in [Examples](https://codeflare.readthedocs.io/en/latest/).
277+
Once in a Jupyer envrionment, refer to [notebooks](https://github.com/project-codeflare/codeflare/tree/develop/notebooks) for example pipelines. Documentation for reference use cases can be found in [Examples](https://codeflare.readthedocs.io/en/latest/).

0 commit comments

Comments
 (0)