feat(burnin): add build.sh for Linux guest + Start-BurnInTest-Linux.ps1
gitea/burnin-dummy/build.sh: bash equivalent of build.ps1 (sleep 30, writes dist/build-info.txt). Needed because powershell is not present on LinuxBuild2404 template. scripts/Start-BurnInTest-Linux.ps1: burn-in wrapper for LinuxBuild2404 template (SnapshotName=BaseClean-Linux, GuestOS=Linux, BuildCommand='bash build.sh'). Mirrors Start-BurnInTest.ps1.
This commit is contained in:
@@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Fake build script per il repo burnin-dummy — variante Linux.
|
||||||
|
# Simula un build reale: attende ~30s, poi scrive dist/build-info.txt.
|
||||||
|
# Invoke-RemoteBuild impacchetta /opt/ci/build/<repo>/dist come artifacts.zip.
|
||||||
|
# Committare questo file come build.sh nella root del repo burnin-dummy.
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
DIST_DIR="$(dirname "$0")/dist"
|
||||||
|
mkdir -p "$DIST_DIR"
|
||||||
|
|
||||||
|
# Simula lavoro di build (~30 s).
|
||||||
|
echo '[build.sh] Simulating build work (~30s)...'
|
||||||
|
sleep 30
|
||||||
|
|
||||||
|
# Scrive un artifact marker con metadati del run.
|
||||||
|
cat > "$DIST_DIR/build-info.txt" <<EOF
|
||||||
|
build-ok
|
||||||
|
date=$(date '+%Y-%m-%d %H:%M:%S')
|
||||||
|
host=$(hostname)
|
||||||
|
pid=$$
|
||||||
|
EOF
|
||||||
|
|
||||||
|
echo "[build.sh] Artifact written to $DIST_DIR"
|
||||||
@@ -0,0 +1,75 @@
|
|||||||
|
#Requires -Version 5.1
|
||||||
|
<#
|
||||||
|
.SYNOPSIS
|
||||||
|
Wrapper di lancio per Test-CapacityBurnIn.ps1 con il template Linux (LinuxBuild2404).
|
||||||
|
|
||||||
|
.DESCRIPTION
|
||||||
|
Esegue il burn-in a 4 job / 3 round contro il repo burnin-dummy su Gitea,
|
||||||
|
usando il template Ubuntu 24.04. Speculare a Start-BurnInTest.ps1 (Windows).
|
||||||
|
|
||||||
|
Prerequisiti:
|
||||||
|
- Repo burnin-dummy su Gitea con build.sh nella root del branch main
|
||||||
|
- Credenziali guest nel Credential Manager target 'BuildVMGuest'
|
||||||
|
(usate per il PAT Gitea; SSH usa chiave F:\CI\keys\ci_linux)
|
||||||
|
- Gitea PAT nel Credential Manager target 'GiteaPAT'
|
||||||
|
New-StoredCredential -Target 'GiteaPAT' -UserName 'ci' -Password '<pat>' -Persist LocalMachine
|
||||||
|
- Template LinuxBuild2404 con snapshot BaseClean-Linux in stato powered-off
|
||||||
|
- VMware Tools attivo nel guest (per auto-detect IP)
|
||||||
|
- build.sh eseguibile (chmod +x) nel repo — oppure viene richiamato via bash
|
||||||
|
|
||||||
|
Esempi di utilizzo:
|
||||||
|
# Run completo (3 round, 4 job paralleli)
|
||||||
|
.\Start-BurnInTest-Linux.ps1
|
||||||
|
|
||||||
|
# Smoke veloce (1 round, 2 job)
|
||||||
|
.\Start-BurnInTest-Linux.ps1 -Rounds 1 -Parallelism 2
|
||||||
|
|
||||||
|
# Build piu' lungo per osservare concorrenza prolungata
|
||||||
|
.\Start-BurnInTest-Linux.ps1 -Rounds 1 -BuildCommand 'sleep 120'
|
||||||
|
|
||||||
|
.PARAMETER Rounds
|
||||||
|
Numero di round sequenziali. Default: 3.
|
||||||
|
|
||||||
|
.PARAMETER Parallelism
|
||||||
|
Job concorrenti per round. Default: 4.
|
||||||
|
|
||||||
|
.PARAMETER BuildCommand
|
||||||
|
Comando da eseguire nel guest come passo build (eseguito via SSH).
|
||||||
|
Default: 'bash build.sh'
|
||||||
|
|
||||||
|
.PARAMETER RoundTimeoutMinutes
|
||||||
|
Minuti massimi di attesa per ogni round prima di interrompere i job rimasti.
|
||||||
|
Default: 60.
|
||||||
|
#>
|
||||||
|
param(
|
||||||
|
[int] $Rounds = 3,
|
||||||
|
[int] $Parallelism = 4,
|
||||||
|
[string] $BuildCommand = 'bash build.sh',
|
||||||
|
[int] $RoundTimeoutMinutes = 60
|
||||||
|
)
|
||||||
|
|
||||||
|
Set-StrictMode -Version Latest
|
||||||
|
$ErrorActionPreference = 'Stop'
|
||||||
|
|
||||||
|
$scriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||||
|
|
||||||
|
$burnInParams = @{
|
||||||
|
RepoUrl = 'https://gitea.emulab.it/Simone/burnin-dummy.git'
|
||||||
|
Branch = 'main'
|
||||||
|
TemplatePath = 'F:\CI\Templates\LinuxBuild2404\LinuxBuild2404.vmx'
|
||||||
|
SnapshotName = 'BaseClean-Linux'
|
||||||
|
CloneBaseDir = 'F:\CI\BuildVMs'
|
||||||
|
ArtifactBaseDir = 'F:\CI\Artifacts'
|
||||||
|
GuestCredentialTarget = 'BuildVMGuest'
|
||||||
|
GiteaCredentialTarget = 'GiteaPAT'
|
||||||
|
VmrunPath = 'C:\Program Files (x86)\VMware\VMware Workstation\vmrun.exe'
|
||||||
|
GuestOS = 'Linux'
|
||||||
|
BuildCommand = $BuildCommand
|
||||||
|
Parallelism = $Parallelism
|
||||||
|
Rounds = $Rounds
|
||||||
|
RoundTimeoutMinutes = $RoundTimeoutMinutes
|
||||||
|
}
|
||||||
|
|
||||||
|
& "$scriptDir\Test-CapacityBurnIn.ps1" @burnInParams
|
||||||
|
|
||||||
|
exit $LASTEXITCODE
|
||||||
Reference in New Issue
Block a user