Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added examples for systemd units #6141

Merged
merged 16 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,18 @@
"version: \"?(?<currentValue>.*?)\"?\\n"
]
},
{
"customType": "regex",
"datasourceTemplate": "github-releases",
"depNameTemplate": "prometheus/alertmanager",
"extractVersionTemplate": "^v(?<version>.+)$",
"fileMatch": [
"^tools/alertmanager/manifest.yaml$"
],
"matchStrings": [
"version: \"?(?<currentValue>.*?)\"?\\n"
]
},
{
"customType": "regex",
"datasourceTemplate": "npm",
Expand Down Expand Up @@ -363,6 +375,18 @@
"version: \"?(?<currentValue>.*?)\"?\\n"
]
},
{
"customType": "regex",
"datasourceTemplate": "github-releases",
"depNameTemplate": "prometheus/blackbox_exporter",
"extractVersionTemplate": "^v(?<version>.+)$",
"fileMatch": [
"^tools/blackbox-exporter/manifest.yaml$"
],
"matchStrings": [
"version: \"?(?<currentValue>.*?)\"?\\n"
]
},
{
"customType": "regex",
"datasourceTemplate": "github-tags",
Expand Down Expand Up @@ -3234,6 +3258,18 @@
"version: \"?(?<currentValue>.*?)\"?\\n"
]
},
{
"customType": "regex",
"datasourceTemplate": "github-releases",
"depNameTemplate": "grafana/grafana",
"extractVersionTemplate": "^v(?<version>.+)$",
"fileMatch": [
"^tools/grafana/manifest.yaml$"
],
"matchStrings": [
"version: \"?(?<currentValue>.*?)\"?\\n"
]
},
{
"customType": "regex",
"datasourceTemplate": "github-releases",
Expand Down Expand Up @@ -5581,6 +5617,18 @@
"version: \"?(?<currentValue>.*?)\"?\\n"
]
},
{
"customType": "regex",
"datasourceTemplate": "github-releases",
"depNameTemplate": "grafana/mimir",
"extractVersionTemplate": "^v(?<version>.+)$",
"fileMatch": [
"^tools/mimir/manifest.yaml$"
],
"matchStrings": [
"version: \"?(?<currentValue>.*?)\"?\\n"
]
},
{
"customType": "regex",
"datasourceTemplate": "github-releases",
Expand Down Expand Up @@ -5926,6 +5974,18 @@
"version: \"?(?<currentValue>.*?)\"?\\n"
]
},
{
"customType": "regex",
"datasourceTemplate": "github-releases",
"depNameTemplate": "prometheus/node_exporter",
"extractVersionTemplate": "^v(?<version>.+)$",
"fileMatch": [
"^tools/node-exporter/manifest.yaml$"
],
"matchStrings": [
"version: \"?(?<currentValue>.*?)\"?\\n"
]
},
{
"customType": "regex",
"datasourceTemplate": "github-releases",
Expand Down Expand Up @@ -6738,6 +6798,18 @@
"version: \"?(?<currentValue>.*?)\"?\\n"
]
},
{
"customType": "regex",
"datasourceTemplate": "github-releases",
"depNameTemplate": "prometheus/prometheus",
"extractVersionTemplate": "^v(?<version>.+)$",
"fileMatch": [
"^tools/prometheus/manifest.yaml$"
],
"matchStrings": [
"version: \"?(?<currentValue>.*?)\"?\\n"
]
},
{
"customType": "regex",
"datasourceTemplate": "github-releases",
Expand Down Expand Up @@ -6810,6 +6882,18 @@
"version: \"?(?<currentValue>.*?)\"?\\n"
]
},
{
"customType": "regex",
"datasourceTemplate": "github-releases",
"depNameTemplate": "prometheus/pushgateway",
"extractVersionTemplate": "^v(?<version>.+)$",
"fileMatch": [
"^tools/pushgateway/manifest.yaml$"
],
"matchStrings": [
"version: \"?(?<currentValue>.*?)\"?\\n"
]
},
{
"customType": "regex",
"datasourceTemplate": "git-tags",
Expand Down Expand Up @@ -7971,6 +8055,30 @@
"version: \"?(?<currentValue>.*?)\"?\\n"
]
},
{
"customType": "regex",
"datasourceTemplate": "github-releases",
"depNameTemplate": "grafana/tempo",
"extractVersionTemplate": "^v(?<version>.+)$",
"fileMatch": [
"^tools/tempo/manifest.yaml$"
],
"matchStrings": [
"version: \"?(?<currentValue>.*?)\"?\\n"
]
},
{
"customType": "regex",
"datasourceTemplate": "github-releases",
"depNameTemplate": "grafana/tempo",
"extractVersionTemplate": "^v(?<version>.+)$",
"fileMatch": [
"^tools/tempo-cli/manifest.yaml$"
],
"matchStrings": [
"version: \"?(?<currentValue>.*?)\"?\\n"
]
},
{
"customType": "regex",
"datasourceTemplate": "pypi",
Expand Down
17 changes: 17 additions & 0 deletions tools/alertmanager/Dockerfile.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#syntax=docker/dockerfile:1.9.0@sha256:fe40cf4e92cd0c467be2cfc30657a680ae2398318afd50b0c80585784c604f28

FROM ghcr.io/uniget-org/images/ubuntu:24.04 AS prepare
COPY --from=ghcr.io/uniget-org/tools/uniget-build:latest \
/etc/profile.d/ \
/etc/profile.d/
SHELL [ "bash", "-clo", "errexit" ]
ARG name
ARG version
RUN <<EOF
check-github-release-asset "prometheus/alertmanager" "v${version}" "alertmanager-${version}.linux-${alt_arch}.tar.gz"
curl --silent --show-error --location --fail "https://github.com/prometheus/alertmanager/releases/download/v${version}/alertmanager-${version}.linux-${alt_arch}.tar.gz" \
| tar --extract --gzip --directory="${prefix}/bin/" --strip-components=1 --no-same-owner \
"alertmanager-${version}.linux-${alt_arch}/alertmanager" \
"alertmanager-${version}.linux-${alt_arch}/amtool"
EOF
COPY compose.yaml.go-template /uniget_bootstrap/etc/docker-compose/alertmanager/
8 changes: 8 additions & 0 deletions tools/alertmanager/compose.yaml.go-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
alertmanager:
image: prom/alertmanager:v{{ .Version }}
command:
- '--storage.path=/alertmanager'
restart: always
ports:
- 9093:9093
35 changes: 35 additions & 0 deletions tools/alertmanager/manifest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# yaml-language-server: $schema=https://tools.uniget.dev/schema.yaml
$schema: https://tools.uniget.dev/schema.yaml
name: alertmanager
license:
name: Apache License 2.0
link: https://github.com/prometheus/alertmanager/blob/main/LICENSE
version: "0.27.0"
check: ${binary} --version | grep ^alertmanager | cut -d' ' -f3
runtime_dependencies:
- docker-compose-systemd
platforms:
- linux/amd64
- linux/arm64
tags:
- org/prometheus
- category/operations
- lang/go
- type/daemon
homepage: https://prometheus.io/
repository: https://github.com/prometheus/alertmanager
description: Prometheus Alertmanager
messages:
usage: |
- A compose.yaml file is provided in /etc/docker-compose/alertmanager/
- Start the service using:
systemctl start docker-compose@alertmanager
- Enable the service using:
systemctl enable docker-compose@alertmanager
- Configure alertmanager using environment variables:
systemctl edit docker-compose@alertmanager
renovate:
datasource: github-releases
package: prometheus/alertmanager
extractVersion: ^v(?<version>.+)$
priority: low
17 changes: 17 additions & 0 deletions tools/blackbox-exporter/Dockerfile.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#syntax=docker/dockerfile:1.9.0@sha256:fe40cf4e92cd0c467be2cfc30657a680ae2398318afd50b0c80585784c604f28

FROM ghcr.io/uniget-org/images/ubuntu:24.04 AS prepare
COPY --from=ghcr.io/uniget-org/tools/uniget-build:latest \
/etc/profile.d/ \
/etc/profile.d/
SHELL [ "bash", "-clo", "errexit" ]
ARG name
ARG version
RUN <<EOF
check-github-release-asset "prometheus/blackbox_exporter" "v${version}" "blackbox_exporter-${version}.linux-${alt_arch}.tar.gz"
curl --silent --show-error --location --fail "https://github.com/prometheus/blackbox_exporter/releases/download/v${version}/blackbox_exporter-${version}.linux-${alt_arch}.tar.gz" \
| tar --extract --gzip --directory="${prefix}/bin/" --strip-components=1 --no-same-owner \
"blackbox_exporter-${version}.linux-${alt_arch}/blackbox_exporter"
EOF
COPY compose.yaml.go-template /uniget_bootstrap/etc/docker-compose/blackbox-exporter/
COPY blackbox.yaml /uniget_bootstrap/etc/docker-compose/blackbox-exporter/config/
6 changes: 6 additions & 0 deletions tools/blackbox-exporter/blackbox.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
modules:
http_2xx:
prober: http
timeout: 5s
http:
method: GET
9 changes: 9 additions & 0 deletions tools/blackbox-exporter/compose.yaml.go-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
services:
blackbox-exporter:
image: prom/blackbox-exporter:v{{ .Version }}
command:
- --config.file=/etc/blackbox/blackbox.yaml
volumes:
- ./config/blackbox.yaml:/etc/blackbox/blackbox.yaml
ports:
- "127.0.0.1:9115:9115"
36 changes: 36 additions & 0 deletions tools/blackbox-exporter/manifest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# yaml-language-server: $schema=https://tools.uniget.dev/schema.yaml
$schema: https://tools.uniget.dev/schema.yaml
name: blackbox-exporter
license:
name: Apache License 2.0
link: https://github.com/prometheus/blackbox_exporter/blob/master/LICENSE
version: "0.25.0"
binary: blackbox_exporter
check: ${binary} --version | grep ^blackbox_exporter | cut -d' ' -f3
runtime_dependencies:
- docker-compose-systemd
platforms:
- linux/amd64
- linux/arm64
tags:
- org/prometheus
- category/operations
- lang/go
- type/daemon
homepage: https://prometheus.io/
repository: https://github.com/prometheus/blackbox_exporter
description: Push acceptor for ephemeral and batch jobs
messages:
usage: |
- A compose.yaml file is provided in /etc/docker-compose/blackbox-exporter/
- Start the service using:
systemctl start docker-compose@blackbox-exporter
- Enable the service using:
systemctl enable docker-compose@blackbox-exporter
- Configure blackbox-exporter using environment variables:
systemctl edit docker-compose@blackbox-exporter
renovate:
datasource: github-releases
package: prometheus/blackbox_exporter
extractVersion: ^v(?<version>.+)$
priority: low
3 changes: 2 additions & 1 deletion tools/cadvisor/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ check-github-release-asset "google/cadvisor" "v${version}" "cadvisor-v${version}
curl --silent --show-error --location --fail --output "${prefix}/bin/cadvisor" \
"https://github.com/google/cadvisor/releases/download/v${version}/cadvisor-v${version}-linux-${alt_arch}"
chmod +x "${prefix}/bin/cadvisor"
EOF
EOF
COPY compose.yaml.go-template /etc/docker-compose/cadvisor/
11 changes: 11 additions & 0 deletions tools/cadvisor/compose.yaml.go-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:
cadvisor:
image: gcr.io/cadvisor/cadvisor:v{{ .Version }}
restart: always
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
ports:
- 8080:8080
15 changes: 12 additions & 3 deletions tools/cadvisor/manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# yaml-language-server: $schema=https://tools.uniget.dev/schema.yaml
name: cadvisor
license:
name: Apache License 2.0
link: https://github.com/google/cadvisor/blob/master/LICENSE
version: "0.49.1"
check: ${binary} --version | cut -d' ' -f3 | tr -d v
platforms:
Expand All @@ -14,11 +17,17 @@ tags:
homepage: https://github.com/google/cadvisor
repository: https://github.com/google/cadvisor
description: Analyzes resource usage and performance characteristics of running containers
messages:
usage: |
- A compose.yaml file is provided in /etc/docker-compose/cadvisor/
- Start the service using:
systemctl start docker-compose@cadvisor
- Enable the service using:
systemctl enable docker-compose@cadvisor
- Configure cadvisor using environment variables:
systemctl edit docker-compose@cadvisor
renovate:
datasource: github-releases
package: google/cadvisor
extractVersion: ^v(?<version>.+)$
priority: medium
license:
name: Apache License 2.0
link: https://github.com/google/cadvisor/blob/master/LICENSE
30 changes: 3 additions & 27 deletions tools/docker-compose-systemd/Dockerfile.template
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,7 @@ COPY --from=ghcr.io/uniget-org/tools/uniget-build:latest \
SHELL [ "bash", "-clo", "errexit" ]
ARG name
ARG version
COPY <<EOF /uniget_bootstrap/etc/systemd/system/[email protected]
[Unit]
Description=docker-compose %i service
Requires=docker.service network-online.target
After=docker.service network-online.target

[Service]
WorkingDirectory=/etc/docker-compose/%i
Type=simple
TimeoutStartSec=15min
Restart=always

ExecStartPre=/usr/local/bin/docker-compose pull --quiet --ignore-pull-failures
ExecStartPre=/usr/local/bin/docker-compose build --pull

ExecStart=/usr/local/bin/docker-compose up --remove-orphans

ExecStop=/usr/local/bin/docker-compose down --remove-orphans

ExecReload=/usr/local/bin/docker-compose pull --quiet --ignore-pull-failures
ExecReload=/usr/local/bin/docker-compose build --pull

[Install]
WantedBy=multi-user.target
EOF
RUN <<EOF
mkdir -p "${prefix}/etc/docker-compose"
COPY [email protected] /uniget_bootstrap/etc/systemd/system/
COPY <<EOF /uniget_bootstrap/etc/docker-compose
Please see usage notes
EOF
Loading
Loading