-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
89 changed files
with
3,122 additions
and
2,405 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- v[0].[0-9]+.[0-9]+ | ||
|
||
jobs: | ||
upload-release-assets: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Install cross-compilation tools | ||
run: | | ||
set -ex | ||
sudo apt-get update | ||
sudo apt-get install -y gcc-aarch64-linux-gnu musl-tools | ||
- name: Build artifacts for arm64/amd64 | ||
run: make build-all | ||
- name: Create checksums and tarballs | ||
run: | | ||
set -ex | ||
echo "Creating checksums and tarballs" | ||
cd .build/linux-amd64 | ||
sha256sum signoz-collector > signoz-collector-linux-amd64.sha256 | ||
tar -czvf signoz-collector-linux-amd64.tar.gz signoz-collector | ||
cd ../linux-arm64 | ||
sha256sum signoz-collector > signoz-collector-linux-arm64.sha256 | ||
tar -czvf signoz-collector-linux-arm64.tar.gz signoz-collector | ||
- name: Create release and upload assets | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
.build/linux-amd64/signoz-collector-linux-amd64.sha256 | ||
.build/linux-amd64/signoz-collector-linux-amd64.tar.gz | ||
.build/linux-arm64/signoz-collector-linux-arm64.sha256 | ||
.build/linux-arm64/signoz-collector-linux-arm64.tar.gz | ||
generate_release_notes: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,5 +18,8 @@ | |
.DS_Store | ||
.idea | ||
./config/default-config.yaml | ||
|
||
# build folder | ||
.build | ||
*.rollback | ||
signoz-collector | ||
signoz-collector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,30 @@ | ||
# Builder stage | ||
FROM golang:1.18-alpine as build | ||
RUN apk --update add ca-certificates | ||
# use a minimal alpine image | ||
FROM alpine:3.17 | ||
|
||
WORKDIR /src | ||
COPY . . | ||
|
||
ARG TARGETPLATFORM | ||
|
||
RUN export GOOS=$(echo ${TARGETPLATFORM} | cut -d / -f1) && \ | ||
export GOARCH=$(echo ${TARGETPLATFORM} | cut -d / -f2) | ||
|
||
ENV OS111MODULE=on | ||
ENV CGO_ENABLED=0 | ||
|
||
RUN cd cmd/signozcollector && go build -tags timetzdata -o /out/signoz-collector | ||
|
||
# Final stage | ||
FROM alpine:3.15 | ||
# add ca-certificates in case you need them | ||
RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/* | ||
|
||
# define arguments and default values | ||
ARG TARGETOS=linux | ||
ARG TARGETARCH=amd64 | ||
ARG USER_UID=10001 | ||
|
||
# create a non-root user for running the collector | ||
USER ${USER_UID} | ||
|
||
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt | ||
COPY --from=build /out/signoz-collector / | ||
COPY --from=build /src/exporter/clickhousetracesexporter/migrations /migrations | ||
COPY --from=build /src/exporter/clickhouselogsexporter/migrations /logsmigrations | ||
# copy the binaries from the multi-stage build | ||
COPY .build/${TARGETOS}-${TARGETARCH}/signoz-collector /signoz-collector | ||
|
||
# copy the config and migration files | ||
COPY config/default-config.yaml /etc/otel/config.yaml | ||
COPY exporter/clickhousetracesexporter/migrations /migrations | ||
COPY exporter/clickhouselogsexporter/migrations /logsmigrations | ||
|
||
ENV LOG_MIGRATIONS_FOLDER="/logsmigrations" | ||
|
||
# expose OTLP ports for the collector | ||
EXPOSE 4317 4318 | ||
ENTRYPOINT ["/signoz-collector"] | ||
|
||
# run the binary as the entrypoint and pass the default config file as a flag | ||
ENTRYPOINT [ "/signoz-collector" ] | ||
CMD ["--config", "/etc/otel/config.yaml"] |
Oops, something went wrong.