Skip to content

Commit 7a6d2bd

Browse files
authored
Merge pull request #3112 from pareenaverma/content_review
Tech review of flyte LP
2 parents ad8bb6c + c90f910 commit 7a6d2bd

8 files changed

Lines changed: 72 additions & 45 deletions

File tree

content/learning-paths/servers-and-cloud-computing/flyte-with-grpc/_index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
title: Build ML Workflow Pipelines with Flyte and gRPC on Google Cloud C4A Axion processors
3+
description: Learn how to build scalable machine learning workflow pipelines on Google Cloud C4A Axion processors using Flyte for workflow orchestration and gRPC for distributed service communication.
34

45
draft: true
56
cascade:
@@ -20,7 +21,7 @@ prerequisites:
2021
- A [Google Cloud Platform (GCP)](https://cloud.google.com/free) account with billing enabled
2122
- Basic familiarity with Python
2223
- Basic understanding of machine learning pipelines
23-
- Familiarity with Linux command-line operations
24+
2425

2526
author: Pareena Verma
2627

content/learning-paths/servers-and-cloud-computing/flyte-with-grpc/architecture.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ weight: 8
66
layout: learningpathall
77
---
88

9-
# ML Pipeline Architecture
10-
119
In this section, you explore the architecture behind the distributed machine learning pipeline built using Flyte and gRPC on Google Axion Arm-based infrastructure.
1210

1311
This architecture demonstrates how modern ML workflows are orchestrated using workflow engines while delegating specific tasks to distributed services.

content/learning-paths/servers-and-cloud-computing/flyte-with-grpc/background.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ In this section, you learned about:
3232
* gRPC as a communication layer for distributed services
3333
* How Flyte and gRPC can be used together to build scalable ML training pipelines
3434

35-
Next, You will deploy Flyte tools, create a gRPC-based feature engineering service, and build a distributed ML workflow pipeline that orchestrates data processing and model training tasks on Axion infrastructure.
35+
Next, you will deploy Flyte tools, create a gRPC-based feature engineering service, and build a distributed ML workflow pipeline that orchestrates data processing and model training tasks on Axion infrastructure.

content/learning-paths/servers-and-cloud-computing/flyte-with-grpc/create-grpc-service.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ weight: 5
66
layout: learningpathall
77
---
88

9-
# Create Feature Engineering gRPC Service
10-
11-
129
In modern machine learning pipelines, feature engineering is often implemented as a separate service so it can scale independently from the training workflow.
1310

1411
In this section, you create a **gRPC-based feature engineering service** that generates features used by the machine learning pipeline.
@@ -46,7 +43,7 @@ vi feature.proto
4643

4744
Add the following code.
4845

49-
```python
46+
```protobuf
5047
syntax = "proto3";
5148
5249
service FeatureService {
@@ -65,11 +62,17 @@ message FeatureResponse {
6562
This file defines the service interface used by the workflow and the feature service.
6663

6764
## Generate gRPC code
68-
Compile the protobuf file to generate Python client and server code.
6965

66+
Make sure the `flyte-env` virtual environment is active before running the following commands. If you opened a new terminal, reactivate it:
7067

71-
```python
72-
python3.11 -m grpc_tools.protoc \
68+
```bash
69+
source ~/flyte-env/bin/activate
70+
```
71+
72+
Compile the protobuf file to generate Python client and server code.
73+
74+
```bash
75+
python -m grpc_tools.protoc \
7376
-I. \
7477
--python_out=. \
7578
--grpc_python_out=. \
@@ -147,7 +150,7 @@ This service receives a value from the workflow and generates a derived feature
147150
Start the gRPC service.
148151

149152
```bash
150-
python3.11 feature_server.py
153+
python feature_server.py
151154
```
152155

153156
The output is similar to:
@@ -157,10 +160,10 @@ Feature gRPC service running on port 50051
157160

158161
## What you've learned and what's next
159162

160-
- Created a project directory for the ML workflow
161-
- Defined a gRPC service using protobuf
162-
- Generated Python client and server code
163-
- Implemented a feature engineering microservice
164-
- Started the gRPC feature service
163+
- Create a project directory for the ML workflow
164+
- Define a gRPC service using protobuf
165+
- Generate Python client and server code
166+
- Implement a feature engineering microservice
167+
- Start the gRPC feature service
165168

166169
In the next section, you will create a Flyte ML training workflow that calls this feature engineering service during pipeline execution.

content/learning-paths/servers-and-cloud-computing/flyte-with-grpc/create-ml-workflow.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ This architecture separates workflow orchestration from feature generation, allo
5353
Create the workflow file.
5454

5555
```bash
56+
cd $HOME/flyte-ml-pipeline
5657
vi workflow.py
5758
```
5859

@@ -179,4 +180,4 @@ In this section, you learned how to:
179180
- Integrate Flyte tasks with a gRPC microservice
180181
- Orchestrate ML pipeline execution
181182

182-
In the next section, you will run the co**mplete ML training pipeline and observe how Flyte interacts with the feature engineering service during workflow execution**.
183+
In the next section, you will run the complete ML training pipeline and observe how Flyte interacts with the feature engineering service during workflow execution.

content/learning-paths/servers-and-cloud-computing/flyte-with-grpc/install-flyte.md

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ python3.11 --version
5959
The output is similar to:
6060

6161
```output
62-
Python 3.11.x
62+
Python 3.11.10
6363
```
6464

6565
**Why this matters:**
@@ -68,36 +68,57 @@ Python 3.11.x
6868
- Modern workflow libraries are optimized for Python 3.11
6969
- Ensures compatibility with Flyte and gRPC libraries
7070

71-
## Install Flyte SDK
71+
## Create a virtual environment
7272

73-
Install the Flyte Python SDK used to define and execute workflows.
73+
`flytekit 1.16.15` requires `setuptools<70`, while `grpcio-tools` requires `setuptools>=77`. These constraints are mutually exclusive at the system level. A virtual environment resolves this by isolating the dependency graph from any pre-installed system packages, allowing pip to resolve all constraints together from scratch.
74+
75+
Create and activate a virtual environment:
7476

7577
```bash
76-
python3.11 -m pip install --upgrade pip
77-
python3.11 -m pip install flytekit
78+
python3.11 -m venv flyte-env
79+
source flyte-env/bin/activate
7880
```
7981

80-
**Verify installation:**
82+
Your prompt will change to show `(flyte-env)`, confirming the environment is active. All subsequent `pip install` commands in this Learning Path use this environment.
83+
84+
## Install Flyte SDK and gRPC libraries
85+
86+
With the virtual environment active, upgrade pip and install Flyte together with the gRPC communication libraries in a single step. This lets pip resolve a consistent set of versions, including `setuptools`, across all packages at once.
8187

8288
```bash
83-
python3.11 -c "import flytekit; print(flytekit.__version__)"
89+
pip install --upgrade pip
90+
pip install flytekit grpcio grpcio-tools protobuf
8491
```
8592

86-
This confirms that Flyte is correctly installed.
93+
**Verify Flyte installation:**
8794

88-
## Install gRPC libraries
95+
```bash
96+
python -c "import flytekit; print(flytekit.__version__)"
97+
```
8998

90-
Install the libraries required for communication between distributed services.
99+
The output is similar to:
100+
101+
```output
102+
1.16.15
103+
```
104+
105+
**Verify gRPC installation:**
91106

92107
```bash
93-
python3.11 -m pip install grpcio grpcio-tools protobuf
108+
python -c "import grpc; import grpc_tools; import google.protobuf; print('gRPC libraries OK')"
109+
```
110+
111+
The output is similar to:
112+
113+
```output
114+
gRPC libraries OK
94115
```
95116

96-
These libraries enable remote procedure calls between workflow tasks and microservices.
117+
This confirms that Flyte and the gRPC libraries are correctly installed and compatible within the virtual environment.
97118

98119
## Install Flyte CLI
99120

100-
Download and install the Flyte command-line tool.
121+
The Flyte CLI is a standalone binary and doesn't use pip, so you install it to the system path independently of the virtual environment.
101122

102123
```bash
103124
curl -L https://github.com/flyteorg/flytectl/releases/latest/download/flytectl_Linux_arm64.tar.gz -o flytectl.tar.gz
@@ -126,10 +147,10 @@ This confirms that the Flyte CLI is correctly installed.
126147

127148
In this section, you learned how to:
128149

129-
- Prepared a SUSE arm64 environment for ML workflow development
130-
- Installed Python 3.11 and development dependencies
131-
- Installed Flyte SDK for workflow orchestration
132-
- Installed gRPC libraries for service communication
133-
- Configured Flyte CLI tools
150+
- Prepare a SUSE arm64 environment for ML workflow development
151+
- Install Python 3.11 and development dependencies
152+
- Create a virtual environment to resolve the `setuptools` conflict between `flytekit` and `grpcio-tools`
153+
- Install Flyte SDK and gRPC libraries in a single isolated environment
154+
- Install Flyte CLI tools
134155

135156
In the next section, you will create a gRPC-based feature engineering service that will be integrated with the Flyte ML workflow pipeline.

content/learning-paths/servers-and-cloud-computing/flyte-with-grpc/instance.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ To create a virtual machine based on the C4A instance type:
2525
* Set **Series** to `C4A`.
2626
* Select `c4a-standard-4` for machine type.
2727

28-
![Screenshot of the Google Cloud Console showing the Machine configuration section. The Series dropdown is set to C4A and the machine type c4a-standard-4 is selected alt-txt#center](images/gcp-vm.png "Configuring machine type to C4A in Google Cloud Console")
28+
![Screenshot of the Google Cloud Console showing the Machine configuration section. The Series dropdown is set to C4A and the machine type c4a-standard-4 is selected#center](images/gcp-vm.png "Configuring machine type to C4A in Google Cloud Console")
2929

3030

3131
* Under **OS and storage**, select **Change**, and then choose an arm64 operating system image.
@@ -34,17 +34,16 @@ To create a virtual machine based on the C4A instance type:
3434
* Increase **Size (GB)** from **10** to **100** to allocate sufficient disk space.
3535
* Select **Choose** to apply the changes.
3636
* Under **Networking**, enable **Allow HTTP traffic** and **Allow HTTPS traffic**
37-
* Also, add the following tag: `allow-flyte-with-grpc` so this virtual machine matches the firewall rule you created in the previous section.
3837
* For some organizations not using the **'default'** network interface, you may need to select the network appropriate for your organization.
3938
* Select **Create** to launch the virtual machine.
4039

4140
After the instance starts, select **SSH** next to the VM in the instance list to open a browser-based terminal session.
4241

43-
![Google Cloud Console VM instances page displaying running instance with green checkmark and SSH button in the Connect column alt-txt#center](images/gcp-pubip-ssh.png "Connecting to a running C4A VM using SSH")
42+
![Google Cloud Console VM instances page displaying running instance with green checkmark and SSH button in the Connect column#center](images/gcp-pubip-ssh.png "Connecting to a running C4A VM using SSH")
4443

4544
A new browser window opens with a terminal connected to your VM.
4645

47-
![Browser-based SSH terminal window with black background showing Linux command prompt and Google Cloud branding at top alt-txt#center](images/gcp-shell.png "Terminal session connected to the VM")
46+
![Browser-based SSH terminal window with black background showing Linux command prompt and Google Cloud branding at top#center](images/gcp-shell.png "Terminal session connected to the VM")
4847

4948
## What you've learned and what's next
5049

content/learning-paths/servers-and-cloud-computing/flyte-with-grpc/run-ml-pipeline.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ weight: 7
66
layout: learningpathall
77
---
88

9-
# Run ML Training Pipeline
10-
119
In this section, you execute the distributed machine learning pipeline built using **Flyte and gRPC**.
1210

1311
The ML workflow will:
@@ -22,10 +20,16 @@ The feature engineering service runs independently and communicates with the wor
2220

2321
## Start the feature engineering service
2422

25-
First, start the feature engineering service that was created in the previous section.
23+
Make sure the `flyte-env` virtual environment is active. If you opened a new terminal, reactivate it:
24+
25+
```bash
26+
source ~/flyte-env/bin/activate
27+
```
28+
29+
Start the feature engineering service that was created in the previous section.
2630

2731
```bash
28-
python3.11 feature_server.py
32+
python feature_server.py
2933
```
3034

3135
The output is similar to:
@@ -46,7 +50,7 @@ cd ~/flyte-ml-pipeline
4650
**Run the workflow:**
4751

4852
```bash
49-
python3.11 workflow.py
53+
python workflow.py
5054
```
5155

5256
## Example pipeline execution output

0 commit comments

Comments
 (0)