Skip to content

Commit 8036680

Browse files
[opampsupervisor] Add MSI installer to release artifacts (#1261)
* Add `.DS_Store` to gitignore Signed-off-by: Douglas Camata <[email protected]> * Add msi build for the opampsupervisor Signed-off-by: Douglas Camata <[email protected]> * Add json schema hint for yaml language server Signed-off-by: Douglas Camata <[email protected]> * Build MSI installer for the `opampsupervisor` Signed-off-by: Douglas Camata <[email protected]> * Add `.zed` to gitignore Signed-off-by: Douglas Camata <[email protected]> * Build and upload MSI in opampsupervisor ci and release Signed-off-by: Douglas Camata <[email protected]> * Remove copy of wxs into core repo dir Signed-off-by: Douglas Camata <[email protected]> * Install wixl for binary CI Signed-off-by: Douglas Camata <[email protected]> * Fix path for msi artifact Signed-off-by: Douglas Camata <[email protected]> * Remove unnecessary comment Signed-off-by: Douglas Camata <[email protected]> * Fix MSI path Signed-off-by: Douglas Camata <[email protected]> * Add changelog entry Signed-off-by: Douglas Camata <[email protected]> * Use different upgrade code and directory name Signed-off-by: Douglas Camata <[email protected]> * Create program data folder for Supervisor Signed-off-by: Douglas Camata <[email protected]> * Update collector config path in windows example Signed-off-by: Douglas Camata <[email protected]> * Update .github/workflows/base-ci-binary.yaml --------- Signed-off-by: Douglas Camata <[email protected]> Signed-off-by: Douglas Camata Co-authored-by: Moritz Wiesinger <[email protected]>
1 parent f0a80cc commit 8036680

File tree

18 files changed

+221
-0
lines changed

18 files changed

+221
-0
lines changed

.chloggen/opampsupevisor-msi.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
2+
change_type: enhancement
3+
4+
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
5+
component: opampsupervisor
6+
7+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
8+
note: Add MSI package release artifacts for the OpAMP supervisor
9+
10+
# One or more tracking issues or pull requests related to the change
11+
issues: [1261]
12+
13+
# (Optional) One or more lines of additional information to render under the primary note.
14+
# These lines will be padded with 2 spaces and then inserted directly into the document.
15+
# Use pipe (|) for multiline entries.
16+
subtext:
17+
18+
# Optional: The change log or logs in which this entry should be included.
19+
# e.g. '[user]' or '[user, api]'
20+
# Include 'user' if the change is relevant to end users.
21+
# Include 'api' if there is a change to a library API.
22+
# Default: '[user]'
23+
change_logs: [user]

.github/workflows/base-binary-release.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ jobs:
8585
- name: Copy Dockerfile to Collector dependency directory
8686
run: cp cmd/${{ inputs.binary }}/Dockerfile ${{ inputs.dependency-target-folder }}/cmd/${{ inputs.binary }}/Dockerfile
8787

88+
- name: Copy MSI files to Core Repo directory
89+
run: |
90+
cp cmd/${{ inputs.binary }}/opentelemetry.ico ${{ inputs.dependency-target-folder }}/cmd/${{ inputs.binary }}
91+
cp cmd/${{ inputs.binary }}/config.windows.example.yaml ${{ inputs.dependency-target-folder }}/cmd/${{ inputs.binary }}
92+
8893
- uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
8994
with:
9095
cosign-release: "v2.6.1"

.github/workflows/base-ci-binary.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ on:
2222
type: boolean
2323
default: false
2424
description: "Set to true if linux packages should be uploaded as an artifact"
25+
windows-msi:
26+
required: false
27+
type: boolean
28+
default: false
29+
description: 'Set to true if windows msi should be uploaded as an artifact'
2530

2631
permissions:
2732
contents: read
@@ -49,6 +54,12 @@ jobs:
4954
- name: Copy Dockerfile to Core Repo directory
5055
run: cp cmd/${{ inputs.binary }}/Dockerfile ${{ inputs.dependency-target-folder }}/cmd/${{ inputs.binary }}/Dockerfile
5156

57+
- name: Copy MSI files to Core Repo directory
58+
if: inputs.windows-msi == true
59+
run: |
60+
cp cmd/${{ inputs.binary }}/opentelemetry.ico ${{ inputs.dependency-target-folder }}/cmd/${{ inputs.binary }}
61+
cp cmd/${{ inputs.binary }}/config.windows.example.yaml ${{ inputs.dependency-target-folder }}/cmd/${{ inputs.binary }}
62+
5263
- uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
5364
with:
5465
cosign-release: "v2.6.1"
@@ -66,6 +77,12 @@ jobs:
6677
with:
6778
go-version: "~1.25.0"
6879

80+
- name: Setup wixl # Required to build MSI packages for Windows
81+
if: runner.os != 'Windows'
82+
run: |
83+
sudo apt-get update
84+
sudo apt-get install -y wixl
85+
6986
- name: Check GoReleaser
7087
uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0
7188
with:
@@ -96,3 +113,12 @@ jobs:
96113
dist/*amd64*.deb
97114
dist/*amd64*.rpm
98115
if-no-files-found: error
116+
117+
- name: Upload Windows MSI
118+
if: ${{ inputs.windows-msi == true }}
119+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
120+
with:
121+
name: windows-msi
122+
path: |
123+
dist/msi/**/*.msi
124+
if-no-files-found: error

.github/workflows/ci-opampsupervisor.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@ jobs:
3838
collector-dependency: 'open-telemetry/opentelemetry-collector-contrib'
3939
dependency-target-folder: '.contrib'
4040
linux-packages: true
41+
windows-msi: true
4142
secrets: inherit
4243
permissions: write-all

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ dist/
77
.core
88
.contrib
99
.tools
10+
.DS_Store
11+
.zed

cmd/builder/.goreleaser.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
12
version: 2
23
project_name: opentelemetry-collector-releases
34
env:

cmd/goreleaser/internal/distro_opamp.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ var (
3333
withBinaryMonorepo(".contrib/cmd/opampsupervisor").
3434
withDefaultBinaryRelease(opampReleaseHeader).
3535
withDefaultNfpms().
36+
withDefaultMSIConfig().
3637
// This is required because of some non-obvious path/workdir handling in
3738
// Github Actions specific to the binaries CI.
3839
withConfigFunc(func(d *distribution) {
@@ -48,6 +49,9 @@ var (
4849
d.Nfpms[0].Scripts.PreInstall = path.Join("cmd", d.Name, d.Nfpms[0].Scripts.PreInstall)
4950
d.Nfpms[0].Scripts.PostInstall = path.Join("cmd", d.Name, d.Nfpms[0].Scripts.PostInstall)
5051
d.Nfpms[0].Scripts.PreRemove = path.Join("cmd", d.Name, d.Nfpms[0].Scripts.PreRemove)
52+
53+
d.MsiConfig[0].Files = append(d.MsiConfig[0].Files, "config.windows.example.yaml")
54+
d.MsiConfig[0].WXS = path.Join("cmd", d.Name, d.MsiConfig[0].WXS)
5155
}).
5256
withNightlyConfig().
5357
build()

cmd/goreleaser/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ func main() {
2525
}
2626
project := internal.BuildDistribution(*distFlag, *contribBuildOrRestFlag)
2727

28+
os.Stdout.WriteString("# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json\n")
2829
e := yaml.NewEncoder(os.Stdout)
2930
e.SetIndent(2)
3031
if err := e.Encode(&project); err != nil {

cmd/opampsupervisor/.goreleaser.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# yaml-language-server: $schema=https://goreleaser.com/static/schema-pro.json
12
version: 2
23
project_name: opentelemetry-collector-releases
34
env:
@@ -13,6 +14,13 @@ release:
1314
name: opentelemetry-collector-releases
1415
make_latest: "false"
1516
header: '### Release of OpAMP supervisor artifacts'
17+
msi:
18+
- id: opampsupervisor
19+
name: opampsupervisor_{{ .Version }}_{{ .Os }}_{{ .MsiArch }}
20+
wxs: cmd/opampsupervisor/windows-installer.wxs
21+
extra_files:
22+
- opentelemetry.ico
23+
- config.windows.example.yaml
1624
builds:
1725
- id: opampsupervisor-linux
1826
goos:
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
server:
2+
endpoint: 'http://:4320/v1/opamp'
3+
headers:
4+
X-Auth: 'some_token'
5+
tls:
6+
insecure_skip_verify: false
7+
8+
capabilities:
9+
reports_effective_config: true
10+
reports_own_metrics: true
11+
reports_own_logs: true
12+
reports_own_traces: true
13+
reports_health: true
14+
accepts_remote_config: true
15+
reports_remote_config: true
16+
17+
agent:
18+
executable: 'C:\Program Files\OpenTelemetry Collector\otelcol-contrib.exe'
19+
passthrough_logs: true
20+
21+
# This passes config files to the Collector.
22+
config_files:
23+
- 'C:\Program Files\OpenTelemetry Collector\config.yaml'
24+
25+
# This adds CLI arguments to the Collector.
26+
args: []
27+
28+
# This adds env vars to the Collector process.
29+
env: {}
30+
31+
# The storage can be used for many things:
32+
# - It stores configuration sent by the OpAMP server so that new collector
33+
# processes can start with the most known desired config.
34+
storage:
35+
directory: 'C:\ProgramData\opampsupervisor'
36+
37+
telemetry:
38+
logs:
39+
level: debug
40+
output_paths:
41+
- 'C:\ProgramData\opampsupervisor\logs\opampsupervisor.log'

0 commit comments

Comments
 (0)