From d78535796aa5b277aa02a8bb1a8406d4a6cdc15c Mon Sep 17 00:00:00 2001 From: ami-GS <1991.daiki@gmail.com> Date: Mon, 17 Jun 2024 22:37:35 -0700 Subject: [PATCH 1/4] install dotnet in prepare-machine.ps1 --- scripts/log_wrapper.sh | 2 +- scripts/prepare-machine.ps1 | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/scripts/log_wrapper.sh b/scripts/log_wrapper.sh index 8da76fae7e..16e871210a 100755 --- a/scripts/log_wrapper.sh +++ b/scripts/log_wrapper.sh @@ -15,5 +15,5 @@ if [ $sessionCreated -eq 0 ]; then lttng destroy msquic babeltrace --names all $dirname/data > $dirname/quic.babel.txt - ./submodules/clog/src/clog2text/clog2text_lttng/bin/Release/net6.0/publish/clog2text_lttng -i $dirname/quic.babel.txt -s ./src/manifest/clog.sidecar -o $dirname/quic.log --showTimestamp --showCpuInfo + ./submodules/clog/src/clog2text/clog2text_lttng/bin/Debug/net6.0/publish/clog2text_lttng -i $dirname/quic.babel.txt -s ./src/manifest/clog.sidecar -o $dirname/quic.log --showTimestamp --showCpuInfo fi diff --git a/scripts/prepare-machine.ps1 b/scripts/prepare-machine.ps1 index 738cf476c8..8b5eb8810a 100644 --- a/scripts/prepare-machine.ps1 +++ b/scripts/prepare-machine.ps1 @@ -459,7 +459,23 @@ function Install-DotnetTool { } } +function Install-Dotnet { + if (!$IsLinux) { + Write-Host "Linux only" + } + + Write-Host "Installing dotnet" + # known issue https://learn.microsoft.com/en-us/dotnet/core/install/linux-package-mixup?pivots=os-linux-ubuntu + sudo bash -c "echo 'Package: dotnet* aspnet* netstandard*' >> /etc/apt/preferences" + sudo bash -c "echo 'Pin: origin packages.microsoft.com' >> /etc/apt/preferences" + sudo bash -c "echo 'Pin-Priority: -10' >> /etc/apt/preferences" + sudo apt-get update -y + sudo apt-get install dotnet-sdk-6.0 aspnetcore-runtime-6.0 dotnet-runtime-6.0 +} + function Install-Clog2Text { + Install-Dotnet + Write-Host "Initializing clog submodule" git submodule init $RootDir/submodules/clog git submodule update From 681aab692c943217a415c8efbc36b42302e7b3ea Mon Sep 17 00:00:00 2001 From: ami-GS <1991.daiki@gmail.com> Date: Mon, 17 Jun 2024 22:40:13 -0700 Subject: [PATCH 2/4] return --- scripts/prepare-machine.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/prepare-machine.ps1 b/scripts/prepare-machine.ps1 index 8b5eb8810a..335cd78d07 100644 --- a/scripts/prepare-machine.ps1 +++ b/scripts/prepare-machine.ps1 @@ -462,6 +462,7 @@ function Install-DotnetTool { function Install-Dotnet { if (!$IsLinux) { Write-Host "Linux only" + return } Write-Host "Installing dotnet" From 40c90826ba88fe7d2fddab0cafca5b93889b7a19 Mon Sep 17 00:00:00 2001 From: ami-GS <1991.daiki@gmail.com> Date: Wed, 3 Jul 2024 16:32:06 -0700 Subject: [PATCH 3/4] idempotency --- scripts/prepare-machine.ps1 | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/prepare-machine.ps1 b/scripts/prepare-machine.ps1 index 335cd78d07..6512254cd6 100644 --- a/scripts/prepare-machine.ps1 +++ b/scripts/prepare-machine.ps1 @@ -466,10 +466,20 @@ function Install-Dotnet { } Write-Host "Installing dotnet" - # known issue https://learn.microsoft.com/en-us/dotnet/core/install/linux-package-mixup?pivots=os-linux-ubuntu - sudo bash -c "echo 'Package: dotnet* aspnet* netstandard*' >> /etc/apt/preferences" - sudo bash -c "echo 'Pin: origin packages.microsoft.com' >> /etc/apt/preferences" - sudo bash -c "echo 'Pin-Priority: -10' >> /etc/apt/preferences" + + # Check /etc/apt/preperences whether it has the known issue workaround + if (Test-Path /etc/apt/preferences) { + $hasKnownIssueWorkaround = (Get-Content /etc/apt/preferences | Select-String -Pattern "Package: dotnet* aspnet* netstandard*") -ne $null + if (!$hasKnownIssueWorkaround) { + # known issue https://learn.microsoft.com/en-us/dotnet/core/install/linux-package-mixup?pivots=os-linux-ubuntu + sudo bash -c "echo 'Package: dotnet* aspnet* netstandard*' >> /etc/apt/preferences" + sudo bash -c "echo 'Pin: origin packages.microsoft.com' >> /etc/apt/preferences" + sudo bash -c "echo 'Pin-Priority: -10' >> /etc/apt/preferences" + } else { + Write-Host "Known issue workaround already applied" + } + } + sudo apt-get update -y sudo apt-get install dotnet-sdk-6.0 aspnetcore-runtime-6.0 dotnet-runtime-6.0 } From 0d80563a70d731df7441903ba7c5e8d5578c3f6a Mon Sep 17 00:00:00 2001 From: ami-GS <1991.daiki@gmail.com> Date: Tue, 5 Nov 2024 10:43:23 -0800 Subject: [PATCH 4/4] add y --- scripts/prepare-machine.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/prepare-machine.ps1 b/scripts/prepare-machine.ps1 index 6512254cd6..ceb9837e1d 100644 --- a/scripts/prepare-machine.ps1 +++ b/scripts/prepare-machine.ps1 @@ -481,7 +481,7 @@ function Install-Dotnet { } sudo apt-get update -y - sudo apt-get install dotnet-sdk-6.0 aspnetcore-runtime-6.0 dotnet-runtime-6.0 + sudo apt-get install -y dotnet-sdk-6.0 aspnetcore-runtime-6.0 dotnet-runtime-6.0 } function Install-Clog2Text {