Skip to content

Commit 6aa30cc

Browse files
committed
feat: add event-export scaffold
Signed-off-by: Ajay Mishra <[email protected]>
1 parent fb4bd6a commit 6aa30cc

File tree

9 files changed

+477
-3
lines changed

9 files changed

+477
-3
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,4 +450,5 @@ health-monitors/kubernetes-object-monitor/kubernetes-object-monitor
450450
labeler/labeler
451451
metadata-collector/metadata-collector
452452
node-drainer/node-drainer
453-
platform-connectors/platform-connectors
453+
platform-connectors/platform-connectors
454+
event-exporter/event-exporter

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ GO_MODULES := \
4949
fault-remediation \
5050
janitor \
5151
metadata-collector \
52+
event-exporter \
5253
store-client \
5354
commons
5455

@@ -441,6 +442,11 @@ lint-test-metadata-collector:
441442
@echo "Linting and testing metadata-collector..."
442443
$(MAKE) -C metadata-collector lint-test
443444

445+
.PHONY: lint-test-event-exporter
446+
lint-test-event-exporter:
447+
@echo "Linting and testing event-exporter..."
448+
$(MAKE) -C event-exporter lint-test
449+
444450
# Python module lint-test targets (non-health-monitors)
445451
# Currently no non-health-monitor Python modules
446452

docker/Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ ALL_MODULES := $(GO_MODULES) $(PYTHON_MODULES) $(CONTAINER_MODULES)
3737

3838
# Build all Docker images for local development
3939
.PHONY: build-all
40-
build-all: build-gpu-health-monitor build-syslog-health-monitor build-metadata-collector build-log-collector
40+
build-all: build-gpu-health-monitor build-syslog-health-monitor build-metadata-collector build-event-exporter build-log-collector
4141
@echo "All Docker images built successfully for local development"
4242

4343
# GPU health monitor (special case with DCGM variants)
@@ -67,6 +67,11 @@ build-metadata-collector:
6767
@echo "Building metadata collector..."
6868
$(MAKE) -C ../metadata-collector docker-build
6969

70+
.PHONY: build-event-exporter
71+
build-event-exporter:
72+
@echo "Building event exporter..."
73+
$(MAKE) -C ../event-exporter docker-build
74+
7075
.PHONY: build-log-collector
7176
build-log-collector:
7277
@echo "Building log collector..."
@@ -79,7 +84,7 @@ build-log-collector:
7984

8085
# Publish all Docker images to registry (CI-like behavior)
8186
.PHONY: publish-all
82-
publish-all: publish-gpu-health-monitor publish-syslog-health-monitor publish-metadata-collector publish-log-collector
87+
publish-all: publish-gpu-health-monitor publish-syslog-health-monitor publish-metadata-collector publish-event-exporter publish-log-collector
8388
@echo "All Docker images published successfully to registry"
8489

8590
# GPU health monitor publish (special case with DCGM variants)
@@ -109,6 +114,11 @@ publish-metadata-collector:
109114
@echo "Publishing metadata collector..."
110115
$(MAKE) -C ../metadata-collector docker-publish
111116

117+
.PHONY: publish-event-exporter
118+
publish-event-exporter:
119+
@echo "Publishing event exporter..."
120+
$(MAKE) -C ../event-exporter docker-publish
121+
112122
.PHONY: publish-log-collector
113123
publish-log-collector:
114124
@echo "Publishing log collector..."

event-exporter/Dockerfile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
FROM public.ecr.aws/docker/library/golang:1.25-trixie AS builder
16+
17+
WORKDIR /go/src/nvsentinel
18+
19+
COPY event-exporter/go.mod event-exporter/go.sum event-exporter/
20+
COPY data-models/go.mod data-models/go.sum ./data-models/
21+
COPY commons/go.mod commons/go.sum ./commons/
22+
COPY store-client/go.mod store-client/go.sum ./store-client/
23+
24+
RUN --mount=type=cache,target=/go/pkg/mod \
25+
cd event-exporter && go mod download
26+
27+
COPY event-exporter/ event-exporter/
28+
COPY data-models/ data-models/
29+
COPY commons/ commons/
30+
COPY store-client/ store-client/
31+
32+
RUN cd event-exporter && \
33+
CGO_ENABLED=0 go build -ldflags="-s -w" -o event-exporter main.go
34+
35+
FROM public.ecr.aws/docker/library/debian:bookworm-slim AS runtime
36+
37+
COPY --from=builder /go/src/nvsentinel/event-exporter/event-exporter /app/event-exporter
38+
39+
ENTRYPOINT ["/app/event-exporter"]

event-exporter/Makefile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# event-exporter Makefile
2+
3+
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
4+
5+
# =============================================================================
6+
# MODULE-SPECIFIC CONFIGURATION
7+
# =============================================================================
8+
9+
IS_GO_MODULE := 1
10+
HAS_DOCKER := 1
11+
12+
export CGO_ENABLED := 0
13+
14+
# =============================================================================
15+
# INCLUDE SHARED DEFINITIONS
16+
# =============================================================================
17+
18+
include ../make/common.mk
19+
include ../make/go.mk
20+
include ../make/docker.mk
21+
22+
# =============================================================================
23+
# DEFAULT TARGET
24+
# =============================================================================
25+
26+
.PHONY: all
27+
all: lint-test
28+
29+
# =============================================================================
30+
# MODULE HELP
31+
# =============================================================================
32+
33+
.PHONY: help
34+
help:
35+
@echo "event-exporter Makefile - Using nvsentinel make/*.mk standards"
36+
@echo ""
37+
@echo "Main targets: all, lint-test, ci-test, build, test, lint, clean"
38+
@echo "Docker targets: docker, docker-build, docker-publish"
39+
40+

event-exporter/Tiltfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
custom_build(
16+
'ghcr.io/nvidia/nvsentinel/event-exporter',
17+
'../scripts/ko-tilt-build.sh . $EXPECTED_REF',
18+
deps=['./'],
19+
skips_local_docker=True
20+
)
21+

event-exporter/go.mod

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module github.com/nvidia/nvsentinel/event-exporter
2+
3+
go 1.25
4+
5+
require (
6+
github.com/BurntSushi/toml v1.5.0
7+
github.com/google/uuid v1.6.0
8+
)
9+
10+
replace (
11+
github.com/nvidia/nvsentinel/commons => ../commons
12+
github.com/nvidia/nvsentinel/data-models => ../data-models
13+
github.com/nvidia/nvsentinel/store-client => ../store-client
14+
)

event-exporter/go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg=
2+
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
3+
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
4+
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=

0 commit comments

Comments
 (0)