Skip to content

Commit 5119087

Browse files
authored
Revert "MSI: Add support to all required configurations" (#4547)
* Revert "Improve tests" This reverts commit 0e1eb31. * Revert "Add all required configurations to the MSI installer" This reverts commit c89ee8d. * Revert "Make MSI more capable during setup" This reverts commit ab04b54. * Revert "Git ignore the source generated by Wix heat tool" This reverts commit 48eafef. * Revert "Validated one property and custom actions" This reverts commit 18d548f. * Revert "MSI build.sh script changes to build MSI locally" This reverts commit 469216e. * Revert "Exclude folders to build MSI locally" This reverts commit 5416185.
1 parent 4236bbf commit 5119087

File tree

12 files changed

+60
-314
lines changed

12 files changed

+60
-314
lines changed

.github/workflows/scripts/win-test-services.ps1

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ param (
44
[string]$realm = "test",
55
[string]$memory = "512",
66
[string]$with_fluentd = "true",
7-
[string]$with_msi_uninstall_comments = "",
8-
[string]$api_url = "https://api.${realm}.signalfx.com",
9-
[string]$ingest_url = "https://ingest.${realm}.signalfx.com"
7+
[string]$with_msi_uninstall_comments = ""
108
)
119

1210
$ErrorActionPreference = 'Stop'
@@ -38,24 +36,22 @@ function service_running([string]$name) {
3836
return ((Get-CimInstance -ClassName win32_service -Filter "Name = '$name'" | Select Name, State).State -Eq "Running")
3937
}
4038

41-
$expected_svc_env_vars = @{
39+
$api_url = "https://api.${realm}.signalfx.com"
40+
$ingest_url = "https://ingest.${realm}.signalfx.com"
41+
42+
check_collector_svc_environment @{
4243
"SPLUNK_CONFIG" = "${env:PROGRAMDATA}\Splunk\OpenTelemetry Collector\${mode}_config.yaml";
4344
"SPLUNK_ACCESS_TOKEN" = "$access_token";
4445
"SPLUNK_REALM" = "$realm";
45-
"SPLUNK_API_URL" = "$api_url";
46+
"SPLUNK_API_URL" = "$api_url";
4647
"SPLUNK_INGEST_URL" = "$ingest_url";
4748
"SPLUNK_TRACE_URL" = "${ingest_url}/v2/trace";
4849
"SPLUNK_HEC_URL" = "${ingest_url}/v1/log";
4950
"SPLUNK_HEC_TOKEN" = "$access_token";
5051
"SPLUNK_BUNDLE_DIR" = "${env:PROGRAMFILES}\Splunk\OpenTelemetry Collector\agent-bundle";
52+
"SPLUNK_MEMORY_TOTAL_MIB" = "$memory";
5153
}
5254

53-
if (![string]::IsNullOrWhitespace($memory)) {
54-
$expected_svc_env_vars["SPLUNK_MEMORY_TOTAL_MIB"] = "$memory"
55-
}
56-
57-
check_collector_svc_environment $expected_svc_env_vars
58-
5955
if ((service_running -name "splunk-otel-collector")) {
6056
write-host "splunk-otel-collector service is running."
6157
} else {

.github/workflows/win-package-test.yml

Lines changed: 14 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -91,39 +91,10 @@ jobs:
9191
name: agent-bundle-windows
9292
path: ./dist/agent-bundle_windows_amd64.zip
9393

94-
msi-custom-actions:
95-
runs-on: windows-2022
96-
steps:
97-
- name: Check out the codebase.
98-
uses: actions/checkout@v4
99-
100-
- name: Build Custom Actions
101-
working-directory: internal/buildscripts/packaging/msi/SplunkCustomActions
102-
run: |
103-
dotnet publish ./SplunkCustomActions.csproj -c Release -o ./bin/Release
104-
105-
- name: Package Custom Actions
106-
run: |
107-
$WixPath = "${Env:ProgramFiles(x86)}\WiX Toolset v3.14"
108-
$sfxcaDll = "${WixPath}\SDK\x64\sfxca.dll"
109-
$Env:PATH = "${WixPath}\SDK;" + $Env:PATH
110-
$customActionDir = "${PWD}\internal\buildscripts\packaging\msi\SplunkCustomActions"
111-
$customActionBinDir = "${customActionDir}\bin\Release"
112-
MakeSfxCA.exe "${PWD}\dist\SplunkCustomActions.CA.dll" `
113-
"${sfxcaDll}" `
114-
"${customActionBinDir}\SplunkCustomActions.dll" `
115-
"${customActionBinDir}\Microsoft.Deployment.WindowsInstaller.dll" `
116-
"${customActionDir}\CustomAction.config"
117-
118-
- uses: actions/upload-artifact@v4
119-
with:
120-
name: msi-custom-actions
121-
path: ./dist/SplunkCustomActions.CA.dll
122-
12394
msi-build:
12495
# Use 20.04.5 until https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/16450 is resolved
12596
runs-on: ubuntu-20.04
126-
needs: [cross-compile, agent-bundle-windows, msi-custom-actions]
97+
needs: [cross-compile, agent-bundle-windows]
12798
steps:
12899
- name: Check out the codebase.
129100
uses: actions/checkout@v4
@@ -142,18 +113,11 @@ jobs:
142113
go-version: ${{ env.GO_VERSION }}
143114
cache-dependency-path: '**/go.sum'
144115

145-
- name: Downloading agent-bundle-windows
146-
uses: actions/download-artifact@v4
116+
- uses: actions/download-artifact@v4
147117
with:
148118
name: agent-bundle-windows
149119
path: ./dist
150120

151-
- name: Downloading msi-custom-actions
152-
uses: actions/download-artifact@v4
153-
with:
154-
name: msi-custom-actions
155-
path: ./internal/buildscripts/packaging/msi/SplunkCustomActions/bin/Release
156-
157121
- name: Build MSI
158122
run: |
159123
mkdir -p dist
@@ -222,24 +186,7 @@ jobs:
222186
strategy:
223187
matrix:
224188
OS: [ "windows-2022" ]
225-
install-properties:
226-
227-
- install: "SPLUNK_ACCESS_TOKEN=fakeToken"
228-
expected: "-mode agent -access_token fakeToken -realm us0 -memory $null -with_fluentd false"
229-
230-
- install: "SPLUNK_SETUP_COLLECTOR_MODE=gateway SPLUNK_ACCESS_TOKEN=testing123"
231-
expected: "-mode gateway -access_token testing123 -realm us0 -memory $null -with_fluentd false"
232-
233-
- install: "SPLUNK_REALM=myrealm SPLUNK_ACCESS_TOKEN=testing"
234-
expected: "-mode agent -access_token testing -realm myrealm -memory $null -with_fluentd false"
235-
236-
- install: "SPLUNK_INGEST_URL=https://fake.ingest.url SPLUNK_ACCESS_TOKEN=testing"
237-
expected: "-mode agent -realm us0 -access_token testing -ingest_url \"https://fake.ingest.url\" -memory $null -with_fluentd false"
238-
239189
steps:
240-
- name: Check out the codebase.
241-
uses: actions/checkout@v4
242-
243190
- name: Downloading msi build
244191
uses: actions/download-artifact@v4
245192
with:
@@ -252,7 +199,7 @@ jobs:
252199
$msi_path = Resolve-Path .\dist\splunk-otel-collector*.msi
253200
Test-Path $msi_path
254201
Write-Host "Installing $msi_path ..."
255-
$process = Start-Process -Wait -PassThru msiexec "/i `"$msi_path`" /qn /l*v msi-install.log ${{ matrix.install-properties.install }}"
202+
$process = Start-Process -Wait -PassThru msiexec "/i `"$msi_path`" /qn /l*v msi-install.log"
256203
if ($process.ExitCode -ne 0) {
257204
throw "MSI installation failed with exit code $($process.ExitCode)"
258205
}
@@ -261,15 +208,21 @@ jobs:
261208
if: ${{ failure() }}
262209
run: Get-Content msi-install.log
263210

211+
- name: Set environment variables required to start the collector service
212+
run: |
213+
$ErrorActionPreference = 'Stop'
214+
[Environment]::SetEnvironmentVariable("SPLUNK_ACCESS_TOKEN", "123456e", "Machine")
215+
[Environment]::SetEnvironmentVariable("SPLUNK_API_URL", "https://non.existent.for.tests", "Machine")
216+
[Environment]::SetEnvironmentVariable("SPLUNK_HEC_TOKEN", "098765e", "Machine")
217+
[Environment]::SetEnvironmentVariable("SPLUNK_HEC_URL", "https://non.existent.for.tests/v1/log", "Machine")
218+
[Environment]::SetEnvironmentVariable("SPLUNK_INGEST_URL", "https://non.existent.for.tests", "Machine")
219+
[Environment]::SetEnvironmentVariable("SPLUNK_TRACE_URL", "https://non.existent.for.tests/v2/trace", "Machine")
220+
[Environment]::SetEnvironmentVariable("SPLUNK_BUNDLE_DIR", "%ProgramFiles%\Splunk\OpenTelemetry", "Machine")
221+
264222
- name: Start the collector service
265223
run:
266224
Start-Service splunk-otel-collector
267225

268-
- name: Check registry expectations
269-
run: |
270-
$ErrorActionPreference = 'Stop'
271-
& ${{ github.workspace }}\.github\workflows\scripts\win-test-services.ps1 ${{ matrix.install-properties.expected }}
272-
273226
- name: Stop the collector service
274227
run:
275228
Stop-Service splunk-otel-collector

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ coverage_all.txt
2424
coverage_old.txt
2525
coverage.html
2626

27-
# Exclude folders used to build MSI locally
28-
/build/
29-
/work/
30-
3127
# Wix
3228
*.wixobj
3329
*.wixpdb

internal/buildscripts/packaging/msi/SplunkCustomActions/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

internal/buildscripts/packaging/msi/SplunkCustomActions/CustomAction.config

Lines changed: 0 additions & 6 deletions
This file was deleted.

internal/buildscripts/packaging/msi/SplunkCustomActions/CustomActions.cs

Lines changed: 0 additions & 61 deletions
This file was deleted.

internal/buildscripts/packaging/msi/SplunkCustomActions/SplunkCustomActions.csproj

Lines changed: 0 additions & 29 deletions
This file was deleted.

internal/buildscripts/packaging/msi/SplunkCustomActions/SplunkCustomActions.sln

Lines changed: 0 additions & 24 deletions
This file was deleted.

internal/buildscripts/packaging/msi/make.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function Install-Tools {
3535
$ProgressPreference = $OriginalPref
3636

3737
choco install wixtoolset -y
38-
setx /m PATH "%PATH%;C:\Program Files (x86)\WiX Toolset v3.14\bin"
38+
setx /m PATH "%PATH%;C:\Program Files (x86)\WiX Toolset v3.11\bin"
3939
refreshenv
4040
}
4141

0 commit comments

Comments
 (0)