diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index dfa7c0c..85cb539 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -53,7 +53,7 @@ The runner host **never executes build tools directly**. Its only role is orches │ │ ├── Clone_Job_002.vmx │ │ │ │ └── Clone_Job_003.vmx │ │ │ └───────────────────────────────────────────────────────────────────┘ │ -│ │ WinRM :5985 (192.168.11.0/24) │ +│ │ WinRM :5985 (192.168.79.0/24 NAT) │ └──────────────────────────────────┼──────────────────────────────────────┘ │ ┌────────────────────────┼──────────────────────────┐ @@ -64,13 +64,14 @@ The runner host **never executes build tools directly**. Its only role is orches │ (ephemeral) │ │ (ephemeral) │ │ (ephemeral) │ │ │ │ │ │ │ │ VS Build Tools │ │ VS Build Tools │ │ VS Build Tools │ -│ .NET SDK 8 │ │ .NET SDK 8 │ │ .NET SDK 8 │ -│ Git │ │ Git │ │ Git │ +│ 2026 (v145) │ │ 2026 (v145) │ │ 2026 (v145) │ +│ .NET SDK 10 │ │ .NET SDK 10 │ │ .NET SDK 10 │ +│ Python 3.13.3 │ │ Python 3.13.3 │ │ Python 3.13.3 │ │ WinRM enabled │ │ WinRM enabled │ │ WinRM enabled │ │ │ │ │ │ │ -│ > git clone │ │ > git clone │ │ > git clone │ -│ > dotnet build │ │ > dotnet build │ │ > dotnet build │ -│ > artifacts │ │ > artifacts │ │ > artifacts │ +│ > unzip src │ │ > unzip src │ │ > unzip src │ +│ > python build │ │ > python build │ │ > python build │ +│ > dist/ │ │ > dist/ │ │ > dist/ │ │ │ │ │ │ │ │ [DESTROYED] │ │ [DESTROYED] │ │ [DESTROYED] │ └──────────────────┘ └──────────────────┘ └──────────────────┘ diff --git a/docs/BEST-PRACTICES.md b/docs/BEST-PRACTICES.md index a88bc28..ec7c915 100644 --- a/docs/BEST-PRACTICES.md +++ b/docs/BEST-PRACTICES.md @@ -35,7 +35,7 @@ $cred = Get-StoredCredential -Target 'BuildVMGuest' ### Current setup (HTTP / port 5985) Acceptable for an **isolated lab network** where: -- Build VMs are on a dedicated host-only VMware network (192.168.11.0/24 — VMnet11 dedicated CI) +- Build VMs sono su VMnet8 NAT (192.168.79.0/24) — raggiungibili dall'host, internet via NAT - No external traffic reaches port 5985 - Credentials are managed via Windows Credential Manager diff --git a/docs/CI-FLOW.md b/docs/CI-FLOW.md index b6b4d2f..fe45ea6 100644 --- a/docs/CI-FLOW.md +++ b/docs/CI-FLOW.md @@ -54,16 +54,24 @@ The workflow YAML defines steps that run as PowerShell commands **on the host**. The first substantive step calls `Invoke-CIJob.ps1`: ```yaml -- name: Build in ephemeral VM +- name: Run CI Job shell: pwsh run: | - .\scripts\Invoke-CIJob.ps1 ` - -JobId "${{ github.run_id }}" ` - -RepoUrl "${{ env.GITEA_REPO_URL }}" ` - -Branch "${{ github.ref_name }}" ` - -Commit "${{ github.sha }}" + & 'N:\Code\Workspace\Local-CI-CD-System\scripts\Invoke-CIJob.ps1' ` + -JobId '${{ github.run_id }}' ` + -RepoUrl 'ssh://gitea-ci/Simone/.git' ` + -Branch '${{ github.ref_name }}' ` + -Commit '${{ github.sha }}' ` + -TemplatePath $env:GITEA_CI_TEMPLATE_PATH ` + -Submodules ` + -BuildCommand 'python build_plugin.py --final --dist-dir dist' ` + -GuestArtifactSource 'dist' + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } ``` +> Il parametro `-VMIPAddress` **non è più necessario** — l'IP viene rilevato automaticamente +> tramite `vmrun getGuestIPAddress` dopo l'avvio della VM. + --- ### Step 4 — Invoke-CIJob.ps1: Clone VM diff --git a/docs/OPTIMIZATION.md b/docs/OPTIMIZATION.md index 727f833..04dbd2b 100644 --- a/docs/OPTIMIZATION.md +++ b/docs/OPTIMIZATION.md @@ -35,16 +35,16 @@ Tier 0: Base OS Install (Windows only, no tools) Tier 1: Build Toolchain └── Snapshot: "BaseClean" ← CLONE SOURCE (weekly refresh) - Includes: VS Build Tools 2022, .NET SDK, Git, WinRM config + Includes: VS Build Tools 2026, .NET SDK 10.0.203, Python 3.13.3, Git, WinRM config Requirement: ALL linked clones must reference this exact snapshot ``` ### Refresh Schedule -| Snapshot | Refresh Frequency | Trigger | -|----------|------------------|-------| -| `OSBase` | Quarterly | Windows cumulative update | -| `BaseClean` | Weekly/Monthly | .NET SDK patch, security update, VS update | +| Snapshot | Refresh Frequency | Trigger | +| ----------- | ----------------- | ------------------------------------------ | +| `OSBase` | Quarterly | Windows cumulative update | +| `BaseClean` | Weekly/Monthly | .NET SDK patch, security update, VS update | > **Note:** Windows Server 2025 KMS lease = 180 giorni. Prima della scadenza: > boot template su VMnet8 (NAT) → `slmgr /ato` → spegni → nuovo snapshot `BaseClean`. @@ -55,15 +55,15 @@ Tier 1: Build Toolchain ### RAM Budget (i9-10900X · 64 GB) -| Component | RAM Usage | -|-----------|----------| -| Windows host OS | ~4 GB | -| VMware Workstation | ~0.5 GB | -| Gitea server | ~0.5–1 GB | -| act_runner service | ~100 MB | -| Each build VM (idle) | ~2–3 GB | -| Each build VM (active MSBuild/Python) | ~6–8 GB | -| **Headroom target (20%)** | ~13 GB | +| Component | RAM Usage | +| ------------------------------------- | --------- | +| Windows host OS | ~4 GB | +| VMware Workstation | ~0.5 GB | +| Gitea server | ~0.5–1 GB | +| act_runner service | ~100 MB | +| Each build VM (idle) | ~2–3 GB | +| Each build VM (active MSBuild/Python) | ~6–8 GB | +| **Headroom target (20%)** | ~13 GB | ``` Available for VMs: 64 - 4 - 0.5 - 1 - 0.1 - 13 = ~45 GB diff --git a/gitea/workflow-example.yml b/gitea/workflow-example.yml index a371270..55fd0a3 100644 --- a/gitea/workflow-example.yml +++ b/gitea/workflow-example.yml @@ -31,14 +31,8 @@ jobs: # GITEA_CI_TEMPLATE_PATH is injected by runner/config.yaml global envs # GITEA_CI_CLONE_BASE_DIR is injected by runner/config.yaml global envs - # IP address for this build VM. - # For parallel builds, each concurrent job needs a unique IP. - # Assign via Gitea matrix or a simple offset scheme. - # Example: use a fixed IP per runner slot, mapped by capacity index. - # For single concurrent builds: use one fixed IP. - BUILD_VM_IP: "192.168.11.101" - # Gitea Credential Manager target (set in runner/config.yaml) + # The VM IP is auto-detected via vmrun getGuestIPAddress — no BUILD_VM_IP needed. GUEST_CRED_TARGET: "BuildVMGuest" steps: @@ -66,8 +60,9 @@ jobs: -RepoUrl "${{ github.server_url }}/${{ github.repository }}.git" ` -Branch "${{ github.ref_name }}" ` -Commit "${{ github.sha }}" ` - -Configuration "Release" ` - -VMIPAddress "$env:BUILD_VM_IP" ` + -Submodules ` + -BuildCommand 'python build_plugin.py --final --dist-dir dist' ` + -GuestArtifactSource 'dist' ` -GuestCredentialTarget "$env:GUEST_CRED_TARGET" if ($LASTEXITCODE -ne 0) {