Skip to content

Commit dc8c326

Browse files
Merge pull request #2046 from madeline-underwood/NET-for-Cobalt
Deploy a Cobalt 100 Virtual Machine on Azure_JA to review
2 parents 8d81b24 + c8028b3 commit dc8c326

File tree

9 files changed

+168
-121
lines changed

9 files changed

+168
-121
lines changed

content/learning-paths/servers-and-cloud-computing/cobalt/1-create-cobalt-vm.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,29 @@ layout: learningpathall
88

99
## Use the Azure Portal to deploy a Cobalt 100 VM
1010

11-
Cobalt 100 is Microsoft’s first Arm-based server processor, built using the Armv9 Neoverse-N2 CPU. The Cobalt 100 processor is optimized for the performance of scale-out cloud-based applications.
11+
Cobalt 100 is Microsoft’s first Arm-based server processor, built on the Armv9 Neoverse-N2 CPU architecture. It is optimized for the performance and efficiency of scale-out, cloud-based applications.
1212

13-
The Azure Cobalt 100 VM instances include two series:
13+
Azure offers Cobalt 100–powered virtual machines in two series:
14+
15+
- **Dpsv6** and **Dplsv6** (general-purpose)
16+
- **Epsv6** (memory-optimized)
1417

15-
The general-purpose Dpsv6 and Dplsv6 virtual machine series.
16-
The memory-optimized Epsv6 virtual machine series.
1718

1819
To create a Cobalt 100 VM, follow these steps:
1920

