Skip to content

Commit

Permalink
feat: release odigos otelcol as linux packages to gemfury (#1149)
Browse files Browse the repository at this point in the history
  • Loading branch information
blumamir committed Apr 30, 2024
1 parent a7576c3 commit b60a398
Show file tree
Hide file tree
Showing 9 changed files with 259 additions and 78 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/publish-modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- "v*"

jobs:

print-tag:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -154,3 +155,54 @@ jobs:
GITHUB_RUN_ID: ${{ github.run_id }}
run: |
curl -X POST -H 'Content-type: application/json' --data '{"link":"https://github.com/${{ env.GITHUB_REPOSITORY }}/actions/runs/${{ env.GITHUB_RUN_ID }}", "description":"ERROR: odigos component ${{ matrix.service }} release failed", "tag":"${{ steps.extract_tag.outputs.tag }}"}' ${{ env.SLACK_WEBHOOK_URL }}
publish-collector-linux-packages:
runs-on: ubuntu-latest
steps:
- name: Extract Tag
id: extract_tag
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT

- name: Notify Slack Start
env:
SLACK_WEBHOOK_URL: ${{ secrets.ODIGOS_RELEASE_STATUS_WEBHOOK_URL }}
run: |
curl -X POST -H 'Content-type: application/json' --data '{"description":"Start releasing odigos collector as linux packages", "tag":"${{ steps.extract_tag.outputs.tag }}"}' ${{ env.SLACK_WEBHOOK_URL }}
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ steps.extract_tag.outputs.tag }}

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.21.0"

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
args: release --clean
workdir: collector
env:
FURY_ACCOUNT: ${{ secrets.FURY_ACCOUNT }}
FURY_API_TOKEN: ${{ secrets.FURY_API_TOKEN }}

- name: Notify Slack End
env:
SLACK_WEBHOOK_URL: ${{ secrets.ODIGOS_RELEASE_STATUS_WEBHOOK_URL }}
run: |
curl -X POST -H 'Content-type: application/json' --data '{"description":"Odigos collector linux packages released successfully", "tag":"${{ steps.extract_tag.outputs.tag }}"}' ${{ env.SLACK_WEBHOOK_URL }}
- name: Notify Slack on Failure
if: failure()
env:
SLACK_WEBHOOK_URL: ${{ secrets.ODIGOS_RELEASE_STATUS_WEBHOOK_URL }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_RUN_ID: ${{ github.run_id }}
run: |
curl -X POST -H 'Content-type: application/json' --data '{"link":"https://github.com/${{ env.GITHUB_REPOSITORY }}/actions/runs/${{ env.GITHUB_RUN_ID }}", "description":"ERROR: failed to publish odigos collector linux packages", "tag":"${{ steps.extract_tag.outputs.tag }}"}' ${{ env.SLACK_WEBHOOK_URL }}
60 changes: 60 additions & 0 deletions collector/.goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
goarch:
- amd64
- arm64
binary: odigos-otelcol
dir: odigosotelcol
ldflags:
- -s
- -w
flags:
- -trimpath
nfpms:
- id: packages # this id is used in the publisher section to specify which artifacts to publish
package_name: odigos-otelcol
contents:
- src: distribution/odigos-otelcol/odigos-otelcol.service
dst: /lib/systemd/system/odigos-otelcol.service
- src: distribution/odigos-otelcol/odigos-otelcol.conf
dst: /etc/odigos-otelcol/odigos-otelcol.conf
type: config|noreplace
- src: distribution/odigos-otelcol/config.yaml
dst: /etc/odigos-otelcol/config.yaml
type: config|noreplace
scripts:
preinstall: distribution/odigos-otelcol/preinstall.sh
preremove: distribution/odigos-otelcol/preremove.sh
vendor: Keyval Inc.
homepage: https://odigos.io
formats:
- deb
- rpm
description: Instant distributed tracing without code changes using eBPF
file_name_template: "{{ .ConventionalFileName }}"
maintainer: Keyval Inc.
publishers:
- name: fury deb publisher
ids: # publish only the artifacts created in the nfpms section. e.g. ignore the tar.gz archive
- packages
cmd: fury push {{ .ArtifactName }} --account {{ .Env.FURY_ACCOUNT }} --api-token {{ .Env.FURY_API_TOKEN }} --public --quiet
dir: dist
# archives:
# builds:
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ incpatch .Version }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
# we don't need the otelcol to have releases in github.
# this goreleaser is only about publishing the collector as deb/rpm package to the fury repository
release:
disable: true
42 changes: 42 additions & 0 deletions collector/distribution/odigos-otelcol/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
extensions:
health_check:
pprof:
endpoint: 0.0.0.0:1777
zpages:
endpoint: 0.0.0.0:55679

receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
http:
endpoint: 0.0.0.0:4318

processors:
batch:

exporters:
debug:
verbosity: detailed

service:

pipelines:

traces:
receivers: [otlp]
processors: [batch]
exporters: [debug]

metrics:
receivers: [otlp]
processors: [batch]
exporters: [debug]

logs:
receivers: [otlp]
processors: [batch]
exporters: [debug]

