Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for MIG and vGPUs in exporter #193

Merged
merged 4 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ test-e2e: build pkg/collector/testdata/sys/.unpacked pkg/collector/testdata/proc
./scripts/e2e-test.sh -s exporter-cgroups-v1
./scripts/e2e-test.sh -s exporter-cgroups-v1-memory-subsystem
./scripts/e2e-test.sh -s exporter-cgroups-v2-nvidia-ipmiutil
./scripts/e2e-test.sh -s exporter-cgroups-v2-nvidia-gpu-reordering
./scripts/e2e-test.sh -s exporter-cgroups-v2-amd-ipmitool
./scripts/e2e-test.sh -s exporter-cgroups-v2-nogpu
./scripts/e2e-test.sh -s exporter-cgroups-v2-procfs
Expand Down Expand Up @@ -202,6 +203,7 @@ test-e2e-update: build pkg/collector/testdata/sys/.unpacked pkg/collector/testda
./scripts/e2e-test.sh -s exporter-cgroups-v1 -u || true
./scripts/e2e-test.sh -s exporter-cgroups-v1-memory-subsystem -u || true
./scripts/e2e-test.sh -s exporter-cgroups-v2-nvidia-ipmiutil -u || true
./scripts/e2e-test.sh -s exporter-cgroups-v2-nvidia-gpu-reordering -u || true
./scripts/e2e-test.sh -s exporter-cgroups-v2-amd-ipmitool -u || true
./scripts/e2e-test.sh -s exporter-cgroups-v2-nogpu -u || true
./scripts/e2e-test.sh -s exporter-cgroups-v2-procfs -u || true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ in a resource manager agnostic way.

- Monitor energy, performance, IO and network metrics for different types of resource
managers (SLURM, Openstack, k8s)
- Support NVIDIA and AMD GPUs
- Support NVIDIA (MIG and vGPU) and AMD GPUs
- Realtime access to metrics *via* Grafana dashboards
- Access control to Prometheus datasource in Grafana
- Stores aggregated metrics in a separate DB that can be retained for long time
Expand Down
14 changes: 5 additions & 9 deletions cmd/ceems_api_server/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"path/filepath"
"testing"
"time"

"github.com/stretchr/testify/require"
)

var binary, _ = filepath.Abs("../../bin/ceems_api_server")
Expand All @@ -24,23 +26,17 @@ func TestBatchjobStatsExecutable(t *testing.T) {
tmpSacctPath := tmpDir + "/sacct"

sacctPath, err := filepath.Abs("../../pkg/api/testdata/sacct")
if err != nil {
t.Error(err)
}
require.NoError(t, err)

err = os.Link(sacctPath, tmpSacctPath)
if err != nil {
t.Error(err)
}
require.NoError(t, err)

usagestats := exec.Command(
binary,
"--web.listen-address", address,
"--no-security.drop-privileges",
)
if err := runCommandAndTests(usagestats); err != nil {
t.Error(err)
}
require.NoError(t, runCommandAndTests(usagestats))
}

func runCommandAndTests(cmd *exec.Cmd) error {
Expand Down
13 changes: 4 additions & 9 deletions cmd/ceems_exporter/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"time"

"github.com/prometheus/procfs"
"github.com/stretchr/testify/require"
)

var binary, _ = filepath.Abs("../../bin/ceems_exporter")
Expand All @@ -37,14 +38,10 @@ func TestFileDescriptorLeak(t *testing.T) {
}

sysfsPath, err := filepath.Abs("../../pkg/collector/testdata/sys/fs/cgroup")
if err != nil {
t.Errorf("Failed to read testdata: %s", err)
}
require.NoError(t, err)

procfsPath, err := filepath.Abs("../../pkg/collector/testdata/proc")
if err != nil {
t.Errorf("Failed to read testdata: %s", err)
}
require.NoError(t, err)

exporter := exec.Command(
binary,
Expand Down Expand Up @@ -91,9 +88,7 @@ func TestFileDescriptorLeak(t *testing.T) {
return nil
}

if err := runCommandAndTests(exporter, address, test); err != nil {
t.Error(err)
}
require.NoError(t, runCommandAndTests(exporter, address, test))
}

func queryExporter(address string) error {
Expand Down
14 changes: 5 additions & 9 deletions cmd/ceems_lb/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import (
"path/filepath"
"testing"
"time"

"github.com/stretchr/testify/require"
)

var binary, _ = filepath.Abs("../../bin/ceems_lb")
Expand All @@ -24,24 +26,18 @@ func TestCEEMSLBExecutable(t *testing.T) {
tmpConfigPath := tmpDir + "/config.yaml"

configPath, err := filepath.Abs("../../build/config/ceems_lb/ceems_lb.yml")
if err != nil {
t.Error(err)
}
require.NoError(t, err)

err = os.Link(configPath, tmpConfigPath)
if err != nil {
t.Error(err)
}
require.NoError(t, err)

lb := exec.Command(
binary, "--path.data", tmpDir,
"--config.path", tmpConfigPath,
"--web.listen-address", address,
"--no-security.drop-privileges",
)
if err := runCommandAndTests(lb); err != nil {
t.Error(err)
}
require.NoError(t, runCommandAndTests(lb))
}

func runCommandAndTests(cmd *exec.Cmd) error {
Expand Down
Loading