You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/dotnet-migration-nopcommerce/2-environment-setup.md
+17-7Lines changed: 17 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,47 +16,57 @@ This path was validated with Ubuntu 24.04 LTS on Azure Cobalt in `westus2` (exam
16
16
17
17
## Install tools on Cobalt VM
18
18
19
-
Install the toolchain on the Cobalt VM before building and testing.
19
+
Install the toolchain on the Cobalt VM before building and testing. The commands install the Linux packages used throughout this Learning Path: source control, HTTP validation, JSON inspection, Python for the endpoint tester, package archive inspection, Docker, and the .NET 9 SDK from the Ubuntu backports feed.
The Docker group change applies to new login sessions. Sign out and sign back in before running Docker without `sudo`, or run `newgrp docker` in the current terminal before continuing.
32
32
33
-
Confirm architecture and tool versions before proceeding.
33
+
Confirm architecture and tool versions before proceeding. On Azure Cobalt, the Linux machine architecture should be `aarch64`, and the .NET SDK should be a 9.0.x release.
34
34
35
35
```bash
36
36
uname -m
37
37
dotnet --version
38
38
docker --version
39
39
```
40
40
41
-
Expected output: `Arm` (kernel strings may still show architecture-specific values). Ensure the .NET SDK version is 9.0.x.
41
+
The output is similar to:
42
+
43
+
```output
44
+
aarch64
45
+
9.0.x
46
+
Docker version ...
47
+
```
42
48
43
49
If you are upgrading from an older .NET version before migrating to Cobalt, you can use [GitHub Copilot modernization for .NET](https://learn.microsoft.com/dotnet/core/porting/github-copilot-app-modernization/overview) to assess the project and guide the upgrade. In Visual Studio Code, open Copilot Chat and use `@modernize-dotnet`; in Visual Studio, use the Modernize action from Solution Explorer.
44
50
45
51
## PostgreSQL prerequisite for nopCommerce install
46
52
47
53
nopCommerce defaults to SQL Server, but this learning path uses PostgreSQL for Arm validation. For PostgreSQL installs, `citext` is required before migration/installation. Without it, installer migrations fail with `type "citext" does not exist` (captured in local test artifacts).
48
54
49
-
Create PostgreSQL and enable `citext` before running the installer:
55
+
Create PostgreSQL and enable `citext` before running the installer. The database runs in Docker on the Cobalt VM so the nopCommerce app can connect to `127.0.0.1:5432` during the local validation phase. Replace the password value before running the command.
The `docker exec` command should print `CREATE EXTENSION`. If it prints `NOTICE: extension "citext" already exists, skipping`, the database is already prepared and you can continue.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/dotnet-migration-nopcommerce/3-checkout-build-baseline.md
@@ -12,7 +12,7 @@ Create a reproducible Arm baseline before optimization work. This page pins sour
12
12
13
13
## Clone and pin the source
14
14
15
-
Pinning the exact tag and commit avoids silent drift in dependencies and behavior.
15
+
Pinning the exact tag and commit avoids silent drift in dependencies and behavior. Run these commands on the Cobalt VM. The later commands assume you are in the `nopCommerce` repository root unless a section says otherwise.
If you open a new terminal later, return to the same repository root before running commands:
26
+
27
+
```bash
28
+
cd~/nopCommerce # replace with your clone path if different
29
+
```
30
+
25
31
## Restore and build on Arm
26
32
27
-
Run on the Arm VM to establish a native Arm baseline.
33
+
Run the restore and build on the Arm-based VM to establish a native Arm baseline. Restoring first separates package resolution problems from compilation problems, and `--no-restore` makes the build validate the already restored dependency graph.
28
34
29
35
```bash
30
36
# Restore dependencies first so build failures are easier to triage.
Start the app locally and complete installer setup with PostgreSQL.
45
+
Start the app locally and complete installer setup with PostgreSQL. Run this command in one terminal and leave it running; `dotnet run` hosts the web application and keeps the terminal attached to the server logs.
40
46
41
47
```bash
42
48
cd src/Presentation/Nop.Web
43
49
dotnet run -c Release --no-build --urls http://0.0.0.0:5000
44
50
```
45
51
46
-
Complete installation with PostgreSQL (`citext` enabled), then verify:
52
+
In a browser, open `http://<cobalt-public-ip>:5000` or use an SSH tunnel to reach `http://127.0.0.1:5000`. On the nopCommerce install page, select PostgreSQL and use the database settings from the previous section:
53
+
54
+
- Server: `127.0.0.1`
55
+
- Port: `5432`
56
+
- Database: `nopcommerce`
57
+
- User: `nop`
58
+
- Password: the value of `NOP_POSTGRES_PASSWORD`
59
+
60
+
Use sample data if you want a stable set of storefront pages for repeatable endpoint tests.
61
+
62
+
Open a second terminal, return to the repository root, and verify that the app is installed and serving storefront traffic:
47
63
48
64
```bash
65
+
cd~/nopCommerce # replace with your clone path if different
@@ -57,21 +75,130 @@ Expected after successful install: `root=200`, `install=302`.
57
75
58
76
## Baseline methodology
59
77
60
-
Do not benchmark `/install`. Baseline real storefront paths:
78
+
Do not benchmark `/install`. Baseline stable storefront paths first, then add cart and attribute-change routes only after you know the valid product IDs, attribute IDs, request method, and anti-forgery token behavior for your installed store.
- Product and category pages from your sample data
85
+
- Cart or checkout endpoints from a recorded production-like workflow
86
+
87
+
Create the endpoint tester in the repository root. The script uses only the Python standard library, submits requests with fixed concurrency, treats non-2xx and non-3xx responses as errors, and writes raw samples plus per-route summaries to JSON.
The command prints the per-route summary and writes the raw measurements to `arm_before.json`. Keep that JSON file unchanged; it is the baseline artifact used by the tuning step.
213
+
85
214
## Baseline quality rules
86
215
87
216
Use these rules before you compare any optimization result:
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/dotnet-migration-nopcommerce/4-dependency-mapping-manifests.md
+15-8Lines changed: 15 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,15 +12,15 @@ Run dependency discovery before migration changes so you understand direct refer
12
12
13
13
### 1. Map direct references
14
14
15
-
Start with project-level references to see what your app explicitly depends on.
15
+
Start from the `nopCommerce` repository root. Project-level references show what the app explicitly depends on before NuGet expands the graph. The command searches project files under `src` and prints file names and line numbers so you can jump directly to the owning project.
16
16
17
17
```bash
18
18
rg -n "<PackageReference|<ProjectReference" src
19
19
```
20
20
21
21
### 2. List transitive dependencies
22
22
23
-
Enumerate the full dependency graph; transitive packages often carry architecture-sensitive constraints.
23
+
Enumerate the full dependency graph for the web entry point. Transitive packages often carry architecture-sensitive constraints, so review the output for runtime-specific package names, native library packages, image processing libraries, database providers, and platform-specific assets.
24
24
25
25
```bash
26
26
dotnet list src/Presentation/Nop.Web/Nop.Web.csproj package --include-transitive
@@ -30,25 +30,32 @@ dotnet list src/Presentation/Nop.Web/Nop.Web.csproj package --include-transitive
30
30
31
31
Generate an SBOM so you can track all components, versions, and exposure surface as a first-class migration artifact. While not strictly necessary for migration purposes, this is a best practice that will save your team time down the road. You can also give this SBOM to an LLM to extract insights about your codebase for you.
32
32
33
+
The CycloneDX tool is installed as a .NET global tool. Add `~/.dotnet/tools` to `PATH` in the current shell so the `dotnet-CycloneDX` command is available immediately after installation.
If tool installation is blocked, treat `dotnet list --include-transitive` plus `*.deps.json` evidence as a temporary fallback, not the final state.
41
+
The `-rs` option includes project references, and `-F Json` writes JSON output that is easier to diff in CI. If tool installation is blocked, treat `dotnet list --include-transitive` plus `*.deps.json` evidence as a temporary fallback, not the final state.
39
42
40
43
### 4. Inspect package internals for native payloads
41
44
42
-
Inspect package contents directly to find architecture-specific native binaries.
45
+
Inspect package contents directly when a dependency looks architecture-sensitive. NuGet package folders are usually lower case on Linux, so set `PACKAGE_ID` to the folder name under `~/.nuget/packages` and `PACKAGE_VERSION` to the version you want to inspect.
This is how you catch hidden architecture-specific binaries.
58
+
If the command prints `runtimes/linux-arm64`, the package already carries an Arm Linux asset. If it prints only `linux-x64`, `win-x64`, or another non-Arm runtime, trace whether that asset is used by nopCommerce before you treat the dependency as portable. If there is no output, the package does not advertise runtime or native payload directories in the `.nupkg`.
0 commit comments