extensions: [health_check, pprof, zpages]
5 changes: 5 additions & 0 deletions collector/distribution/odigos-otelcol/odigos-otelcol.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Systemd environment file for the odiogs-otelcol service

# Command-line options for the odiogs-otelcol service.
# Run `/usr/bin/odiogs-otelcol --help` to see all available options.
OTELCOL_OPTIONS="--config=/etc/odigos-otelcol/config.yaml"
15 changes: 15 additions & 0 deletions collector/distribution/odigos-otelcol/odigos-otelcol.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[Unit]
Description=Odigos Distribution of the OpenTelemetry Collector
After=network.target

[Service]
EnvironmentFile=/etc/otelcol-contrib/otelcol-contrib.conf
ExecStart=/usr/bin/otelcol-contrib $OTELCOL_OPTIONS
KillMode=mixed
Restart=on-failure
Type=simple
User=odigos
Group=odigos

[Install]
WantedBy=multi-user.target
2 changes: 2 additions & 0 deletions collector/distribution/odigos-otelcol/preinstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

getent passwd odigos >/dev/null || useradd --system --user-group --no-create-home --shell /sbin/nologin odigos
4 changes: 4 additions & 0 deletions collector/distribution/odigos-otelcol/preremove.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if command -v systemctl >/dev/null 2>&1; then
systemctl stop odigos-otelcol.service
systemctl disable odigos-otelcol.service
fi
50 changes: 25 additions & 25 deletions collector/odigosotelcol/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,20 @@ require (
go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.94.1
go.opentelemetry.io/collector/receiver v0.94.1
go.opentelemetry.io/collector/receiver/otlpreceiver v0.94.1
golang.org/x/sys v0.16.0
golang.org/x/sys v0.18.0
)

require (
cloud.google.com/go v0.112.0 // indirect
cloud.google.com/go/compute v1.23.3 // indirect
cloud.google.com/go v0.112.2 // indirect
cloud.google.com/go/compute v1.24.0 // indirect
cloud.google.com/go/compute/metadata v0.2.4-0.20230617002413-005d2dfb6b68 // indirect
cloud.google.com/go/iam v1.1.5 // indirect
cloud.google.com/go/iam v1.1.6 // indirect
cloud.google.com/go/logging v1.9.0 // indirect
cloud.google.com/go/longrunning v0.5.4 // indirect
cloud.google.com/go/monitoring v1.17.0 // indirect
cloud.google.com/go/longrunning v0.5.5 // indirect
cloud.google.com/go/monitoring v1.18.0 // indirect
cloud.google.com/go/pubsub v1.36.1 // indirect
cloud.google.com/go/storage v1.36.0 // indirect
cloud.google.com/go/trace v1.10.4 // indirect
cloud.google.com/go/storage v1.39.1 // indirect
cloud.google.com/go/trace v1.10.5 // indirect
code.cloudfoundry.org/clock v0.0.0-20180518195852-02e53af36e6c // indirect
github.com/99designs/keyring v1.1.6 // indirect
github.com/AthenZ/athenz v1.10.39 // indirect
Expand Down Expand Up @@ -224,15 +224,15 @@ require (
github.com/golang-jwt/jwt/v5 v5.0.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/mock v1.6.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/googleapis/gax-go/v2 v2.12.3 // indirect
github.com/grafana/loki/pkg/push v0.0.0-20231127162423-bd505f8e2d37 // indirect
github.com/grafana/regexp v0.0.0-20221122212121-6b5c0a4cb7fd // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.19.1 // indirect
Expand Down Expand Up @@ -394,11 +394,11 @@ require (
go.opentelemetry.io/collector/semconv v0.94.1 // indirect
go.opentelemetry.io/collector/service v0.94.1 // indirect
go.opentelemetry.io/contrib/config v0.3.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.48.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/contrib/propagators/b3 v1.22.0 // indirect
go.opentelemetry.io/contrib/zpages v0.47.0 // indirect
go.opentelemetry.io/otel v1.23.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/bridge/opencensus v0.45.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v0.45.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v0.45.0 // indirect
Expand All @@ -408,32 +408,32 @@ require (
go.opentelemetry.io/otel/exporters/prometheus v0.45.1 // indirect
go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v0.45.0 // indirect
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.23.0 // indirect
go.opentelemetry.io/otel/metric v1.23.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/sdk v1.23.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.23.0 // indirect
go.opentelemetry.io/otel/trace v1.23.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.opentelemetry.io/proto/otlp v1.1.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc // indirect
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.20.0 // indirect
golang.org/x/oauth2 v0.16.0 // indirect
golang.org/x/net v0.22.0 // indirect
golang.org/x/oauth2 v0.18.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/term v0.16.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.16.0 // indirect
gonum.org/v1/gonum v0.14.0 // indirect
google.golang.org/api v0.160.0 // indirect
google.golang.org/api v0.170.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240125205218-1f4bbc51befe // indirect
google.golang.org/grpc v1.61.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240314234333-6e1732d8331c // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240314234333-6e1732d8331c // indirect
google.golang.org/grpc v1.62.1 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
Loading

0 comments on commit b60a398

Please sign in to comment.