Skip to content

Commit d99d028

Browse files
Upda
Upda# modified: content/learning-paths/servers-and-cloud-computing/django-on-gcp/_index.md
1 parent c8e2e08 commit d99d028

9 files changed

Lines changed: 79 additions & 63 deletions

File tree

content/learning-paths/servers-and-cloud-computing/django-on-gcp/_index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
---
22
title: Deploy Django on Google Cloud C4A (Arm-based Axion VMs)
33

4-
minutes_to_complete: 30
4+
minutes_to_complete: 60
55

6-
who_is_this_for: This is an introductory topic for DevOps engineers and software developers who want to deploy, operate, and benchmark a production-grade Django REST API on Google Kubernetes Engine (GKE) running on Arm64 Axion processors, integrated with managed Google Cloud data services.
6+
who_is_this_for: This is an introductory topic for DevOps engineers and software developers who want to deploy, operate, and benchmark a production-grade Django REST API on Google Kubernetes Engine (GKE) running on Arm64 Axion processors, integrated with managed Google Cloud data services
77

88
learning_objectives:
9-
- Provision an Arm-based SUSE Linux Enterprise Server (SLES) virtual machine on Google Cloud (C4A with Axion processors)
10-
- Provision Google Axion (Arm64) compute using GKE node pools
9+
- Provision Arm-based Axion compute on Google Cloud using virtual machines and GKE node pools
1110
- Package a Django REST API into an Arm-native Docker container
1211
- Push container images to Google Artifact Registry
1312
- Deploy Django on GKE using Kubernetes manifests (Deployment, Service, ConfigMap, Secrets)
@@ -20,6 +19,7 @@ learning_objectives:
2019
prerequisites:
2120
- A [Google Cloud Platform (GCP)](https://cloud.google.com/free) account with billing enabled
2221
- Basic familiarity with [Django](https://www.djangoproject.com/)
22+
- Basic understanding of containers and Kubernetes concepts
2323

2424
author: Pareena Verma
2525

@@ -72,5 +72,5 @@ further_reading:
7272

7373
weight: 1
7474
layout: "learningpathall"
75-
learning_path_main_page: "yes"
75+
learning_path_main_page: yes
7676
---

content/learning-paths/servers-and-cloud-computing/django-on-gcp/background.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ Google Axion C4A is a family of Arm-based virtual machines built on Google’s c
1212

1313
The C4A series provides a cost-effective alternative to x86 virtual machines while leveraging the scalability and performance benefits of the Arm architecture in Google Cloud.
1414

15-
To learn more about Google Axion, see the [Introducing Google Axion Processors, our new Arm-based CPUs](https://cloud.google.com/blog/products/compute/introducing-googles-new-arm-based-cpu) blog.
15+
To learn more, see the Google blog [Introducing Google Axion Processors, our new Arm-based CPUs](https://cloud.google.com/blog/products/compute/introducing-googles-new-arm-based-cpu).
1616

1717

18-
## Understand Django on Google Axion C4A (Arm Neoverse-V2)
18+
## Explore Django on Google Axion C4A (Arm Neoverse V2)
1919

2020
Django is a high-level, open-source Python web framework that encourages rapid development and clean, pragmatic design. Developed and maintained by the [Django Software Foundation](https://www.djangoproject.com/foundation/), it simplifies web application development by handling much of the boilerplate and providing powerful built-in features.
2121

@@ -27,10 +27,13 @@ Common use cases include web applications, content management systems, APIs, e-c
2727

2828
To learn more, visit the [Django website](https://www.djangoproject.com/) and explore the [Django documentation](https://docs.djangoproject.com/en/stable/).
2929

30-
## Summary and what's next
30+
## What you've accomplished and what's next
3131

32-
You now understand the capabilities of Google Axion C4A Arm-based VMs and why Django is an excellent choice for building web applications on Arm infrastructure. The combination provides a cost-effective, high-performance platform for deploying Python web applications at scale.
32+
In this section, you learned about:
33+
- Google Axion C4A Arm-based VMs and their performance characteristics
34+
- Django web framework and its suitability for building REST APIs
35+
- How Arm architecture provides cost-effective, high-performance infrastructure for Python applications
3336

34-
In the next sections, you'll provision your own Arm-based VM on Google Cloud, install Django, and benchmark your application's performance.
37+
Next, you'll configure firewall rules to allow external access to your Django application.
3538

3639

content/learning-paths/servers-and-cloud-computing/django-on-gcp/baseline.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Replace `<YOUR_VM_EXTERNAL_IP>` with the public IP address of your GCP VM.
9898

9999
You should see the Django welcome page with the message "The install worked successfully!":
100100

101-
![Screenshot of the Django welcome page displayed in a web browser. The page features a large heading stating The install worked successfully followed by a subheading congratulating the user on successfully installing Django. Below are instructions for the next steps, including editing the settings file and reading the Django documentation. The page has a clean white background with blue highlights#center](images/django-welcome-page.png "Django welcome page")
101+
![Screenshot of the Django welcome page displayed in a web browser. The page features a large heading stating The install worked successfully followed by a subheading congratulating the user on successfully installing Django. Below are instructions for the next steps, including editing the settings file and reading the Django documentation. The page has a clean white background with blue highlights alt-txt#center](images/django-welcome-page.png "Django welcome page")
102102

103103
## Build a simple Django app with custom routing
104104

@@ -220,10 +220,15 @@ Open your browser and navigate to:
220220
http://<YOUR_VM_EXTERNAL_IP>:8000
221221
```
222222

223-
You should now see your custom message displayed:
223+
Your browser displays your custom message:
224224

225-
![Screenshot of a web browser displaying a Django app with a large heading that reads Hello, Django on Arm centered on a clean white background. The page contains no additional content or navigation, creating a straightforward and welcoming tone#center](images/django-app.png "Django custom app")
225+
![Screenshot of a web browser displaying a Django app with a large heading that reads Hello, Django on Arm, centered on a clean white background alt-txt#center](images/django-app.png "Django custom app")
226226

227-
## Summary and what's next
227+
## What you've accomplished and what's next
228228

229-
You've successfully verified that Django is installed and working on your Arm-based VM. Your application can serve web requests, handle routing, and render custom views.
229+
In this section, you:
230+
- Created a Django project and ran the development server
231+
- Built a custom Django app with routing and views
232+
- Verified that Django serves web requests successfully on your Arm VM
233+
234+
Next, you'll set up the complete GKE infrastructure with Cloud SQL and Memorystore for production deployment.

content/learning-paths/servers-and-cloud-computing/django-on-gcp/benchmarking.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,9 @@ This installs Django and Gunicorn. Gunicorn is a high-performance WSGI HTTP serv
4444

4545
## Run Django with Gunicorn
4646

47-
Your Django application runs with Gunicorn inside GKE:
47+
Your Django application runs with Gunicorn inside GKE. Gunicorn is deployed inside your Kubernetes Pods and exposed through a Kubernetes Service and LoadBalancer. The benchmark is executed against the external IP of the GKE service.
4848

49-
Gunicorn is deployed inside your Kubernetes Pods and exposed through a Kubernetes Service and LoadBalancer.
50-
The benchmark is executed against the **external IP of the GKE service**.
51-
52-
{{% notice Note %}}
53-
Ensure your VM's firewall allows inbound traffic on port 8000. See the firewall setup section if you haven't already configured this.
54-
{{% /notice %}}
49+
{{% notice note %}}Ensure your GKE cluster and LoadBalancer are properly configured. If you haven't set up the cluster yet, refer to the previous sections for GKE deployment and service configuration. {{% /notice %}}
5550

5651
## Run the benchmark
5752

@@ -104,23 +99,28 @@ Percentage of the requests served within a certain time (ms)
10499
```
105100
## Interpret your benchmark results
106101

107-
The ApacheBench output provides key performance metrics that help you evaluate your Django application's capabilities on Google Axion (Arm64) GKE. Here's what each metric tells you:
102+
The ApacheBench output provides key performance metrics for evaluating your Django application on Google Axion (Arm64) GKE:
103+
108104
### Request handling metrics
105+
109106
- Concurrency Level: number of simultaneous requests the benchmark sent (100 in this test)
110107
- Complete Requests: total successful requests processed (5000 in this test)
111108
- Failed Requests: number of errors or timeouts (0, indicating stable production-grade performance)
112109

113110
### Performance metrics
114-
- Requests per Second: how many requests your server handles per second — higher values indicate better throughput (14,001.88 req/sec)
111+
112+
- Requests per Second: how many requests your server handles per second; higher values indicate better throughput (14,001.88 req/sec)
115113
- Time per Request (mean): average time to complete a single request (7.142 ms)
116114
- Time per Request (across concurrent): average latency when factoring in concurrent processing (0.071 ms), showing excellent parallel execution on Axion Arm cores
117115

118116
### Data transfer metrics
117+
119118
- Total Transferred: all data sent and received, including HTTP headers (1,650,000 bytes)
120119
- HTML Transferred: actual response payload size (75,000 bytes)
121120
- Transfer Rate: network throughput in KB/sec (4512.32 KB/sec), indicating efficient networking through GKE LoadBalancer
122121

123122
### Timing breakdown
123+
124124
- Time Taken for Tests: total benchmark duration (0.357 seconds)
125125
- Connection Times: shows minimum, mean, median, and maximum times for connecting, processing, and waiting
126126

@@ -145,7 +145,7 @@ Results from the run on the `Axion (C4A) Arm64 GKE nodes`:
145145
| **Failed Requests** | Number of failed requests | 0 |
146146
| **Total Transferred** | Total bytes transferred (including headers) | 1,650,000 bytes |
147147
| **HTML Transferred** | Total response body bytes | 75,000 bytes |
148-
| **Requests per Second (mean)** | Throughput higher is better | **14,001.88 req/sec** |
148+
| **Requests per Second (mean)** | Throughput - higher is better | **14,001.88 req/sec** |
149149
| **Time per Request (mean)** | Average time for each request | **7.142 ms** |
150150
| **Time per Request (across all concurrent requests)** | Average latency considering concurrency | **0.071 ms** |
151151
| **Transfer Rate** | Network throughput rate | **4512.32 KB/sec** |
@@ -163,4 +163,4 @@ The benchmark results demonstrate the strength of running Django on Google Axion
163163
- Ultra-Low p95 Latency: Even at 100 concurrent users, 95% of all requests completed within 11 ms.
164164
- Production Stability: Zero failed requests confirms the platform is resilient under heavy parallel load.
165165
- Efficient Networking: Over 4.4 MB/sec of data transfer through the GKE LoadBalancer shows Arm-based networking is highly optimized.
166-
- Cloud-native Scalability: These results validate that Axion Arm64 nodes are well-suited for high-performance, horizontally scalable REST APIs in production.
166+
- Cloud-native Scalability: These results validate that Axion Arm64 nodes are well-suited for high-performance, horizontally scalable REST APIs in production.

content/learning-paths/servers-and-cloud-computing/django-on-gcp/containerization-and-deploy.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Containerize and Deploy Django on Axion GKE
2+
title: Containerize and deploy Django on Axion GKE
33
weight: 9
44

55
### FIXED, DO NOT MODIFY
@@ -8,10 +8,10 @@ layout: learningpathall
88

99
## Containerize and deploy Django on Axion GKE
1010

11-
This guide converts your Django REST API into a production-grade Arm64 container and deploys it on Axion-powered Google Kubernetes Engine (GKE). You will validate that the workload runs natively on Arm and is publicly accessible through a cloud Load Balancer.
11+
This guide converts your Django REST API into a production-grade Arm64 container and deploys it on Axion-powered GKE.
1212

1313
### Create Docker image
14-
This step packages your Django API and all its dependencies into a **portable container image** that can run on any Axion Arm64 node.
14+
This step packages your Django API and all its dependencies into a portable container image that can run on any Axion Arm64 node.
1515

1616
Create a file called `requirements.txt` and insert the following:
1717

@@ -106,7 +106,7 @@ Verify pods are running on Axion Arm nodes:
106106
kubectl get pods -o wide
107107
```
108108

109-
Pods must show nodes like:
109+
The output is similar to:
110110
```output
111111
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
112112
django-api-XXXXXX 1/1 Running 0 3h52m 10.0.2.9 gke-django-axion-cluster-axion-pool-xxxxxxx <none> <none>
@@ -161,20 +161,19 @@ Open the following URL in browser:
161161
http://<EXTERNAL-IP>/healthz/
162162
```
163163

164-
You should see output similar to the following:
164+
The output is similar to:
165165

166166
![Screenshot showing Django health check endpoint returning a JSON response with status ok, indicating successful deployment and validation of the Django application running on GKE alt-txt#center](images/django_framework.png "Django health check validation")
167167

168168
The Arm-based Django API is now accessible over the internet.
169169

170170
## What you've accomplished and what's next
171-
You have deployed a fully cloud-native, Arm-optimized application:
172171

173-
- Django REST API
174-
- Running on Axion Arm64
175-
- Exposed through Google Cloud LoadBalancer
176-
- Backed by Cloud SQL PostgreSQL
177-
- Accelerated by Memorystore Redis
178-
- Delivered through Artifact Registry
172+
In this section, you:
173+
- Containerized your Django REST API for Arm64
174+
- Pushed the image to Artifact Registry
175+
- Deployed the application to GKE running on Axion nodes
176+
- Exposed the service through a Kubernetes LoadBalancer
177+
- Validated public access to your Django API
179178

180-
This is a real production architecture running on Arm in GCP.
179+
Next, you'll benchmark your Django application to measure performance on Arm infrastructure.

content/learning-paths/servers-and-cloud-computing/django-on-gcp/django_application.md

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

99
## Django REST API with PostgreSQL and Redis
1010

11-
This guide walks you through building a production-ready Django REST API that connects to PostgreSQL for data and Redis for caching. You will create a backend that is cloud-deployable and compatible with containerized Kubernetes environments.
11+
This guide walks you through building a production-ready Django REST API that connects to PostgreSQL for data and Redis for caching.
1212

1313
### Create Django project
1414

@@ -21,14 +21,14 @@ source venv/bin/activate
2121
sudo zypper install postgresql-devel libpq5 postgresql15-server-devel gcc make python3-devel
2222
```
2323

24-
Also, please run:
24+
Install the required Python packages:
2525

2626
```bash
2727
which pg_config
28-
pip install psycopg2-binary django djangorestframework psycopg2-binary django-redis gunicorn
28+
pip install psycopg2-binary django djangorestframework django-redis gunicorn
2929
```
3030

31-
Finally, run:
31+
Create the Django project structure:
3232

3333
```bash
3434
django-admin startproject django_api .
@@ -39,7 +39,7 @@ The Django project structure is ready with all required libraries for database,
3939

4040
### Enable Django apps
4141

42-
Django must be told which components are active. Enable the REST framework and the API app so that Django can expose HTTP endpoints. Edit `django_api/settings.py` and add 'rest_framework' and 'api' to INSTALLED_APPS. Set DEBUG to False. Finally add '*' to ALLOWED_HOSTS.
42+
Enable the REST framework and API app by editing `django_api/settings.py`. Add 'rest_framework' and 'api' to INSTALLED_APPS, set DEBUG to False, and add '*' to ALLOWED_HOSTS:
4343

4444
```python
4545
DEBUG = False
@@ -79,7 +79,7 @@ DATABASES = {
7979
}
8080
```
8181

82-
Edit the above addition and set "CLOUDSQL_IP" to the actual IP address that you saved from earlier.
82+
Replace `CLOUDSQL_IP` with the actual Cloud SQL IP address you saved earlier.
8383

8484
Additionally, add the CACHES configuration per below to the same file and save:
8585

content/learning-paths/servers-and-cloud-computing/django-on-gcp/firewall_setup.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ Configure the protocol and port settings:
5050

5151
![Screenshot of the Protocols and ports section. The TCP checkbox is checked and port 8000 is entered in the Ports field#center](images/network-port.png "Specifying TCP port 8000")
5252

53-
## Summary and what's next
53+
## What you've accomplished and what's next
5454

55-
Your firewall rule is now created and active. Your Django application running on port 8000 is now accessible from external IP addresses.
55+
In this section, you configured firewall rules to allow external HTTP traffic on port 8000, making your Django application accessible from the internet.
56+
57+
Next, you'll provision a Google Axion C4A Arm VM to host your Django application.

content/learning-paths/servers-and-cloud-computing/django-on-gcp/installation.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ source venv/bin/activate
105105

106106
The `python3.11 -m venv venv` command creates an isolated Python environment named `venv` inside your project folder. Running `source venv/bin/activate` activates this environment.
107107

108-
Once activated, your command prompt displays `(venv)` at the beginning, indicating you're working inside an isolated Python environment where all packages are isolated from your system Python installation.
108+
Once activated, your command prompt displays `(venv)` at the beginning, indicating that you're working inside an isolated Python environment.
109109

110110
## Upgrade pip and install Django
111111

@@ -122,8 +122,8 @@ python3 -m pip install django gunicorn
122122
```
123123

124124
This installs:
125-
- **Django** the web framework for building your application
126-
- **Gunicorn** a production-ready WSGI (Web Server Gateway Interface) server for running Django applications
125+
- **Django** - the web framework for building your application
126+
- **Gunicorn** - a production-ready WSGI (Web Server Gateway Interface) server for running Django applications
127127

128128
Verify that Django is installed correctly:
129129

@@ -137,6 +137,11 @@ The output is similar to:
137137
5.2.10
138138
```
139139

140-
## Summary and what's next
140+
## What you've accomplished and what's next
141141

142-
You have successfully installed the Google Cloud CLI, Python 3.11, Django, and Gunicorn on your Arm-based VM. Your environment is now fully prepared to build, containerize, and deploy a Django REST API on GKE with Cloud SQL and Memorystore.
142+
In this section, you installed:
143+
- Google Cloud CLI for GCP service management
144+
- Python 3.11 with a virtual environment
145+
- Django and Gunicorn for web application development
146+
147+
Next, you'll verify Django is working by creating a basic project and running the development server.

0 commit comments

Comments
 (0)