2021
1. Sign in to the [Azure Portal](https://portal.azure.com/).
2122
2. Select **Create a resource → Compute → Virtual machine**.
22-
3. Complete the *Basics* tab:
23-
![Azure Portal – Basics tab for the VM wizard#center](images/create-cobalt-vm.png)
24-
The Dpsv6-series are powered by Cobalt 100. Selecting Standard_D4ps_v6 will give you a Cobalt VM with 4 physical cores. you can change the 4 to another value if you want a different number of cores.
23+
3. Complete the fields in the **Basics** tab using the values shown in the figure below:
24+
25+
![Azure Portal – Basics tab for the VM wizard#center](images/create-cobalt-vm.png "Configuring the Basics tab")
26+
27+
Cobalt 100 powers the Dpsv6 and Dplsv6 series. Selecting **Standard_D4ps_v6** creates a Cobalt VM with four physical cores.
28+
You can choose a different size if you need more or fewer cores.
2529
4. Upload your public SSH key or generate a new one in the wizard.
26-
5. Disallow public inbound ports for now.
27-
5. Accept the defaults on the *Disks* tab.
28-
6. On the *Networking* tab ensure that a **Public IP** is selected. You will need it to connect later. Leave the NSG settings as *Basic* for now.
30+
5. For the **Public inbound ports** field, select **None**.
31+
6. On the **Disks** tab, accept the default options.
32+
7. On the **Networking** tab, ensure that a **Public IP** is selected. You will need it to connect to the VM later. Leave the NSG settings as **Basic**.
2933

30-
Click **Review + create** followed by **Create**. Azure now deploys the VM and the automatically-generated Network Security Group (NSG). Provisioning takes ~2 minutes.
34+
8. Select **Review + create**, then **Create**. Azure deploys the VM and the automatically-generated Network Security Group (NSG). Provisioning takes ~2 minutes.
3135

32-
Navigate to the **Deployment in progress** pane or open the **Notifications** panel to track progress. When the deployment succeeds proceed to the next step to expose an inbound port.
36+
9. Navigate to the **Deployment in progress** pane or open the **Notifications** panel to track progress. When the deployment completes, proceed to the next step to expose an inbound port.
Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Open an inbound port in the Network Security Group
2+
title: Open inbound ports in the Network Security Group
33
weight: 3
44

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

99
## Allow external traffic to TCP ports 22 (SSH) and 8080
1010

11-
Every new virtual machine created through the Azure wizard is associated with a **Network Security Group (NSG)**. An NSG acts like a stateful firewall – if no rule explicitly allows traffic, Azure blocks it.
11+
Every new virtual machine created through the Azure wizard is associated with a **Network Security Group (NSG)**. An NSG acts as a stateful firewall – if no rule explicitly allows traffic, Azure blocks it by default.
1212

13-
In this step you will open port 22 for SSH, as well as port 8080 so that a web application running on the VM is reachable from your IP for testing. Substitute a different port if required by your workload, or a different IP range if you'd like broader accessibility.
13+
In this step, you'll open port 22 for SSH and port 8080 so that a web application running on the VM is reachable from your IP for testing. Substitute a different port if required by your workload, or a different IP range if you'd like broader accessibility.
1414

15-
1. In the Azure Portal open the newly created VM resource and click **Networking → Network settings** in the left nav.
15+
1. In the Azure Portal, open the newly-created VM resource and select **Networking → Network settings** from the left-hand menu.
1616
2. Select the **Network security group**.
17-
3. Click on **Create Port Rule** and from the drop-down men select **Inbound port rule**
18-
4. Fill in the form, specifying **My IP address** as the source and 22 as the destination port:
19-
![Add inbound security rule with source of my IP and destination port 22#center](images/create-nsg-rule.png)
20-
5. Click **Add**.
21-
To open port 8080, follow steps 3 through 5 again, but instead choose port 8080 for the destination port.
17+
3. Select **Create Port Rule**, then choose **Inbound port rule** from the drop-down menu.
2218

23-
You have now opened ports 22 and 8080 to your IP. In the next step you will verify connectivity.
19+
4. Fill in the form with **My IP address** as the source and 22 as the destination port:
20+
21+
![Add inbound security rule with source of my IP and destination port 22#center](images/create-nsg-rule.png "Create Port Rule form")
22+
23+
5. Select **Add**.
24+
25+
6. To open port 8080, repeat steps 3-5 and enter 8080 as the destination port.
26+
27+
You have now opened ports 22 and 8080 to your IP. In the next step, you'll verify connectivity from your local machine.

content/learning-paths/servers-and-cloud-computing/cobalt/3-verify-connectivity.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,19 @@ layout: learningpathall
88

99
## Connect over SSH and test the open port
1010

11-
1. On the **Overview** page for the VM copy the **Public IP address**.
12-
2. Open a terminal on your local machine and SSH to the VM (replace *azureuser* if you chose a different admin username):
11+
On the **Overview** page of the VM, copy the **Public IP address**. Open a terminal on your local machine, and SSH to the VM (replace *azureuser* if you chose a different admin username):
1312

1413
```bash
1514
ssh -i [path to your pem file] azureuser@[public IP]
1615
```
1716

18-
Where `[public IP]` is your public IP and `[path to your pem file]` is the path to your SSH key file.
17+
Replace `[public IP]` with your VM's public IP address, and `[path to your pem file]` with the path to your SSH private key file.
1918

20-
Accept the prompt to add the host to *known_hosts* the first time you connect.
19+
When prompted, confirm the connection to add the VM to your *known_hosts* file.
2120

22-
### Start a simple HTTP server
21+
### Start a temporary HTTP server
2322

24-
If you do not already have an application listening on TCP 8080 you can start one temporarily:
23+
If you don't already have an application listening on TCP 8080, you can start one temporarily:
2524

2625
```bash
2726
sudo apt update -y && sudo apt install -y python3
@@ -32,16 +31,18 @@ Leave this terminal open – the server runs in the foreground.
3231

3332
### Test from your local machine
3433

35-
In a second local terminal run `curl` to confirm you can reach the server through the NSG rule you created:
34+
In a second local terminal run `curl` to confirm that you can reach the server through the NSG rule you created:
3635

3736
```bash
3837
curl http://[public IP]:8080
3938
```
4039

41-
Where `[public IP]` is your public IP.
40+
Replace `[public IP]` with your VM's public IP address.
4241

43-
You should see an HTML directory listing (or your application response). Receiving a response verifies that TCP 8080 is open and the VM is reachable from the public internet.
42+
You should see an HTML directory listing (or your application response). A successful response confirms that TCP port 8080 is open and the VM is reachable from the public internet.
4443

45-
Terminate the Python server when you are finished testing (press `Ctrl + C`).
44+
To stop the server, press `Ctrl + C`.
4645

47-
You now have an Arm-based Cobalt 100 VM with an exposed port 8080 that you can use to run any test server. To learn about optimizing .NET workloads on Cobalt, check out [Migrating a .NET application to Azure Cobalt](../../dotnet-migration/).
46+
You now have an Arm-based Cobalt 100 VM with port 8080 open and ready to receive external traffic. You can use it to run any test server or deploy your own application.
47+
48+
To learn about optimizing .NET workloads on Cobalt, check out [Migrating a .NET application to Azure Cobalt](../../dotnet-migration/).

content/learning-paths/servers-and-cloud-computing/cobalt/_index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
---
2-
title: Create an Azure Cobalt 100 VM
2+
title: Deploy a Cobalt 100 Virtual Machine on Azure
33

44
minutes_to_complete: 10
55

6-
who_is_this_for: This is an introductory topic for developers and DevOps engineers who need an Arm-based virtual machine on Azure and want to expose an application port to the internet.
6+
who_is_this_for: This is an introductory topic for developers and DevOps engineers who want to deploy an Arm-based virtual machine on Azure and expose an application port to the internet.
77

88
learning_objectives:
9-
- Deploy an Arm-based Cobalt 100 virtual machine (VM) on Microsoft Azure.
10-
- Connect to the Cobalt 100 VM using SSH.
11-
- Open an inbound TCP port in the associated Network Security Group (NSG).
12-
- Verify external connectivity to the newly opened port.
9+
- Deploy an Arm-based Cobalt 100 virtual machine (VM) on Microsoft Azure
10+
- Connect to the Cobalt 100 VM using SSH
11+
- Configure an inbound TCP port in the associated Network Security Group (NSG)
12+
- Verify external connectivity to the newly-opened port
1313

1414
prerequisites:
15-
- A Microsoft Azure subscription with permission to create resources
15+
- A Microsoft Azure subscription with permissions to create virtual machines and networking resources
1616
- Basic familiarity with SSH
1717

1818
author: Joe Stech
Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
---
2-
title: Create a basic OrchardCore application
2+
title: Build and run an OrchardCore CMS app on Azure Cobalt (Arm64)
33
weight: 2
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
88

9-
# Create a basic OrchardCore application
9+
## Getting started with the OrchardCore app
1010

11-
In this section, you will learn how to create and compile a basic [OrchardCore](https://github.com/OrchardCMS/OrchardCore) CMS application, as an example of a popular Linux-based .NET workload. OrchardCore is a modular and multi-tenant application framework built with ASP.NET Core, which can be used to create content-driven websites.
11+
In this section, you'll build and run a basic [OrchardCore](https://github.com/OrchardCMS/OrchardCore) CMS application, which is a popular Linux-based .NET workload. OrchardCore is a modular and multi-tenant application framework built with ASP.NET Core, that's commonly used to create content-driven websites.
1212

13-
## Step 1: Set up your development environment
13+
### Set up your development environment
1414

15-
1. Launch an Azure Cobalt instance running Ubuntu 24.04, and open port 8080 to the internet. For instructions on how to do this, see the [Create an Azure Cobalt 100 VM](../../cobalt) Learning Path.
15+
First, launch an Azure Cobalt 100 instance (Arm-based VM) running Ubuntu 24.04, and open port 8080 to the internet.
1616

17-
2. **Install .NET SDK**:
17+
For setup instructions, see the [Create an Azure Cobalt 100 VM](../../cobalt) Learning Path.
18+
19+
Next, install .NET SDK:
1820

1921
```bash
2022
wget https://packages.microsoft.com/config/ubuntu/24.04/packages-microsoft-prod.deb
@@ -23,35 +25,35 @@ sudo apt-get update
2325
sudo apt-get install -y dotnet-sdk-8.0
2426
```
2527

26-
3. **Verify installations**:
28+
Verify the installation:
2729

2830
```bash
2931
dotnet --version
3032
```
3133

32-
The output should look like:
34+
You should then see output similar to:
3335

3436
```output
3537
8.0.117
3638
```
3739

38-
4. Install gcc for compiling your application:
40+
Install gcc for compiling your application:
3941

4042
```bash
4143
sudo apt install gcc g++ build-essential -y
4244
```
4345

44-
## Step 2: Install the OrchardCore Templates
46+
### Install the OrchardCore templates
4547

46-
To start building an OrchardCore application, you need to install the OrchardCore templates. Open your terminal and run the following command:
48+
Install the OrchardCore templates:
4749

4850
```bash
4951
dotnet new install OrchardCore.ProjectTemplates::2.1.7
5052
```
5153

52-
This command installs the OrchardCore project templates, which you will use to create a new application.
54+
This command installs the OrchardCore project templates you'll use to create a new OrchardCore application.
5355

54-
The output will look like:
56+
Expected output:
5557

5658
```output
5759
Success: OrchardCore.ProjectTemplates::2.1.7 installed the following templates:
@@ -64,31 +66,31 @@ Orchard Core Mvc Web App ocmvc [C#] Web/Orchard Core/Mvc
6466
Orchard Core Theme octheme [C#] Web/Orchard Core/CMS
6567
```
6668

67-
## Step 3: Create a new OrchardCore application
69+
### Create a new OrchardCore application
6870

69-
1. **Create a new project**: Use the `dotnet` CLI to create a new OrchardCore application.
71+
First, create a new project using the `dotnet` CLI to create a new OrchardCore application:
7072

7173
```bash
7274
dotnet new occms -n MyOrchardCoreApp
7375
```
7476

75-
This command creates a new OrchardCore CMS application in a directory named `MyOrchardCoreApp`.
77+
This command creates a new OrchardCore CMS application in a directory named `MyOrchardCoreApp`.
7678

77-
2. **Navigate to the project directory**:
79+
Now navigate to the project directory:
7880

7981
```bash
8082
cd MyOrchardCoreApp
8183
```
8284

83-
## Step 4: Run the OrchardCore application
85+
### Run the OrchardCore application
8486

85-
1. **Build the application**: Compile the application using the following command:
87+
Build the application:
8688

8789
```bash
8890
dotnet build
8991
```
9092

91-
The output will look like:
93+
The output should look like:
9294

9395
```output
9496
MSBuild version 17.8.27+3ab07f0cf for .NET
@@ -103,14 +105,22 @@ Build succeeded.
103105
104106
Time Elapsed 00:00:38.05
105107
```
106-
2. **Run the application**: Start the application with:
108+
Run the application:
107109

108110
```bash
109111
dotnet run --urls http://0.0.0.0:8080
110112
```
111113

112-
3. **Access the application**: Open a web browser and navigate to `http://[instance IP]:8080` to see your OrchardCore application in action, where `[instance IP]` is the public IP of your Azure Cobalt instance.
114+
Access the application:
115+
116+
* In your browser, navigate to `http://[instance IP]:8080` to see your OrchardCore application in action.
117+
118+
* Replace `[instance IP]` with your VM’s public IP address. You can find it in the Azure portal under the **Networking** tab of your virtual machine.
119+
120+
Configure the application:
121+
122+
* On the setup screen, choose the Blog recipe and complete the admin credentials and database configuration to finish setup.
113123

114-
4. **Configure the application as a blog** In the resulting configuration page,
124+
### Summary and next steps
115125

116126
You have successfully created and run a basic OrchardCore CMS application. In the next sections, you will learn how to integrate a C shared library into your .NET application and explore performance optimizations for Arm architecture.

content/learning-paths/servers-and-cloud-computing/dotnet-migration/2-add-shared-c-library.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
---
2-
title: Add a simple C shared library to your .NET OrchardCore application
2+
title: Integrate a C shared library into your .NET OrchardCore app
33
weight: 3
44

55
### FIXED, DO NOT MODIFY
66
layout: learningpathall
77
---
8+
## Create a C shared library
89

9-
## Introduction
10+
In this section, you’ll integrate a simple C shared library into your .NET OrchardCore application, by doing the following:
1011

11-
In this section, you will learn how to integrate a simple C shared library into your .NET OrchardCore application. This process involves creating a C library, compiling it, and then using it within your .NET application. This integration can help you leverage existing C code and libraries, enhancing the functionality and performance of your application.
12+
- Write a C function
13+
- Compile it into a shared object (`.so`)
14+
- Call it from C# using `DllImport`
1215

16+
This allows you to reuse existing C code and improve performance by accessing native functionality.
1317

14-
## Step 1: Create a C shared library
15-
16-
First, you need to create a simple C shared library. This library will contain a function that you will call from your .NET application.
17-
18-
1. Create a new file named `mylib.c` with the following content:
18+
Create a file named `mylib.c` with the following:
1919

2020
```c
2121
#include <stdio.h>
@@ -25,19 +25,19 @@ void greet() {
2525
}
2626
```
2727

28-
2. Compile the C file into a shared library:
28+
Compile the C file into a shared library:
2929

3030
```bash
3131
gcc -shared -o libmylib.so -fPIC mylib.c
3232
```
3333

34-
This will generate a shared library file (`libmylib.so`).
34+
This creates a shared object file named `libmylib.so` which your .NET application can call at runtime.
3535

36-
## Step 2: Use the C library in your .NET application
36+
## Use the C library in your .NET application
3737

3838
Now that you have a shared library, you can use it in your .NET application.
3939

40-
1. In your OrchardCore application, create a new class file named `NativeMethods.cs`:
40+
In your OrchardCore application, create a new class file named `NativeMethods.cs`:
4141

4242
```csharp
4343
using System;
@@ -49,8 +49,11 @@ public static class NativeMethods
4949
public static extern void Greet();
5050
}
5151
```
52+
{{% notice Note %}}
53+
On Linux, the `DllImport("mylib")` attribute resolves to `libmylib.so`. On Windows, the runtime would look for `mylib.dll`, and on macOS, `libmylib.dylib`.
54+
{{% /notice %}}
5255

53-
2. Call the `Greet` method from your application. For example, you can add the following code to your main program `Program.cs` as shown:
56+
Call the `Greet` method from your application. For example, you can add the following code to your main program `Program.cs` as shown:
5457

5558
```csharp
5659
using OrchardCore.Logging;
@@ -88,31 +91,29 @@ app.UseOrchardCore();
8891
app.Run();
8992
```
9093

91-
3. Ensure that dotnet can find your shared library:
94+
Ensure that dotnet can find your shared library:
9295

9396
```bash
9497
export LD_LIBRARY_PATH=$(pwd):$LD_LIBRARY_PATH
9598
```
9699

97-
## Step 3: Run your application
100+
## Run your application
98101

99-
Now when you run `dotnet run`, you will see
102+
When you run `dotnet run`, you’ll see the following output:
100103

101104
```bash
102105
Calling native greet...
103106
Hello from the C library!
104107
```
105108

106-
in the logging output.
107-
108109
## Compiling for Arm
109110

110-
If you are compiling for Arm directly on Azure Cobalt, the compiler understands what default processor optimizations it should use, and you can compile as done in Step 1 above. However, if you are cross-compiling in your build pipeline, you should specify `-mcpu=neoverse-n2 -O3` when running the cross-compiler:
111+
If you are compiling for Arm directly on Azure Cobalt, the compiler understands what default processor optimizations it should use, and you can compile as done above. However, if you are cross-compiling in your build pipeline, you should specify `-mcpu=neoverse-n2 -O3` when running the cross-compiler:
111112

112113
```bash
113114
aarch64-linux-gnu-gcc -mcpu=neoverse-n2 -O3 -shared -o libmylib.so -fPIC mylib.c
114115
```
115116

116-
The `-mcpu=neoverse-n2` flag specifies the Cobalt architecture, and `-O3` ensures that maximum optimizations are completed (including SIMD opimizations).
117+
The `-mcpu=neoverse-n2` flag specifies the Cobalt architecture, and `-O3` ensures that maximum optimizations are completed (including SIMD optimizations).
117118

118-
In the next section, you will explore how to make your build architecture agnostic with the anyCPU feature.
119+
In the next section, you’ll make your native interop cross-platform by using the AnyCPU feature and runtime dispatch strategies.

0 commit comments

Comments
 (0)