Skip to content

Commit cf22492

Browse files
first pass of storefront on GKE
1 parent caeef46 commit cf22492

9 files changed

Lines changed: 76 additions & 74 deletions

File tree

content/learning-paths/servers-and-cloud-computing/storefront-ai-assistant-gke-axion/_index.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
---
2-
title: Build a mixed-placement AI shopping assistant on GKE with Axion
3-
4-
draft: true
5-
cascade:
6-
draft: true
2+
title: Build a mixed-placement AI shopping assistant on Google Kubernetes Engine with Axion-based compute
73

84
minutes_to_complete: 120
95
description: Deploy and validate an Online Boutique storefront on GKE, add an AI shopping assistant, and compare N4A and C4A placement for the assistant tier.
10-
who_is_this_for: This is an advanced topic for cloud developers, platform engineers, and site reliability engineers who run applications on Google Kubernetes Engine and want to place application tiers on the Axion-based machine series that fits each workload.
6+
who_is_this_for: This is an advanced topic for cloud developers, platform engineers, and site reliability engineers who run applications on Google Kubernetes Engine (GKE) and want to place application tiers on the Axion-based machine series that fits each workload.
117

128
learning_objectives:
139
- Create and validate an Online Boutique storefront on an N4A node pool
@@ -18,7 +14,7 @@ learning_objectives:
1814
prerequisites:
1915
- A [Google Cloud account](https://console.cloud.google.com/) with billing enabled
2016
- Access to a [GKE Standard cluster with Arm node pools](https://cloud.google.com/kubernetes-engine/docs/how-to/create-arm-clusters-nodes), including N4A and C4A node pools
21-
- Basic familiarity with Docker, Kubernetes, Kustomize, and Google Kubernetes Engine
17+
- Basic familiarity with Docker, Kubernetes, Kustomize, and GKE
2218

2319
author:
2420
- Rani Chowdary Mandepudi

content/learning-paths/servers-and-cloud-computing/storefront-ai-assistant-gke-axion/background.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,29 @@ layout: "learningpathall"
99

1010
Modern AI applications often contain more than one workload shape. For example, a storefront is steady, service-oriented, and always on. An AI assistant is burstier and more latency-sensitive because it runs only when users ask for help.
1111

12-
This Learning Path uses that split in a live Online Boutique storefront on Google Kubernetes Engine (GKE). The storefront starts on N4A nodes powered by Google Axion processors and Arm Neoverse N3. You add the missing `shoppingassistantservice`, run it on N4A first, and then move only that assistant tier to C4A nodes powered by Google Axion and Arm Neoverse V2.
12+
You'll use this split in a live Online Boutique storefront on Google Kubernetes Engine (GKE). The storefront starts on N4A nodes powered by Google Axion processors and Arm Neoverse N3. You'll add the missing `shoppingassistantservice`, run it on N4A first, and then move only that assistant tier to C4A nodes powered by Google Axion and Arm Neoverse V2.
1313

14-
The goal isn't to prove that one Axion-based machine series replaces the other. You use N4A for the steady storefront tier and evaluate C4A for the AI reasoning tier so you can decide which machine series fits each workload.
14+
The goal isn't to prove that one Axion-based machine series replaces the other. You'll use N4A for the steady storefront tier and evaluate C4A for the AI reasoning tier so you can decide which machine series fits each workload.
1515

1616
![Architecture diagram showing the existing multi-architecture storefront image workflow and the final GKE placement on Axion. Core storefront services run on N4A, while the shopping assistant, Ollama sidecar, and Gemma model run together on C4A and call the live cart and catalog services.#center](images/mixed-placement-agentic-storefront-on-axion.webp "Mixed-placement agentic storefront on Axion")
1717

18-
The diagram shows the final mixed-placement pattern you build toward. Its left side summarizes the multi-architecture image publishing process used for the existing storefront images; you don't repeat that process here. The assistant image you build later targets only `linux/arm64` because both destination node pools are Arm-based. The right side shows the final placement: core services remain on N4A while the assistant, its Ollama sidecar, and the Gemma model move together to C4A.
18+
The diagram shows the final mixed-placement pattern you'll build toward. Its left side summarizes the multi-architecture image publishing process used for the existing storefront images; you don't repeat that process here. The assistant image you'll build later targets only `linux/arm64` because both destination node pools are Arm-based. The right side shows the final placement: core services remain on N4A while the assistant, its Ollama sidecar, and the Gemma model move together to C4A.
1919

2020
## How the storefront already runs on Arm
2121

2222
The storefront baseline uses container images that can run on Arm nodes. A common way to publish portable container images is to use a multi-architecture image, which is one image reference that contains variants for more than one CPU architecture, such as `linux/amd64` and `linux/arm64`.
2323

24-
When Kubernetes schedules a pod that uses a multi-architecture image on an Arm node, the container runtime pulls the Arm-compatible variant from the same image reference. That is why the storefront can already run on Axion nodes before you build the assistant image.
24+
When Kubernetes schedules a pod that uses a multi-architecture image on an Arm node, the container runtime pulls the Arm-compatible variant from the same image reference. That's why the storefront can already run on Axion nodes before you build the assistant image.
2525

26-
This Learning Path starts with Arm-compatible storefront images already available. To learn the full build-and-publish workflow for multi-architecture images on GKE, see [Migrate x86 workloads to Arm on Google Kubernetes Engine with Axion processors](/learning-paths/servers-and-cloud-computing/gke-multi-arch-axion/).
26+
You'll start with Arm-compatible storefront images already available. To learn the full build-and-publish workflow for multi-architecture images on GKE, see [Migrate x86 workloads to Arm on Google Kubernetes Engine with Axion processors](/learning-paths/servers-and-cloud-computing/gke-multi-arch-axion/).
2727

28-
One image reference can therefore contain an Arm-compatible variant. You confirm the storefront image reference from the source tree after you set up your tools and cluster access.
28+
One image reference can therefore contain an Arm-compatible variant. You'll confirm the storefront image reference from the source tree after you set up your tools and cluster access.
2929

3030
## How assistant requests flow
3131

32-
The `shoppingassistantservice` is the AI layer for the application. It runs as its own Kubernetes service and handles requests sent through the storefront frontend. When a shopper uses the assistant, the request follows this path:
32+
The `shoppingassistantservice` is the AI layer for the application. It runs as its own Kubernetes service and handles requests sent through the storefront frontend.
33+
34+
When a shopper uses the assistant, the request follows this path:
3335

3436
1. The browser sends the request to `frontend`.
3537
2. `frontend` forwards the request to `shoppingassistantservice`.
@@ -43,5 +45,8 @@ The `search_catalog` and `get_product_details` tools query the live catalog. The
4345

4446
This design keeps the placement comparison focused. You don't add a separate vector database, retrieval pipeline, or hosted large language model API. When you move the assistant pod, you move the assistant logic and local reasoning runtime together as one AI tier.
4547

48+
## What you've learned and what's next
49+
50+
You've now understood the architecture of the storefront application and its AI assistant.
4651

47-
In the next section, you'll set up environment variables, connect to the GKE cluster, and clone the source tree that contains the assistant implementation.
52+
Next, you'll set up environment variables, connect to the GKE cluster, and clone the source tree that contains the assistant implementation.

content/learning-paths/servers-and-cloud-computing/storefront-ai-assistant-gke-axion/build-assistant-image.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ layout: "learningpathall"
77

88
## Build one Arm image for both Axion placements
99

10-
Both the N4A and C4A node pools in this Learning Path use Arm-based Google Axion processors. You only need one `linux/arm64` assistant image, and that image can run in either placement.
10+
You need only one `linux/arm64` assistant image for both the N4A and C4A pools, and that image can run in either placement.
1111

1212
{{% notice Note %}}
1313
This is an Arm-targeted build for Axion, not a full multi-architecture build. A multi-architecture image is useful when the same tag must support non-Arm environments such as `linux/amd64`.
@@ -46,10 +46,10 @@ List the tags for the assistant image:
4646
gcloud artifacts docker tags list "${ASSISTANT_IMAGE_REPO}"
4747
```
4848

49-
The output should include the `lab-v1` tag.
49+
The output includes the `lab-v1` tag.
5050

51-
## What you've accomplished
51+
## What you've accomplished and what's next
5252

53-
You've built and published an Arm image for the shopping assistant. Kubernetes can now pull this image when you deploy the assistant on N4A.
53+
You've now built and published an Arm image for the shopping assistant. Kubernetes can now pull this image when you deploy the assistant on N4A.
5454

5555
Next, you'll create the N4A overlay and add the assistant to the running storefront.

content/learning-paths/servers-and-cloud-computing/storefront-ai-assistant-gke-axion/deploy-assistant-n4a.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export FRONTEND_IP="$(kubectl get service frontend-external \
1818
export APP_URL="http://${FRONTEND_IP}"
1919
```
2020

21-
The `storefront-n4a` overlay already places every deployment on N4A. Extend it with the assistant component and the image you pushed. The existing `node-selector.yaml` patch then applies the same placement to the assistant deployment.
21+
The `storefront-n4a` overlay already places every deployment on N4A. Extend it with the assistant component and the image you pushed. The existing `node-selector.yaml` patch then applies the same placement to the assistant deployment:
2222

2323
```bash
2424
cat <<EOF > kustomize/overlays/storefront-n4a/kustomization.yaml
@@ -49,7 +49,7 @@ sed -n '1,120p' kustomize/overlays/storefront-n4a/node-selector.yaml
4949
kubectl kustomize kustomize/overlays/storefront-n4a | sed -n '1,240p'
5050
```
5151

52-
Do not apply the overlay if the rendered manifest has an empty image name, image tag, or node-pool value.
52+
Don't apply the overlay if the rendered manifest has an empty image name, image tag, or node-pool value.
5353

5454
## Apply the overlay
5555

@@ -62,7 +62,7 @@ kubectl rollout status deployment/shoppingassistantservice --timeout=1200s
6262
```
6363

6464
{{% notice Note %}}
65-
`kubectl apply -k` reapplies the full rendered application state. It is normal to see existing deployments reported as `configured`. The `shopping-assistant` component patches `frontend`, so a frontend rollout is expected.
65+
`kubectl apply -k` reapplies the full rendered application state. It's normal to see existing deployments reported as `configured`. The `shopping-assistant` component patches `frontend`, so a frontend rollout is expected.
6666
{{% /notice %}}
6767

6868
## Confirm pod placement
@@ -121,7 +121,7 @@ for i in {1..12}; do
121121
done
122122
```
123123

124-
The JSON response should include a non-empty assistant message. The exact product names can vary, but the response should be grounded in the live product catalog.
124+
The JSON response includes a non-empty assistant message. The exact product names can vary, but the response is grounded in the live product catalog.
125125

126126
## Try the browser flow
127127

@@ -138,8 +138,8 @@ What is in my cart now?
138138

139139
The assistant should recommend a catalog item, ask for confirmation before changing the cart, and then show the cart contents.
140140

141-
## What you've accomplished
141+
## What you've accomplished and what's next
142142

143-
You've deployed the assistant on N4A and validated it through the same storefront path that a shopper uses.
143+
You've now deployed the assistant on N4A and validated it through the same storefront path that a shopper uses.
144144

145145
Next, you'll observe the assistant as a live workload and capture the N4A benchmark baseline.

content/learning-paths/servers-and-cloud-computing/storefront-ai-assistant-gke-axion/move-assistant-c4a.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ sed -n '1,140p' kustomize/overlays/assistant-c4a/shoppingassistant-c4a.yaml
8484
kubectl kustomize kustomize/overlays/assistant-c4a | sed -n '1,240p'
8585
```
8686

87-
Do not continue if `newName`, `newTag`, or either node-pool value is blank.
87+
Don't continue if `newName`, `newTag`, or either node-pool value is blank.
8888

8989
{{% notice Note %}}
9090
The first patch keeps the storefront on N4A by default. The second patch overrides only `shoppingassistantservice` and moves that deployment to C4A.
@@ -107,7 +107,7 @@ kubectl get pods -o wide | grep -E 'frontend|shoppingassistantservice'
107107
kubectl get nodes -L cloud.google.com/gke-nodepool,node.kubernetes.io/instance-type,kubernetes.io/arch
108108
```
109109

110-
The frontend should remain on N4A, and `shoppingassistantservice` should now run on C4A.
110+
The frontend remains on N4A, and `shoppingassistantservice` now runs on C4A.
111111

112112
## Warm the assistant on C4A
113113

@@ -129,7 +129,7 @@ for i in {1..12}; do
129129
done
130130
```
131131

132-
The response should contain a non-empty message.
132+
The response contains a non-empty message.
133133

134134
## Run the fixed C4A benchmark
135135

@@ -158,7 +158,7 @@ Print the C4A summary line:
158158
grep 'SUMMARY_JSON' workshop/fixed-c4a-summary.log
159159
```
160160

161-
The summary should show successful requests and the assistant running on the C4A node pool. Do not compare the runs if the summary line is missing or reports a different node pool.
161+
The summary shows successful requests and the assistant running on the C4A node pool. Don't compare the runs if the summary line is missing or reports a different node pool.
162162

163163
## Compare the two runs
164164

@@ -187,7 +187,7 @@ Your numbers can vary by prompt mix, model warmup state, node pressure, and clus
187187
Assistant CPU values come from sampled Kubernetes telemetry. Short bursts can be underrepresented, especially on faster runs. Treat request success, benchmark duration, and latency as the primary comparison signals.
188188
{{% /notice %}}
189189

190-
## Explain the result
190+
## Understand the result
191191

192192
You changed one architectural variable: the placement of the assistant. The storefront tier, prompts, model, traffic shape, and benchmark script stayed the same.
193193

@@ -201,12 +201,12 @@ That sequence is the core architectural point. A modern application can contain
201201

202202
Both Axion machine series run `arm64`, so the same assistant image moves between the Neoverse N3-based N4A pool and the Neoverse V2-based C4A pool. You can evaluate placement without maintaining a second image or build pipeline.
203203

204-
For this application, the useful pattern is not replacing one machine series with another. It is placing each workload tier where its behavior fits best.
204+
For this application, the useful pattern isn't replacing one machine series with another. It's placing each workload tier where its behavior fits best.
205205

206-
If your N4A and C4A results are close, or if N4A looks better for a particular run, that is still useful information. The decision should come from the workload behavior you observe, not from assuming one Axion-based machine series is always the right answer.
206+
If your N4A and C4A results are close, or if N4A looks better for a particular run, that's still useful information. The decision should come from the workload behavior you observe, not from assuming one Axion-based machine series is always the right answer.
207207

208208
## What you've accomplished
209209

210210
You've built, observed, and compared a mixed-placement storefront application on Axion. You kept the storefront on N4A, moved only the assistant tier to C4A, and used the same benchmark to compare both placements.
211211

212-
You are now ready to use the same overlay and benchmark pattern to evaluate which Axion-based machine series matches each tier's workload behavior.
212+
You're now ready to use the same overlay and benchmark pattern to evaluate which Axion-based machine series matches each tier's workload behavior.

content/learning-paths/servers-and-cloud-computing/storefront-ai-assistant-gke-axion/observe-benchmark-n4a.md

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ python3 -m py_compile workshop/fixed_batch_trial.py
2929
python3 -m py_compile workshop/compare_summaries.py
3030
```
3131

32-
If `kubectl top` is not available yet, make sure metrics collection is enabled in the cluster before you rely on CPU telemetry.
32+
If `kubectl top` isn't available yet, make sure metrics collection is enabled in the cluster before you rely on CPU telemetry.
3333

3434
## Open three terminals
3535

@@ -45,18 +45,11 @@ export FRONTEND_IP="$(kubectl get service frontend-external \
4545
-o jsonpath='{.status.loadBalancer.ingress[0].ip}')"
4646
export APP_URL="http://${FRONTEND_IP}"
4747
```
48-
49-
Use this terminal map:
50-
51-
| Terminal | Purpose |
52-
|----------|---------|
53-
| Terminal 1 | Telemetry collector |
54-
| Terminal 2 | Dashboard web server |
55-
| Terminal 3 | Live traffic and fixed benchmarks |
48+
Use the first terminal for collecting telemetry, the second terminal for the dashboard web server, and the third terminal for live traffic and fixed benchmarks.
5649

5750
## Start telemetry collection
5851

59-
Run this in Terminal 1. The `rm` command clears previous live telemetry samples for the dashboard:
52+
Run the following command in the first terminal. The `rm` command clears previous live telemetry samples for the dashboard:
6053

6154
```bash
6255
cd "${REPO}" || exit 1
@@ -71,7 +64,7 @@ Leave this command running.
7164

7265
## Start the dashboard
7366

74-
Run this in Terminal 2. The `rm` command clears previous live request data for the dashboard:
67+
Run the following command in the second terminal. The `rm` command clears previous live request data for the dashboard:
7568

7669
```bash
7770
cd "${REPO}" || exit 1
@@ -87,7 +80,7 @@ If port `5000` is already in use, choose another available port, such as `5001`.
8780

8881
## Confirm assistant health
8982

90-
Run this in Terminal 3:
83+
Run the following command in the third terminal to confirm the health of the assistant:
9184

9285
```bash
9386
cd "${REPO}" || exit 1
@@ -103,7 +96,7 @@ kubectl get pods -o wide | grep -E 'frontend|shoppingassistantservice'
10396

10497
## Generate a short live burst
10598

106-
Start a short request burst so the dashboard shows activity:
99+
Start a short request burst in the third terminal so the dashboard shows activity:
107100

108101
```bash
109102
rm -f workshop/request-live.pid
@@ -142,7 +135,7 @@ Stopping the live burst keeps the N4A and C4A benchmark runs comparable.
142135

143136
## Run the fixed N4A benchmark
144137

145-
Run the fixed batch while the assistant is still on N4A:
138+
Run the fixed batch in the third terminal while the assistant is still on N4A:
146139

147140
```bash
148141
python3 workshop/fixed_batch_trial.py \
@@ -161,18 +154,18 @@ python3 workshop/fixed_batch_trial.py \
161154
tee workshop/fixed-n4a-summary.log
162155
```
163156

164-
The command can keep running after the last request lines appear. It is still sampling telemetry and waiting for the assistant to settle back toward idle.
157+
The command can keep running after the last request lines appear. It's still sampling telemetry and waiting for the assistant to settle back toward idle.
165158

166159
Print the summary line:
167160

168161
```bash
169162
grep 'SUMMARY_JSON' workshop/fixed-n4a-summary.log
170163
```
171164

172-
The summary should show successful requests and the assistant running on the N4A node pool. Do not continue if the summary line is missing or reports a different node pool.
165+
The summary shows successful requests and the assistant running on the N4A node pool. Don't continue if the summary line is missing or reports a different node pool.
173166

174-
## What you've accomplished
167+
## What you've accomplished and what's next
175168

176-
You've observed the assistant as a live workload and captured the N4A benchmark baseline.
169+
You've now observed the assistant as a live workload and captured the N4A benchmark baseline.
177170

178171
Next, you'll move only the assistant tier to C4A and run the same benchmark again.

0 commit comments

Comments
 (0)