Commit 10b18eab authored by Your Name's avatar Your Name

prometheus ok

parent edc7b3ff
FROM golang:1.21.7-alpine3.18 AS build FROM docker.ai.17xuexi.com/monitorapi/dcgm-exporter:3.3.5-3.4.0-ubuntu22.04
# ENV PACKAGES git openssh-client build-base RUN apt update
# Install dependencies RUN apt install -y supervisor
# RUN apk add --update $PACKAGES
RUN mkdir -p /var/log/supervisor
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# COPY my_first_process my_first_process
# COPY my_second_process my_second_process
WORKDIR /go/src/github.com/monitorapi COPY ./test/monitorapi /usr/local/bin/monitorapi
COPY ./test/node_exporter /usr/local/bin/node_exporter
COPY ./test/prometheus /usr/local/bin/prometheus
COPY ./prometheus.yml /prometheus/prometheus.yml
COPY ./ ./ ENTRYPOINT ["/usr/bin/supervisord"]
RUN go env -w GOPROXY=https://goproxy.cn
RUN export GOPROXY=https://goproxy.cn
RUN go build -o /monitorapi
# RUN cd go-kafka && go mod tidy && make build-docker-ouput
#go build -o /ai-api-mgr
FROM alpine
WORKDIR /root
COPY --from=build /monitorapi /usr/bin/monitorapi
ENTRYPOINT ["/usr/bin/monitorapi"]
# RUN apk add make
# RUN apk add git
# WORKDIR /go/src/github.com/odysseus/
# Authorize SSH Host
# RUN mkdir -p /root/.ssh && \
# chmod 0700 /root/.ssh && \
# ssh-keyscan github.com > /root/.ssh/known_hosts
#ENV https_proxy 'http://192.168.1.180:1080'
#RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
# RUN mkdir -p ./go-kafka/
# COPY ./ ./go-kafka
# COPY ./cache ./cache
# COPY ./odysseus-protocol ./odysseus-protocol
# COPY ./service-registry ./service-registry
# RUN cat ./go-kafka/id_rsa > /root/.ssh/id_rsa && \
# cat ./go-kafka/id_rsa.pub > /root/.ssh/id_rsa.pub && \
# chmod 600 /root/.ssh/id_rsa && \
# chmod 600 /root/.ssh/id_rsa.pub
#RUN pwd && ls && sleep 10
# RUN go mod tidy
#RUN go build -o /go-kafka
# RUN cd go-kafka && go mod tidy && make build-docker-ouput
# #go build -o /ai-api-mgr
# FROM alpine
# WORKDIR /root
# COPY --from=build /ai-api-mgr /usr/bin/ai-api-mgr
#ENTRYPOINT [ "/usr/bin/ai-api-mgr" ]
# FROM alpine
# WORKDIR /root
# COPY --from=base /ai-api-mgr /usr/bin/
# RUN ls /usr/bin/ai-api-mgr && sleep 30
# ENTRYPOINT [ "/usr/bin/ai-api-mgr" ]
# RUN ls /ai-api-mgr && sleep 30
# FROM alpine
# WORKDIR /root
# RUN ls /usr/bin/ && sleep 10
# COPY --from=base /ai-api-mgr /usr/bin/
# RUN ls /usr/bin/ai-api-mgr && sleep 10
#/usr/bin/go-kafka
# Add entrypoint script
#COPY ./scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
#RUN chmod u+x /usr/local/bin/entrypoint.sh
FROM golang:1.21.7-alpine3.18 AS build
# ENV PACKAGES git openssh-client build-base
# Install dependencies
# RUN apk add --update $PACKAGES
WORKDIR /go/src/github.com/monitorapi
COPY ./ ./
RUN go env -w GOPROXY=https://goproxy.cn
RUN export GOPROXY=https://goproxy.cn
RUN go build -o /monitorapi
# RUN cd go-kafka && go mod tidy && make build-docker-ouput
#go build -o /ai-api-mgr
FROM alpine
WORKDIR /root
COPY --from=build /monitorapi /usr/bin/monitorapi
ENTRYPOINT ["/usr/bin/monitorapi"]
# RUN apk add make
# RUN apk add git
# WORKDIR /go/src/github.com/odysseus/
# Authorize SSH Host
# RUN mkdir -p /root/.ssh && \
# chmod 0700 /root/.ssh && \
# ssh-keyscan github.com > /root/.ssh/known_hosts
#ENV https_proxy 'http://192.168.1.180:1080'
#RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
# RUN mkdir -p ./go-kafka/
# COPY ./ ./go-kafka
# COPY ./cache ./cache
# COPY ./odysseus-protocol ./odysseus-protocol
# COPY ./service-registry ./service-registry
# RUN cat ./go-kafka/id_rsa > /root/.ssh/id_rsa && \
# cat ./go-kafka/id_rsa.pub > /root/.ssh/id_rsa.pub && \
# chmod 600 /root/.ssh/id_rsa && \
# chmod 600 /root/.ssh/id_rsa.pub
#RUN pwd && ls && sleep 10
# RUN go mod tidy
#RUN go build -o /go-kafka
# RUN cd go-kafka && go mod tidy && make build-docker-ouput
# #go build -o /ai-api-mgr
# FROM alpine
# WORKDIR /root
# COPY --from=build /ai-api-mgr /usr/bin/ai-api-mgr
#ENTRYPOINT [ "/usr/bin/ai-api-mgr" ]
# FROM alpine
# WORKDIR /root
# COPY --from=base /ai-api-mgr /usr/bin/
# RUN ls /usr/bin/ai-api-mgr && sleep 30
# ENTRYPOINT [ "/usr/bin/ai-api-mgr" ]
# RUN ls /ai-api-mgr && sleep 30
# FROM alpine
# WORKDIR /root
# RUN ls /usr/bin/ && sleep 10
# COPY --from=base /ai-api-mgr /usr/bin/
# RUN ls /usr/bin/ai-api-mgr && sleep 10
#/usr/bin/go-kafka
# Add entrypoint script
#COPY ./scripts/entrypoint.sh /usr/local/bin/entrypoint.sh
#RUN chmod u+x /usr/local/bin/entrypoint.sh
...@@ -6,12 +6,13 @@ scrape_configs: ...@@ -6,12 +6,13 @@ scrape_configs:
- job_name: prometheus - job_name: prometheus
static_configs: static_configs:
- targets: - targets:
- prometheus:9090 - 127.0.0.1:9090
- job_name: gpuNode - job_name: gpuNode
static_configs: static_configs:
- targets: - targets:
- node-exporter:9100 - 127.0.0.1:9100
- job_name: gpu - job_name: gpu
static_configs: static_configs:
- targets: - targets:
- dcgm:9400 - 127.0.0.1:9400
\ No newline at end of file
[supervisord]
nodaemon=true
logfile=/dev/null
logfile_maxbytes=0
[program:dcgm]
command=sh -c '/usr/local/dcgm/dcgm-exporter-entrypoint.sh'
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true
[program:monitorapi]
command=sh -c '/usr/local/bin/monitorapi'
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true
[program:node_exporter]
command=sh -c '/usr/local/bin/node_exporter'
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true
[program:prometheus]
command=sh -c '/usr/local/bin/prometheus --config.file=/prometheus/prometheus.yml'
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true
File added
File added
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment