Skip to content

Commit

Permalink
Merge pull request #37 from devops-42/feature/add-arm64-support
Browse files Browse the repository at this point in the history
Added arm64 support
  • Loading branch information
zeitlinger authored Apr 24, 2024
2 parents 980a060 + 598ee67 commit 770a1ba
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 19 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
.idea
venv/
.venv
/container/grafana/*
/container/loki/*
/container/prometheus/*
5 changes: 5 additions & 0 deletions build-lgtm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

RELEASE=${1:-dev}

docker buildx build -f docker/Dockerfile docker --tag grafana/otel-lgtm:${RELEASE}
40 changes: 23 additions & 17 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,40 @@ ENV TEMPO_VERSION="2.4.1"
ENV LOKI_VERSION="2.9.6"
ENV OPENTELEMETRY_COLLECTOR_VERSION="0.97.0"

# TARGETARCH is automatically detected and set by the Docker daemon during the build process. If the build starts
# on an amd64 architecture, than the TARGETARCH will be set to `amd64`.
# More details on the variables can be found here: https://docs.docker.com/desktop/extensions-sdk/extensions/multi-arch/
ARG TARGETARCH
ENV TARGETARCH=${TARGETARCH}

RUN mkdir /otel-lgtm
WORKDIR /otel-lgtm

RUN yum install -y unzip jq
RUN yum install -y unzip jq procps

RUN curl -sOL https://dl.grafana.com/oss/release/grafana-$GRAFANA_VERSION.linux-amd64.tar.gz && \
tar xfz grafana-$GRAFANA_VERSION.linux-amd64.tar.gz && \
rm grafana-$GRAFANA_VERSION.linux-amd64.tar.gz
RUN curl -sOL https://dl.grafana.com/oss/release/grafana-$GRAFANA_VERSION.linux-${TARGETARCH}.tar.gz && \
tar xfz grafana-$GRAFANA_VERSION.linux-${TARGETARCH}.tar.gz && \
rm grafana-$GRAFANA_VERSION.linux-${TARGETARCH}.tar.gz

RUN curl -sOL https://github.com/prometheus/prometheus/releases/download/v$PROMETHEUS_VERSION/prometheus-$PROMETHEUS_VERSION.linux-amd64.tar.gz && \
tar xfz prometheus-$PROMETHEUS_VERSION.linux-amd64.tar.gz && \
mv prometheus-$PROMETHEUS_VERSION.linux-amd64 prometheus-$PROMETHEUS_VERSION && \
rm prometheus-$PROMETHEUS_VERSION.linux-amd64.tar.gz
RUN curl -sOL https://github.com/prometheus/prometheus/releases/download/v$PROMETHEUS_VERSION/prometheus-$PROMETHEUS_VERSION.linux-${TARGETARCH}.tar.gz && \
tar xfz prometheus-$PROMETHEUS_VERSION.linux-${TARGETARCH}.tar.gz && \
mv prometheus-$PROMETHEUS_VERSION.linux-${TARGETARCH} prometheus-$PROMETHEUS_VERSION && \
rm prometheus-$PROMETHEUS_VERSION.linux-${TARGETARCH}.tar.gz

RUN curl -sOL https://github.com/grafana/tempo/releases/download/v$TEMPO_VERSION/tempo_${TEMPO_VERSION}_linux_amd64.tar.gz && \
RUN curl -sOL https://github.com/grafana/tempo/releases/download/v$TEMPO_VERSION/tempo_${TEMPO_VERSION}_linux_${TARGETARCH}.tar.gz && \
mkdir tempo-$TEMPO_VERSION/ && \
tar xfz tempo_${TEMPO_VERSION}_linux_amd64.tar.gz -C tempo-$TEMPO_VERSION/ && \
rm tempo_${TEMPO_VERSION}_linux_amd64.tar.gz
tar xfz tempo_${TEMPO_VERSION}_linux_${TARGETARCH}.tar.gz -C tempo-$TEMPO_VERSION/ && \
rm tempo_${TEMPO_VERSION}_linux_${TARGETARCH}.tar.gz

RUN curl -sOL https://github.com/grafana/loki/releases/download/v$LOKI_VERSION/loki-linux-amd64.zip && \
RUN curl -sOL https://github.com/grafana/loki/releases/download/v$LOKI_VERSION/loki-linux-${TARGETARCH}.zip && \
mkdir loki-$LOKI_VERSION && \
unzip loki-linux-amd64 -d loki-$LOKI_VERSION/ && \
rm loki-linux-amd64.zip
unzip loki-linux-${TARGETARCH} -d loki-$LOKI_VERSION/ && \
rm loki-linux-${TARGETARCH}.zip

RUN curl -sOL https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v$OPENTELEMETRY_COLLECTOR_VERSION/otelcol-contrib_${OPENTELEMETRY_COLLECTOR_VERSION}_linux_amd64.tar.gz && \
RUN curl -sOL https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v$OPENTELEMETRY_COLLECTOR_VERSION/otelcol-contrib_${OPENTELEMETRY_COLLECTOR_VERSION}_linux_${TARGETARCH}.tar.gz && \
mkdir otelcol-contrib-$OPENTELEMETRY_COLLECTOR_VERSION && \
tar xfz otelcol-contrib_${OPENTELEMETRY_COLLECTOR_VERSION}_linux_amd64.tar.gz -C otelcol-contrib-$OPENTELEMETRY_COLLECTOR_VERSION/ && \
rm otelcol-contrib_${OPENTELEMETRY_COLLECTOR_VERSION}_linux_amd64.tar.gz
tar xfz otelcol-contrib_${OPENTELEMETRY_COLLECTOR_VERSION}_linux_${TARGETARCH}.tar.gz -C otelcol-contrib-$OPENTELEMETRY_COLLECTOR_VERSION/ && \
rm otelcol-contrib_${OPENTELEMETRY_COLLECTOR_VERSION}_linux_${TARGETARCH}.tar.gz

COPY prometheus.yaml .
COPY run-prometheus.sh .
Expand Down
2 changes: 1 addition & 1 deletion docker/run-loki.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

./loki-$LOKI_VERSION/loki-linux-amd64 --config.file=./loki-config.yaml > /dev/null 2>&1
./loki-$LOKI_VERSION/loki-linux-${TARGETARCH} --config.file=./loki-config.yaml > /dev/null 2>&1
1 change: 1 addition & 0 deletions docker/run-prometheus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
--web.enable-remote-write-receiver \
--enable-feature=exemplar-storage \
--enable-feature=native-histograms \
--storage.tsdb.path=/data/prometheus \
--config.file=./prometheus.yaml > /dev/null 2>&1
15 changes: 14 additions & 1 deletion run-lgtm.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
#!/bin/bash

docker run -p 3000:3000 -p 4317:4317 -p 4318:4318 --rm -ti grafana/otel-lgtm
RELEASE=${1:-dev}

docker run \
--name lgtm \
-p 3000:3000 \
-p 4317:4317 \
-p 4318:4318 \
--rm \
-ti \
-v $PWD/container/grafana:/data/grafana \
-v $PWD/container/prometheus:/data/prometheus \
-v $PWD/container/loki:/loki \
-e GF_PATHS_DATA=/data/grafana \
localhost/grafana/otel-lgtm:${RELEASE}

0 comments on commit 770a1ba

Please sign in to comment.