-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrockcraft.yaml
62 lines (61 loc) · 2.27 KB
/
rockcraft.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Based on: https://github.com/open-telemetry/opentelemetry-collector-releases/blob/main/distributions/otelcol/Dockerfile
name: opentelemetry-collector
summary: Crucial component in the OpenTelemetry ecosystem.
description: |
Designed to collect, process, and export telemetry data such as metrics, logs,
and traces from various sources to multiple destinations.
version: "0.110.0"
base: [email protected]
license: Apache-2.0
platforms:
amd64:
services:
otelcol:
override: replace
summary: "Entry point for opentelemetry-collector oci-image"
startup: enabled
command: "/usr/bin/otelcol [ --config /etc/otelcol/config.yaml ]"
run-user: _daemon_
parts:
opentelemetry-collector:
plugin: nil
source: https://github.com/open-telemetry/opentelemetry-collector-releases
source-type: git
source-tag: v0.110.0
build-snaps:
- go/1.23/stable
build-environment:
- CGO_ENABLED: 0
- GOOS: linux
override-build: |
make build DISTRIBUTIONS="otelcol"
install -D distributions/otelcol/_build/otelcol ${CRAFT_PART_INSTALL}/opt/otelcol/otelcol
install -D distributions/otelcol/config.yaml ${CRAFT_PART_INSTALL}/opt/otelcol/config.yaml
organize:
opt/otelcol/otelcol: usr/bin/otelcol
opt/otelcol/config.yaml: etc/otelcol/config.yaml
permissions:
# _daemon_ user has UID/GID = 584792
# Ref: https://documentation.ubuntu.com/rockcraft/en/stable/reference/rockcraft.yaml/#run-user
- path: etc/otelcol/config.yaml
owner: 584792
group: 584792
mode: "600"
- path: usr/bin/otelcol
owner: 584792
group: 584792
mode: "500"
ca-certs:
plugin: nil
overlay-packages:
- ca-certificates
deb-security-manifest:
# https://github.com/canonical/oci-factory/blob/5ce610fa00456a34ef54c09b4a82537447f61a90/IMAGE_MAINTAINER_AGREEMENT.md?plain=1#L159
plugin: nil
after:
- opentelemetry-collector
- ca-certs
override-prime: |
set -x
mkdir -p $CRAFT_PRIME/usr/share/rocks/
(echo "# os-release" && cat /etc/os-release && echo "# dpkg-query" && dpkg-query --admindir=$CRAFT_PRIME/var/lib/dpkg/ -f '${db:Status-Abbrev},${binary:Package},${Version},${source:Package},${Source:Version}\n' -W) > $CRAFT_PRIME/usr/share/rocks/dpkg.query