Skip to content

Commit

Permalink
feat: Update Unix install script (#1757)
Browse files Browse the repository at this point in the history
* update unix install scripts

* dedup messages

* docker updates

* docker working

* rename to supervisor.yaml, add pre & post remove scripts, remove uninstall section, update entrypoint for docker images

* update permission for supervisor cfg

* new supervisor storage changes

* use INSTALL_DIR const

* messing around with pre-post scripts

* use shell formatter & finalize scripts

* remove returns, update msg, remove log dir creation in goreleaser

* move supervisors files creation into goreleaser

* only pull most recent contrib commit, change replace to internal pkg for gcp exporters

* chown opampsupervisor

* remove user var
  • Loading branch information
dpaasman00 committed Aug 16, 2024
1 parent 634fcc5 commit 8ef84e2
Show file tree
Hide file tree
Showing 22 changed files with 728 additions and 624 deletions.
15 changes: 14 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ nfpms:
mode: 0755
owner: observiq-otel-collector
group: observiq-otel-collector
# TODO: (dakota) evaluate this file once supervisor has support for configuring agent logging
- src: release_deps/logging.yaml
dst: /opt/observiq-otel-collector/logging.yaml
file_info:
Expand Down Expand Up @@ -202,12 +203,16 @@ nfpms:
mode: 0750
owner: observiq-otel-collector
group: observiq-otel-collector
- dst: /opt/observiq-otel-collector/log
- dst: /opt/observiq-otel-collector/supervisor_storage
type: dir
file_info:
mode: 0750
owner: observiq-otel-collector
group: observiq-otel-collector
- dst: /opt/observiq-otel-collector/supervisor_storage/effective.yaml
type: ghost
- dst: /opt/observiq-otel-collector/supervisor_storage/agent.log
type: ghost
- src: service/observiq-otel-collector.service
dst: /usr/lib/systemd/system/observiq-otel-collector.service
type: config|noreplace
Expand All @@ -232,6 +237,8 @@ nfpms:
scripts:
preinstall: ./scripts/package/preinstall.sh
postinstall: ./scripts/package/postinstall.sh
preremove: ./scripts/package/preremove.sh
postremove: ./scripts/package/postremove.sh

# Build container images with docker buildx (mutli arch builds).
dockers:
Expand All @@ -240,6 +247,7 @@ dockers:
goarch: amd64
ids:
- collector
- supervisor
image_templates:
- "observiq/bindplane-agent-amd64:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-minimal"
- "ghcr.io/observiq/bindplane-agent-amd64:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-minimal"
Expand All @@ -262,6 +270,7 @@ dockers:
goarch: arm64
ids:
- collector
- supervisor
image_templates:
- "observiq/bindplane-agent-arm64:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-minimal"
- "ghcr.io/observiq/bindplane-agent-arm64:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-minimal"
Expand All @@ -284,6 +293,7 @@ dockers:
goarch: amd64
ids:
- collector
- supervisor
image_templates:
- "observiq/observiq-otel-collector-amd64:latest"
- "observiq/observiq-otel-collector-amd64:{{ .Major }}.{{ .Minor }}.{{ .Patch }}"
Expand Down Expand Up @@ -329,6 +339,7 @@ dockers:
goarch: arm64
ids:
- collector
- supervisor
image_templates:
- "observiq/observiq-otel-collector-arm64:latest"
- "observiq/observiq-otel-collector-arm64:{{ .Major }}.{{ .Minor }}.{{ .Patch }}"
Expand Down Expand Up @@ -375,6 +386,7 @@ dockers:
goarch: amd64
ids:
- collector
- supervisor
image_templates:
- "observiq/observiq-otel-collector-amd64:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-ubi8"
- "ghcr.io/observiq/observiq-otel-collector-amd64:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-ubi8"
Expand Down Expand Up @@ -402,6 +414,7 @@ dockers:
goarch: arm64
ids:
- collector
- supervisor
image_templates:
- "observiq/observiq-otel-collector-arm64:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-ubi8"
- "ghcr.io/observiq/observiq-otel-collector-arm64:{{ .Major }}.{{ .Minor }}.{{ .Patch }}-ubi8"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ updater:
# Runs the supervisor invoking the agent build in /dist
.PHONY: run-supervisor
run-supervisor:
opampsupervisor --config ./local/supervisor-config.yaml
opampsupervisor --config ./local/supervisor.yaml

# Ensures the supervisor and agent are stopped
.PHONY: kill
Expand Down
2 changes: 1 addition & 1 deletion buildscripts/download-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ SUPERVISOR_REPO="https://github.com/open-telemetry/opentelemetry-collector-contr
PLATFORMS=("linux/amd64" "linux/arm64" "linux/arm" "linux/ppc64" "linux/ppc64le" "darwin/amd64" "darwin/arm64" "windows/amd64")

mkdir "$DOWNLOAD_DIR/supervisor_bin"
$(cd $DOWNLOAD_DIR && git clone "$SUPERVISOR_REPO")
$(cd $DOWNLOAD_DIR && git clone --depth 1 "$SUPERVISOR_REPO")
cd "$DOWNLOAD_DIR/opentelemetry-collector-contrib/cmd/opampsupervisor"
go get github.com/open-telemetry/opentelemetry-collector-contrib/cmd/opampsupervisor/supervisor
for PLATFORM in "${PLATFORMS[@]}"; do
Expand Down
3 changes: 2 additions & 1 deletion docker/Dockerfile.scratch
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ COPY --from=stage --chown=otel:otel /etc/otel /etc/otel
COPY --from=stage --chown=otel:otel /etc/otel/storage /etc/otel/storage

COPY observiq-otel-collector /collector/observiq-otel-collector
COPY opampsupervisor /collector/opampsupervisor

ENV OIQ_OTEL_COLLECTOR_HOME=/etc/otel
ENV OIQ_OTEL_COLLECTOR_STORAGE=/etc/otel/storage

USER otel
WORKDIR /etc/otel
ENTRYPOINT ["/collector/observiq-otel-collector"]
ENTRYPOINT [ "/collector/opampsupervisor", "--config", "/etc/otel/supervisor.yaml" ]
6 changes: 3 additions & 3 deletions docker/Dockerfile.ubi8
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ COPY LICENSE /licenses/observiq-otel-collector.license
COPY release_deps/VERSION.txt /etc/otel/VERSION.txt

COPY observiq-otel-collector /collector/observiq-otel-collector
COPY opampsupervisor /collector/opampsupervisor

COPY release_deps/opentelemetry-java-contrib-jmx-metrics.jar /opt/opentelemetry-java-contrib-jmx-metrics.jar
COPY release_deps/plugins /etc/otel/plugins

Expand All @@ -71,6 +73,4 @@ RUN chmod 0600 \
USER otel
WORKDIR /etc/otel

# User should mount /etc/otel/config.yaml at runtime using docker volumes / k8s configmap unless
# connecting to an OpAMP platform.
ENTRYPOINT [ "/collector/observiq-otel-collector" ]
ENTRYPOINT [ "/collector/opampsupervisor", "--config", "/etc/otel/supervisor.yaml" ]
6 changes: 3 additions & 3 deletions docker/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ COPY LICENSE /licenses/observiq-otel-collector.license
COPY release_deps/VERSION.txt /etc/otel/VERSION.txt

COPY observiq-otel-collector /collector/observiq-otel-collector
COPY opampsupervisor /collector/opampsupervisor

COPY release_deps/opentelemetry-java-contrib-jmx-metrics.jar /opt/opentelemetry-java-contrib-jmx-metrics.jar
COPY release_deps/plugins /etc/otel/plugins

Expand All @@ -72,6 +74,4 @@ RUN chmod 0600 \
USER otel
WORKDIR /etc/otel

# User should mount /etc/otel/config.yaml at runtime using docker volumes / k8s configmap unless
# connecting to an OpAMP platform.
ENTRYPOINT [ "/collector/observiq-otel-collector" ]
ENTRYPOINT [ "/collector/opampsupervisor", "--config", "/etc/otel/supervisor.yaml" ]
2 changes: 1 addition & 1 deletion exporter/googlecloudexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,4 @@ require (
)

// Needed until 'version' package changes are included in a release
replace github.com/observiq/bindplane-agent/internal/version v1.56.0 => github.com/observiq/bindplane-agent/internal/version v0.0.0-20240717172323-a1d3e6ed4aab
replace github.com/observiq/bindplane-agent/internal/version => ../../internal/version
2 changes: 0 additions & 2 deletions exporter/googlecloudexporter/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,6 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk=
github.com/observiq/bindplane-agent/internal/version v0.0.0-20240717172323-a1d3e6ed4aab h1:sj9huSMQ9MqOWRGJ1OJtIhpXZZpg1OoB8YvJ3kBCYlg=
github.com/observiq/bindplane-agent/internal/version v0.0.0-20240717172323-a1d3e6ed4aab/go.mod h1:TfycUeyrZvoFI6crSlts5HxdHgxYtoYaXwSZ2ZQIj5I=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlecloudexporter v0.106.1 h1:EYGXhnPSrsat4GBRTfZKy4daIkYE2ygFKTO3UCJb0qY=
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlecloudexporter v0.106.1/go.mod h1:C9B4brSSB+jdAxg8JZL1icsaiMc1hJl3gnw/Fl5dS8w=
Expand Down
2 changes: 1 addition & 1 deletion exporter/googlemanagedprometheusexporter/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@ require (
)

// Needed until 'version' package changes are included in a release
replace github.com/observiq/bindplane-agent/internal/version v1.56.0 => github.com/observiq/bindplane-agent/internal/version v0.0.0-20240717172323-a1d3e6ed4aab
replace github.com/observiq/bindplane-agent/internal/version => ../../internal/version
2 changes: 0 additions & 2 deletions exporter/googlemanagedprometheusexporter/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,6 @@ github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8m
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/npillmayer/nestext v0.1.3/go.mod h1:h2lrijH8jpicr25dFY+oAJLyzlya6jhnuG+zWp9L0Uk=
github.com/observiq/bindplane-agent/internal/version v0.0.0-20240717172323-a1d3e6ed4aab h1:sj9huSMQ9MqOWRGJ1OJtIhpXZZpg1OoB8YvJ3kBCYlg=
github.com/observiq/bindplane-agent/internal/version v0.0.0-20240717172323-a1d3e6ed4aab/go.mod h1:TfycUeyrZvoFI6crSlts5HxdHgxYtoYaXwSZ2ZQIj5I=
github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA=
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlemanagedprometheusexporter v0.106.1 h1:uZggOpvxGaueWznr1bxaNBPZdCAfV/3ioZKBD++/gqg=
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/googlemanagedprometheusexporter v0.106.1/go.mod h1:EKzTHTMRO1GH7SCVaJgG5uuY2XKDFPxYLgNFNDIB19U=
Expand Down
12 changes: 6 additions & 6 deletions manifests/minimal/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@ dist:
description: ObservIQ's minimal distro for OpenTelemetry Collector
version: "v0.0.1"
output_path: ./dist
otelcol_version: 0.105.0
otelcol_version: 0.106.1

conf_resolver:
default_uri_scheme: "env"

extensions:
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.105.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/opampextension v0.105.0
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.106.1
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/opampextension v0.106.1
- gomod: github.com/observiq/bindplane-agent/extension/bindplaneextension v1.56.0
path: "./extension/bindplaneextension"

exporters:
- gomod: go.opentelemetry.io/collector/exporter/nopexporter v0.105.0
- gomod: go.opentelemetry.io/collector/exporter/nopexporter v0.106.1

processors:
- gomod: github.com/observiq/bindplane-agent/processor/snapshotprocessor v1.56.0
- gomod: github.com/observiq/bindplane-agent/processor/snapshotprocessor v1.58.0
path: "./processor/snapshotprocessor"

receivers:
- gomod: go.opentelemetry.io/collector/receiver/nopreceiver v0.105.0
- gomod: go.opentelemetry.io/collector/receiver/nopreceiver v0.106.1

connectors: []

Expand Down
Loading

0 comments on commit 8ef84e2

Please sign in to comment.