Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gpuhw
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Odysseus
gpuhw
Commits
47cc9754
Commit
47cc9754
authored
May 20, 2024
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add docker compose
parent
b27a2460
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
169 additions
and
2 deletions
+169
-2
docker-compose.yml
docker-compose.yml
+54
-0
dockerfile
dockerfile
+98
-0
main.go
main.go
+0
-2
prometheus.yml
prometheus.yml
+17
-0
No files found.
docker-compose.yml
0 → 100644
View file @
47cc9754
version
:
"
3.9"
services
:
prometheus
:
image
:
prom/prometheus:v2.51.0
volumes
:
-
"
./prometheus.yml:/prometheus/prometheus.yml"
# - "./rules.yml:/etc/prometheus/rules.yml"
network_mode
:
host
ports
:
-
9090:9090
node-exporter
:
image
:
prom/node-exporter:v1.7.0
network_mode
:
host
privileged
:
true
pid
:
host
ports
:
-
9100:9100
volumes
:
-
/proc:/host/proc:ro
-
/sys:/host/sys:ro
-
/:/rootfs:ro
command
:
-
'
--path.procfs=/host/proc'
-
'
--path.rootfs=/rootfs'
-
'
--path.sysfs=/host/sys'
-
'
--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
-
'
--collector.cpu.info.flags-include=^(aes|avx.?|constant_tsc)$$'
restart
:
unless-stopped
dcgm
:
image
:
nvcr.io/nvidia/k8s/dcgm-exporter:3.3.5-3.4.0-ubuntu22.04
ports
:
-
9400:9400
deploy
:
resources
:
reservations
:
devices
:
-
driver
:
nvidia
count
:
all
capabilities
:
[
gpu
]
restart
:
always
environment
:
-
DCGM_EXPORTER_NO_HOSTNAME=1
cap_add
:
-
SYS_ADMIN
monitorapi
:
image
:
docker.ai.17xuexi.com/monitorapi/monitorapi:latest
ports
:
-
5000:5000
# docker run -d --gpus all --rm -p 9400:9400 nvcr.io/nvidia/k8s/dcgm-exporter:3.3.5-3.4.0-ubuntu22.04
dockerfile
0 → 100644
View file @
47cc9754
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
main.go
View file @
47cc9754
...
@@ -99,9 +99,7 @@ func main() {
...
@@ -99,9 +99,7 @@ func main() {
})
})
// app.Get("/hw/usage", func(c *fiber.Ctx) error {
// app.Get("/hw/usage", func(c *fiber.Ctx) error {
// res := make([]DeviceInfo, 0, 10)
// res := make([]DeviceInfo, 0, 10)
// // gpuUtils, err := cli.GpuUtil()
// // gpuUtils, err := cli.GpuUtil()
// // if err != nil {
// // if err != nil {
// // return c.JSON(Response{
// // return c.JSON(Response{
...
...
prometheus.yml
0 → 100644
View file @
47cc9754
global
:
scrape_interval
:
10s
evaluation_interval
:
10s
scrape_configs
:
-
job_name
:
prometheus
static_configs
:
-
targets
:
-
prometheus:9090
-
job_name
:
gpuNode
static_configs
:
-
targets
:
-
node-exporter:9100
-
job_name
:
gpu
static_configs
:
-
targets
:
-
dcgm:9400
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment